We'll be taking GitLab down for maintenance around 22 in the evening on the 15th of September, so this Sunday. Let us know (tt.mpi-cbg.de) if you experience any issues with it after the maintenance period.

Commit 3b2b0b3c authored by incardon's avatar incardon

Fixing example to ork without NVCC

parent 7834af62
......@@ -115,6 +115,8 @@ endif()
if(MPI_FOUND)
set(DEFINE_HAVE_MPI "#define HAVE_MPI")
file(WRITE mpi_include_dirs ${MPI_C_INCLUDE_DIRS})
file(WRITE mpi_libs ${MPI_C_LIBRARIES})
else()
file(WRITE error_code "200")
message( FATAL_ERROR "MPI is required in order to install OpenFPM" )
......@@ -153,7 +155,7 @@ else()
message( FATAL_ERROR "LibHilbert is required in order to install OpenFPM")
endif()
if(SUITESPARSE_FOUND)
if(SUITESPARSE_FOUND AND SuiteSparse_UMFPACK_FOUND)
set(DEFINE_HAVE_SUITESPARSE "#define HAVE_SUITESPARSE")
endif()
......
......@@ -143,6 +143,20 @@
//! [ps_cma_es_inclusion]
// This example need EIGEN, if we do not have NOP the full example
#include "config.h"
#ifndef HAVE_EIGEN
int main(int argc, char* argv[])
{
return 0;
}
#else
#define EIGEN_USE_LAPACKE
#include "Vector/vector_dist.hpp"
#include "DMatrix/EMatrix.hpp"
......@@ -1313,3 +1327,5 @@ int main(int argc, char* argv[])
*
*/
}
#endif
include ../../example.mk
CUDA_CC=
ifeq (, $(shell which nvcc))
CUDA_CC=mpic++ -x c++ $(INCLUDE_PATH)
INCLUDE_PATH_NVCC=
else
CUDA_CC=nvcc
endif
CC_SCOREP=scorep --nocompiler --cuda --mpp=mpi nvcc
CC=nvcc #${CC_SCOREP}
CC=$(CUDA_CC) #${CC_SCOREP}
CC_MPI=mpic++
LDIR =
......
include ../../example.mk
### This is a trick to avoid "Command not found if you no not have NVCC compiler". In practice the normal C++ compiler is used
### internally the example disable with the preprocessor its code if not compiled with nvcc
CUDA_CC=
CUDA_CC_LINK=
ifeq (, $(shell which nvcc))
CUDA_CC=mpic++ -x c++ $(INCLUDE_PATH)
INCLUDE_PATH_NVCC=
CUDA_CC_LINK=mpic++
else
CUDA_CC=nvcc
CUDA_CC_LINK=nvcc
endif
CC=mpic++
LDIR =
......@@ -12,13 +25,13 @@ sph_dlb_test: OPT += -DTEST_RUN
sph_dlb_test: sph_dlb
%.o: %.cu
nvcc -O3 $(OPT) -g -c -isystem=/home/i-bird/MPI/include --std=c++11 -o $@ $< $(INCLUDE_PATH_NVCC)
$(CUDA_CC) -O3 $(OPT) -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH_NVCC)
%.o: %.cpp
$(CC) -O3 $(OPT) -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH)
sph_dlb: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
$(CUDA_CC_LINK) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
all: sph_dlb
......
......@@ -43,6 +43,8 @@
*
*/
#ifdef __NVCC__
#include "Vector/vector_dist.hpp"
#include <math.h>
#include "Draw/DrawParticles.hpp"
......@@ -991,3 +993,11 @@ int main(int argc, char* argv[])
openfpm_finalize();
}
#else
int main(int argc, char* argv[])
{
return 0;
}
#endif
include ../../example.mk
### This is a trick to avoid "Command not found if you no not have NVCC compiler". In practice the normal C++ compiler is used
### internally the example disable with the preprocessor its code if not compiled with nvcc
CUDA_CC=
CUDA_CC_LINK=
ifeq (, $(shell which nvcc))
CUDA_CC=mpic++ -x c++ $(INCLUDE_PATH)
INCLUDE_PATH_NVCC=
CUDA_CC_LINK=mpic++
else
CUDA_CC=nvcc
CUDA_CC_LINK=nvcc
endif
CC=mpic++
LDIR =
......@@ -12,13 +26,13 @@ sph_dlb_test: OPT += -DTEST_RUN
sph_dlb_test: sph_dlb
%.o: %.cu
nvcc -O3 $(OPT) -g -c -isystem=/home/i-bird/MPI/include --std=c++11 -o $@ $< $(INCLUDE_PATH_NVCC)
$(CUDA_CC) -O3 $(OPT) -g -c -isystem=/home/i-bird/MPI/include --std=c++11 -o $@ $< $(INCLUDE_PATH_NVCC)
%.o: %.cpp
$(CC) -O3 $(OPT) -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH)
sph_dlb: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
$(CUDA_CC_LINK) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
all: sph_dlb
......
......@@ -37,6 +37,8 @@
*
*/
#ifdef __NVCC__
#include "Vector/vector_dist.hpp"
#include <math.h>
#include "Draw/DrawParticles.hpp"
......@@ -940,3 +942,11 @@ int main(int argc, char* argv[])
openfpm_finalize();
}
#else
int main(int argc, char* argv[])
{
return 0;
}
#endif
......@@ -425,15 +425,15 @@ elif [ -d "$i_dir/HDF5/lib64" ]; then
fi
echo "INCLUDE_PATH=-Wno-deprecated-declarations $openmp_flags -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" > example.mk
echo "LIBS_PATH= $openmp_flags -L$install_base/openfpm_devices/lib -L$install_base/openfpm_pdata/lib -L$install_base/openfpm_vcluster/lib -L$i_dir/METIS/lib -L$i_dir/PARMETIS/lib -L$i_dir/BOOST/lib -L$hdf5_lib -L$i_dir/LIBHILBERT/lib $lin_alg_dir" >> example.mk
echo "LIBS_PATH= $openmp_flags -L$install_base/openfpm_devices/lib -L$install_base/openfpm_pdata/lib -L$install_base/openfpm_vcluster/lib -L$i_dir/METIS/lib -L$i_dir/PARMETIS/lib -L$i_dir/BOOST/lib -L$hdf5_lib -L$i_dir/LIBHILBERT/lib $lin_alg_dir " >> example.mk
if [ x"$gpu_support" == x"1" ]; then
echo "LIBS=-lvcluster -lofpm_pdata -lofpmmemory -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert $(cat cuda_lib) $lin_alg_lib" >> example.mk
echo "LIBS=-lvcluster -lofpm_pdata -lofpmmemory -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert $(cat cuda_lib) $lin_alg_lib $(cat mpi_libs) -ldl" >> example.mk
echo "LIBS_SE2=-lvcluster -lofpmmemory_se2 -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert $(cat cuda_lib) $lin_alg_lib" >> example.mk
else
echo "LIBS=-lvcluster -lofpm_pdata -lofpmmemory -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert $lin_alg_lib" >> example.mk
echo "LIBS=-lvcluster -lofpm_pdata -lofpmmemory -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert $lin_alg_lib $(cat mpi_libs) -ldl" >> example.mk
echo "LIBS_SE2=-lvcluster -lofpmmemory_se2 -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert $lin_alg_lib" >> example.mk
fi
echo "INCLUDE_PATH_NVCC=-Xcompiler="-Wno-deprecated-declarations" $(cat openmp_flags) -Xcudafe \"--display_error_number --diag_suppress=2885 --diag_suppress=2886 --diag_suppress=2887 --diag_suppress=2888 --diag_suppress=186 --diag_suppress=111\" --expt-extended-lambda -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" >> example.mk
echo "INCLUDE_PATH_NVCC=-Xcompiler="-Wno-deprecated-declarations" $(cat openmp_flags) -Xcudafe \"--display_error_number --diag_suppress=2885 --diag_suppress=2886 --diag_suppress=2887 --diag_suppress=2888 --diag_suppress=186 --diag_suppress=111\" --expt-extended-lambda -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$(cat mpi_include_dirs)" >> example.mk
cp example.mk src/example.mk
cp example.mk example/example.mk
......@@ -534,7 +534,8 @@ else
installation_report="$installation_report \033[91;1mOPENBLAS\033[0m Installed: \033[1m NO \033[0m\n"
fi
if [ -d "$i_dir/SUITESPARSE" ]; then
if [ -d "$i_dir/SUITESPARSE" -a -f "$i_dir/SUITESPARSE/include/umfpack.h" ]; then
installation_report="$installation_report \033[92;1mSUITESPARSE\033[0m Installed: \033[1m $i_dir/SUITESPARSE \033[0m\n"
bash_library="$bash_library:$i_dir/SUITESPARSE/lib"
else
......@@ -576,8 +577,8 @@ fi
echo ""
echo -e "\033[1m source $HOME/openfpm_vars \033[0m"
echo ""
echo -e "\033[91;1m if you have in your .bashrc or .bash_profile old openfpm setting, please remove it\033[0m"
echo ""
echo -e "Remember to do: \033[91;5;1m make install \033[0m"
echo ""
if [ x"$inst_lin_alg" == "y" -a x"$lin_alg_installed" == x"" ]; then
conf_err=1
......
......@@ -14,7 +14,7 @@ function conf_PETSC()
lin_alg_inc="$lin_alg_inc -I$i_dir/OPENBLAS/include"
configure_blas_option="--with-blas=$i_dir/OPENBLAS/"
fi
if [ -d "$i_dir/SUITESPARSE" ]; then
if [ -d "$1/SUITESPARSE" -a -f "$1/SUITESPARSE/include/umfpack.h" ]; then
lin_alg_dir="$lin_alg_dir -L$i_dir/SUITESPARSE/lib"
lin_alg_inc="$lin_alg_inc -I$i_dir/SUITESPARSE/include"
lin_alg_lib="$lin_alg_lib -lumfpack -lamd -lbtf -lcamd -lccolamd -lcholmod -lcolamd -lcxsparse -lklu -ldl -lrbio -lspqr -lsuitesparseconfig"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment