Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -76,7 +77,7 @@ if(ENABLE_MINIMAL)
set(ENABLE_UTILS OFF)
set(ENABLE_TESTS OFF)
endif()

# Metaflag for pyEXP only

if(ENABLE_PYEXP_ONLY)
Expand All @@ -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)")
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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})

2 changes: 1 addition & 1 deletion exputil/DiskDensityFunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 6 additions & 2 deletions include/DiskDensityFunc.H
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
#define _DiskDensityFunc_H_

#include <functional>
#include <stdexcept>
#include <string>

#include "config_exp.h"

#ifdef HAVE_PYTHON3
#include <pybind11/pybind11.h>
#include <pybind11/embed.h>
#endif

/** Python disk-density function wrapper

Expand All @@ -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--------------------------------

*/
Expand Down
Loading