Skip to content
Merged
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
14 changes: 7 additions & 7 deletions BUILD_OPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@ For a more complete list of cmake variables, take a look in the file `CMakeCache
-DEIGEN3_INCLUDE_DIR=your/path/to/eigen


# Set the Python executable: PYTHON_EXECUTABLE
# Set the Python executable: Python3_EXECUTABLE
# If working from a virtual environment, cmake will automatically set this as
# the executable in the environment's directory. It may, however, have trouble
# finding the system Python library and include directory of the same version, so
# setting PYTHON_LIBRARY and PYTHON_INCLUDE_DIR manually is encouraged.
-DPYTHON_EXECUTABLE=/usr/bin/python3
# setting Python3_LIBRARY and Python3_INCLUDE_DIR manually is encouraged.
-DPython3_EXECUTABLE=/usr/bin/python3

# Set the Python include directory: PYTHON_INCLUDE_DIR
-DPYTHON_INCLUDE_DIR=/usr/include/python3.7m
# Set the Python include directory: Python3_INCLUDE_DIR
-DPython3_INCLUDE_DIR=/usr/include/python3.10

# Set the Python library: PYTHON_LIBRARY
-DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.7m.so
# Set the Python library: Python3_LIBRARY
-DPython3_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.10.so


# Switch HepMC on/off: WITH_HEPMC (On|Off)
Expand Down
2 changes: 1 addition & 1 deletion README_OSX.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Configure GAMBIT. Key optional extras:
`-D WITH_MPI=ON` if you want scanners to be parallelised
`-D WITH_HEPMC=ON` if you want HepMC enabled
```
cmake -D PYTHON_EXECUTABLE=/usr/bin/python3 -D PYTHON_LIBRARY=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/Current/Python3 -D PYTHON_INCLUDE_DIR=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Headers ..
cmake -D Python3_EXECUTABLE=/usr/bin/python3 -D Python3_LIBRARY=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/Current/Python3 -D Python3_INCLUDE_DIR=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Headers ..
```

Now, see the instructions in the main README.md for possible make targets, and BUILD_OPTIONS.md for other cmake options.
Expand Down
2 changes: 1 addition & 1 deletion ScannerBit/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if(Python3_Interpreter_FOUND)
################## ScannerBit_python_interface ##################

set(scan_module_libraries
#${PYTHON_LIBRARIES}
#${Python3_LIBRARIES}
yaml-cpp
${OpenMP_omp_LIBRARY}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function(add_gambit_deps obj_name)
target_link_libraries(${obj_name} ${Mathematica_WSTP_LIBRARIES})
endif()
#if(pybind11_FOUND)
# target_link_libraries(${obj_name} ${PYTHON_LIBRARIES})
# target_link_libraries(${obj_name} ${Python3_LIBRARIES})
#endif()
if(SQLITE3_FOUND)
target_link_libraries(${obj_name} ${SQLITE3_LIBRARIES})
Expand Down
17 changes: 2 additions & 15 deletions ScannerBit/scripts/scanner+_harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def main(argv):
inc_commands += [incdir]
scanbit_reqs[plugin[7]][plugin_name][version][5] += [incdir]
inc_files += [[inc, incdir]]
elif inc == "ROOT" or inc == "GSL" or inc == "pybind11" or inc == "Python" or inc == "PYTHONLIBS":
elif inc == "ROOT" or inc == "GSL" or inc == "pybind11" or inc == "Python3":
auto_incs += [inc]
#scanbit_reqs[plugin[7]][plugin_name][version][5] += [inc]
if scanbit_reqs[plugin[7]][plugin_name][version][2] == "":
Expand Down Expand Up @@ -840,7 +840,7 @@ def main(argv):

temp = set(inc for inc in scanbit_auto_incs[plug_type[i]][directory])
for inc in temp:
if inc == "ROOT" or inc == "Python":
if inc == "ROOT" or inc == "Python3":
towrite += """
if ({2}_FOUND)
set ({0}_plugin_includes_{1}
Expand All @@ -867,19 +867,6 @@ def main(argv):
set ({0}_ok_flag_{1} \"${{{0}_ok_flag_{1}}} \\n - file missing: \\\"{2}\\\"\")
endif()
""".format(plug_type[i], directory, inc, "PYBIND11")
elif inc == "PYTHONLIBS":
towrite += """
if ({2}_FOUND)
set ({0}_plugin_includes_{1}
${{{0}_plugin_includes_{1}}}
${{{3}_INCLUDE_DIRS}}
)
set ({0}_plugin_found_incs_{1} \"${{{0}_plugin_found_incs_{1}}} \\\"{2}\\\": ${{{3}_INCLUDE_DIRS}}\\n\")
else()
message(\"-- Did not find {0} header {2}. Disabling scanners that depend on this.\")
set ({0}_ok_flag_{1} \"${{{0}_ok_flag_{1}}} \\n - file missing: \\\"{2}\\\"\")
endif()
""".format(plug_type[i], directory, inc, "PYTHON")
else:
towrite += """
unset({0}_{1}_{3}_INCLUDE_PATH CACHE)
Expand Down
2 changes: 1 addition & 1 deletion ScannerBit/src/objectives/python/python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace Gambit
objective_plugin(python, version(1, 0, 0))
{

reqd_headers("PYTHONLIBS");
reqd_headers("Python3");
reqd_headers("pybind11");

Gambit::Utils::python_interpreter_guard g;
Expand Down
2 changes: 1 addition & 1 deletion ScannerBit/src/scanners/python/python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ namespace Gambit
scanner_plugin(python, version(1, 0, 0))
{

reqd_headers("PYTHONLIBS");
reqd_headers("Python3");
reqd_headers("pybind11");

Gambit::Utils::python_interpreter_guard g;
Expand Down
2 changes: 1 addition & 1 deletion gum/gum
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if [ -f ${cmake_variables_file} ]
then

# Extract location of python executable
python_exec=`awk -F\" '/^PYTHON_EXECUTABLE/{print $2}' ${cmake_variables_file}`
python_exec=`awk -F\" '/^Python3_EXECUTABLE/{print $2}' ${cmake_variables_file}`

