Skip to content

Commit

Permalink
Merge pull request #385 from mmuetzel/spqr
Browse files Browse the repository at this point in the history
SPQR: Make GPUQREngine and SuiteSparse_GPURuntime subprojects
  • Loading branch information
DrTimothyAldenDavis authored Oct 19, 2023
2 parents 6b32579 + c31c551 commit da6dea4
Show file tree
Hide file tree
Showing 110 changed files with 98 additions and 620 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-arch-emu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency: ci-arch-emu-${{ github.ref }}

env:
# string with name of libraries to be built
BUILD_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:RBio:SuiteSparse_GPURuntime:GPUQREngine:SPQR:SPEX"
BUILD_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:RBio:SPQR:SPEX"
# string with name of libraries to be checked
CHECK_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:RBio:SPQR:SPEX"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency: ci-${{ github.ref }}

env:
# string with name of libraries to be built
BUILD_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:RBio:SuiteSparse_GPURuntime:GPUQREngine:SPQR:GraphBLAS:SPEX"
BUILD_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:RBio:SPQR:GraphBLAS:SPEX"
# string with name of libraries to be checked
CHECK_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:RBio:SPQR:GraphBLAS:SPEX"

Expand Down
32 changes: 0 additions & 32 deletions Example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ find_package ( SPEX 2.2.1 REQUIRED )
find_package ( SPQR 4.2.1 REQUIRED )
find_package ( UMFPACK 6.2.1 REQUIRED )

if ( TARGET CUDA::nvrtc )
# CHOLMOD and SPQR have been compiled with CUDA enabled.
find_package ( SuiteSparse_GPURuntime 3.2.1 REQUIRED )
find_package ( GPUQREngine 3.2.1 REQUIRED )
endif ( )

# look for all external libaries:
find_package ( OpenMP REQUIRED )

Expand Down Expand Up @@ -298,19 +292,6 @@ else ( )
target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CXSparse )
endif ( )

# GPUQREngine:
if ( ENABLE_CUDA )
target_link_libraries ( my PRIVATE SuiteSparse::GPUQREngine )
target_link_libraries ( my_cxx PRIVATE SuiteSparse::GPUQREngine )
if ( TARGET SuiteSparse::GPUQREngine_static )
target_link_libraries ( my_static PUBLIC SuiteSparse::GPUQREngine_static )
target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GPUQREngine_static )
else ( )
target_link_libraries ( my_static PUBLIC SuiteSparse::GPUQREngine )
target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GPUQREngine )
endif ( )
endif ( )

# GraphBLAS:
if ( TARGET SuiteSparse::GraphBLAS )
target_link_libraries ( my PRIVATE SuiteSparse::GraphBLAS )
Expand Down Expand Up @@ -417,19 +398,6 @@ else ( )
target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::SuiteSparseConfig )
endif ( )

# GPURuntime:
if ( ENABLE_CUDA )
target_link_libraries ( my PRIVATE SuiteSparse::GPURuntime )
target_link_libraries ( my_cxx PRIVATE SuiteSparse::GPURuntime )
if ( TARGET SuiteSparse::GPURuntime_static )
target_link_libraries ( my_static PUBLIC SuiteSparse::GPURuntime_static )
target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GPURuntime_static )
else ( )
target_link_libraries ( my_static PUBLIC SuiteSparse::GPURuntime )
target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GPURuntime )
endif ( )
endif ( )

# UMFPACK:
target_link_libraries ( my PRIVATE SuiteSparse::UMFPACK )
target_link_libraries ( my_cxx PRIVATE SuiteSparse::UMFPACK )
Expand Down
8 changes: 0 additions & 8 deletions GPUQREngine/Include/README.txt

This file was deleted.

77 changes: 0 additions & 77 deletions GPUQREngine/Makefile

This file was deleted.

