Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,17 @@ endif()
# Linear
# ------

# Accelerate solver (Include before Eigen)

if(POLYSOLVE_WITH_ACCELERATE)
set(BLA_VENDOR Apple)
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
target_link_libraries(polysolve_linear PRIVATE BLAS::BLAS LAPACK::LAPACK)
target_compile_definitions(polysolve_linear PUBLIC POLYSOLVE_WITH_ACCELERATE)
if(POLYSOLVE_LARGE_INDEX)
message(STATUS "POLYSOLVE_LARGE_INDEX is ON: disabling Apple Accelerate (it only supports 32-bit sparse indices).")
else()
set(BLA_VENDOR Apple)
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
target_link_libraries(polysolve_linear PRIVATE BLAS::BLAS LAPACK::LAPACK)
target_compile_definitions(polysolve_linear PUBLIC POLYSOLVE_WITH_ACCELERATE)
endif()
endif()

include(eigen)
Expand Down
8 changes: 8 additions & 0 deletions src/polysolve/linear/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ namespace polysolve::linear
#include <Eigen/SuperLUSupport>
#endif
#ifdef POLYSOLVE_WITH_MKL
#ifndef POLYSOLVE_LARGE_INDEX
// Eigen's PardisoSupport only specializes for int/long long indices, not the
// std::ptrdiff_t (long) StiffnessMatrix used with POLYSOLVE_LARGE_INDEX.
#include <Eigen/PardisoSupport>
#endif
#endif
#ifdef POLYSOLVE_WITH_PARDISO
#include "Pardiso.hpp"
#endif
Expand Down Expand Up @@ -368,6 +372,7 @@ namespace polysolve::linear
RETURN_DIRECT_SOLVER_PTR(SPQR, "Eigen::SPQR");
#endif
#ifdef POLYSOLVE_WITH_MKL
#ifndef POLYSOLVE_LARGE_INDEX
}
else if (solver == "Eigen::PardisoLLT")
{
Expand All @@ -381,6 +386,7 @@ namespace polysolve::linear
{
RETURN_DIRECT_SOLVER_PTR(PardisoLU, "Eigen::PardisoLU");
#endif
#endif
#ifdef POLYSOLVE_WITH_PARDISO
}
else if (solver == "Pardiso")
Expand Down Expand Up @@ -524,10 +530,12 @@ namespace polysolve::linear
"Eigen::SPQR",
#endif
#ifdef POLYSOLVE_WITH_MKL
#ifndef POLYSOLVE_LARGE_INDEX
"Eigen::PardisoLLT",
"Eigen::PardisoLDLT",
"Eigen::PardisoLU",
#endif
#endif
#ifdef POLYSOLVE_WITH_PARDISO
"Pardiso",
#endif
Expand Down