Skip to content

Commit

Permalink
cmake: unify indent using 4 spaces for all our cmake files
Browse files Browse the repository at this point in the history
Unify the indent used to 4 spaces (just my personal preference)

Also update the repo url from google code to github.
  • Loading branch information
NeroBurner committed Jan 23, 2024
1 parent 0eaf43f commit 4fe07a2
Show file tree
Hide file tree
Showing 7 changed files with 377 additions and 349 deletions.
528 changes: 277 additions & 251 deletions CMakeLists.txt

Large diffs are not rendered by default.

26 changes: 15 additions & 11 deletions SuiteSparse/CHOLMOD/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,23 @@ include_directories("${CCOLAMD_SOURCE_DIR}/Include")
# Headers:
file(GLOB LIBHDRS "${CHOLMOD_SOURCE_DIR}/Include/*.h")

file ( GLOB CHOLMOD_SOURCES
file(GLOB CHOLMOD_SOURCES
"Check/cholmod_*.c"
"Cholesky/cholmod_*.c"
"Utility/cholmod_*.c"
"MatrixOps/cholmod_*.c"
"Modify/cholmod_*.c"
"Partition/cholmod_*.c"
"Supernodal/cholmod_*.c" )
"Supernodal/cholmod_*.c"
)

include(CheckTypeSize)
check_type_size("ssize_t" SSIZE_T)

include ( CheckTypeSize )
check_type_size ( "ssize_t" SSIZE_T )
if ( NOT HAVE_SSIZE_T )
if(NOT HAVE_SSIZE_T)
# #include <sys/types.h> and ssize_t not defined (typically on Windows)
add_compile_definitions ( NO_SSIZE_T )
endif ( )
add_compile_definitions(NO_SSIZE_T)
endif()

# METIS and the Partition module:
if(BUILD_METIS)
Expand All @@ -35,22 +37,24 @@ if(BUILD_METIS)
include_directories("${CMAKE_CURRENT_BINARY_DIR}") # include for modified metis.h
include_directories("${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_metis/include")

#includes to make metis-wrapper work
# includes to make metis-wrapper work
include_directories("${CHOLMOD_SOURCE_DIR}")
include_directories("${CHOLMOD_SOURCE_DIR}/SuiteSparse_metis/GKlib")

# add metis-wrapper to compiled files
set(LIBHDRS ${LIBHDRS} "${CHOLMOD_SOURCE_DIR}/Partition/cholmod_metis_wrapper.h")
file ( GLOB CHOLMOD_SOURCES_PARTITION "Partition/cholmod_*.c")
file(GLOB CHOLMOD_SOURCES_PARTITION "Partition/cholmod_*.c")
list(APPEND CHOLMOD_SOURCES ${CHOLMOD_SOURCES_PARTITION})
else()
add_compile_definitions(NPARTITION)
endif()

include_directories("${CHOLMOD_SOURCE_DIR}/Include")
declare_suitesparse_library(cholmod "${CHOLMOD_SOURCES}" "${LIBHDRS}"
TARGET_PRIVATE_LINK ${SuiteSparse_LINKER_LAPACK_BLAS_LIBS}
TARGET_PUBLIC_LINK amd camd colamd ccolamd
TARGET_PUBLIC_LINK amd camd colamd ccolamd
)

if(WITH_CUDA)
target_link_libraries(cholmod ${CUDA_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES})
target_link_libraries(cholmod ${CUDA_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES})
endif(WITH_CUDA)
62 changes: 31 additions & 31 deletions SuiteSparse/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ project(SuiteSparse)

# Set optimized building:
if(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
# only optimize for native processer when NOT cross compiling
if(NOT CMAKE_CROSSCOMPILING)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=native")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mtune=native")
endif(NOT CMAKE_CROSSCOMPILING)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")

# only optimize for native processer when NOT cross compiling
if(NOT CMAKE_CROSSCOMPILING)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=native")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mtune=native")
endif(NOT CMAKE_CROSSCOMPILING)
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug")

# Global flags:
Expand All @@ -17,40 +18,39 @@ if(NOT BUILD_METIS)
endif()