4 changes: 0 additions & 4 deletions GPUQREngine/build/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ library:
( cd KLU && $(MAKE) )
( cd UMFPACK && $(MAKE) )
( cd RBio && $(MAKE) )
( cd SuiteSparse_GPURuntime && $(MAKE) )
( cd GPUQREngine && $(MAKE) )
( cd SPQR && $(MAKE) )
( cd GraphBLAS && $(MAKE) )
( cd SPEX && $(MAKE) )
Expand All @@ -58,8 +56,6 @@ local:
( cd KLU && $(MAKE) local )
( cd UMFPACK && $(MAKE) local )
( cd RBio && $(MAKE) local )
( cd SuiteSparse_GPURuntime && $(MAKE) local )
( cd GPUQREngine && $(MAKE) local )
( cd SPQR && $(MAKE) local )
( cd GraphBLAS && $(MAKE) local )
( cd SPEX && $(MAKE) local )
Expand All @@ -81,8 +77,6 @@ global:
( cd KLU && $(MAKE) global )
( cd UMFPACK && $(MAKE) global )
( cd RBio && $(MAKE) global )
( cd SuiteSparse_GPURuntime && $(MAKE) global )
( cd GPUQREngine && $(MAKE) global )
( cd SPQR && $(MAKE) global )
( cd GraphBLAS && $(MAKE) global )
( cd SPEX && $(MAKE) global )
Expand All @@ -102,8 +96,6 @@ install:
( cd KLU && $(MAKE) install )
( cd UMFPACK && $(MAKE) install )
( cd RBio && $(MAKE) install )
( cd SuiteSparse_GPURuntime && $(MAKE) install )
( cd GPUQREngine && $(MAKE) install )
( cd SPQR && $(MAKE) install )
( cd GraphBLAS && $(MAKE) install )
( cd SPEX && $(MAKE) install )
Expand All @@ -123,8 +115,6 @@ uninstall:
( cd CHOLMOD && $(MAKE) uninstall )
( cd CXSparse && $(MAKE) uninstall )
( cd RBio && $(MAKE) uninstall )
( cd SuiteSparse_GPURuntime && $(MAKE) uninstall )
( cd GPUQREngine && $(MAKE) uninstall )
( cd SPQR && $(MAKE) uninstall )
( cd GraphBLAS && $(MAKE) uninstall )
( cd SPEX && $(MAKE) uninstall )
Expand All @@ -148,8 +138,6 @@ purge:
- ( cd CSparse && $(MAKE) purge )
- ( cd CXSparse && $(MAKE) purge )
- ( cd RBio && $(MAKE) purge )
- ( cd SuiteSparse_GPURuntime && $(MAKE) purge )
- ( cd GPUQREngine && $(MAKE) purge )
- ( cd SPQR && $(MAKE) purge )
- $(RM) MATLAB_Tools/*/*.mex* MATLAB_Tools/*/*/*.mex*
- $(RM) MATLAB_Tools/*/*.o MATLAB_Tools/*/*/*.o
Expand Down Expand Up @@ -224,8 +212,6 @@ debug:
( cd KLU && $(MAKE) debug )
( cd UMFPACK && $(MAKE) debug )
( cd RBio && $(MAKE) debug )
( cd SuiteSparse_GPURuntime && $(MAKE) )
( cd GPUQREngine && $(MAKE) )
( cd SPQR && $(MAKE) debug )
( cd GraphBLAS && $(MAKE) cdebug )
( cd SPEX && $(MAKE) debug )
Expand Down
35 changes: 5 additions & 30 deletions SPQR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,6 @@ if ( NOT TARGET SuiteSparse::CHOLMOD )
endif ( )

if ( SUITESPARSE_CUDA )
find_package ( SuiteSparse_GPURuntime 3.2.0
PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_GPURuntime/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::GPURuntime )
find_package ( SuiteSparse_GPURuntime 3.2.0 REQUIRED )
endif ( )

find_package ( GPUQREngine 3.2.0
PATHS ${CMAKE_SOURCE_DIR}/../GPUQREngine/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::GPUQREngine )
find_package ( GPUQREngine 3.2.0 REQUIRED )
endif ( )

find_package ( CHOLMOD_CUDA 4.2.0
PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::CHOLMOD_CUDA )
Expand All @@ -91,6 +79,8 @@ include ( SuiteSparseLAPACK ) # requires cmake 3.22

if ( SUITESPARSE_CUDA )
# with CUDA
add_subdirectory ( GPURuntime )
add_subdirectory ( GPUQREngine )
add_subdirectory ( SPQRGPU )
endif ( )

Expand Down Expand Up @@ -226,13 +216,8 @@ endif ( )

if ( SUITESPARSE_CUDA )
# CUDA
target_link_libraries ( SPQR PRIVATE SuiteSparse::CHOLMOD_CUDA SPQR_CUDA )
# SPQR includes files from the following targets that are not installed by
# them. That looks strange and will only work before they are installed.
# Maybe, those two targets aren't actually standalone libraries but should
# be part of the SPQR project?
target_link_libraries ( SPQR PRIVATE
SuiteSparse::GPUQREngine SuiteSparse::GPURuntime )
SuiteSparse::CHOLMOD_CUDA SPQR_CUDA GPUQREngine GPURuntime )
target_compile_definitions ( SPQR PUBLIC "SUITESPARSE_CUDA" )
set ( SPQR_CFLAGS "-DSUITESPARSE_CUDA" )
if ( NOT NSTATIC )
Expand All @@ -241,19 +226,9 @@ if ( SUITESPARSE_CUDA )
else ( )
target_link_libraries ( SPQR_static PUBLIC SuiteSparse::CHOLMOD_CUDA )
endif ( )
target_link_libraries ( SPQR_static PUBLIC SPQR_CUDA_static )
target_link_libraries ( SPQR_static PUBLIC
SPQR_CUDA_static GPUQREngine_static GPURuntime_static )
target_compile_definitions ( SPQR_static PUBLIC "SUITESPARSE_CUDA" )

