Skip to content

Commit

Permalink
Update Eigen and PyBind versions to be compatible with Pyodide
Browse files Browse the repository at this point in the history
  • Loading branch information
mducle committed Jan 11, 2024
1 parent 9b1dca0 commit 095b40a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 30 deletions.
27 changes: 13 additions & 14 deletions cmake/Eigen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@ option(USE_SYSTEM_EIGEN "Use the system installed Eigen" OFF)

if(USE_SYSTEM_EIGEN)
message(STATUS "Using system Eigen")
find_package(Eigen3 REQUIRED)
else()
message(STATUS "Using Eigen in ExternalProject")

# Download and unpack Eigen at configure time
configure_file(${CMAKE_SOURCE_DIR}/cmake/Eigen.in ${CMAKE_BINARY_DIR}/extern-eigen/CMakeLists.txt)

# The OLD behavior for this policy is to ignore the visibility properties
# for static libraries, object libraries, and executables without exports.
cmake_policy(SET CMP0063 "OLD")

execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/extern-eigen )
execute_process(COMMAND ${CMAKE_COMMAND} --build . WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/extern-eigen )

set(Eigen3_DIR "${CMAKE_BINARY_DIR}/extern-eigen/install/share/eigen3/cmake" CACHE PATH "")
ExternalProject_Add(
eigen
URL https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/extern-eigen/download
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/extern-eigen/source
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/extern-eigen/install
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
set(EIGEN3_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/extern-eigen/source")
endif()

find_package(Eigen3 REQUIRED)
15 changes: 0 additions & 15 deletions cmake/Eigen.in

This file was deleted.

2 changes: 1 addition & 1 deletion cmake/PyBind11.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include( ExternalProject )

ExternalProject_Add(pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11.git
GIT_TAG v2.2.4
GIT_TAG v2.11.1
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
1 change: 1 addition & 0 deletions src/libmcphase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ set(LIBMCPHASE_PYTHON_SOURCES
)
target_sources(${LIBMCPHASE_PYTHON_MODULE} PRIVATE ${LIBMCPHASE_PYTHON_SOURCES})
target_link_libraries(${LIBMCPHASE_PYTHON_MODULE} PUBLIC ${LIBMCPHASE_CXX_LIBRARIES})
add_dependencies(${LIBMCPHASE_PYTHON_MODULE} eigen)

0 comments on commit 095b40a

Please sign in to comment.