Skip to content

Commit de66432

Browse files
author
Martin D. Weinberg
committed
Implement two minimal build flavors
1 parent 9e8faf2 commit de66432

2 files changed

Lines changed: 46 additions & 17 deletions

File tree

CMakeLists.txt

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,41 @@ endif()
4747
# Build options
4848
option(ENABLE_NBODY "Enable EXP n-body" ON)
4949
option(ENABLE_PYEXP "Enable the Python bindings" ON)
50+
option(ENABLE_PYEXP_ONLY "Python bindings and support libraries only" OFF)
51+
option(ENABLE_UTILS "Enable build of the EXP standalone utilities" OFF)
5052
option(ENABLE_PNG "Enable PNG graphics support" FALSE)
5153
option(ENABLE_CUDA "Enable CUDA" FALSE)
5254
option(ENABLE_SLURM "Enable SLURM checkpointing support" FALSE)
5355
option(ENABLE_XDR "Enable RPC/XDR support for Tipsy standard" FALSE)
5456
option(ENABLE_VTK "Configure VTK if available" FALSE)
5557
option(ENABLE_CUDA_SINGLE "Use real*4 instead of real*8 for CUDA" FALSE)
56-
option(ENABLE_USER "Enable basic user modules" ON)
58+
option(ENABLE_USER "Enable compilation of user modules" ON)
5759
option(ENABLE_SLCHECK "Enable *careful* Sturm-Liouville solutions" TRUE)
5860
option(ENABLE_TESTS "Enable build tests for EXP, pyEXP and helpers" ON)
61+
option(ENABLE_MINIMAL "Compile EXP support libraries only" OFF)
5962
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
6063
option(BUILD_DOCS "Build documentation" OFF)
6164

65+
# Metaflag for minimal build
66+
67+
if(ENABLE_MINIMAL)
68+
set(ENABLE_NBODY OFF)
69+
set(ENABLE_PYEXP OFF)
70+
set(ENABLE_USER OFF)
71+
set(ENABLE_UTILS OFF)
72+
set(ENABLE_TESTS OFF)
73+
endif()
74+
75+
# Metaflag for pyEXP only
76+
77+
if(ENABLE_PYEXP_ONLY)
78+
set(ENABLE_NBODY OFF)
79+
set(ENABLE_PYEXP ON )
80+
set(ENABLE_USER OFF)
81+
set(ENABLE_UTILS OFF)
82+
set(ENABLE_TESTS OFF)
83+
endif()
84+
6285
# Set mpirun launcher for CTest
6386

6487
set(EXP_MPI_LAUNCH "mpirun" CACHE STRING "Command to run an MPI application (for unit tests only)")
@@ -253,12 +276,15 @@ add_subdirectory(expui)
253276
if (ENABLE_NBODY)
254277
add_subdirectory(src)
255278
endif()
256-
add_subdirectory(utils)
279+
if (ENABLE_UTILS)
280+
add_subdirectory(utils)
281+
endif()
257282
if (ENABLE_PYEXP)
258283
add_subdirectory(pyEXP)
259284
endif()
260-
261-
add_subdirectory(extern/user-modules)
285+
if (ENABLE_USER)
286+
add_subdirectory(extern/user-modules)
287+
endif()
262288

263289
# Build the tests; set ENABLE_TEST=OFF to disable
264290
if(ENABLE_TESTS)

expui/CMakeLists.txt

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,19 @@ install(TARGETS expui DESTINATION lib)
4848

4949
# Configure and build the test routines
5050
#
51-
add_executable(nativetoh5 coefstoh5.cc)
52-
add_executable(h5compare h5compare.cc)
53-
add_executable(viewcoefs viewcoefs.cc)
54-
add_executable(h5power h5power.cc)
55-
add_executable(makecoefs makecoefs.cc)
56-
add_executable(testread testread.cc)
57-
58-
foreach(program ${bin_PROGRAMS})
59-
target_link_libraries(${program} expui exputil ${common_LINKLIB})
60-
target_include_directories(${program} PUBLIC ${common_INCLUDE})
61-
target_compile_options(${program} PUBLIC ${OpenMP_CXX_FLAGS})
62-
install(TARGETS ${program} DESTINATION bin)
63-
endforeach()
51+
if(ENABLE_UTILS)
52+
add_executable(nativetoh5 coefstoh5.cc)
53+
add_executable(h5compare h5compare.cc)
54+
add_executable(viewcoefs viewcoefs.cc)
55+
add_executable(h5power h5power.cc)
56+
add_executable(makecoefs makecoefs.cc)
57+
add_executable(testread testread.cc)
58+
59+
foreach(program ${bin_PROGRAMS})
60+
target_link_libraries(${program} expui exputil ${common_LINKLIB})
61+
target_include_directories(${program} PUBLIC ${common_INCLUDE})
62+
target_compile_options(${program} PUBLIC ${OpenMP_CXX_FLAGS})
63+
install(TARGETS ${program} DESTINATION bin)
64+
endforeach()
65+
66+
endif()

0 commit comments

Comments
 (0)