Skip to content
Snippets Groups Projects
Commit 8dfcaaed authored by Pietro Incardona's avatar Pietro Incardona
Browse files

Refactoring CMAKE for backend

parent c56bddfb
No related branches found
No related tags found
No related merge requests found
Pipeline #3838 failed
......@@ -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)
......@@ -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
......
#! /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
}
#!/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
......
......@@ -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()
......
/* 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment