Skip to content

Commit

Permalink
[LinearSolver] Remove CSparse-based linear solvers (#4258)
Browse files Browse the repository at this point in the history
* [LinearSolver.Direct] Remove CSparse based solvers

* Remove csparse extlib

* Fetchable CSparseSolvers plugin

* Remove references of SparseLUSolver

* Remove references to SparseCholeskySolver

* Remove csparse

* Try to fix on Linux

* Update the compat

* [LinearSolver.Direct] Remove CSparse based solvers

* Fix direct solver
  • Loading branch information
alxbilger authored Nov 23, 2023
1 parent b422d39 commit 5a3f36c
Show file tree
Hide file tree
Showing 42 changed files with 89 additions and 3,818 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@

#include <sofa/component/linearsolver/direct/SparseCholeskySolver.h>

SOFA_DISABLED_HEADER("v22.06", "v23.06", "sofa/component/linearsolver/direct/SparseCholeskySolver.h")
SOFA_PRAGMA_ERROR( \
"This header has been DISABLED since v23.12. " \
"To fix this error you must use the CSparseSolvers plugins. " )
4 changes: 3 additions & 1 deletion Sofa/Component/Compat/src/SofaSparseSolver/SparseLUSolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@

#include <sofa/component/linearsolver/direct/SparseLUSolver.h>

SOFA_DISABLED_HEADER("v22.06", "v23.06", "sofa/component/linearsolver/direct/SparseLUSolver.h")
SOFA_PRAGMA_ERROR( \
"This header has been DISABLED since v23.12. " \
"To fix this error you must use the CSparseSolvers plugins. " )
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@

#include <sofa/component/linearsolver/direct/SparseLUSolver.inl>

SOFA_DISABLED_HEADER("v22.06", "v23.06", "sofa/component/linearsolver/direct/SparseLUSolver.inl")
SOFA_PRAGMA_ERROR( \
"This header has been DISABLED since v23.12. " \
"To fix this error you must use the CSparseSolvers plugins. " )
6 changes: 1 addition & 5 deletions Sofa/Component/LinearSolver/Direct/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,10 @@ set(SOURCE_FILES
${SOFACOMPONENTLINEARSOLVERDIRECT_SOURCE_DIR}/MatrixLinearSystem[BTDMatrix].cpp
${SOFACOMPONENTLINEARSOLVERDIRECT_SOURCE_DIR}/PrecomputedLinearSolver.cpp
${SOFACOMPONENTLINEARSOLVERDIRECT_SOURCE_DIR}/SVDLinearSolver.cpp
${SOFACOMPONENTLINEARSOLVERDIRECT_SOURCE_DIR}/SparseCholeskySolver.cpp
${SOFACOMPONENTLINEARSOLVERDIRECT_SOURCE_DIR}/SparseCommon.cpp
${SOFACOMPONENTLINEARSOLVERDIRECT_SOURCE_DIR}/SparseLDLSolver.cpp
${SOFACOMPONENTLINEARSOLVERDIRECT_SOURCE_DIR}/SparseLUSolver.cpp
${SOFACOMPONENTLINEARSOLVERDIRECT_SOURCE_DIR}/TypedMatrixLinearSystem[BTDMatrix].cpp
)
add_subdirectory(extlibs/csparse)
sofa_set_01(SOFA_COMPONENT_LINEARSOLVER_DIRECT_HAVE_CSPARSE VALUE TRUE)

sofa_find_package(metis QUIET) # Unix users can have an installed version of metis
if(NOT metis_FOUND)
Expand All @@ -75,7 +71,7 @@ sofa_find_package(Sofa.Component.LinearSolver.Iterative REQUIRED) # Only for Mat

add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${WRAPPER_FILES})
target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Core Sofa.Component.LinearSolver.Iterative)
target_link_libraries(${PROJECT_NAME} PUBLIC metis csparse)
target_link_libraries(${PROJECT_NAME} PUBLIC metis)
target_link_libraries(${PROJECT_NAME} PUBLIC Threads::Threads)

sofa_create_package_with_targets(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@ find_package(Sofa.Component.LinearSolver.Iterative QUIET REQUIRED)
find_package(Threads QUIET REQUIRED)

set(SOFA_COMPONENT_LINEARSOLVER_DIRECT_HAVE_METIS @SOFA_COMPONENT_LINEARSOLVER_DIRECT_HAVE_METIS@)
set(SOFA_COMPONENT_LINEARSOLVER_DIRECT_HAVE_CSPARSE @SOFA_COMPONENT_LINEARSOLVER_DIRECT_HAVE_CSPARSE@)

if(SOFA_COMPONENT_LINEARSOLVER_DIRECT_HAVE_METIS)
find_package(Metis QUIET REQUIRED HINTS "${CMAKE_CURRENT_LIST_DIR}/..")
endif()
if(SOFA_COMPONENT_LINEARSOLVER_DIRECT_HAVE_CSPARSE)
find_package(CSparse QUIET REQUIRED HINTS "${CMAKE_CURRENT_LIST_DIR}/..")
endif()

if(NOT TARGET @PROJECT_NAME@)
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
Expand Down
32 changes: 0 additions & 32 deletions Sofa/Component/LinearSolver/Direct/extlibs/csparse/CMakeLists.txt

This file was deleted.

This file was deleted.

This file was deleted.

118 changes: 0 additions & 118 deletions Sofa/Component/LinearSolver/Direct/extlibs/csparse/UFconfig.h

This file was deleted.

Loading

0 comments on commit 5a3f36c

Please sign in to comment.