Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename compiled library: Mongoose to SuiteSparse_Mongoose #588

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions Example/Source/my_cxx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
//--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion LAGraph/Acknowledgments.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ THIS WORK IS FUNDED IN PART BY:
THIS WORK BUILDS UPON THE FOLLOWING PRIOR WORKS:
1. SuiteSparse:GraphBLAS,
(http://faculty.cse.tamu.edu/davis/GraphBLAS.html)
Copyright 2017-2022 Timothy A. Davis (Author), AldenMath.com.
Copyright 2017-2023 Timothy A. Davis (Author), AldenMath.com.
By Tim Davis, Texas A&M University. Note that while SuiteSparse:GraphBLAS
is itself under the Apache 2 license, any contributions derived from
SuiteSparse:GraphBLAS and incorporated by the Author into LAGraph are
Expand Down
3 changes: 1 addition & 2 deletions LAGraph/config/LAGraph.pc.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# LAGraph, Copyright (c) 2019-2023, Timothy A. Davis.
# All Rights Reserved.
# LAGraph, Copyright (c) 2019-2023, LAGraph Contributors. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause

prefix=@prefix@
Expand Down
3 changes: 2 additions & 1 deletion LAGraph/config/LAGraphConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

# The following copyright and license applies to just this file only, not to
# the library itself:
# LAGraphConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved.
# LAGraphConfig.cmake, Copyright (c) 2019-2023, LAGraph Contributors. All
# Rights Reserved.
# SPDX-License-Identifier: BSD-3-clause

#-------------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion LAGraph/src/test/test_Xinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@

#include "LAGraph_test.h"
#include "LAGraphX.h"
#include "LG_init.h"

// functions defined in LAGr_Init.c:
LAGRAPH_PUBLIC void LG_set_LAGr_Init_has_been_called (bool setting) ;
LAGRAPH_PUBLIC bool LG_get_LAGr_Init_has_been_called (void) ;

//------------------------------------------------------------------------------
// global variables
Expand Down
8 changes: 5 additions & 3 deletions LAGraph/src/utility/LAGr_Init.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@

static bool LG_LAGr_Init_has_been_called = false ;

// LG_LAGr_Init_has_been_called is only modified or accessed by these two
// routines (even in this file):
// LG_LAGr_Init_has_been_called is only modified or accessed by the following
// two routines (even in this file). The two functions are made accessible via
// LAGRAPH_PUBLIC, only for testing purposes by src/test/test_Xinit.c.

#include "LG_init.h"
LAGRAPH_PUBLIC void LG_set_LAGr_Init_has_been_called (bool setting) ;
LAGRAPH_PUBLIC bool LG_get_LAGr_Init_has_been_called (void) ;

LAGRAPH_PUBLIC
void LG_set_LAGr_Init_has_been_called (bool setting)
Expand Down
32 changes: 0 additions & 32 deletions LAGraph/src/utility/LG_init.h

This file was deleted.

60 changes: 30 additions & 30 deletions Mongoose/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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" )
Expand All @@ -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
Expand All @@ -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 )
Expand All @@ -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 ( )
Expand Down Expand Up @@ -546,53 +546,53 @@ 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}
PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} )
endif ( )
if ( BUILD_STATIC_LIBS )
install ( TARGETS Mongoose_static
EXPORT MongooseTargets
EXPORT SuiteSparse_MongooseTargets
ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR}
PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} )
endif ( )
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
Expand All @@ -619,16 +619,16 @@ if ( NOT MSVC )
set ( SUITESPARSE_LIB_BASE_NAME $<TARGET_FILE_BASE_NAME:Mongoose_static> )
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 ( )

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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@
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.
Expand All @@ -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 )
Expand All @@ -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 )
Expand Down Expand Up @@ -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
Expand All @@ -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}" )
10 changes: 10 additions & 0 deletions Mongoose/Doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -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

Expand Down