Skip to content

Commit

Permalink
CXSparse: date. Example: add LAGraph. LAGraph: *.h for C++
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed Nov 30, 2023
1 parent 616d583 commit b02ef0b
Show file tree
Hide file tree
Showing 12 changed files with 161 additions and 215 deletions.
4 changes: 2 additions & 2 deletions CXSparse/Config/cs.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// CXSparse/Include/cs.h: include file for CXSparse
//------------------------------------------------------------------------------

// CXSparse, Copyright (c) 2006-2022, Timothy A. Davis, All Rights Reserved
// CXSparse, Copyright (c) 2006-2023, Timothy A. Davis, All Rights Reserved
// SPDX-License-Identifier: LGPL-2.1+

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -39,7 +39,7 @@
#define CS_SUBVER @CXSPARSE_VERSION_MINOR@
#define CS_SUBSUB @CXSPARSE_VERSION_SUB@
#define CS_DATE "@CXSPARSE_DATE@" /* CXSparse release date */
#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2022"
#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2023"
#define CXSPARSE

#include "SuiteSparse_config.h"
Expand Down
4 changes: 2 additions & 2 deletions CXSparse/Include/cs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// CXSparse/Include/cs.h: include file for CXSparse
//------------------------------------------------------------------------------

// CXSparse, Copyright (c) 2006-2022, Timothy A. Davis, All Rights Reserved
// CXSparse, Copyright (c) 2006-2023, Timothy A. Davis, All Rights Reserved
// SPDX-License-Identifier: LGPL-2.1+

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -39,7 +39,7 @@
#define CS_SUBVER 3
#define CS_SUBSUB 0
#define CS_DATE "Dec 30, 2023" /* CXSparse release date */
#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2022"
#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2023"
#define CXSPARSE

#include "SuiteSparse_config.h"
Expand Down
56 changes: 52 additions & 4 deletions Example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,53 @@
# Copyright (c) 2022-2023, Timothy A. Davis, All Rights Reserved.
# SPDX-License-Identifier: BSD-3-clause

# See the section below, "help with building this Example ..." for how to tell
# this Example library where to find SuiteSparse.

cmake_minimum_required ( VERSION 3.20 )

#-------------------------------------------------------------------------------
# help with building this Example package and finding SuiteSparse
#-------------------------------------------------------------------------------

# To build this example, add the location of the CMake config files to
# CMAKE_PREFIX_PATH if the SuiteSparse libraries aren't installed at a
# default location.
# CMAKE_PREFIX_PATH if the SuiteSparse libraries aren't installed at a default
# location. For example, on Linux or Mac, if you have your own a compiled copy
# of SuiteSparse in /home/me/SuiteSparse that was compiled and installed with
# LOCAL_INSTALL set to ON, use the following:
#
# export CMAKE_PREFIX_PATH /home/me/SuiteSparse
#
# or uncomment and revise one of these examples, on any platform:
#
# set ( CMAKE_PREFIX_PATH /home/me/SuiteSparse )
# set ( CMAKE_PREFIX_PATH /opt/SuiteSparse )
#
# The following is added, just to simplify building this Example if it is
# located inside SuiteSparse itself and compiled with LOCAL_INSTALL set to ON.
# Normally you would not use this in a stand-alone library that relies on
# SuiteSparse:

set ( CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${CMAKE_SOURCE_DIR}/.. )

# Next, to build and install this Example library, do the following:
#
# cd Example/build
# cmake ..
# cmake --build . --config Release
# sudo cmake --install .
#
# Alternatively, if you have "make", just do this in this directory:
#
# make
# sudo make install

message ( STATUS "MY prefix path: ${CMAKE_PREFIX_PATH}" )

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

cmake_minimum_required ( VERSION 3.20 )

# cmake inserts the date and version number into Include/my.h:
set ( MY_DATE "Dec 30, 2023" )
set ( MY_VERSION_MAJOR 1 )
Expand Down Expand Up @@ -596,3 +633,14 @@ if ( BUILD_STATIC_LIBS )
add_executable ( my_cxx_demo_static "Demo/my_demo.c" )
target_link_libraries ( my_cxx_demo_static PUBLIC my_cxx_static )
endif ( )

#-------------------------------------------------------------------------------
# report
#-------------------------------------------------------------------------------

