Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openfpm_data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sbalzarini Lab
Software
Parallel Computing
OpenFPM
openfpm_data
Commits
1dfea0e4
Commit
1dfea0e4
authored
3 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
Refactoring CMake
parent
14dae8cc
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+17
-24
17 additions, 24 deletions
CMakeLists.txt
configure
+27
-10
27 additions, 10 deletions
configure
src/CMakeLists.txt
+6
-9
6 additions, 9 deletions
src/CMakeLists.txt
src/config/config_cmake.h.in
+42
-0
42 additions, 0 deletions
src/config/config_cmake.h.in
with
92 additions
and
43 deletions
CMakeLists.txt
+
17
−
24
View file @
1dfea0e4
...
...
@@ -20,10 +20,11 @@ set(OPENFPM_PDATA_DIR CACHE PATH "OpenFPM_pdata dirs")
set
(
PETSC_ROOT CACHE PATH
"If compiling with linear algebra indicate the PETSC root directory"
)
set
(
ENV{PETSC_DIR}
${
PETSC_ROOT
}
)
if
(
ENABLE_GPU
)
set
(
CUDA_ON_CPU OFF
)
enable_language
(
CUDA
)
find_package
(
CUDA
)
add_subdirectory
(
../openfpm_vcluster openfpm_vcluster
)
if
(
CUDA_ON_BACKEND STREQUAL
"CUDA"
)
enable_language
(
CUDA
)
find_package
(
CUDA
)
endif
()
set
(
CMAKE_CXX_STANDARD 14
)
...
...
@@ -41,6 +42,7 @@ find_package(MPI REQUIRED)
find_package
(
HDF5 REQUIRED
)
find_package
(
TinyObjLoader
)
find_package
(
PETSc
)
find_package
(
OpenMP
)
if
(
CUDA_FOUND
)
set
(
OPENFPM_INIT_FILE
"initialize/initialize_wrapper_cuda.cu"
)
...
...
@@ -72,24 +74,6 @@ if(PETSC_FOUND)
set
(
DEFINE_HAVE_PETSC
"#define HAVE_PETSC"
)
endif
()
if
(
Boost_FOUND
)
set
(
DEFINE_HAVE_BOOST
"#define HAVE_BOOST"
)
set
(
DEFINE_HAVE_BOOST_IOSTREAMS
"#define HAVE_BOOST_IOSTREAMS"
)
set
(
DEFINE_HAVE_BOOST_PROGRAM_OPTIONS
"#define HAVE_BOOST_PROGRAM_OPTIONS"
)
set
(
DEFINE_HAVE_BOOST_UNIT_TEST_FRAMEWORK
"#define HAVE_BOOST_UNIT_TEST_FRAMEWORK"
)
if
(
Boost_CONTEXT_FOUND
)
set
(
DEFINE_HAVE_BOOST_CONTEXT
"#define HAVE_BOOST_CONTEXT"
)
else
()
#if context is not there CUDA_ON_CPU cannot be activated
set
(
CUDA_ON_CPU OFF
)
endif
()
if
(
Boost_FIBER_FOUND
)
set
(
DEFINE_HAVE_BOOST_FIBER
"#define HAVE_BOOST_FIBER"
)
endif
()
else
()
message
(
FATAL_ERROR
"BOOST is required in order to install OpenFPM"
)
endif
()
if
(
HDF5_FOUND
)
if
(
HDF5_IS_PARALLEL
)
set
(
DEFINE_HAVE_HDF5
"#define HAVE_HDF5"
)
...
...
@@ -108,10 +92,19 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config/config_cmake.h.in ${CMAKE_
include_directories
(
SYSTEM
${
MPI_INCLUDE_PATH
}
)
add_subdirectory
(
../openfpm_vcluster openfpm_vcluster
)
set
(
WARNING_SUPPRESSION_AND_OPTION_NVCC
${
WARNING_SUPPRESSION_AND_OPTION_NVCC
}
PARENT_SCOPE
)
set
(
WARNING_SUPPRESSION_AND_OPTION_NVCC_TEXT
${
WARNING_SUPPRESSION_AND_OPTION_NVCC_TEXT
}
PARENT_SCOPE
)
add_subdirectory
(
src
)
set
(
DEFINE_HAVE_BOOST
${
DEFINE_HAVE_BOOST
}
PARENT_SCOPE
)
set
(
DEFINE_HAVE_BOOST_IOSTREAMS
${
DEFINE_HAVE_BOOST_IOSTREAMS
}
PARENT_SCOPE
)
set
(
DEFINE_HAVE_BOOST_PROGRAM_OPTIONS
${
DEFINE_HAVE_BOOST_PROGRAM_OPTIONS
}
PARENT_SCOPE
)
set
(
DEFINE_HAVE_BOOST_UNIT_TEST_FRAMEWORK
${
DEFINE_HAVE_BOOST_UNIT_TEST_FRAMEWORK
}
PARENT_SCOPE
)
set
(
DEFINE_HAVE_BOOST_CONTEXT
${
DEFINE_HAVE_BOOST_CONTEXT
}
PARENT_SCOPE
)
set
(
DEFINE_HAVE_BOOST_FIBER
${
DEFINE_HAVE_BOOST_FIBER
}
PARENT_SCOPE
)
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
)
This diff is collapsed.
Click to expand it.
configure
+
27
−
10
View file @
1dfea0e4
...
...
@@ -100,6 +100,7 @@ enable_debug
with_metis
with_hdf5
with_libhilbert
with_cuda_on_backend
enable_cuda_on_cpu
enable_scan_coverty
enable_test_performance
...
...
@@ -121,8 +122,9 @@ with_suitesparse
with_petsc
with_eigen
with_vcdevel
enable_gpu
enable_asan
enable_garbageinj
enable_garbageinjv
'
rm
-rf
build
...
...
@@ -240,22 +242,20 @@ do
conf_options
=
"
$conf_options
-DSCAN_COVERTY=ON"
;;
cuda_on_cpu
)
conf_options
=
"
$conf_options
-DCUDA_ON_
CPU=ON
"
conf_options
=
"
$conf_options
-DCUDA_ON_
BACKEND=SEQUENTIAL
"
;;
test_performance
)
conf_options
=
"
$conf_options
-DTEST_PERFORMANCE=ON"
;;
gpu
)
if
[
x
"
$CXX
"
==
x
""
]
;
then
conf_options
=
"
$conf_options
"
else
conf_options
=
"
$conf_options
-DCMAKE_CUDA_HOST_COMPILER=
$(
which
$CXX
)
"
fi
conf_options
=
"
$conf_options
-DENABLE_GPU=ON"
;;
asan
)
conf_options
=
"
$conf_options
-DENABLE_ASAN=ON"
;;
garbageinj
)
conf_options
=
"
$conf_options
-DENABLE_GARBAGE_INJECTOR=ON"
;;
garbageinjv
)
conf_options
=
"
$conf_options
-DENABLE_VCLUSTER_GARBAGE_INJECTOR=ON"
;;
*
)
ac_unrecognized_opts
=
"
$ac_unrecognized_opts$ac_unrecognized_sep
--enable-
$ac_useropt_orig
"
ac_unrecognized_sep
=
', '
;;
...
...
@@ -461,6 +461,21 @@ do
ac_useropt_orig
=
$ac_useropt
ac_useropt
=
`
$as_echo
"
$ac_useropt
"
|
sed
's/[-+.]/_/g'
`
case
$ac_useropt
in
cuda_on_backend
)
conf_options
=
"
$conf_options
-DCUDA_ON_BACKEND=
$ac_optarg
"
if
[
x
"
$ac_optarg
"
==
x
"CUDA"
]
;
then
if
[
x
"
$CXX
"
==
x
""
]
;
then
conf_options
=
"
$conf_options
"
else
conf_options
=
"
$conf_options
-DCMAKE_CUDA_HOST_COMPILER=
$(
which
$CXX
)
"
fi
if
[
x
"
$CXXCUDA
"
==
x
""
]
;
then
conf_options
=
"
$conf_options
"
else
conf_options
=
"
$conf_options
-DCMAKE_CUDA_COMPILER=
$(
which
$CXXCUDA
)
"
fi
fi
;;
libhilbert
)
conf_options
=
"
$conf_options
-DLIBHILBERT_ROOT=
$ac_optarg
"
;;
...
...
@@ -573,6 +588,7 @@ cd build
## remove enerything
echo
"Calling cmake ../.
$conf_options
"
printf
"cmake ../.
$conf_options
"
>
cmake_build_options
rm
../error_code
DYLD_LIBRARY_PATH
=
$ld_lib_pathopt
cmake ../.
$conf_options
if
[
$?
!=
0
]
;
then
...
...
@@ -601,6 +617,7 @@ clean:
install:
\$
(MAKE) -C build
\$
@
script/install_parallel_debugger
pdata:
\$
(MAKE) -C build
\$
@
...
...
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
+
6
−
9
View file @
1dfea0e4
...
...
@@ -2,10 +2,6 @@ cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
########################### Executables
if
(
CUDA_ON_CPU
)
add_definitions
(
-DCUDA_ON_CPU
)
endif
()
add_executable
(
io main.cpp
MetaParser/MetaParser_unit_test.cpp
...
...
@@ -32,12 +28,12 @@ if (CUDA_FOUND)
target_include_directories
(
io PUBLIC
${
MPI_C_INCLUDE_DIRS
}
)
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0
)
add_compile_options
(
"-fabi-version=6"
)
endif
()
add_compile_options
(
"-fabi-version=6"
)
endif
()
if
(
TEST_COVERAGE
)
target_compile_options
(
io PRIVATE $<$<COMPILE_LANGUAGE:CUDA>: -Xcompiler
"-fprofile-arcs -ftest-coverage"
>
)
endif
()
if
(
TEST_COVERAGE
)
target_compile_options
(
io PRIVATE $<$<COMPILE_LANGUAGE:CUDA>: -Xcompiler
"-fprofile-arcs -ftest-coverage"
>
)
endif
()
endif
()
target_include_directories
(
io PUBLIC
${
CUDA_INCLUDE_DIRS
}
)
...
...
@@ -62,6 +58,7 @@ 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
(
PETSC_FOUND
)
target_link_libraries
(
io
${
PETSC_LIBRARIES
}
)
endif
()
...
...
This diff is collapsed.
Click to expand it.
src/config/config_cmake.h.in
+
42
−
0
View file @
1dfea0e4
...
...
@@ -4,6 +4,18 @@ ${DEFINE_COVERTY_SCAN}
/* GPU support */
${DEFINE_CUDA_GPU}
/* Define CUDIFY backend */
${DEFINE_CUDIFY_BACKEND}
/* OpenMP support */
${DEFINE_HAVE_OPENMP}
/* HIP GPU support */
${DEFINE_HIP_GPU}
/* HIP Cudify GPU support */
${DEFINE_CUDIFY_USE_HIP}
/* Debug */
${DEFINE_DEBUG} /**/
...
...
@@ -32,6 +44,12 @@ ${DEFINE_HAVE_BOOST_PROGRAM_OPTIONS} /**/
/* define if the Boost::Unit_Test_Framework library is available */
${DEFINE_HAVE_BOOST_UNIT_TEST_FRAMEWORK} /**/
/* define if the Boost::Context library is available */
${DEFINE_HAVE_BOOST_CONTEXT} /**/
/* define if the Boost::Fiber library is available */
${DEFINE_HAVE_BOOST_FIBER} /**/
/* Have clock time */
${DEFINE_HAVE_CLOCK_GETTIME} /**/
...
...
@@ -107,12 +125,28 @@ ${DEFINE_HAVE_UNISTD_H}
/* Test TinyObjLoader */
${DEFINE_HAVE_TINYOBJLOADER}
/* ACTION to take in case of error */
${DEFINE_ACTION_ON_ERROR}
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#define LT_OBJDIR ".libs/"
/* NVCC compiling */
${DEFINE_NVCC} /**/
/* Define if we have Alpaka */
${DEFINE_HAVE_ALPAKA}
/* Additional alpaka definitions */
${ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE_DEF}
${ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE_DEF}
${ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE_DEF}
${ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE_DEF}
${ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE_DEF}
${ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE_DEF}
${ALPAKA_ACC_CPU_BT_OMP4_ENABLE_DEF}
/* Name of package */
#define PACKAGE "openfpm_pdata"
...
...
@@ -140,6 +174,9 @@ ${DEFINE_PERFORMANCE_TEST}
/* Security enhancement class 1 */
${DEFINE_SE_CLASS1}
/* Security enhancement class 2 */
${DEFINE_SE_CLASS2}
/* Security enhancement class 3 */
${DEFINE_SE_CLASS3}
...
...
@@ -149,6 +186,9 @@ ${DEFINE_STDC_HEADERS}
/* If an error occur stop the program */
${DEFINE_STOP_ON_ERROR}
/* Garbage injector*/
${DEFINE_GARBAGE_INJECTOR}
/* Test coverage mode */
${DEFINE_TEST_COVERAGE_MODE}
...
...
@@ -157,3 +197,5 @@ ${DEFINE_TEST_COVERAGE_MODE}
/* Version number of package */
#define VERSION "1.0.0"
#define OPENFPM_PDATA
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment