diff --git a/external/external_build.cmake b/external/external_build.cmake index a38fc1d..c8fedcf 100644 --- a/external/external_build.cmake +++ b/external/external_build.cmake @@ -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) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 0e67f2f..6045aca 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -88,11 +88,13 @@ message(STATUS "User python site: ${USER_PYTHON_SITE_PACKAGES}") OPTION(INSTALL_PYTHON_LOCAL OFF) -IF (NOT INSTALL_PYTHON_LOCAL) - SET(PYTHON_SITE_PACKAGES ${SYSTEM_PYTHON_SITE_PACKAGES}) -ELSE (NOT INSTALL_PYTHON_LOCAL) - SET(PYTHON_SITE_PACKAGES ${USER_PYTHON_SITE_PACKAGES}) -ENDIF(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) + SET(PYTHON_SITE_PACKAGES ${USER_PYTHON_SITE_PACKAGES}) + ENDIF(NOT INSTALL_PYTHON_LOCAL) +ENDIF() cmessage(STATUS "Python install location: ${PYTHON_SITE_PACKAGES}") diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index 02b7a12..53429da 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -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) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bc7ae98..927785e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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 diff --git a/src/fourier/fft/fftw_calls_mpi.hpp b/src/fourier/fft/fftw_calls_mpi.hpp index 1b14128..7a4cf0c 100644 --- a/src/fourier/fft/fftw_calls_mpi.hpp +++ b/src/fourier/fft/fftw_calls_mpi.hpp @@ -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 \ + static ptrdiff_t local_size(std::array 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); \