Skip to content
Snippets Groups Projects
Commit c4e0d0e8 authored by Rahil Doshi's avatar Rahil Doshi
Browse files

Remove pybind11 module from CMakeLists.txt, rename project and library name

parent 05b94204
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ walberla_codegen_venv_install(
add_executable ( HeatEquationWithMaterial )
target_sources( HeatEquationWithMaterial PRIVATE CodegenHeatEquationWithMaterial.cpp )
target_link_libraries( HeatEquationWithMaterial PRIVATE walberla::blockforest walberla::core walberla::field walberla::stencil walberla::timeloop walberla::vtk walberla::pde )
target_link_libraries( HeatEquationWithMaterial PRIVATE interpolation_template )
target_link_libraries( HeatEquationWithMaterial PRIVATE pymatlib_interpolators )
pystencilssfg_generate_target_sources( HeatEquationWithMaterial
SCRIPTS HeatEquationKernelWithMaterial.py
......
cmake_minimum_required(VERSION 3.10)
project(fast_interpolation)
project(pymatlib_interpolators)
# Find required packages
find_package(Python COMPONENTS Interpreter Development NumPy REQUIRED)
execute_process(
COMMAND ${Python_EXECUTABLE} -m pybind11 --cmakedir
OUTPUT_VARIABLE PYBIND11_CMAKE_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
find_package(pybind11 PATHS ${PYBIND11_CMAKE_DIR} NO_DEFAULT_PATH REQUIRED)
# execute_process(
# COMMAND ${Python_EXECUTABLE} -m pybind11 --cmakedir
# OUTPUT_VARIABLE PYBIND11_CMAKE_DIR
# OUTPUT_STRIP_TRAILING_WHITESPACE
# )
# find_package(pybind11 PATHS ${PYBIND11_CMAKE_DIR} NO_DEFAULT_PATH REQUIRED)
# Create interface library for header-only template implementation
add_library(interpolation_template INTERFACE)
target_include_directories(interpolation_template INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}
add_library(pymatlib_interpolators INTERFACE)
target_include_directories(pymatlib_interpolators INTERFACE
# ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
)
# Add the Pybind11 module
pybind11_add_module(fast_interpolation
module.cpp
binary_search_interpolation.cpp
double_lookup_interpolation.cpp
)
target_include_directories(fast_interpolation PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
)
target_compile_features(fast_interpolation PRIVATE cxx_std_11)
target_compile_options(fast_interpolation PRIVATE -O3)
target_link_libraries(fast_interpolation PRIVATE
interpolation_template
pybind11::module
Python::NumPy
)
# pybind11_add_module(fast_interpolation
# module.cpp
# )
# target_include_directories(fast_interpolation PRIVATE
# ${CMAKE_CURRENT_SOURCE_DIR}/include
# )
# target_compile_features(fast_interpolation PRIVATE cxx_std_11)
# target_compile_options(fast_interpolation PRIVATE -O3)
# target_link_libraries(fast_interpolation PRIVATE
# interpolation_template
# pybind11::module
# Python::NumPy
# )
# Remove or update this if test_interpolation.py has been moved
# add_custom_target(fast_interpolation_test_py
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment