diff --git a/Example/CMakeLists.txt b/Example/CMakeLists.txt index 2577ca9a9..8c14ae033 100644 --- a/Example/CMakeLists.txt +++ b/Example/CMakeLists.txt @@ -107,7 +107,7 @@ find_package ( KLU 2.3.0 REQUIRED ) find_package ( KLU_CHOLMOD 2.3.0 REQUIRED ) find_package ( LDL 3.3.0 REQUIRED ) find_package ( LAGraph 1.1.0 ) -find_package ( Mongoose 3.3.0 REQUIRED ) +find_package ( SuiteSparse_Mongoose 3.3.0 REQUIRED ) find_package ( ParU 0.1.0 REQUIRED ) find_package ( RBio 4.3.0 REQUIRED ) find_package ( SPEX 2.3.0 REQUIRED ) # requires GMP and MPFR diff --git a/Example/Source/my_cxx.cc b/Example/Source/my_cxx.cc index 2a2d8a469..26cddcb87 100644 --- a/Example/Source/my_cxx.cc +++ b/Example/Source/my_cxx.cc @@ -445,6 +445,19 @@ int my_function (void) umfpack_dl_report_status (Control, result) ; umfpack_dl_report_info (Control, Info) ; + //-------------------------------------------------------------------------- + // Mongoose + //-------------------------------------------------------------------------- + + version [0] = Mongoose::major_version ( ) ; + version [1] = Mongoose::minor_version ( ) ; + version [2] = Mongoose::patch_version ( ) ; + OK (my_check_version ("Mongoose", Mongoose_VERSION_MAJOR, + Mongoose_VERSION_MINOR, Mongoose_VERSION_PATCH, Mongoose_DATE, + version)) ; + std::cout << "Mongoose::mongoose_version(): " << + Mongoose::mongoose_version ( ) << std::endl; + //-------------------------------------------------------------------------- // free workspace //-------------------------------------------------------------------------- diff --git a/Mongoose/CMakeLists.txt b/Mongoose/CMakeLists.txt index f66f4ec93..4da5911c9 100644 --- a/Mongoose/CMakeLists.txt +++ b/Mongoose/CMakeLists.txt @@ -1,8 +1,8 @@ #------------------------------------------------------------------------------- -# Mongoose/CMakeLists.txt: instructions for building Mongoose with cmake +# SuiteSparse/Mongoose/CMakeLists.txt: building SuiteSparse_Mongoose with cmake #------------------------------------------------------------------------------- # -# Mongoose, Copyright (c) 2018-2023, All Rights Reserved. +# SuiteSparse_Mongoose, Copyright (c) 2018-2023, All Rights Reserved. # Nuri Yeralan, Microsoft Research # Scott Kolodziej, Texas A&M University # Tim Davis, Texas A&M University @@ -12,11 +12,11 @@ # # http://suitesparse.com See Mongoose/Doc/License.txt for license. # -# To compile the Mongoose library and demo programs just do "make" +# To compile the SuiteSparse_Mongoose library and demo programs just do "make" # in this directory. The Mongoose/Makefile will then run cmake # in the build directory. # -# To install Mongoose in /usr/local/lib and /usr/local/include, +# To install SuiteSparse_Mongoose in /usr/local/lib and /usr/local/include, # and also in ../lib, ../include, and ../bin: # # sudo make install @@ -202,12 +202,12 @@ if ( BUILD_STATIC_LIBS ) add_library ( Mongoose_static STATIC ${MONGOOSE_LIB_FILES} ) set_target_properties ( Mongoose_static PROPERTIES - OUTPUT_NAME mongoose + OUTPUT_NAME suitesparse_mongoose PUBLIC_HEADER "Include/Mongoose.hpp" ) if ( MSVC ) set_target_properties ( Mongoose_static PROPERTIES - OUTPUT_NAME mongoose_static ) + OUTPUT_NAME suitesparse_mongoose_static ) endif ( ) if ( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.25" ) @@ -230,7 +230,7 @@ if ( BUILD_SHARED_LIBS ) add_library ( Mongoose SHARED ${MONGOOSE_LIB_FILES} ) set_target_properties ( Mongoose PROPERTIES - OUTPUT_NAME mongoose + OUTPUT_NAME suitesparse_mongoose SOVERSION ${Mongoose_VERSION_MAJOR} PUBLIC_HEADER "Include/Mongoose.hpp" WINDOWS_EXPORT_ALL_SYMBOLS ON @@ -256,7 +256,7 @@ endif ( ) # Build the Mongoose debug/test library add_library ( Mongoose_static_dbg STATIC ${MONGOOSE_LIB_FILES} ) set_target_properties ( Mongoose_static_dbg PROPERTIES - OUTPUT_NAME mongoose_dbg ) + OUTPUT_NAME suitesparse_mongoose_dbg ) if ( TARGET SuiteSparse::SuiteSparseConfig_static ) target_link_libraries ( Mongoose_static_dbg SuiteSparse::SuiteSparseConfig_static ) @@ -267,7 +267,7 @@ endif ( ) # Build the Mongoose executable add_executable ( mongoose_exe ${EXE_FILES} ) set_target_properties ( mongoose_exe PROPERTIES - OUTPUT_NAME mongoose ) + OUTPUT_NAME suitesparse_mongoose ) if ( BUILD_STATIC_LIBS ) target_link_libraries ( mongoose_exe Mongoose_static ) else ( ) @@ -546,7 +546,7 @@ include ( CMakePackageConfigHelpers ) if ( BUILD_SHARED_LIBS ) install ( TARGETS Mongoose - EXPORT MongooseTargets + EXPORT SuiteSparse_MongooseTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} @@ -554,7 +554,7 @@ if ( BUILD_SHARED_LIBS ) endif ( ) if ( BUILD_STATIC_LIBS ) install ( TARGETS Mongoose_static - EXPORT MongooseTargets + EXPORT SuiteSparse_MongooseTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) endif ( ) @@ -562,37 +562,37 @@ install ( TARGETS mongoose_exe RUNTIME DESTINATION ${SUITESPARSE_BINDIR} ) # create (temporary) export target file during build -export ( EXPORT MongooseTargets +export ( EXPORT SuiteSparse_MongooseTargets NAMESPACE SuiteSparse:: - FILE ${CMAKE_CURRENT_BINARY_DIR}/MongooseTargets.cmake ) + FILE ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_MongooseTargets.cmake ) # install export target, config and version files for find_package -install ( EXPORT MongooseTargets +install ( EXPORT SuiteSparse_MongooseTargets NAMESPACE SuiteSparse:: - DESTINATION ${SUITESPARSE_PKGFILEDIR}/cmake/Mongoose ) + DESTINATION ${SUITESPARSE_PKGFILEDIR}/cmake/SuiteSparse_Mongoose ) # generate config file to be used in common build tree set ( SUITESPARSE_IN_BUILD_TREE ON ) configure_package_config_file ( - Config/MongooseConfig.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/MongooseConfig.cmake - INSTALL_DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/MongooseConfig.cmake ) + Config/SuiteSparse_MongooseConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_MongooseConfig.cmake + INSTALL_DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_MongooseConfig.cmake ) # generate config file to be installed set ( SUITESPARSE_IN_BUILD_TREE OFF ) configure_package_config_file ( - Config/MongooseConfig.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/target/MongooseConfig.cmake - INSTALL_DESTINATION ${SUITESPARSE_PKGFILEDIR}/cmake/Mongoose ) + Config/SuiteSparse_MongooseConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/target/SuiteSparse_MongooseConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_PKGFILEDIR}/cmake/SuiteSparse_Mongoose ) write_basic_package_version_file ( - ${CMAKE_CURRENT_BINARY_DIR}/MongooseConfigVersion.cmake + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_MongooseConfigVersion.cmake COMPATIBILITY SameMajorVersion ) install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/target/MongooseConfig.cmake - ${CMAKE_CURRENT_BINARY_DIR}/MongooseConfigVersion.cmake - DESTINATION ${SUITESPARSE_PKGFILEDIR}/cmake/Mongoose ) + ${CMAKE_CURRENT_BINARY_DIR}/target/SuiteSparse_MongooseConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_MongooseConfigVersion.cmake + DESTINATION ${SUITESPARSE_PKGFILEDIR}/cmake/SuiteSparse_Mongoose ) #------------------------------------------------------------------------------- # create pkg-config file @@ -619,16 +619,16 @@ if ( NOT MSVC ) set ( SUITESPARSE_LIB_BASE_NAME $ ) endif ( ) configure_file ( - Config/Mongoose.pc.in - Mongoose.pc.out + Config/SuiteSparse_Mongoose.pc.in + SuiteSparse_Mongoose.pc.out @ONLY NEWLINE_STYLE LF ) file ( GENERATE - OUTPUT Mongoose.pc - INPUT ${CMAKE_CURRENT_BINARY_DIR}/Mongoose.pc.out + OUTPUT SuiteSparse_Mongoose.pc + INPUT ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_Mongoose.pc.out NEWLINE_STYLE LF ) install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/Mongoose.pc + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_Mongoose.pc DESTINATION ${SUITESPARSE_PKGFILEDIR}/pkgconfig ) endif ( ) diff --git a/Mongoose/Config/Mongoose.pc.in b/Mongoose/Config/SuiteSparse_Mongoose.pc.in similarity index 72% rename from Mongoose/Config/Mongoose.pc.in rename to Mongoose/Config/SuiteSparse_Mongoose.pc.in index 44d9312d4..d806a09c2 100644 --- a/Mongoose/Config/Mongoose.pc.in +++ b/Mongoose/Config/SuiteSparse_Mongoose.pc.in @@ -1,4 +1,6 @@ -# Mongoose, Copyright (c) 2018-2023, Timothy A. Davis. +# SuiteSparse/Mongoose, Copyright (c) 2017-2023, +# Scott P. Kolodziej, Nuri S. Yeralan, Timothy A. Davis, William W. Hager +# Timothy A. Davis # All Rights Reserved. # SPDX-License-Identifier: GPL-3.0-only @@ -7,7 +9,7 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -Name: Mongoose +Name: SuiteSparse_Mongoose URL: https://github.com/DrTimothyAldenDavis/SuiteSparse Description: Graph partitioning library in SuiteSparse Version: @Mongoose_VERSION_MAJOR@.@Mongoose_VERSION_MINOR@.@Mongoose_VERSION_PATCH@ diff --git a/Mongoose/Config/MongooseConfig.cmake.in b/Mongoose/Config/SuiteSparse_MongooseConfig.cmake.in similarity index 79% rename from Mongoose/Config/MongooseConfig.cmake.in rename to Mongoose/Config/SuiteSparse_MongooseConfig.cmake.in index 69d0eb4cf..2599123b7 100644 --- a/Mongoose/Config/MongooseConfig.cmake.in +++ b/Mongoose/Config/SuiteSparse_MongooseConfig.cmake.in @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------- -# SuiteSparse/Mongoose/cmake_modules/MongooseConfig.cmake +# SuiteSparse/Mongoose/cmake_modules/SuiteSparse_MongooseConfig.cmake #------------------------------------------------------------------------------- # The following copyright and license applies to just this file only, not to @@ -9,18 +9,18 @@ #------------------------------------------------------------------------------- -# Finds the Mongoose include file and compiled library. +# Finds the SuiteSparse_Mongoose include file and compiled library. # The following targets are defined: # SuiteSparse::Mongoose - for the shared library (if available) # SuiteSparse::Mongoose_static - for the static library (if available) # For backward compatibility the following variables are set: -# MONGOOSE_INCLUDE_DIR - where to find Mongoose.hpp -# MONGOOSE_LIBRARY - dynamic Mongoose library -# MONGOOSE_STATIC - static Mongoose library -# MONGOOSE_LIBRARIES - libraries when using Mongoose -# MONGOOSE_FOUND - true if Mongoose found +# SUITESPARSE_MONGOOSE_INCLUDE_DIR - where to find Mongoose.hpp +# SUITESPARSE_MONGOOSE_LIBRARY - dynamic Mongoose library +# SUITESPARSE_MONGOOSE_STATIC - static Mongoose library +# SUITESPARSE_MONGOOSE_LIBRARIES - libraries when using Mongoose +# SuiteSparse_Mongoose_FOUND - true if Mongoose found # Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is # installed. @@ -33,7 +33,7 @@ set ( MONGOOSE_DATE "@Mongoose_DATE@" ) set ( MONGOOSE_VERSION_MAJOR @Mongoose_VERSION_MAJOR@ ) set ( MONGOOSE_VERSION_MINOR @Mongoose_VERSION_MINOR@ ) set ( MONGOOSE_VERSION_PATCH @Mongoose_VERSION_PATCH@ ) -set ( MONGOOSE_VERSION "@Mongoose_VERSION_MAJOR@.@Mongoose_VERSION_MINOR@.@Mongoose_VERSION_PATCH@" ) +set ( SUITESPARSE_MONGOOSE_VERSION "@Mongoose_VERSION_MAJOR@.@Mongoose_VERSION_MINOR@.@Mongoose_VERSION_PATCH@" ) # Check for dependent targets include ( CMakeFindDependencyMacro ) @@ -55,19 +55,19 @@ else ( ) endif ( ) endif ( ) if ( NOT SuiteSparse_config_FOUND ) - set ( Mongoose_FOUND OFF ) + set ( SuiteSparse_Mongoose_FOUND OFF ) return ( ) endif ( ) # Import target -include ( ${CMAKE_CURRENT_LIST_DIR}/MongooseTargets.cmake ) +include ( ${CMAKE_CURRENT_LIST_DIR}/SuiteSparse_MongooseTargets.cmake ) # The following is only for backward compatibility with FindMongoose. set ( _target_shared SuiteSparse::Mongoose ) set ( _target_static SuiteSparse::Mongoose_static ) -set ( _var_prefix "MONGOOSE" ) +set ( _var_prefix "SUITESPARSE_MONGOOSE" ) if ( NOT @BUILD_SHARED_LIBS@ AND NOT TARGET ${_target_shared} ) # make sure there is always an import target without suffix ) @@ -130,7 +130,7 @@ foreach ( _config ${_config_types} ) endif ( ) endforeach ( ) -set ( MONGOOSE_LIBRARIES ${MONGOOSE_LIBRARY} ) +set ( SUITESPARSE_MONGOOSE_LIBRARIES ${SUITESPARSE_MONGOOSE_LIBRARY} ) macro ( suitesparse_check_exist _var _files ) # ignore generator expressions @@ -143,10 +143,10 @@ macro ( suitesparse_check_exist _var _files ) endforeach () endmacro ( ) -suitesparse_check_exist ( MONGOOSE_INCLUDE_DIR ${MONGOOSE_INCLUDE_DIR} ) -suitesparse_check_exist ( MONGOOSE_LIBRARY ${MONGOOSE_LIBRARY} ) +suitesparse_check_exist ( SUITESPARSE_MONGOOSE_INCLUDE_DIR ${SUITESPARSE_MONGOOSE_INCLUDE_DIR} ) +suitesparse_check_exist ( SUITESPARSE_MONGOOSE_LIBRARY ${SUITESPARSE_MONGOOSE_LIBRARY} ) -message ( STATUS "Mongoose version: ${MONGOOSE_VERSION}" ) -message ( STATUS "Mongoose include: ${MONGOOSE_INCLUDE_DIR}" ) -message ( STATUS "Mongoose library: ${MONGOOSE_LIBRARY}" ) -message ( STATUS "Mongoose static: ${MONGOOSE_STATIC}" ) +message ( STATUS "SuiteSparse_Mongoose version: ${SUITESPARSE_MONGOOSE_VERSION}" ) +message ( STATUS "SuiteSparse_Mongoose include: ${SUITESPARSE_MONGOOSE_INCLUDE_DIR}" ) +message ( STATUS "SuiteSparse_Mongoose library: ${SUITESPARSE_MONGOOSE_LIBRARY}" ) +message ( STATUS "SuiteSparse_Mongoose static: ${SUITESPARSE_MONGOOSE_STATIC}" ) diff --git a/Mongoose/Doc/ChangeLog b/Mongoose/Doc/ChangeLog index bb1fa54a8..d3fd96fef 100644 --- a/Mongoose/Doc/ChangeLog +++ b/Mongoose/Doc/ChangeLog @@ -1,6 +1,16 @@ Dec 30, 2023: version 3.3.0 * major change to build system: by Markus Mützel + * library name change: compiled library renamed from libmongoose.so (dylib, + etc) to libsuitesparse_mongoose.so, to avoid name conflict with the + mongoose web server (https://github.com/cesanta/mongoose). That + package is in C, and its user-visible functions are all prefixed mg_*, + and an #include file of mongoose.h. This SuiteSparse/Mongoose library + is in C++, with a namespace of Mongoose::, and an #include file of + Mongoose.hpp. So the function names and include files do not conflict. + The web mongoose project does not create any *Config.cmake files, but + they might in the future, so the cmake and pkg-config files here have + been renamed from Mongoose*.cmake, etc, to SuiteSparse_Mongoose*.cmake. Sept 18, 2023: version 3.2.1