This commit is contained in:
Guilhem Lavaux 2019-04-18 11:30:55 +02:00
commit 88bea91a89
5 changed files with 23 additions and 5 deletions

View File

@ -12,6 +12,7 @@ SET(BOOST_URL "http://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_
SET(GSL_URL "ftp://ftp.gnu.org/gnu/gsl/gsl-1.15.tar.gz" CACHE STRING "URL to download GSL from ")
mark_as_advanced(FFTW_URL EIGEN_URL HDF5_URL NETCDF_URL BOOST_URL GSL_URL)
SET(all_deps)
MACRO(CHECK_CHANGE_STATE VAR)
IF (DEFINED _PREVIOUS_${VAR})
@ -108,6 +109,7 @@ if (INTERNAL_HDF5)
MESSAGE(STATUS "Internal HDF5 directory: $ENV{HDF5_ROOT}")
MESSAGE(STATUS "Libs: ${HDF5_LIBRARIES}")
SET(HDF5_FOUND TRUE)
SET(all_deps ${all_deps} hdf5)
else (INTERNAL_HDF5)
mark_as_advanced(CLEAR HDF5_LIBRARIES HDF5_CXX_LIBRARIES HDF5_INCLUDE_DIRS)
if(HDF5_ROOTDIR)
@ -210,6 +212,8 @@ if (INTERNAL_NETCDF)
SET(NETCDF_INCLUDE_PATH ${NETCDF_BIN_DIR}/include CACHE STRING "NetCDF include" FORCE)
SET(NETCDFCPP_INCLUDE_PATH ${NETCDF_INCLUDE_PATH} CACHE STRING "NetCDF C++ include path" FORCE)
SET(all_deps ${all_deps} netcdf netcdf-c++)
ELSE(INTERNAL_NETCDF)
find_path(NETCDF_INCLUDE_PATH NAMES netcdf.h)
find_path(NETCDFCPP_INCLUDE_PATH NAMES netcdfcpp.h netcdf)

View File

@ -88,11 +88,13 @@ message(STATUS "User python site: ${USER_PYTHON_SITE_PACKAGES}")
OPTION(INSTALL_PYTHON_LOCAL OFF)
IF (NOT INSTALL_PYTHON_LOCAL)
IF (NOT PYTHON_SITE_PACKAGES)
IF (NOT INSTALL_PYTHON_LOCAL)
SET(PYTHON_SITE_PACKAGES ${SYSTEM_PYTHON_SITE_PACKAGES})
ELSE (NOT INSTALL_PYTHON_LOCAL)
ELSE (NOT INSTALL_PYTHON_LOCAL)
SET(PYTHON_SITE_PACKAGES ${USER_PYTHON_SITE_PACKAGES})
ENDIF(NOT INSTALL_PYTHON_LOCAL)
ENDIF(NOT INSTALL_PYTHON_LOCAL)
ENDIF()
cmessage(STATUS "Python install location: ${PYTHON_SITE_PACKAGES}")

View File

@ -105,6 +105,12 @@ if (Boost_FOUND)
add_executable(graficToDensity graficToDensity.cpp)
target_link_libraries(graficToDensity ${tolink})
if (all_deps)
message(STATUS "Deps = ${all_deps}")
add_dependencies(gadgetToArray ${all_deps})
add_dependencies(testHDF5 ${all_deps})
add_dependencies(graficToDensity ${all_deps})
endif()
endif()
endif (Boost_FOUND)

View File

@ -38,6 +38,7 @@ if (HDF5_FOUND)
h5_readFlash.cpp
loadFlash.cpp
)
set_property(TARGET CosmoHDF5 PROPERTY POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS})
target_include_directories(CosmoHDF5 BEFORE PRIVATE ${HDF5_INCLUDE_DIR})
else(HDF5_FOUND)
add_library(CosmoHDF5 OBJECT

View File

@ -33,6 +33,11 @@ public: \
static real_type *alloc_real(size_t N) { return prefix ## _alloc_real(N); } \
static void free(void *p) { fftw_free(p); } \
\
template<size_t Nd> \
static ptrdiff_t local_size(std::array<ptrdiff_t,Nd> const& N, MPI_Comm comm, \
ptrdiff_t *local_n0, ptrdiff_t *local_0_start) { \
return prefix ## _mpi_local_size(Nd, N.data(), comm, local_n0, local_0_start); \
} \
static ptrdiff_t local_size_2d(ptrdiff_t N0, ptrdiff_t N1, MPI_Comm comm, \
ptrdiff_t *local_n0, ptrdiff_t *local_0_start) { \
return prefix ## _mpi_local_size_2d(N0, N1, comm, local_n0, local_0_start); \