From 095b40a0e5db320cfd42bad766815419083fc9cf Mon Sep 17 00:00:00 2001 From: Duc Le Date: Thu, 11 Jan 2024 16:38:07 +0000 Subject: [PATCH] Update Eigen and PyBind versions to be compatible with Pyodide --- cmake/Eigen.cmake | 27 +++++++++++++-------------- cmake/Eigen.in | 15 --------------- cmake/PyBind11.in | 2 +- src/libmcphase/CMakeLists.txt | 1 + 4 files changed, 15 insertions(+), 30 deletions(-) delete mode 100644 cmake/Eigen.in diff --git a/cmake/Eigen.cmake b/cmake/Eigen.cmake index d9145ee..0d62be9 100644 --- a/cmake/Eigen.cmake +++ b/cmake/Eigen.cmake @@ -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) diff --git a/cmake/Eigen.in b/cmake/Eigen.in deleted file mode 100644 index bbd7e36..0000000 --- a/cmake/Eigen.in +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required ( VERSION 3.1 ) -project(libMcPhase_Eigen) -include( ExternalProject ) - -ExternalProject_Add(eigen - URL http://bitbucket.org/eigen/eigen/get/3.3.4.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 - CMAKE_CACHE_ARGS - -DCMAKE_BUILD_TYPE:STRING=Release - -DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF - -DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_CURRENT_BINARY_DIR}/extern-eigen/install -) - diff --git a/cmake/PyBind11.in b/cmake/PyBind11.in index 8dc25d1..20e4bb7 100644 --- a/cmake/PyBind11.in +++ b/cmake/PyBind11.in @@ -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 "" diff --git a/src/libmcphase/CMakeLists.txt b/src/libmcphase/CMakeLists.txt index e409e37..a9c2e3a 100644 --- a/src/libmcphase/CMakeLists.txt +++ b/src/libmcphase/CMakeLists.txt @@ -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)