Skip to content

Commit

Permalink
sync with dev2
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed Nov 28, 2023
1 parent bc78384 commit 8af5657
Show file tree
Hide file tree
Showing 126 changed files with 831 additions and 11,163 deletions.
161 changes: 92 additions & 69 deletions AMD/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,54 +12,48 @@

cmake_minimum_required ( VERSION 3.20 )

set ( AMD_DATE "Nov 30, 2023" )
set ( AMD_VERSION_MAJOR 3 )
set ( AMD_VERSION_MINOR 2 )
set ( AMD_VERSION_SUB 2 )
set ( AMD_DATE "Dec 30, 2023" )
set ( AMD_VERSION_MAJOR 3 CACHE STRING "" FORCE )
set ( AMD_VERSION_MINOR 3 CACHE STRING "" FORCE )
set ( AMD_VERSION_SUB 0 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}/../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 )
# 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.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 )
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 ( )
endif ( )

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -87,32 +81,33 @@ 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 11
C_STANDARD_REQUIRED ON
OUTPUT_NAME amd
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 )

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

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

if ( NOT NSTATIC )
if ( BUILD_STATIC_LIBS )
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 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
Expand All @@ -130,10 +125,12 @@ endif ( )
#-------------------------------------------------------------------------------

# SuiteSparseConfig:
target_link_libraries ( AMD PRIVATE SuiteSparse::SuiteSparseConfig )
target_include_directories ( AMD PUBLIC
"$<TARGET_PROPERTY:SuiteSparse::SuiteSparseConfig,INTERFACE_INCLUDE_DIRECTORIES>" )
if ( NOT NSTATIC )
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 ( )
Expand All @@ -143,8 +140,10 @@ endif ( )

# libm:
if ( NOT WIN32 )
target_link_libraries ( AMD PRIVATE m )
if ( NOT NSTATIC )
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 ( )
Expand All @@ -156,16 +155,19 @@ endif ( )

include ( CMakePackageConfigHelpers )

install ( TARGETS AMD
EXPORT AMDTargets
LIBRARY DESTINATION ${SUITESPARSE_LIBDIR}
ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR}
RUNTIME DESTINATION ${SUITESPARSE_BINDIR}
PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} )
if ( NOT NSTATIC )
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} )
ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR}
PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} )
endif ( )

# create (temporary) export target file during build
Expand All @@ -176,21 +178,30 @@ export ( EXPORT AMDTargets
# install export target, config and version files for find_package
install ( EXPORT AMDTargets
NAMESPACE SuiteSparse::
DESTINATION ${SUITESPARSE_LIBDIR}/cmake/AMD )
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 ${SUITESPARSE_LIBDIR}/cmake/AMD )
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}/AMDConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/target/AMDConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/AMDConfigVersion.cmake
DESTINATION ${SUITESPARSE_LIBDIR}/cmake/AMD )
DESTINATION ${SUITESPARSE_PKGFILEDIR}/cmake/AMD )

#-------------------------------------------------------------------------------
# create pkg-config file
Expand Down Expand Up @@ -218,7 +229,7 @@ if ( NOT MSVC )
NEWLINE_STYLE LF )
install ( FILES
${CMAKE_CURRENT_BINARY_DIR}/AMD.pc
DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig )
DESTINATION ${SUITESPARSE_PKGFILEDIR}/pkgconfig )
endif ( )

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -248,13 +259,24 @@ if ( DEMO )
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 ( NOT NFORTRAN )
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 ( NOT NFORTRAN )
target_link_libraries ( amd_f77demo PUBLIC AMD_static )
target_link_libraries ( amd_f77simple PUBLIC AMD_static )
endif ( )
endif ( )

else ( )
Expand All @@ -267,5 +289,6 @@ endif ( )
# report status
#-------------------------------------------------------------------------------

include ( SuiteSparseReport )

if ( NOT SUITESPARSE_ROOT_CMAKELISTS )
include ( SuiteSparseReport )
endif ( )
6 changes: 3 additions & 3 deletions AMD/Demo/amd_demo.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AMD version 3.2.2, date: Nov 30, 2023
AMD version 3.3.0, date: Dec 30, 2023
AMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24:

