Skip to content

Commit

Permalink
lots of diagnostics in UMFPACK/CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed Dec 2, 2023
1 parent 2924933 commit 4228c25
Showing 1 changed file with 99 additions and 0 deletions.
99 changes: 99 additions & 0 deletions UMFPACK/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ project ( umfpack
VERSION "${UMFPACK_VERSION_MAJOR}.${UMFPACK_VERSION_MINOR}.${UMFPACK_VERSION_SUB}"
LANGUAGES C )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "1: ${dirs}" )

#-------------------------------------------------------------------------------
# SuiteSparse policies
#-------------------------------------------------------------------------------
Expand All @@ -43,6 +46,9 @@ option ( DEMO "ON: Build the demo programs. OFF (default): do not build the dem

include ( SuiteSparsePolicy )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "2: ${dirs}" )

if ( SUITESPARSE_CUDA )
# UMFPACK with CHOLMOD (which can use CUDA)
enable_language ( CXX CUDA )
Expand All @@ -60,42 +66,63 @@ else ( )
find_package ( OpenMP )
endif ( )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "3: ${dirs}" )

if ( NOT SUITESPARSE_ROOT_CMAKELISTS )
find_package ( SuiteSparse_config 7.4.0
PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::SuiteSparseConfig )
find_package ( SuiteSparse_config 7.4.0 REQUIRED )
endif ( )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "4: ${dirs}" )

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

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "5: ${dirs}" )

if ( DEMO AND NOT WIN32 )
find_package ( COLAMD 3.3.0
PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::COLAMD )
find_package ( COLAMD 3.3.0 REQUIRED )
endif ( )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "6: ${dirs}" )

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

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "7: ${dirs}" )

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

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "8: ${dirs}" )
endif ( )
endif ( )

include ( SuiteSparseBLAS ) # requires cmake 3.22

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "9: ${dirs}" )

option ( NCHOLMOD "ON: do not use CHOLMOD. OFF (default): use CHOLMOD" OFF )

if ( NOT SUITESPARSE_ROOT_CMAKELISTS AND NOT NCHOLMOD )
Expand All @@ -106,6 +133,9 @@ if ( NOT SUITESPARSE_ROOT_CMAKELISTS AND NOT NCHOLMOD )
find_package ( CHOLMOD 5.1.0 )
endif ( )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "10: ${dirs}" )

if ( NOT CHOLMOD_FOUND )
# CHOLMOD not found so disable it
set ( NCHOLMOD true )
Expand All @@ -120,6 +150,9 @@ else ( )
message ( STATUS "Using CHOLMOD for addtional pre-ordering options" )
endif ( )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "11: ${dirs}" )

#-------------------------------------------------------------------------------
# configure files
#-------------------------------------------------------------------------------
Expand All @@ -135,17 +168,29 @@ configure_file ( "Config/umfpack_version.tex.in"
# include directories
#-------------------------------------------------------------------------------

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "12: ${dirs}" )

include_directories ( Source Include )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "13: ${dirs}" )

#-------------------------------------------------------------------------------
# dynamic umfpack library properties
#-------------------------------------------------------------------------------

file ( GLOB UMFPACK_SOURCES "Source2/*.c" )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "14: ${dirs}" )

if ( BUILD_SHARED_LIBS )
add_library ( UMFPACK SHARED ${UMFPACK_SOURCES} )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "15: ${dirs}" )

set_target_properties ( UMFPACK PROPERTIES
VERSION ${UMFPACK_VERSION_MAJOR}.${UMFPACK_VERSION_MINOR}.${UMFPACK_VERSION_SUB}
C_STANDARD 11
Expand All @@ -155,34 +200,52 @@ if ( BUILD_SHARED_LIBS )
PUBLIC_HEADER "Include/umfpack.h"
WINDOWS_EXPORT_ALL_SYMBOLS ON )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "16: ${dirs}" )

target_include_directories ( UMFPACK
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Include>
$<INSTALL_INTERFACE:${SUITESPARSE_INCLUDEDIR}> )
endif ( )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "17: ${dirs}" )

#-------------------------------------------------------------------------------
# static umfpack library properties
#-------------------------------------------------------------------------------

