diff --git a/CMakeLists.txt b/CMakeLists.txt index 117bb75903d04a7ff095d8cf72775bc3fde6bdfc..4131d48f4744e9259272b88f69309887c1f872dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,4 +119,5 @@ set(DEFINE_HAVE_OPENMP ${DEFINE_HAVE_OPENMP} PARENT_SCOPE) set(DEFINE_HAVE_ALPAKA ${DEFINE_HAVE_ALPAKA} PARENT_SCOPE) set(DEFINE_CUDA_GPU ${DEFINE_CUDA_GPU} PARENT_SCOPE) set(DEFINE_CUDIFY_BACKEND ${DEFINE_CUDIFY_BACKEND} PARENT_SCOPE) +set(OPTIONAL_BOOST_LIBS ${OPTIONAL_BOOST_LIBS} PARENT_SCOPE) diff --git a/build.sh b/build.sh index a3ad1fda6ce9342e1ca2b226d6532e463cfe5f50..6673bc9a0019d2f221276b3d4741c17d353ef9b8 100755 --- a/build.sh +++ b/build.sh @@ -74,7 +74,11 @@ fi echo "Compiling on $2" sh ./autogen.sh -sh ./configure CXX=mpic++ --with-vcdevel=$HOME/openfpm_dependencies/openfpm_io/$branch/VCDEVEL --with-libhilbert=$HOME/openfpm_dependencies/openfpm_io/$branch/LIBHILBERT --with-hdf5=$HOME/openfpm_dependencies/openfpm_io/$branch/HDF5 --with-boost=$HOME/openfpm_dependencies/openfpm_io/$branch/BOOST --with-pdata=../../openfpm_pdata/ --enable-cuda-on-cpu +if [ x"$hostname" == x"cifarm-mac-node.mpi-cbg.de" ]; then + sh ./configure CXX=mpic++ --with-vcdevel=$HOME/openfpm_dependencies/openfpm_io/$branch/VCDEVEL --with-libhilbert=$HOME/openfpm_dependencies/openfpm_io/$branch/LIBHILBERT --with-hdf5=$HOME/openfpm_dependencies/openfpm_io/$branch/HDF5 --with-boost=$HOME/openfpm_dependencies/openfpm_io/$branch/BOOST --with-pdata=../../openfpm_pdata/ --enable-cuda-on-cpu +else + sh ./configure CXX=mpic++ --with-vcdevel=$HOME/openfpm_dependencies/openfpm_io/$branch/VCDEVEL --with-libhilbert=$HOME/openfpm_dependencies/openfpm_io/$branch/LIBHILBERT --with-hdf5=$HOME/openfpm_dependencies/openfpm_io/$branch/HDF5 --with-boost=$HOME/openfpm_dependencies/openfpm_io/$branch/BOOST --with-pdata=../../openfpm_pdata/ --with-cuda-on-cackend=OpenMP +fi make VERBOSE=1 -j 4 diff --git a/discover_os b/discover_os new file mode 100755 index 0000000000000000000000000000000000000000..0a5742ed9bba0f52c0fd1d39226159b793e61762 --- /dev/null +++ b/discover_os @@ -0,0 +1,39 @@ +#! /bin/bash + +function discover_os() { +platform=unknown +arch=$(uname -m) + + if [[ "$OSTYPE" == "linux-gnu" ]]; then + echo -e "We are on\033[1;34m LINUX \033[0m, with architecture \033[1;34m$arch\033[0m" + platform=linux + elif [[ "$OSTYPE" == "linux" ]]; then + echo -e "We are on\033[1;34m LINUX \033[0m, with architecture \033[1;34m$arch\033[0m" + platform=linux + elif [[ "$OSTYPE" == "darwin"* ]]; then + echo -e "We are on\033[1;34m MAC OSX \033[0m, with architecture \033[1;34m$arch\033[0m" + platform=osx + elif [[ "$OSTYPE" == "cygwin" ]]; then + echo -e "We are on\033[1;34m CYGWIN \033[0m, with architecture \033[1;34m$arch\033[0m" + platform=cygwin + elif [[ "$OSTYPE" == "msys" ]]; then + echo -e "We are on\033[1;34m Microsoft Window \033[0m, with architecture \033[1;34m$arch\033[0m" + echo "This platform is not supported" + exit 1 + elif [[ "$OSTYPE" == "win32" ]]; then + echo -e "We are on\033[1;34m Microsoft Window \033[0m, with architecture \033[1;34m$arch\033[0m" + echo "This platform is not supported" + exit 1 + elif [[ "$OSTYPE" == "freebsd"* ]]; then + echo -e "We are on\033[1;34m FREEBSD \033[0m, with architecture \033[1;34m$arch\033[0m" + echo "This platform is not supported" + exit 1 + else + echo -e "We are on an\033[1;34m unknown OS \033[0m, with architecture \033[1;34m$arch\033[0m" + echo "This platform is not supported" + exit 1 + fi + + +} + diff --git a/install_BOOST.sh b/install_BOOST.sh index f401534545f4d58be883d31bc027b75a976b7b82..d080b347e8710c4caa5098d820ec6b15796827d0 100755 --- a/install_BOOST.sh +++ b/install_BOOST.sh @@ -1,5 +1,8 @@ #!/bin/bash +source discover_os +discover_os + # check if the directory $1/BOOST exist if [ -d "$1/BOOST" ]; then @@ -23,7 +26,21 @@ if [ x"$4" != x"" ]; then fi ./bootstrap.sh --with-toolset=$3 mkdir $1/BOOST -./b2 -j $2 install --prefix=$1/BOOST +# Several flavours +if [ x"$platform" == x"osx" ]; then + if [ x"$arch" == x"arm64" ]; then + if [ x"$3" == x"" ]; then + ./b2 -j $2 install --prefix=$1/BOOST address-model=64 architecture=arm abi=aapcs binary-format=mach-o toolset=clang + else + ./b2 -j $2 install --prefix=$1/BOOST address-model=64 architecture=arm abi=aapcs binary-format=mach-o toolset=$3 + fi + else + ./b2 -j $2 install --prefix=$1/BOOST address-model=64 architecture=x86 abi=sysv binary-format=mach-o toolset=clang + fi +else + ./b2 -j $2 install --prefix=$1/BOOST +fi + rm -rf boost_1_75_0 if [ -f $HOME/user-config.jam_bck ]; then diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 72f045195c12067c20fad606e3d01acc10e2c8a3..e4f57cf0c899eb750a3b105b04b025cdc8a1c7d0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -85,7 +85,10 @@ target_link_libraries(io ${HDF5_LIBRARIES}) target_link_libraries(io ${TINYOBJLOADER_LIBRARIES} ) target_link_libraries(io vcluster) target_link_libraries(io ofpmmemory) -target_link_libraries(io OpenMP::OpenMP_CXX) +if (OPENMP_FOUND) + target_link_libraries(io OpenMP::OpenMP_CXX) +endif() + if (PETSC_FOUND) target_link_libraries(io ${PETSC_LIBRARIES}) endif() diff --git a/src/config/config_cmake.h.in b/src/config/config_cmake.h.in index 007dfb669768aa11bdb2e5bf445570899a40863d..63f14c669359d1fcfdaf8703baf397db9e11d2a0 100644 --- a/src/config/config_cmake.h.in +++ b/src/config/config_cmake.h.in @@ -1,12 +1,12 @@ +/* Coverty scan */ +${DEFINE_COVERTY_SCAN} + /* HIP GPU support */ ${DEFINE_HIP_GPU} /* HIP Cudify GPU support */ ${DEFINE_CUDIFY_USE_HIP} -/* Coverty scan */ -${DEFINE_COVERTY_SCAN} - /* GPU support */ ${DEFINE_CUDA_GPU} @@ -204,4 +204,4 @@ ${DEFINE_TEST_COVERAGE_MODE} /* Version number of package */ #define VERSION "1.0.0" -#define OPENFPM_PDATA +#define OPENFPM_IO