if ( TARGET SuiteSparse::GPUQREngine_static )
target_link_libraries ( SPQR_static PUBLIC SuiteSparse::GPUQREngine_static )
else ( )
target_link_libraries ( SPQR_static PUBLIC SuiteSparse::GPUQREngine )
endif ( )
if ( TARGET SuiteSparse::GPURuntime_static )
target_link_libraries ( SPQR_static PUBLIC SuiteSparse::GPURuntime_static )
else ( )
target_link_libraries ( SPQR_static PUBLIC SuiteSparse::GPURuntime )
endif ( )
endif ( )
endif ( )

Expand Down
36 changes: 32 additions & 4 deletions SPQR/Config/SPQRConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,48 @@ set ( _dependencies_found ON )
if ( @SUITESPARSE_CUDA@ )
# Look for imported targets of additional dependency if SPQR was built with CUDA

if ( NOT SPQR_CUDA_FOUND )
if ( @SUITESPARSE_IN_BUILD_TREE@ )
if ( @SUITESPARSE_IN_BUILD_TREE@ )
if ( NOT SuiteSparse_GPURuntime_FOUND )
# First check in a common build tree
find_dependency ( SuiteSparse_GPURuntime @SUITESPARSE_GPURUNTIME_VERSION_MAJOR@.@GPUQRENGINE_VERSION_MINOR@
PATHS ${CMAKE_SOURCE_DIR}/../SPQR/build/GPURuntime NO_DEFAULT_PATH )
# Then, check in the currently active CMAKE_MODULE_PATH
if ( NOT SuiteSparse_GPURuntime_FOUND )
find_dependency ( SuiteSparse_GPURuntime @SUITESPARSE_GPURUNTIME_VERSION_MAJOR@.@GPUQRENGINE_VERSION_MINOR@ )
endif ( )
endif ( )

if ( NOT GPUQREngine_FOUND )
# First check in a common build tree
find_dependency ( GPUQREngine @GPUQRENGINE_VERSION_MAJOR@.@GPUQRENGINE_VERSION_MINOR@
PATHS ${CMAKE_SOURCE_DIR}/../SPQR/build/GPUQREngine NO_DEFAULT_PATH )
# Then, check in the currently active CMAKE_MODULE_PATH
if ( NOT GPUQREngine_FOUND )
find_dependency ( GPUQREngine @GPUQRENGINE_VERSION_MAJOR@.@GPUQRENGINE_VERSION_MINOR@ )
endif ( )
endif ( )

if ( NOT SPQR_CUDA_FOUND )
# First check in a common build tree
find_dependency ( SPQR_CUDA ${SPQR_VERSION}
PATHS ${CMAKE_SOURCE_DIR}/../SPQR/build NO_DEFAULT_PATH )
# Then, check in the currently active CMAKE_MODULE_PATH
if ( NOT SPQR_CUDA_FOUND )
find_dependency ( SPQR_CUDA ${SPQR_VERSION} )
endif ( )
else ( )
endif ( )
else ( )
if ( NOT SuiteSparse_GPURuntime_FOUND )
find_dependency ( SuiteSparse_GPURuntime @SUITESPARSE_GPURUNTIME_VERSION_MAJOR@.@GPUQRENGINE_VERSION_MINOR@ )
endif ( )
if ( NOT GPUQREngine_FOUND )
find_dependency ( GPUQREngine @GPUQRENGINE_VERSION_MAJOR@.@GPUQRENGINE_VERSION_MINOR@ )
endif ( )
if ( NOT SPQR_CUDA_FOUND )
find_dependency ( SPQR_CUDA ${SPQR_VERSION} )
endif ( )
endif ( )
if ( NOT SPQR_CUDA_FOUND )
if ( NOT SuiteSparse_GPURuntime_FOUND OR NOT GPUQREngine_FOUND OR NOT SPQR_CUDA_FOUND )
set ( _dependencies_found OFF )
endif ( )
endif ( )
Expand Down
Loading

0 comments on commit da6dea4

Please sign in to comment.