message ( STATUS "MY source: ${CMAKE_SOURCE_DIR} ")
message ( STATUS "MY build: ${CMAKE_BINARY_DIR} ")
message ( STATUS "MY install prefix: ${CMAKE_INSTALL_PREFIX}" )
message ( STATUS "MY install rpath: ${CMAKE_INSTALL_RPATH}" )
message ( STATUS "MY build rpath: ${CMAKE_BUILD_RPATH}" )

183 changes: 0 additions & 183 deletions Example/Demo/mydemo.out

This file was deleted.

6 changes: 3 additions & 3 deletions Example/Include/my.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// file, since it is constructed from Config/my.h.in by cmake.

// version and date for example user library
#define MY_DATE "Nov 30, 2023"
#define MY_DATE "Dec 30, 2023"
#define MY_MAJOR_VERSION 1
#define MY_MINOR_VERSION 4
#define MY_PATCH_VERSION 4
#define MY_MINOR_VERSION 5
#define MY_PATCH_VERSION 0

#ifdef __cplusplus
extern "C" {
Expand Down
4 changes: 4 additions & 0 deletions Example/Include/my_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
#if ! defined (NO_GRAPHBLAS)
# include "GraphBLAS.h"
#endif
#if ! defined (NO_LAGRAPH)
# include "LAGraph.h"
#endif
#include "klu.h"
#include "klu.h"
#include "ldl.h"
#include "RBio.h"
Expand Down
35 changes: 18 additions & 17 deletions Example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,28 @@ SPDX-License-Identifier: BSD-3-clause
An example of how to use the SuiteSparse `Find*.cmake` files in cmake
to build a library that depends on SuiteSparse libraries.

README.md this file
CMakeLists.txt primary method for building the package
Makefile optional; relies on cmake to do the work
Include/my.h created by cmake from Config/my.h.in
Config/my.h.in input file for Include/my.h
Demo/my_demo.c demo program that uses 'my' package
Demo/mydemo.out output of my_demo
Source/my.c library source code
build where the 'my' package is built
cmake_modules/FindGMP.cmake how to find the GMP library
cmake_modules/FindMPFR.cmake how to find the MPFR library
README.md this file
License.txt license
CMakeLists.txt primary method for building the package
Makefile optional; relies on cmake to do the work
Include/my.h created by cmake from Config/my.h.in
Include/my_internal.h internal include file
Config/my.h.in input file for Include/my.h
Demo/my_demo.c demo program that uses 'my' package
Demo/my_demo.out output of my_demo
Source/my.c library source code (C)
Source/my_cxx.cc library source code (C++)
build where the 'my' package is built

The 'my' library relies on the following SuiteSparse libraries, each of which
has a cmake module to use in `find_package` that is installed alongside the
compiled libraries (/usr/local/lib/cmake/SuiteSparse) `AMD`, `BTF`, `CAMD`,
`CCOLAMD`, `CHOLMOD`, `CHOLMOD_CUDA`, `COLAMD`, `CXSparse`, `GPUQREngine`,
`GraphBLAS`, `KLU`, `KLU_CHOLMOD`, `LDL`, `Mongoose`, `RBio`, `SPEX`, `SPQR`,
`CCOLAMD`, `CHOLMOD`, `COLAMD`, `CXSparse`, `GPUQREngine`, `GraphBLAS`, `KLU`,
`KLU_CHOLMOD`, `LAGraph`, `LDL`, `Mongoose`, `RBio`, `SPEX`, `SPQR`,
`SPQR_CUDA`, `SuiteSparse_GPURuntime`, `SuiteSparse_config`, and `UMFPACK`.

In addition, the 'my' package relies on the following external libraries:
`BLAS`, `LAPACK`, `OpenMP`, `GMP`, and `MPFR`. The latter two (GMP and MPFR)
do not have cmake `find_package` modules. These can be found in
`SuiteSparse/Example/cmake_modules`, or in `SuiteSparse/SPEX/cmake_modules`.
They are not installed in /usr/local/lib/cmake/SuiteSparse.
`BLAS`, `LAPACK`, `OpenMP`, `GMP`, and `MPFR`.

To compile the `my` package and run a demo program:

Expand All @@ -46,3 +44,6 @@ To remove all compiled files and folders, delete the contents of Example/build

make clean

See the instructions in CMakeLists.txt for additional instructions (in
particular, if SuiteSparse is not found).

Loading

0 comments on commit b02ef0b

Please sign in to comment.