-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from jmikeowen/feature/cmake-build-time-tpls
CMake build time TPLs
- Loading branch information
Showing
78 changed files
with
2,582 additions
and
1,730 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# CMakeLists to build the Spheral library. | ||
cmake_minimum_required(VERSION 3.14) | ||
project(spheral LANGUAGES CXX) | ||
|
||
include(ExternalProject) | ||
|
||
################################ | ||
# Configure CMake | ||
################################ | ||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") | ||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS On) | ||
|
||
################################ | ||
# Configure and Include blt | ||
################################ | ||
set(ENABLE_MPI ON CACHE BOOL "") | ||
set(ENABLE_OPENMP ON CACHE BOOL "") | ||
|
||
if(NOT SPHERAL_BLT_DIR) | ||
set (SPHERAL_BLT_REL_DIR "${PROJECT_SOURCE_DIR}/cmake/blt" CACHE PATH "") | ||
get_filename_component(SPHERAL_BLT_DIR "${SPHERAL_BLT_REL_DIR}" ABSOLUTE) | ||
endif() | ||
|
||
if (NOT EXISTS "${SPHERAL_BLT_DIR}/SetupBLT.cmake") | ||
message(FATAL_ERROR | ||
"${SPHERAL_BLT_DIR} is not present.\n" | ||
"call cmake with -DSPHERAL_BLT_DIR=/your/installation/of/blt\n") | ||
endif() | ||
|
||
include(${SPHERAL_BLT_DIR}/SetupBLT.cmake) | ||
|
||
################################ | ||
# Include standard build system logic and options / definitions | ||
################################ | ||
set(ENABLE_CXXONLY OFF CACHE BOOL "enable C++ only build without python bindings") | ||
set(ENABLE_2D ON CACHE BOOL "enable 2d") | ||
set(ENABLE_3D ON CACHE BOOL "enable 3d") | ||
set(ENABLE_INSTANTIATIONS ON CACHE BOOL "enable instantiations") | ||
set(ENABLE_TIMER OFF CACHE BOOL "enable timer") | ||
|
||
option(ENABLE_STATIC_CXXONLY "build only static libs" OFF) | ||
if(ENABLE_STATIC_CXXONLY) | ||
set(ENABLE_CXXONLY ON) | ||
endif() | ||
|
||
if(ENABLE_MPI) | ||
set(BLT_MPI_COMPILE_FLAGS -DUSE_MPI -DMPICH_SKIP_MPICXX -ULAM_WANT_MPI2CPP -DOMPI_SKIP_MPICXX) | ||
list(APPEND spheral_blt_depends mpi) | ||
endif() | ||
|
||
if(ENABLE_OPENMP) | ||
list(APPEND spheral_blt_depends openmp) | ||
endif() | ||
|
||
|
||
################################ | ||
# Install / Locate third party libraries | ||
################################ | ||
set(SPHERAL_INSTALL_DIR "" CACHE STRING "Directory to install Spheral TPLs and/or Spheral libs.") | ||
include(cmake/InstallTPLs.cmake) | ||
|
||
if(ENABLE_CXXONLY) | ||
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/Spheral) | ||
if(SPHERAL_INSTALL_DIR) | ||
set(CMAKE_INSTALL_PREFIX ${SPHERAL_INSTALL_DIR}) | ||
endif() | ||
else() | ||
set(CMAKE_INSTALL_PREFIX ${PYTHON_SITE_PACKAGE_DIR}) | ||
endif() | ||
|
||
|
||
include(cmake/CMakeDefinitions.cmake) | ||
|
||
|
||
################################ | ||
# Set full rpath information by default | ||
################################ | ||
# use, i.e. don't skip the full RPATH for the build tree | ||
set(CMAKE_SKIP_BUILD_RPATH FALSE) | ||
|
||
# when building, don't use the install RPATH already | ||
# (but later on when installing) | ||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) | ||
|
||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}") | ||
|
||
# add the automatically determined parts of the RPATH | ||
# which point to directories outside the build tree to the install RPATH | ||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) | ||
|
||
add_subdirectory(src) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#----------------------------------------------------------------------------------- | ||
# Defeinitions to be added as compile flags for spheral | ||
#----------------------------------------------------------------------------------- | ||
|
||
if (CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
add_definitions("-DDEBUG=1") | ||
else() | ||
add_definitions("-DDEBUG=0") | ||
endif() | ||
|
||
if (ENABLE_BOUNDCHECKING) | ||
add_definitions(-D_GLIBCXX_DEBUG=1) | ||
endif() | ||
|
||
if(ENABLE_CXXONLY) | ||
add_definitions(-DCXXONLY=1) | ||
endif() | ||
add_definitions(-DUSE_TETGEN=0) | ||
add_definitions(-DUSE_TRIANGLE=0) | ||
add_definitions(-DNOPOLYTOPE=1) | ||
add_definitions(-DSPHERAL1D=1) | ||
if(ENABLE_2D) | ||
add_definitions(-DSPHERAL2D=1) | ||
endif() | ||
if(ENABLE_3D) | ||
add_definitions(-DNOR3D=1) | ||
add_definitions(-DSPHERAL3D=1) | ||
endif() | ||
if(ENABLE_TIMER) | ||
add_definitions(-DTIMER=1) | ||
endif() | ||
|
||
if (ENABLE_MPI) | ||
add_definitions(-DUSE_MPI=1) | ||
endif() |
Oops, something went wrong.