Skip to content

Commit

Permalink
fix Eigen import Error
Browse files Browse the repository at this point in the history
  • Loading branch information
ronald-jaepel committed Apr 17, 2024
1 parent 9853ef6 commit 0feb8db
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 22 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
nuget install intelmkl.static.win-x64 -Version 2023.0.0.25930
Invoke-WebRequest -Uri "https://gitlab.com/libeigen/eigen/-/archive/master/eigen-master.zip" -OutFile eigen.zip
7z x eigen.zip
- name: Build UMFPACK and HDF5
- name: Build UMFPACK and HDF5 and Eigen3
if: steps.cache.outputs.cache-hit != 'true'
run: |
$base_dir = $($env:BASE_DIR.Replace('\', '/'))
Expand All @@ -69,6 +69,14 @@ jobs:
$ENV:MKLROOT="${env:BASE_DIR}/intelmkl.static.win-x64.2023.0.0.25930/lib/native/win-x64".Replace('\', '/')
cmake -DCMAKE_INSTALL_PREFIX="${base_dir}\suitesparse\install" -DBLA_VENDOR=Intel10_64lp_seq -DBLA_STATIC=ON -G "Ninja" -DCMAKE_C_FLAGS="/GL" -DCMAKE_STATIC_LINKER_FLAGS="/LTCG" -DCMAKE_BUILD_TYPE=Release -DBUILD_METIS=OFF ..\suitesparse-metis-for-windows-e8d953dffb8a99aa8b65ff3ff03e12a3ed72f90c\
ninja install
cd "${env:BASE_DIR}"
Invoke-WebRequest -Uri "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip" -OutFile eigen.zip
7z x eigen.zip -oeigen\code -y
cd eigen
mkdir build
cd build
cmake ../code -DCMAKE_INSTALL_PREFIX="../install"
cmake --build . --target install
- name: Build and Install
run: |
cd "${env:BASE_DIR}"
Expand All @@ -78,6 +86,7 @@ jobs:
$ENV:MKLROOT="${env:BASE_DIR}/intelmkl.static.win-x64.2023.0.0.25930/lib/native/win-x64".Replace('\', '/')
$ENV:TBB_ROOT="${env:BASE_DIR}/inteltbb.devel.win.2021.8.0.25874/lib/native".Replace('\', '/')
$ENV:UMFPACK_ROOT="${env:BASE_DIR}/suitesparse/install".Replace('\', '/')
$ENV:Eigen3_DIR="${env:BASE_DIR}/eigen/install".Replace('\', '/')
$install_prefix = $($env:INSTALL_PREFIX.Replace('\', '/'))
$src_dir = $($env:SRC_DIR.Replace('\', '/'))
$base_dir = $($env:BASE_DIR.Replace('\', '/'))
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,16 @@ endif()

set(EIGEN_TARGET "")
if (ENABLE_DG)
find_package(Eigen3 3.4)
find_package(Eigen3 3.4 NO_MODULE)

# Disable DG if Eigen is not present
if (NOT TARGET Eigen3::Eigen)
message(STATUS "Disabling DG support because Eigen3 could not be found")
set(ENABLE_DG OFF)
else()
set(EIGEN_TARGET "Eigen3::Eigen")
get_target_property(Eigen3_INCLUDE_DIRS Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES)
include_directories(${Eigen3_INCLUDE_DIRS} "${Eigen3_INCLUDE_DIRS}/..")
endif()
endif()

Expand Down Expand Up @@ -611,7 +613,6 @@ endif()
if (ENABLE_DG)
message("Found Eigen3: ${Eigen3_FOUND}")
if (TARGET Eigen3::Eigen)
get_target_property(Eigen3_INCLUDE_DIRS Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES)
message(" Version ${Eigen3_VERSION}")
message(" Includes ${Eigen3_INCLUDE_DIRS}")
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/libcadet/AdUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "linalg/SparseMatrix.hpp"
#include "AdUtils.hpp"

#include <eigen3/EigenSparse>
#include <eigen3/Eigen/Sparse>
#include <limits>
#include <algorithm>

Expand Down
2 changes: 1 addition & 1 deletion src/libcadet/AutoDiff.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "cadet/cadetCompilerInfo.hpp"
#include "common/CompilerSpecific.hpp"

#include <eigen3/EigenCore>
#include <eigen3/Eigen/Core>
#include <type_traits>

#if defined(ACTIVE_SFAD) || defined(ACTIVE_SETFAD)
Expand Down
4 changes: 2 additions & 2 deletions src/libcadet/linalg/BandedEigenSparseRowIterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <vector>
#include <ostream>
#include <algorithm>
#include <eigen3/EigenSparse>// @TODO: third party #include <Eigen>
#include <eigen3/EigenDense>
#include <eigen3/Eigen/Sparse>// @TODO: third party #include <Eigen>
#include <eigen3/Eigen/Dense>

#include "SparseSolverInterface.hpp"
#include "cadet/cadetCompilerInfo.hpp"
Expand Down
4 changes: 2 additions & 2 deletions src/libcadet/linalg/Subset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#include "linalg/BandMatrix.hpp"

#include <algorithm>
#include <eigen3/EigenDense>
#include <eigen3/EigenSparse>
#include <eigen3/Eigen/Dense>
#include <eigen3/Eigen/Sparse>

namespace cadet
{
Expand Down
4 changes: 2 additions & 2 deletions src/libcadet/model/GeneralRateModelDG.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include "Memory.hpp"
#include "model/ModelUtils.hpp"
#include "ParameterMultiplexing.hpp"
#include <eigen3/EigenDense>
#include <eigen3/EigenSparse>
#include <eigen3/Eigen/Dense>
#include <eigen3/Eigen/Sparse>
#include <array>
#include <vector>
#ifndef _USE_MATH_DEFINES
Expand Down
4 changes: 2 additions & 2 deletions src/libcadet/model/GeneralRateModelDGFV.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include "model/ModelUtils.hpp"
#include "ParameterMultiplexing.hpp"

#include <eigen3/EigenDense>
#include <eigen3/EigenSparse>
#include <eigen3/Eigen/Dense>
#include <eigen3/Eigen/Sparse>
#include <array>
#include <vector>
#ifndef _USE_MATH_DEFINES
Expand Down
4 changes: 2 additions & 2 deletions src/libcadet/model/LumpedRateModelWithPoresDG.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include "model/ModelUtils.hpp"
#include "ParameterMultiplexing.hpp"

#include <eigen3/EigenDense>
#include <eigen3/EigenSparse>
#include <eigen3/Eigen/Dense>
#include <eigen3/Eigen/Sparse>
#include <array>
#include <vector>
#ifndef _USE_MATH_DEFINES
Expand Down
4 changes: 2 additions & 2 deletions src/libcadet/model/LumpedRateModelWithoutPoresDG.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
#include <vector>

#include "Benchmark.hpp"
#include <eigen3/EigenDense> // use LA lib Eigen for Matrix operations
#include <eigen3/EigenSparse>
#include <eigen3/Eigen/Dense> // use LA lib Eigen for Matrix operations
#include <eigen3/Eigen/Sparse>
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#include <math.h>
Expand Down
4 changes: 2 additions & 2 deletions src/libcadet/model/parts/ConvectionDispersionOperatorDG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include "LoggingUtils.hpp"
#include "Logging.hpp"

#include <eigen3/EigenDense>
#include <eigen3/EigenSparse>
#include <eigen3/Eigen/Dense>
#include <eigen3/Eigen/Sparse>
#include <algorithm>
#include <cmath>

Expand Down
4 changes: 2 additions & 2 deletions src/libcadet/model/parts/ConvectionDispersionOperatorDG.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

#include <unordered_map>
#include <unordered_set>
#include <eigen3/EigenDense>
#include <eigen3/EigenSparse>
#include <eigen3/Eigen/Dense>
#include <eigen3/Eigen/Sparse>
#include <vector>

using namespace Eigen;
Expand Down
2 changes: 1 addition & 1 deletion src/libcadet/model/parts/DGToolbox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef LIBCADET_DGTOOLBOX_HPP_
#define LIBCADET_DGTOOLBOX_HPP_

#include <eigen3/EigenDense>
#include <eigen3/Eigen/Dense>

namespace cadet
{
Expand Down

0 comments on commit 0feb8db

Please sign in to comment.