# Used even for MSVC, so blas function names have the final "_"
if (MSVC)
add_definitions(-D__MINGW32__)
if(MSVC)
add_definitions(-D__MINGW32__)
endif(MSVC)


include_directories(".") # Needed for "SourceWrappers/*.c" files
include_directories(".") # Needed for "SourceWrappers/*.c" files

set(suitesparseconfig_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SuiteSparse_config) # Needed by all subprojects

if(WITH_CUDA)
set(SUBPROJECTS_TO_ADD
${SUBPROJECTS_TO_ADD}
SuiteSparse_GPURuntime
GPUQREngine
)
set(SUBPROJECTS_TO_ADD
${SUBPROJECTS_TO_ADD}
SuiteSparse_GPURuntime
GPUQREngine
)
endif()

set(SUBPROJECTS_TO_ADD
${SUBPROJECTS_TO_ADD}
SuiteSparse_config
AMD
BTF
CAMD
CCOLAMD
COLAMD
CHOLMOD
CXSparse
KLU
LDL
UMFPACK
SPQR
#CACHE STRING "list of all sub-directories to add to cmake build"
${SUBPROJECTS_TO_ADD}
SuiteSparse_config
AMD
BTF
CAMD
CCOLAMD
COLAMD
CHOLMOD
CXSparse
KLU
LDL
UMFPACK
SPQR
# CACHE STRING "list of all sub-directories to add to cmake build"
)

foreach(subdir ${SUBPROJECTS_TO_ADD})
add_subdirectory(${subdir})
add_subdirectory(${subdir})
endforeach()
2 changes: 1 addition & 1 deletion SuiteSparse/KLU/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ file(GLOB LIBHDRS "Include/*.h")
file(GLOB LIBSRCS "SourceWrappers/*.c")

declare_suitesparse_library(klu "${LIBSRCS}" "${LIBHDRS}"
TARGET_PUBLIC_LINK amd colamd btf
TARGET_PUBLIC_LINK amd colamd btf
)
96 changes: 48 additions & 48 deletions SuiteSparse/SPQR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,58 @@ include_directories("${SPQR_SOURCE_DIR}/Include")
include_directories("${CHOLMOD_SOURCE_DIR}/Include")