# If the variable does not appear on the cmake_variable file, something went wrong
if [ -z ${python_exec} ]
Expand Down
2 changes: 1 addition & 1 deletion gum/src/cmake_variables.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
GUM_DIR = "@GUM_DIR@"

# Python executable
PYTHON_EXECUTABLE = "@PYTHON_EXECUTABLE@"
Python3_EXECUTABLE = "@Python3_EXECUTABLE@"

# Pythia version (No longer a constant)
# base_pythia_version = "@BASE_PYTHIA_VERSION@"
Expand Down
2 changes: 1 addition & 1 deletion gum/src/pythia.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def write_pythia_cmake_entry(model, output_dir, base_pythia_version):
" BUILD_IN_SOURCE 1\n"\
" PATCH_COMMAND patch -p1 < ${model_specific_patch}\n"\
" COMMAND patch -p1 < ${patch}\n"\
" COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Backends/patches/${name}/${ver}/patch_${name}.py\n"\
" COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Backends/patches/${name}/${ver}/patch_${name}.py\n"\
" CONFIGURE_COMMAND ./configure ${EXTRA_CONFIG} --enable-shared --cxx=\"${CMAKE_CXX_COMPILER}\" --cxx-common=\"${pythia_CXXFLAGS}\" --cxx-shared=\"${pythia_CXX_SHARED_FLAGS}\" --cxx-soname=\"${pythia_CXX_SONAME_FLAGS}\" --lib-suffix=\".so\"\n"\
" BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} CXX=\"${CMAKE_CXX_COMPILER}\" lib/${lib}.so\n"\
" INSTALL_COMMAND \"\"\n"\
Expand Down
Loading