Skip to content

Commit

Permalink
Merge branch 'develop' into feature_1269_split_exprs
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl authored Feb 26, 2024
2 parents f41894e + e679e51 commit e797560
Show file tree
Hide file tree
Showing 75 changed files with 7,690 additions and 2,750 deletions.
4 changes: 4 additions & 0 deletions ThirdParty/SuiteSparse/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ CSparse/Tcov/cov.sort
CSparse/Tcov/cover.out
CSparse/Tcov/covs.out
CSparse/Tcov/cs_*.c
CSparse/Tcov/csparse_version.c
CSparse/Tcov/cstcov_test
CSparse/Tcov/*.out
CSparse/Tcov/cs_demo1
Expand All @@ -138,6 +139,7 @@ CXSparse/Tcov/cov.sort
CXSparse/Tcov/cover.out
CXSparse/Tcov/covs.out
CXSparse/Tcov/cs_*.c
CXSparse/Tcov/cxsparse_version.c
CXSparse/Tcov/*.out
CXSparse/Tcov/cs_demo1_ci
CXSparse/Tcov/cs_demo1_cl
Expand Down Expand Up @@ -168,7 +170,9 @@ SPQR/Tcov/gpu_results.txt
SPQR/Tcov/gpuqrengine_demo
SPQR/Tcov/qrdemo_gpu
SPQR/Tcov/qrtest
SPQR/Tcov/qrtest32
SPQR/Tcov/qrtest_out.txt
SPQR/Tcov/qrtest_out32.txt
SPQR/Tcov/troll.m
SPQR/Tcov/cov.out

Expand Down
257 changes: 185 additions & 72 deletions ThirdParty/SuiteSparse/AMD/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,59 @@
# SuiteSparse/AMD/CMakeLists.txt: cmake for AMD
#-------------------------------------------------------------------------------

# Copyright (c) 1996-2022, Timothy A. Davis, Patrick Amestoy, Iain Duff.
# Copyright (c) 1996-2023, Timothy A. Davis, Patrick Amestoy, Iain Duff.
# All Rights Reserved.
# SPDX-License-Identifier: BSD-3-clause

#-------------------------------------------------------------------------------
# get the version
#-------------------------------------------------------------------------------

cmake_minimum_required ( VERSION 3.19 )
cmake_minimum_required ( VERSION 3.22 )

set ( AMD_DATE "Jan 17, 2023" )
set ( AMD_VERSION_MAJOR 3 )
set ( AMD_VERSION_MINOR 0 )
set ( AMD_VERSION_SUB 3 )
set ( AMD_DATE "Jan 10, 2024" )
set ( AMD_VERSION_MAJOR 3 CACHE STRING "" FORCE )
set ( AMD_VERSION_MINOR 3 CACHE STRING "" FORCE )
set ( AMD_VERSION_SUB 1 CACHE STRING "" FORCE )

message ( STATUS "Building AMD version: v"
${AMD_VERSION_MAJOR}.
${AMD_VERSION_MINOR}.
${AMD_VERSION_SUB} " (" ${AMD_DATE} ")" )

#-------------------------------------------------------------------------------
# SuiteSparse policies
# define the project
#-------------------------------------------------------------------------------

set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${CMAKE_SOURCE_DIR}/cmake_modules
${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules )

include ( SuiteSparsePolicy )
project ( AMD
VERSION "${AMD_VERSION_MAJOR}.${AMD_VERSION_MINOR}.${AMD_VERSION_SUB}"
LANGUAGES C )

#-------------------------------------------------------------------------------
# define the project
# SuiteSparse policies
#-------------------------------------------------------------------------------

if ( WIN32 )
# disable Fortran in AMD when compiling on Windows
set ( NFORTRAN true )
endif ( )
set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${PROJECT_SOURCE_DIR}/../SuiteSparse_config/cmake_modules )

include ( SuiteSparsePolicy )

if ( NOT NFORTRAN )
if ( SUITESPARSE_HAS_FORTRAN )
# Fortan is available and enabled
project ( amd
VERSION "${AMD_VERSION_MAJOR}.${AMD_VERSION_MINOR}.${AMD_VERSION_SUB}"
LANGUAGES C Fortran )
else ( )
# no Fortran compiler available; do not compile Source/*.f or Demo/*.f
project ( amd
VERSION "${AMD_VERSION_MAJOR}.${AMD_VERSION_MINOR}.${AMD_VERSION_SUB}"
LANGUAGES C )
enable_language ( Fortran )
endif ( )

#-------------------------------------------------------------------------------
# find library dependencies
#-------------------------------------------------------------------------------

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

#-------------------------------------------------------------------------------
# configure files
Expand All @@ -72,85 +69,191 @@ configure_file ( "Config/amd_version.tex.in" "${PROJECT_SOURCE_DIR}/Doc/amd_vers
# include directories
#-------------------------------------------------------------------------------

include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} )
include_directories ( Source Include )

#-------------------------------------------------------------------------------
# dynamic amd library properties
#-------------------------------------------------------------------------------

if ( NOT NFORTRAN )
if ( SUITESPARSE_HAS_FORTRAN )
file ( GLOB AMD_SOURCES "Source/*.c" "Source/*.f" )
else ( )
file ( GLOB AMD_SOURCES "Source/*.c" )
endif ( )

add_library ( amd SHARED ${AMD_SOURCES} )
set_target_properties ( amd PROPERTIES
VERSION ${AMD_VERSION_MAJOR}.${AMD_VERSION_MINOR}.${AMD_VERSION_SUB}
C_STANDARD_REQUIRED 11
SOVERSION ${AMD_VERSION_MAJOR}
PUBLIC_HEADER "Include/amd.h"
WINDOWS_EXPORT_ALL_SYMBOLS ON )
if ( BUILD_SHARED_LIBS )
add_library ( AMD SHARED ${AMD_SOURCES} )
set_target_properties ( AMD PROPERTIES
VERSION ${AMD_VERSION_MAJOR}.${AMD_VERSION_MINOR}.${AMD_VERSION_SUB}
C_STANDARD 11
C_STANDARD_REQUIRED ON
OUTPUT_NAME amd
SOVERSION ${AMD_VERSION_MAJOR}
PUBLIC_HEADER "Include/amd.h"
WINDOWS_EXPORT_ALL_SYMBOLS ON )

if ( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.25" )
set_target_properties ( AMD PROPERTIES EXPORT_NO_SYSTEM ON )
endif ( )

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

#-------------------------------------------------------------------------------
# static amd library properties
#-------------------------------------------------------------------------------

if ( NOT NSTATIC )
add_library ( amd_static STATIC ${AMD_SOURCES} )
set_target_properties ( amd_static PROPERTIES
VERSION ${AMD_VERSION_MAJOR}.${AMD_VERSION_MINOR}.${AMD_VERSION_SUB}
C_STANDARD_REQUIRED 11
if ( BUILD_STATIC_LIBS )
add_library ( AMD_static STATIC ${AMD_SOURCES} )
set_target_properties ( AMD_static PROPERTIES
C_STANDARD 11
C_STANDARD_REQUIRED ON
OUTPUT_NAME amd
SOVERSION ${AMD_VERSION_MAJOR} )
PUBLIC_HEADER "Include/amd.h" )

if ( MSVC )
set_target_properties ( amd_static PROPERTIES
set_target_properties ( AMD_static PROPERTIES
OUTPUT_NAME amd_static )
endif ( )

if ( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.25" )
set_target_properties ( AMD_static PROPERTIES EXPORT_NO_SYSTEM ON )
endif ( )

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

endif ( )

#-------------------------------------------------------------------------------
# add the library dependencies
#-------------------------------------------------------------------------------

# suitesparseconfig:
target_link_libraries ( amd PUBLIC ${SUITESPARSE_CONFIG_LIBRARIES} )
if ( NOT NSTATIC )
target_link_libraries ( amd_static PUBLIC ${SUITESPARSE_CONFIG_STATIC} )
# SuiteSparseConfig:
if ( BUILD_SHARED_LIBS )
target_link_libraries ( AMD PRIVATE SuiteSparse::SuiteSparseConfig )
target_include_directories ( AMD PUBLIC
"$<TARGET_PROPERTY:SuiteSparse::SuiteSparseConfig,INTERFACE_INCLUDE_DIRECTORIES>" )
endif ( )
if ( BUILD_STATIC_LIBS )
if ( TARGET SuiteSparse::SuiteSparseConfig_static )
target_link_libraries ( AMD_static PUBLIC SuiteSparse::SuiteSparseConfig_static )
else ( )
target_link_libraries ( AMD_static PUBLIC SuiteSparse::SuiteSparseConfig )
endif ( )
endif ( )

# libm:
if ( NOT WIN32 )
target_link_libraries ( amd PUBLIC m )
if ( NOT NSTATIC )
target_link_libraries ( amd_static PUBLIC m )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( AMD PRIVATE m )
endif ( )
if ( BUILD_STATIC_LIBS )
set ( AMD_STATIC_LIBS "${AMD_STATIC_LIBS} -lm" )
target_link_libraries ( AMD_static PUBLIC m )
endif ( )
endif ( )

#-------------------------------------------------------------------------------
# AMD installation location
#-------------------------------------------------------------------------------

install ( TARGETS amd
LIBRARY DESTINATION ${SUITESPARSE_LIBDIR}
ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR}
RUNTIME DESTINATION ${SUITESPARSE_BINDIR}
PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} )
install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindAMD.cmake
DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse
COMPONENT Development )
if ( NOT NSTATIC )
install ( TARGETS amd_static
ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} )
include ( CMakePackageConfigHelpers )

if ( BUILD_SHARED_LIBS )
install ( TARGETS AMD
EXPORT AMDTargets
LIBRARY DESTINATION ${SUITESPARSE_LIBDIR}
ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR}
RUNTIME DESTINATION ${SUITESPARSE_BINDIR}
PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} )
endif ( )
if ( BUILD_STATIC_LIBS )
install ( TARGETS AMD_static
EXPORT AMDTargets
ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR}
PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} )
endif ( )

# create (temporary) export target file during build
export ( EXPORT AMDTargets
NAMESPACE SuiteSparse::
FILE ${CMAKE_CURRENT_BINARY_DIR}/AMDTargets.cmake )

# install export target, config and version files for find_package
install ( EXPORT AMDTargets
NAMESPACE SuiteSparse::
DESTINATION ${SUITESPARSE_PKGFILEDIR}/cmake/AMD )

# generate config file to be used in common build tree
set ( SUITESPARSE_IN_BUILD_TREE ON )
configure_package_config_file (
Config/AMDConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/AMDConfig.cmake
INSTALL_DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/AMDConfig.cmake )

# generate config file to be installed
set ( SUITESPARSE_IN_BUILD_TREE OFF )
configure_package_config_file (
Config/AMDConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/target/AMDConfig.cmake
INSTALL_DESTINATION ${SUITESPARSE_PKGFILEDIR}/cmake/AMD )

write_basic_package_version_file (
${CMAKE_CURRENT_BINARY_DIR}/AMDConfigVersion.cmake
COMPATIBILITY SameMajorVersion )

install ( FILES
${CMAKE_CURRENT_BINARY_DIR}/target/AMDConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/AMDConfigVersion.cmake
DESTINATION ${SUITESPARSE_PKGFILEDIR}/cmake/AMD )

#-------------------------------------------------------------------------------
# create pkg-config file
#-------------------------------------------------------------------------------

if ( NOT MSVC )
set ( prefix "${CMAKE_INSTALL_PREFIX}" )
set ( exec_prefix "\${prefix}" )
cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE )
if (SUITESPARSE_LIBDIR_IS_ABSOLUTE)
set ( libdir "${SUITESPARSE_LIBDIR}")
else ( )
set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}")
endif ( )
cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE )
if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE)
set ( includedir "${SUITESPARSE_INCLUDEDIR}")
else ( )
set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}")
endif ( )
if ( BUILD_SHARED_LIBS )
set ( SUITESPARSE_LIB_BASE_NAME $<TARGET_FILE_BASE_NAME:AMD> )
else ( )
set ( SUITESPARSE_LIB_BASE_NAME $<TARGET_FILE_BASE_NAME:AMD_static> )
endif ( )
configure_file (
Config/AMD.pc.in
AMD.pc.out
@ONLY
NEWLINE_STYLE LF )
file ( GENERATE
OUTPUT AMD.pc
INPUT ${CMAKE_CURRENT_BINARY_DIR}/AMD.pc.out
NEWLINE_STYLE LF )
install ( FILES
${CMAKE_CURRENT_BINARY_DIR}/AMD.pc
DESTINATION ${SUITESPARSE_PKGFILEDIR}/pkgconfig )
endif ( )

#-------------------------------------------------------------------------------
# Demo library and programs
#-------------------------------------------------------------------------------

option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off )
if ( DEMO )
if ( SUITESPARSE_DEMOS )

#---------------------------------------------------------------------------
# demo library
Expand All @@ -166,19 +269,30 @@ if ( DEMO )
add_executable ( amd_l_demo "Demo/amd_l_demo.c" )
add_executable ( amd_demo2 "Demo/amd_demo2.c" )
add_executable ( amd_simple "Demo/amd_simple.c" )
if ( NOT NFORTRAN )
if ( SUITESPARSE_HAS_FORTRAN )
add_executable ( amd_f77demo "Demo/amd_f77demo.f" )
add_executable ( amd_f77simple "Demo/amd_f77simple.f" )
endif ( )

# Libraries required for Demo programs
target_link_libraries ( amd_demo PUBLIC amd )
target_link_libraries ( amd_l_demo PUBLIC amd )
target_link_libraries ( amd_demo2 PUBLIC amd )
target_link_libraries ( amd_simple PUBLIC amd )
if ( NOT NFORTRAN )
target_link_libraries ( amd_f77demo PUBLIC amd )
target_link_libraries ( amd_f77simple PUBLIC amd )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( amd_demo PUBLIC AMD )
target_link_libraries ( amd_l_demo PUBLIC AMD )
target_link_libraries ( amd_demo2 PUBLIC AMD )
target_link_libraries ( amd_simple PUBLIC AMD )
if ( SUITESPARSE_HAS_FORTRAN )
target_link_libraries ( amd_f77demo PUBLIC AMD )
target_link_libraries ( amd_f77simple PUBLIC AMD )
endif ( )
else ( )
target_link_libraries ( amd_demo PUBLIC AMD_static )
target_link_libraries ( amd_l_demo PUBLIC AMD_static )
target_link_libraries ( amd_demo2 PUBLIC AMD_static )
target_link_libraries ( amd_simple PUBLIC AMD_static )
if ( SUITESPARSE_HAS_FORTRAN )
target_link_libraries ( amd_f77demo PUBLIC AMD_static )
target_link_libraries ( amd_f77simple PUBLIC AMD_static )
endif ( )
endif ( )

else ( )
Expand All @@ -192,4 +306,3 @@ endif ( )
#-------------------------------------------------------------------------------

include ( SuiteSparseReport )

Loading

0 comments on commit e797560

Please sign in to comment.