diff --git a/CMakeLists.txt b/CMakeLists.txt index 17f9b64e0..d638baf72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,7 @@ option(ENABLE_TESTS "Enable build tests for EXP, pyEXP and helpers" ON) option(ENABLE_MINIMAL "Compile EXP support libraries only" OFF) option(BUILD_SHARED_LIBS "Build using shared libraries" ON) option(BUILD_DOCS "Build documentation" OFF) +option(DISABLE_PYTHON "Disable the Python development environment" OFF) # Metaflag for minimal build @@ -76,7 +77,7 @@ if(ENABLE_MINIMAL) set(ENABLE_UTILS OFF) set(ENABLE_TESTS OFF) endif() - + # Metaflag for pyEXP only if(ENABLE_PYEXP_ONLY) @@ -86,7 +87,7 @@ if(ENABLE_PYEXP_ONLY) set(ENABLE_UTILS OFF) set(ENABLE_TESTS OFF) endif() - + # Set mpirun launcher for CTest set(EXP_MPI_LAUNCH "mpirun" CACHE STRING "Command to run an MPI application (for unit tests only)") @@ -299,7 +300,9 @@ if(ENABLE_TESTS) endif() # try to find pybind11 and build wrapper python module -find_package(Python3 COMPONENTS Interpreter Development) +if (NOT DISABLE_PYTHON) + find_package(Python3 COMPONENTS Interpreter Development) +endif() message(STATUS "python3 include dirs: ${Python3_INCLUDE_DIRS}") if(Python3_FOUND) set(HAVE_PYTHON3 TRUE) @@ -405,4 +408,3 @@ set(CMAKE_CXX_FLAGS_UBSAN # from the same source. configure_file(${CMAKE_SOURCE_DIR}/config_cmake.h_in ${CMAKE_BINARY_DIR}/config_exp.h) include_directories(${PROJECT_BINARY_DIR}) - diff --git a/exputil/DiskDensityFunc.cc b/exputil/DiskDensityFunc.cc index 65418193e..44ad15990 100644 --- a/exputil/DiskDensityFunc.cc +++ b/exputil/DiskDensityFunc.cc @@ -38,7 +38,7 @@ DiskDensityFunc::DiskDensityFunc(const std::string& modulename, const std::string& funcname) : funcname(funcname) { - throw std::runtime_error("DiskDensityFunc: you environoment does not have Python3 support. Use a built-in density target or install Python3 and recompile"); + throw std::runtime_error("DiskDensityFunc: your environoment does not have Python3 support. Use a built-in density target or install Python3 and recompile"); } DiskDensityFunc::~DiskDensityFunc() diff --git a/include/DiskDensityFunc.H b/include/DiskDensityFunc.H index 637d8cb14..f2b521e5b 100644 --- a/include/DiskDensityFunc.H +++ b/include/DiskDensityFunc.H @@ -2,11 +2,15 @@ #define _DiskDensityFunc_H_ #include +#include +#include #include "config_exp.h" +#ifdef HAVE_PYTHON3 #include #include +#endif /** Python disk-density function wrapper @@ -26,9 +30,9 @@ a = 1.0 # Scale radius h = 0.2 # Scale height f = math.exp(-0.5*math.fabs(z)/h) # Prevent overflows - sech = 2.0*f / (1.0 + f*f) # + sech = 2.0*f / (1.0 + f*f) # return math.exp(-R/a)*sech*sech/(8*math.pi*h*a*a) - + --------------------------cut here-------------------------------- */