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

Fixing examples

parent 6eeb0000
No related branches found
No related tags found
No related merge requests found
Pipeline #3899 passed
......@@ -164,6 +164,24 @@ if (OPENMP_FOUND)
set(DEFINE_HAVE_OPENMP "#define HAVE_OPENMP")
endif()
macro(getAllLinkedLibraries iTarget iReturnValue)
if(NOT TARGET ${iTarget})
message(WARNING "${iTarget} is not a target")
else()
get_target_property(path ${iTarget} LOCATION)
if(NOT ${path} IN_LIST ${iReturnValue})
if (NOT ${path} STREQUAL "path-NOTFOUND")
list(APPEND ${iReturnValue} ${path})
endif()
endif()
get_target_property(linkedLibrairies ${iTarget} INTERFACE_LINK_LIBRARIES)
if(NOT "${linkedLibrairies}" STREQUAL "")
FOREACH(linkedLibrary ${linkedLibrairies})
getAllLinkedLibraries(${linkedLibrary} ${iReturnValue})
ENDFOREACH()
endif()
endif()
endmacro()
if(MPI_FOUND)
get_filename_component(OPENFPM_MPI_DEP "${MPI_C_INCLUDE_DIRS}" DIRECTORY)
......@@ -180,7 +198,11 @@ if (Boost_FOUND)
file(WRITE error_code "202")
message( FATAL_ERROR "BOOST is invalid reinstalling" )
endif()
file(WRITE optional_boost_libs "${OPTIONAL_BOOST_LIBS}")
# Get the library names
getAllLinkedLibraries(Boost::context OPENFPM_CONTEXT_LIBS)
getAllLinkedLibraries(Boost::fiber OPENFPM_CONTEXT_LIBS)
string (REPLACE ";" " " OPENFPM_CONTEXT_LIBS "${OPENFPM_CONTEXT_LIBS}")
file(WRITE optional_boost_libs "${OPENFPM_CONTEXT_LIBS}")
else()
file(WRITE error_code "202")
message( FATAL_ERROR "BOOST is required in order to install OpenFPM" )
......
include ../../example.mk
LIBS_CUDA_ON_CPU=$(LIBS)
CUDA_CC=
CC=mpic++
......@@ -13,7 +12,7 @@ else
CUDA_CC=mpic++ -x c++ $(INCLUDE_PATH)
INCLUDE_PATH_NVCC=
CUDA_OPTIONS=-DCUDA_ON_CPU -D__NVCC__ -DCUDART_VERSION=11000
LIBS_SELECT=$(LIBS_CUDA_ON_CPU)
LIBS_SELECT=$(LIBS)
else
ifeq (, $(shell which nvcc))
CUDA_CC=mpic++ -x c++ $(INCLUDE_PATH)
......
......@@ -8,7 +8,7 @@ ifdef CUDA_ON_CPU
CUDA_CC=mpic++ -x c++ $(INCLUDE_PATH)
INCLUDE_PATH_NVCC=
CUDA_CC_LINK=mpic++
LIBS_SELECT=$(LIBS_CUDA_ON_CPU)
LIBS_SELECT=$(LIBS)
else
ifeq (, $(shell which nvcc))
CUDA_CC=mpic++ -x c++ $(INCLUDE_PATH)
......
......@@ -18,7 +18,7 @@ else
INCLUDE_PATH_NVCC=
CUDA_CC_LINK=mpic++
CUDA_OPTIONS=-DCUDA_ON_CPU -D__NVCC__ -DCUDART_VERSION=11000
LIBS_SELECT=$(LIBS_CUDA_ON_CPU)
LIBS_SELECT=$(LIBS)
else
ifeq (, $(shell which nvcc))
CUDA_CC=mpic++ -x c++ $(INCLUDE_PATH)
......
......@@ -15,8 +15,8 @@ else
CUDA_CC=mpic++ -x c++ $(INCLUDE_PATH)
INCLUDE_PATH_NVCC=
CUDA_CC_LINK=mpic++
CUDA_OPTIONS=-DCUDA_ON_CPU -D__NVCC__ -DCUDART_VERSION=11000
LIBS_SELECT=$(LIBS_CUDA_ON_CPU)
CUDA_OPTIONS=-D__NVCC__ -DCUDART_VERSION=11000
LIBS_SELECT=$(LIBS)
else
ifeq (, $(shell which nvcc))
CUDA_CC=mpic++ -x c++ $(INCLUDE_PATH)
......
......@@ -890,6 +890,7 @@ int main(int argc, char* argv[])
{
Vcluster<> & v_cl = create_vcluster();
timer it_time;
it_time.start();
////// Do rebalancing every 200 timesteps
it_reb++;
......
......@@ -446,10 +446,8 @@ if [ x"$cuda_on_cpu" == x"YES" ]; then
fi
if [ x"$gpu_support" == x"1" ]; then
echo "LIBS=$mpi_libs -lvcluster -lofpm_pdata -lofpmmemory -lparmetis -lmetis -lboost_iostreams -lboost_program_options -lhdf5 -llibhilbert -lVc $(cat cuda_lib) $lin_alg_lib -ldl -lboost_filesystem -lboost_system" >> example.mk
echo "LIBS_CUDA_ON_CPU=-lvcluster_cuda_on_cpu -lofpmmemory_cuda_on_cpu -lparmetis -lmetis -lboost_iostreams -lboost_program_options -lhdf5 -llibhilbert -lVc $(cat cuda_lib) $lin_alg_lib -lboost_filesystem -lboost_system -lboost_context" >> example.mk
else
echo "LIBS=-lvcluster -lofpm_pdata -lofpmmemory -lparmetis -lmetis -lboost_iostreams -lboost_program_options -lhdf5 -llibhilbert -lVc $lin_alg_lib -ldl -lboost_filesystem -lboost_system $optional_boost" >> example.mk
echo "LIBS_CUDA_ON_CPU=\$(LIBS)" >> example.mk
fi
echo "INCLUDE_PATH_NVCC=-Xcompiler="-Wno-deprecated-declarations" $(cat openmp_flags) "$(cat cuda_options)" $mpi_include_dirs -I. -I$install_base/openfpm_numerics/include -I$install_base/openfpm_pdata/include/config -I$install_base/openfpm_pdata/include -I$install_base/openfpm_data/include -I$install_base/openfpm_vcluster/include -I$install_base/openfpm_io/include -I$install_base/openfpm_devices/include -I$i_dir/METIS/include -I$i_dir/PARMETIS/include -I$i_dir/BOOST/include -I$i_dir/HDF5/include -I$i_dir/LIBHILBERT/include $lin_alg_inc -I$i_dir/BLITZ/include -I$i_dir/ALGOIM/include" >> example.mk
cp example.mk src/example.mk
......
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