AMD version 3.2.2, Nov 30, 2023: approximate minimum degree ordering
AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering
dense row parameter: 10
(rows with more than max (10 * sqrt (n), 16) entries are
considered "dense", and placed last in output permutation)
Expand Down Expand Up @@ -115,7 +115,7 @@ Plot of input matrix pattern:
23: . . . . . . X . . . . X X . . . . . . . . . . X
return value from amd_order: 0 (should be 0)

AMD version 3.2.2, Nov 30, 2023, results:
AMD version 3.3.0, Dec 30, 2023, results:
status: OK
n, dimension of A: 24
nz, number of nonzeros in A: 160
Expand Down
4 changes: 2 additions & 2 deletions AMD/Demo/amd_demo2.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AMD demo, with a jumbled version of the 24-by-24
Harwell/Boeing matrix, can_24:

AMD version 3.2.2, Nov 30, 2023: approximate minimum degree ordering
AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering
dense row parameter: 10
(rows with more than max (10 * sqrt (n), 16) entries are
considered "dense", and placed last in output permutation)
Expand Down Expand Up @@ -144,7 +144,7 @@ Plot of symmetric matrix to be ordered by amd_order:
23: . . . . . . X . . . . X X . . . . . . . . . . X
return value from amd_order: 1 (should be 1)

AMD version 3.2.2, Nov 30, 2023, results:
AMD version 3.3.0, Dec 30, 2023, results:
status: OK, but jumbled
n, dimension of A: 24
nz, number of nonzeros in A: 102
Expand Down
6 changes: 3 additions & 3 deletions AMD/Demo/amd_l_demo.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AMD version 3.2.2, date: Nov 30, 2023
AMD version 3.3.0, date: Dec 30, 2023
AMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24:

AMD version 3.2.2, Nov 30, 2023: approximate minimum degree ordering
AMD version 3.3.0, Dec 30, 2023: approximate minimum degree ordering
dense row parameter: 10
(rows with more than max (10 * sqrt (n), 16) entries are
considered "dense", and placed last in output permutation)
Expand Down Expand Up @@ -115,7 +115,7 @@ Plot of input matrix pattern:
23: . . . . . . X . . . . X X . . . . . . . . . . X
return value from amd_l_order: 0 (should be 0)

AMD version 3.2.2, Nov 30, 2023, results:
AMD version 3.3.0, Dec 30, 2023, results:
status: OK
n, dimension of A: 24
nz, number of nonzeros in A: 160
Expand Down
Binary file modified AMD/Doc/AMD_UserGuide.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion AMD/Doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Nov 30, 2023: version 3.2.2
Dec 30, 2023: version 3.3.0

* major change to build system: by Markus Mützel
* revised test for integer overflow: for CHOLMOD 5.1.0 tests

Sept 18, 2023: version 3.2.1
Expand Down
2 changes: 1 addition & 1 deletion AMD/Doc/amd_version.tex
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
% version of SuiteSparse/AMD
\date{VERSION 3.2.2, Nov 30, 2023}
\date{VERSION 3.3.0, Dec 30, 2023}
6 changes: 3 additions & 3 deletions AMD/Include/amd.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,10 @@ void amd_l_info (double Info [ ]) ;
* Versions 1.1 and earlier of AMD do not include a #define'd version number.
*/

#define AMD_DATE "Nov 30, 2023"
#define AMD_DATE "Dec 30, 2023"
#define AMD_MAIN_VERSION 3
#define AMD_SUB_VERSION 2
#define AMD_SUBSUB_VERSION 2
#define AMD_SUB_VERSION 3
#define AMD_SUBSUB_VERSION 0

#define AMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub))
#define AMD_VERSION AMD_VERSION_CODE(AMD_MAIN_VERSION,AMD_SUB_VERSION)
Expand Down
Loading

0 comments on commit 8af5657

Please sign in to comment.