if ( BUILD_STATIC_LIBS )
add_library ( UMFPACK_static STATIC ${UMFPACK_SOURCES} )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "18: ${dirs}" )

set_target_properties ( UMFPACK_static PROPERTIES
C_STANDARD 11
C_STANDARD_REQUIRED ON
OUTPUT_NAME umfpack
PUBLIC_HEADER "Include/umfpack.h" )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "19: ${dirs}" )

if ( MSVC )
set_target_properties ( UMFPACK_static PROPERTIES
OUTPUT_NAME umfpack_static )
endif ( )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "20: ${dirs}" )

target_include_directories ( UMFPACK_static
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Include>
$<INSTALL_INTERFACE:${SUITESPARSE_INCLUDEDIR}> )
endif ( )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "21: ${dirs}" )

#-------------------------------------------------------------------------------
# add the library dependencies
#-------------------------------------------------------------------------------
Expand All @@ -201,6 +264,9 @@ if ( BUILD_STATIC_LIBS )
endif ( )
endif ( )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "22: ${dirs}" )

# AMD:
if ( BUILD_SHARED_LIBS )
target_link_libraries ( UMFPACK PRIVATE SuiteSparse::AMD )
Expand All @@ -215,6 +281,9 @@ if ( BUILD_STATIC_LIBS )
endif ( )
endif ( )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "23: ${dirs}" )

# CHOLMOD:
if ( NOT NCHOLMOD )
# link with CHOLMOD and its dependencies, both required and optional
Expand All @@ -231,6 +300,9 @@ if ( NOT NCHOLMOD )
endif ( )
endif ( )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "24: ${dirs}" )

# OpenMP:
if ( OPENMP_FOUND )
message ( STATUS "OpenMP C libraries: ${OpenMP_C_LIBRARIES}" )
Expand All @@ -247,6 +319,9 @@ if ( OPENMP_FOUND )
include_directories ( ${OpenMP_C_INCLUDE_DIRS} )
endif ( )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "25: ${dirs}" )

# libm:
if ( NOT WIN32 )
if ( BUILD_SHARED_LIBS )
Expand All @@ -258,6 +333,9 @@ if ( NOT WIN32 )
endif ( )
endif ( )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "26: ${dirs}" )

# BLAS:
message ( STATUS "BLAS libraries: ${BLAS_LIBRARIES}" )
message ( STATUS "BLAS include: ${BLAS_INCLUDE_DIRS}" )
Expand All @@ -271,12 +349,21 @@ if ( BUILD_STATIC_LIBS )
endif ( )
include_directories ( ${BLAS_INCLUDE_DIRS} )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "27: ${dirs}" )

#-------------------------------------------------------------------------------
# UMFPACK installation location
#-------------------------------------------------------------------------------

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "28: ${dirs}" )

include ( CMakePackageConfigHelpers )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "29: ${dirs}" )

if ( BUILD_SHARED_LIBS )
install ( TARGETS UMFPACK
EXPORT UMFPACKTargets
Expand Down Expand Up @@ -325,6 +412,9 @@ install ( FILES
${CMAKE_CURRENT_BINARY_DIR}/UMFPACKConfigVersion.cmake
DESTINATION ${SUITESPARSE_PKGFILEDIR}/cmake/UMFPACK )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "1: ${dirs}" )

#-------------------------------------------------------------------------------
# create pkg-config file
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -357,6 +447,9 @@ if ( NOT MSVC )
endforeach ( )
endforeach ( )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "1: ${dirs}" )

set ( prefix "${CMAKE_INSTALL_PREFIX}" )
set ( exec_prefix "\${prefix}" )
cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE )
Expand All @@ -381,6 +474,9 @@ if ( NOT MSVC )
DESTINATION ${SUITESPARSE_PKGFILEDIR}/pkgconfig )
endif ( )

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "1: ${dirs}" )

#-------------------------------------------------------------------------------
# Demo library and programs
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -465,6 +561,9 @@ endif ( )
# report status
#-------------------------------------------------------------------------------

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "1: ${dirs}" )

if ( NOT SUITESPARSE_ROOT_CMAKELISTS )
include ( SuiteSparseReport )
endif ( )

0 comments on commit 4228c25

Please sign in to comment.