file(GLOB LIBHDRS "Include/*.h*") # .h & .hpp
set(LIBSRCS
Source/spqr_1colamd.cpp
Source/spqr_1factor.cpp
Source/spqr_1fixed.cpp
Source/spqr_analyze.cpp
Source/spqr_append.cpp
Source/spqr_assemble.cpp
Source/spqr_cholmod_wrappers.cpp
Source/spqr_cpack.cpp
Source/spqr_csize.cpp
Source/spqr_cumsum.cpp
Source/spqr_debug.cpp
Source/spqr_factorize.cpp
Source/spqr_fcsize.cpp
Source/spqr_freefac.cpp
Source/spqr_freenum.cpp
Source/spqr_freesym.cpp
Source/spqr_front.cpp
Source/spqr_fsize.cpp
Source/spqr_happly.cpp
Source/spqr_happly_work.cpp
Source/spqr_hpinv.cpp
Source/spqr_kernel.cpp
Source/spqr_larftb.cpp
Source/spqr_maxcolnorm.cpp
Source/spqr_panel.cpp
Source/spqr_parallel.cpp
Source/spqr_rconvert.cpp
Source/spqr_rcount.cpp
Source/spqr_rhpack.cpp
Source/spqr_rmap.cpp
Source/spqr_rsolve.cpp
Source/spqr_shift.cpp
Source/spqr_stranspose1.cpp
Source/spqr_stranspose2.cpp
Source/spqr_tol.cpp
Source/spqr_trapezoidal.cpp
Source/spqr_type.cpp
Source/SuiteSparseQR_C.cpp
Source/SuiteSparseQR.cpp
Source/SuiteSparseQR_expert.cpp
Source/SuiteSparseQR_qmult.cpp
SPQRGPU/spqrgpu_buildAssemblyMaps.cpp
SPQRGPU/spqrgpu_computeFrontStaging.cpp
SPQRGPU/spqrgpu_kernel.cpp
set(LIBSRCS
Source/spqr_1colamd.cpp
Source/spqr_1factor.cpp
Source/spqr_1fixed.cpp
Source/spqr_analyze.cpp
Source/spqr_append.cpp
Source/spqr_assemble.cpp
Source/spqr_cholmod_wrappers.cpp
Source/spqr_cpack.cpp
Source/spqr_csize.cpp
Source/spqr_cumsum.cpp
Source/spqr_debug.cpp
Source/spqr_factorize.cpp
Source/spqr_fcsize.cpp
Source/spqr_freefac.cpp
Source/spqr_freenum.cpp
Source/spqr_freesym.cpp
Source/spqr_front.cpp
Source/spqr_fsize.cpp
Source/spqr_happly.cpp
Source/spqr_happly_work.cpp
Source/spqr_hpinv.cpp
Source/spqr_kernel.cpp
Source/spqr_larftb.cpp
Source/spqr_maxcolnorm.cpp
Source/spqr_panel.cpp
Source/spqr_parallel.cpp
Source/spqr_rconvert.cpp
Source/spqr_rcount.cpp
Source/spqr_rhpack.cpp
Source/spqr_rmap.cpp
Source/spqr_rsolve.cpp
Source/spqr_shift.cpp
Source/spqr_stranspose1.cpp
Source/spqr_stranspose2.cpp
Source/spqr_tol.cpp
Source/spqr_trapezoidal.cpp
Source/spqr_type.cpp
Source/SuiteSparseQR_C.cpp
Source/SuiteSparseQR.cpp
Source/SuiteSparseQR_expert.cpp
Source/SuiteSparseQR_qmult.cpp
SPQRGPU/spqrgpu_buildAssemblyMaps.cpp
SPQRGPU/spqrgpu_computeFrontStaging.cpp
SPQRGPU/spqrgpu_kernel.cpp
)

declare_suitesparse_library(spqr "${LIBSRCS}" "${LIBHDRS}"
TARGET_PRIVATE_LINK ${SuiteSparse_LINKER_LAPACK_BLAS_LIBS}
TARGET_PUBLIC_LINK camd ccolamd cholmod
TARGET_PRIVATE_LINK ${SuiteSparse_LINKER_LAPACK_BLAS_LIBS}
TARGET_PUBLIC_LINK camd ccolamd cholmod
)

if(WITH_CUDA)
target_link_libraries(spqr GPUQREngine ${CUDA_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES})
target_link_libraries(spqr GPUQREngine ${CUDA_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES})
endif(WITH_CUDA)
7 changes: 3 additions & 4 deletions SuiteSparse/SuiteSparse_config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ project(suitesparseconfig)
include_directories("${suitesparseconfig_SOURCE_DIR}")

add_library(suitesparseconfig STATIC
SuiteSparse_config.c
SuiteSparse_config.h
)
SuiteSparse_config.c
SuiteSparse_config.h
)

target_compile_definitions(suitesparseconfig PUBLIC NTIMER)
install_suitesparse_project(suitesparseconfig "SuiteSparse_config.h")

5 changes: 2 additions & 3 deletions SuiteSparse/UMFPACK/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ file(GLOB LIBHDRS "${UMFPACK_SOURCE_DIR}/Include/*.h")
file(GLOB LIBSRCS "${UMFPACK_SOURCE_DIR}/SourceWrappers/*.c")

declare_suitesparse_library(umfpack "${LIBSRCS}" "${LIBHDRS}"
TARGET_PRIVATE_LINK ${SuiteSparse_LINKER_LAPACK_BLAS_LIBS}
TARGET_PUBLIC_LINK amd camd colamd ccolamd cholmod ${SuiteSparse_LINKER_PUBLIC_LIBS}
TARGET_PRIVATE_LINK ${SuiteSparse_LINKER_LAPACK_BLAS_LIBS}
TARGET_PUBLIC_LINK amd camd colamd ccolamd cholmod ${SuiteSparse_LINKER_PUBLIC_LIBS}
)

0 comments on commit 4fe07a2

Please sign in to comment.