From 2db10e469bd89ad8d8e14d4edb68ee28a1e90fd6 Mon Sep 17 00:00:00 2001 From: Kwabena N Amponsah Date: Thu, 21 Nov 2024 22:21:08 +0000 Subject: [PATCH] #20 Make castxml and clang system dependencies --- .github/workflows/test-cells-conda.yml | 5 +++-- .github/workflows/test-cells-ubuntu.yml | 7 +++++-- .github/workflows/test-shapes-pip.yml | 2 +- README.md | 6 ++++++ examples/cells/CMakeLists.txt | 25 ++++++++++++++----------- setup.cfg | 1 - 6 files changed, 29 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test-cells-conda.yml b/.github/workflows/test-cells-conda.yml index 306cd04..23e490a 100644 --- a/.github/workflows/test-cells-conda.yml +++ b/.github/workflows/test-cells-conda.yml @@ -30,7 +30,7 @@ jobs: - name: Install system dependencies run: | sudo apt-get update - sudo apt-get install cmake git + sudo apt-get install castxml clang cmake git - name: Setup Miniconda Python ${{ matrix.python-version }} uses: conda-incubator/setup-miniconda@v3 @@ -81,7 +81,8 @@ jobs: run: mamba install boa conda-build conda-verify - name: Build - run: conda mambabuild recipe -m variants/python${{ matrix.python-version }}.yaml + run: | + conda mambabuild recipe -m variants/python${{ matrix.python-version }}.yaml working-directory: examples/cells/conda - name: Install diff --git a/.github/workflows/test-cells-ubuntu.yml b/.github/workflows/test-cells-ubuntu.yml index b1360c9..715b687 100644 --- a/.github/workflows/test-cells-ubuntu.yml +++ b/.github/workflows/test-cells-ubuntu.yml @@ -41,6 +41,8 @@ jobs: echo "VTK version: ${vtk_ver}" sudo apt-get install \ + castxml \ + clang \ cmake \ git \ libboost-all-dev \ @@ -58,8 +60,9 @@ jobs: # Check installed package versions dpkg-query -W \ + castxml \ + clang \ cmake \ - g++ \ git \ libboost-all-dev \ libpetsc-real-dev \ @@ -73,7 +76,7 @@ jobs: python3-vtk${vtk_ver} - name: Install cppwg - run: pipx install . --include-deps + run: pipx install . - name: Configure run: | diff --git a/.github/workflows/test-shapes-pip.yml b/.github/workflows/test-shapes-pip.yml index bea7477..a7d01b8 100644 --- a/.github/workflows/test-shapes-pip.yml +++ b/.github/workflows/test-shapes-pip.yml @@ -26,7 +26,7 @@ jobs: - name: Install system dependencies run: | sudo apt-get update - sudo apt-get install cmake git + sudo apt-get install castxml clang cmake git - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 diff --git a/README.md b/README.md index 697dfd6..6927ced 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,12 @@ Automatically generate pybind11 Python wrapper code for C++ projects. ## Installation +Install CastXML (required) and Clang (recommended). On Ubuntu, this would be: + +```bash +sudo apt-get install castxml clang +``` + Clone the repository and install cppwg: ```bash diff --git a/examples/cells/CMakeLists.txt b/examples/cells/CMakeLists.txt index acec276..433499b 100644 --- a/examples/cells/CMakeLists.txt +++ b/examples/cells/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16...3.22) +cmake_minimum_required(VERSION 3.16...3.28) project(pycells LANGUAGES C CXX) set(CMAKE_CXX_STANDARD 17) @@ -53,25 +53,27 @@ file(GLOB_RECURSE MAIN_SOURCES ${CMAKE_SOURCE_DIR}/src/cpp/*.hpp ) add_library(cells SHARED ${MAIN_SOURCES}) -target_link_libraries(cells PUBLIC - ${Boost_LIBRARIES} - ${VTK_LIBRARIES} - ${PETSC_LIBRARIES} - ${MPI_C_LIBRARIES} - ${MPI_CXX_LIBRARIES} -) target_include_directories(cells PUBLIC ${CMAKE_SOURCE_DIR}/src/cpp ${CMAKE_SOURCE_DIR}/src/cpp/cell ${CMAKE_SOURCE_DIR}/src/cpp/mesh ${CMAKE_SOURCE_DIR}/src/cpp/utils ${CMAKE_SOURCE_DIR}/src/cpp/visualization +) +target_include_directories(cells SYSTEM PUBLIC ${Boost_INCLUDE_DIR} ${VTK_INCLUDE_DIRS} ${PETSC_INCLUDES} ${MPI_C_INCLUDE_PATH} ${MPI_CXX_INCLUDE_PATH} ) +target_link_libraries(cells PUBLIC + ${Boost_LIBRARIES} + ${VTK_LIBRARIES} + ${PETSC_LIBRARIES} + ${MPI_C_LIBRARIES} + ${MPI_CXX_LIBRARIES} +) # Set up the pycells module with pybind11 file(GLOB WRAPPER_SOURCES @@ -79,14 +81,14 @@ file(GLOB WRAPPER_SOURCES ${CMAKE_SOURCE_DIR}/dynamic/wrappers/all/*.hpp ) pybind11_add_module(_pycells_all MODULE ${WRAPPER_SOURCES}) -target_link_libraries(_pycells_all PRIVATE cells) target_include_directories(_pycells_all PRIVATE ${CMAKE_SOURCE_DIR}/dynamic/wrappers/all ${CMAKE_SOURCE_DIR}/dynamic/typecasters/ ${CMAKE_SOURCE_DIR}/dynamic/typecasters/thirdparty/dolfinx ${CMAKE_SOURCE_DIR}/dynamic/typecasters/thirdparty/smtk - ${PETSC4PY_INCLUDES} ) +target_include_directories(_pycells_all SYSTEM PRIVATE ${PETSC4PY_INCLUDES}) +target_link_libraries(_pycells_all PRIVATE cells) # Add install targets for scikit-build if(SKBUILD) @@ -106,7 +108,8 @@ add_custom_target(pycells_wrappers COMMAND ${CPPWG} ${CMAKE_SOURCE_DIR}/src/cpp -w ${CMAKE_SOURCE_DIR}/dynamic/wrappers -p ${CMAKE_SOURCE_DIR}/dynamic/config.yaml - -i "$,;>" + -i "$,;>" + "$,;>" -l ${CMAKE_BINARY_DIR}/cppwg.log --std c++17 COMMAND_EXPAND_LISTS diff --git a/setup.cfg b/setup.cfg index 2022a7a..04f5f7a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,7 +32,6 @@ python_requires = >=3.8 install_requires = pyyaml>=6.0 pygccxml>=2.2 - castxml>=0.4 [options.entry_points] console_scripts =