Skip to content

Commit

Permalink
fix pybind issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpvandermause committed Sep 16, 2024
1 parent 87c8dd0 commit 0ee5132
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 66 deletions.
50 changes: 0 additions & 50 deletions .github/workflows/cpp.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/flare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
cmake ..
cmake --build . -j4
cp _C_flare* ../flare/bffs/sgp
cd ctests
./tests
- name: Install LAMMPS
run: |
Expand Down
25 changes: 9 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,22 +150,15 @@ if(NOT DEFINED ENV{NO_LAPACK})
endif()
endif()

option(NO_PYTHON "Do not build Python module." OFF)
if(NOT NO_PYTHON)
set(PYBIND11_NEWPYTHON ON)
FetchContent_Declare(pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
)
FetchContent_MakeAvailable(pybind11)
#find_package(pybind11 CONFIG REQUIRED)

# Greatly reduces the code bloat
# target_compile_options(pybind11 INTERFACE "-fvisibility=hidden")
pybind11_add_module(flare_module ${PYBIND_SOURCES})
target_link_libraries(flare_module PUBLIC flare)
set_target_properties(flare_module PROPERTIES OUTPUT_NAME "_C_flare")
install(TARGETS flare_module LIBRARY DESTINATION flare/bffs/sgp)
endif()
set(PYBIND11_FINDPYTHON ON)
FetchContent_Declare(pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
)
FetchContent_MakeAvailable(pybind11)
pybind11_add_module(flare_module ${PYBIND_SOURCES})
target_link_libraries(flare_module PUBLIC flare)
set_target_properties(flare_module PROPERTIES OUTPUT_NAME "_C_flare")
install(TARGETS flare_module LIBRARY DESTINATION flare/bffs/sgp)

# Add test directory.
if(NOT DEFINED SKBUILD)
Expand Down

0 comments on commit 0ee5132

Please sign in to comment.