diff --git a/CMakeLists.txt b/CMakeLists.txt index d7c783c002..588e9e5216 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,9 +39,7 @@ message ( STATUS "GraphBLAS C API: v" set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake_modules - ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules - ${CMAKE_SOURCE_DIR}/../SuiteSparse/SuiteSparse_config/cmake_modules - ) + ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) if ( NOT DEFINED NSTATIC ) # default for GraphBLAS: do not build the static libraries @@ -52,6 +50,7 @@ endif ( ) # FIXME # set ( ENABLE_CUDA false ) set ( ENABLE_CUDA true ) + include ( SuiteSparsePolicy ) #------------------------------------------------------------------------------- @@ -269,11 +268,13 @@ endif ( ) if ( CMAKE_CUDA_DEV ) # for CUDA development only; not for production use - file ( GLOB GRAPHBLAS_SOURCES "Source/*.c" "Source/Generated1/*.c" - "Source/Shared/*.c" ) + file ( GLOB GRAPHBLAS_SOURCES "Source/*.c" + "Source/Shared/*.c" + "Source/Generated1/*.c" ) else ( ) - file ( GLOB GRAPHBLAS_SOURCES "Source/*.c" "Source/Generated1/*.c" - "Source/Shared/*.c" "Source/Generated2/*.c" ) + file ( GLOB GRAPHBLAS_SOURCES "Source/*.c" + "Source/Shared/*.c" + "Source/Generated1/*.c" "Source/Generated2/*.c" ) endif ( ) add_library ( graphblas SHARED ${GRAPHBLAS_SOURCES} ) @@ -458,6 +459,9 @@ if ( GLOBAL_INSTALL ) install ( TARGETS graphblas LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) + install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindGraphBLAS.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SuiteSparse + COMPONENT Development ) if ( NOT NSTATIC ) install ( TARGETS graphblas_static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -472,6 +476,9 @@ if ( INSIDE_SUITESPARSE ) install ( TARGETS graphblas LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) + install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindGraphBLAS.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse + COMPONENT Development ) if ( NOT NSTATIC ) install ( TARGETS graphblas_static ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) diff --git a/Config/README.md.in b/Config/README.md.in index 7e53c76c6a..a7ace42c43 100644 --- a/Config/README.md.in +++ b/Config/README.md.in @@ -53,7 +53,7 @@ To remove all compiled files: To compile and run the demos: - make demo + make demos See the GraphBLAS/ subfolder for the Octave/MATLAB interface, which contains a README.md file with further details. diff --git a/Doc/GraphBLAS_UserGuide.pdf b/Doc/GraphBLAS_UserGuide.pdf index ff973728a8..461fa66fe3 100644 Binary files a/Doc/GraphBLAS_UserGuide.pdf and b/Doc/GraphBLAS_UserGuide.pdf differ diff --git a/Doc/GraphBLAS_UserGuide.tex b/Doc/GraphBLAS_UserGuide.tex index 3d446d9ed5..cc2d74f2f4 100644 --- a/Doc/GraphBLAS_UserGuide.tex +++ b/Doc/GraphBLAS_UserGuide.tex @@ -14869,7 +14869,7 @@ \subsection{On Linux and Mac} make CMAKE_OPTIONS='-DGBNCPUFEAT=1 -DGBAVX2=1' JOBS=40 \end{verbatim} } After compiling the library, you can compile the demos with -\verb'make all' and then \verb'make demo' while in the top-level +\verb'make all' and then \verb'make demos' while in the top-level GraphBLAS folder. If \verb'cmake' or \verb'make' fail, it might be that your default compiler diff --git a/Makefile b/Makefile index cf0c7fc054..42cde14ebc 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,7 @@ all: ( cd build && cmake $(CMAKE_OPTIONS) -DDEMO=1 .. && $(MAKE) --jobs=$(JOBS) ) # run the demos -demo: all +demos: all ( cd Demo && ./demo ) # just do 'make' in build; do not rerun the cmake script diff --git a/README.md b/README.md index 4626964947..35154225f2 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ To remove all compiled files: To compile and run the demos: - make demo + make demos See the GraphBLAS/ subfolder for the Octave/MATLAB interface, which contains a README.md file with further details. diff --git a/alternative/Makefile b/alternative/Makefile index c0cd4901f2..d1d5285fbd 100644 --- a/alternative/Makefile +++ b/alternative/Makefile @@ -142,7 +142,7 @@ DOBJ = $(DSRC2:.c=.o) DEMO_PRG = $(notdir $(wildcard ../Demo/Program/*_demo.c)) DEMO = $(DEMO_PRG:.c=) -demo: $(DEMO) +demos: $(DEMO) ./altdemo clean: diff --git a/alternative/README.txt b/alternative/README.txt index 5000677f35..b6d09dfd98 100644 --- a/alternative/README.txt +++ b/alternative/README.txt @@ -35,5 +35,5 @@ to compile the static library: make static to compile in parallel with 4 cores: make -j4 to install in /usr/local/*: sudo make install to cleanup: make distclean -to compile and run the demos: make demo +to compile and run the demos: make demos diff --git a/cmake_modules/FindGraphBLAS.cmake b/cmake_modules/FindGraphBLAS.cmake index 85f61b57fc..db0575585e 100644 --- a/cmake_modules/FindGraphBLAS.cmake +++ b/cmake_modules/FindGraphBLAS.cmake @@ -72,11 +72,12 @@ find_library( ) # get version of .so using REALPATH -get_filename_component(GRAPHBLAS_LIBRARY ${GRAPHBLAS_LIBRARY} REALPATH) -string( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - GRAPHBLAS_VERSION - ${GRAPHBLAS_LIBRARY} +get_filename_component ( GRAPHBLAS_LIBRARY ${GRAPHBLAS_LIBRARY} REALPATH ) +get_filename_component ( GRAPHBLAS_FILENAME ${GRAPHBLAS_LIBRARY} NAME ) +string ( + REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" + GRAPHBLAS_VERSION + ${GRAPHBLAS_FILENAME} ) set(GRAPHBLAS_LIBRARIES ${GRAPHBLAS_LIBRARY}) diff --git a/cmake_modules/SuiteSparsePolicy.cmake b/cmake_modules/SuiteSparsePolicy.cmake index 1b93f69765..79991fac43 100644 --- a/cmake_modules/SuiteSparsePolicy.cmake +++ b/cmake_modules/SuiteSparsePolicy.cmake @@ -28,7 +28,9 @@ # NSTATIC: if true, static libraries are not built. # Default is false, except for GraphBLAS, which # takes a long time to compile so the default for -# GraphBLAS is true. +# GraphBLAS is true. For Mongoose, the NSTATIC setting +# is treated as if it always false, since the mongoose +# program is built with the static library. # # SUITESPARSE_CUDA_ARCHITECTURES a string, such as "all" or # "35;50;75;80" that lists the CUDA architectures to use @@ -48,6 +50,20 @@ cmake_policy ( SET CMP0048 NEW ) # VERSION variable policy cmake_policy ( SET CMP0054 NEW ) # if ( expression ) handling policy cmake_policy ( SET CMP0104 NEW ) # initialize CUDA architectures +# look for cmake modules installed by prior compilations of SuiteSparse packages +set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} + ${CMAKE_SOURCE_DIR}/cmake_modules ) + +if ( SUITESPARSE_SECOND_LEVEL ) + # some packages in SuiteSparse is in SuiteSparse/Package/Package + set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} + ${CMAKE_SOURCE_DIR}/../../lib/cmake ) +else ( ) + # most packages in SuiteSparse are located in SuiteSparse/Package + set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} + ${CMAKE_SOURCE_DIR}/../lib/cmake ) +endif ( ) + set ( CMAKE_MACOSX_RPATH TRUE ) enable_language ( C ) include ( GNUInstallDirs ) diff --git a/cmake_modules/SuiteSparseReport.cmake b/cmake_modules/SuiteSparseReport.cmake index 1c4e095161..eb72f4e1f9 100644 --- a/cmake_modules/SuiteSparseReport.cmake +++ b/cmake_modules/SuiteSparseReport.cmake @@ -9,38 +9,39 @@ # report status and compile flags #------------------------------------------------------------------------------- -message ( STATUS -"----------------------------------------------------------------------------" ) +message ( STATUS "------------------------------------------------------------------------" ) message ( STATUS "SuiteSparse CMAKE report for: ${CMAKE_PROJECT_NAME}" ) -message ( STATUS -"----------------------------------------------------------------------------" ) +message ( STATUS "------------------------------------------------------------------------" ) if ( GLOBAL_INSTALL ) message ( STATUS "install in ${CMAKE_INSTALL_PREFIX}: true" ) else ( ) message ( STATUS "install in ${CMAKE_INSTALL_PREFIX}: false" ) endif ( ) message ( STATUS "install in SuiteSparse/lib and SuiteSparse/include: ${INSIDE_SUITESPARSE}" ) -message ( STATUS "build type: ${CMAKE_BUILD_TYPE}" ) -message ( STATUS "have OpenMP: ${OPENMP_FOUND} ") -message ( STATUS "C compiler: ${CMAKE_C_COMPILER_ID} ") -message ( STATUS "C flags: ${CMAKE_C_FLAGS}" ) -message ( STATUS "C++ compiler: ${CMAKE_CXX_COMPILER_ID}" ) -message ( STATUS "C++ flags: ${CMAKE_CXX_FLAGS}" ) +message ( STATUS "build type: ${CMAKE_BUILD_TYPE}" ) +if ( NSTATIC ) +message ( STATUS "build static library: no" ) +else ( ) +message ( STATUS "build static library: yes" ) +endif ( ) +message ( STATUS "have OpenMP: ${OPENMP_FOUND} ") +message ( STATUS "C compiler: ${CMAKE_C_COMPILER_ID} ") +message ( STATUS "C flags: ${CMAKE_C_FLAGS}" ) +message ( STATUS "C++ compiler: ${CMAKE_CXX_COMPILER_ID}" ) +message ( STATUS "C++ flags: ${CMAKE_CXX_FLAGS}" ) if ( ${CMAKE_BUILD_TYPE} STREQUAL "Debug" ) - message ( STATUS "C Flags debug: ${CMAKE_C_FLAGS_DEBUG} ") - message ( STATUS "C++ Flags debug: ${CMAKE_CXX_FLAGS_DEBUG} ") + message ( STATUS "C Flags debug: ${CMAKE_C_FLAGS_DEBUG} ") + message ( STATUS "C++ Flags debug: ${CMAKE_CXX_FLAGS_DEBUG} ") else ( ) - message ( STATUS "C Flags release: ${CMAKE_C_FLAGS_RELEASE} ") - message ( STATUS "C++ Flags release: ${CMAKE_CXX_FLAGS_RELEASE} ") + message ( STATUS "C Flags release: ${CMAKE_C_FLAGS_RELEASE} ") + message ( STATUS "C++ Flags release: ${CMAKE_CXX_FLAGS_RELEASE} ") endif ( ) get_property ( CDEFN DIRECTORY PROPERTY COMPILE_DEFINITIONS ) -message ( STATUS "compile definitions: ${CDEFN}") +message ( STATUS "compile definitions: ${CDEFN}") if ( DEFINED SuiteSparse_BLAS_integer ) - message ( STATUS "BLAS integer: ${SuiteSparse_BLAS_integer}" ) + message ( STATUS "BLAS integer: ${SuiteSparse_BLAS_integer}" ) endif ( ) if ( DEFINED CMAKE_CUDA_ARCHITECTURES ) - message ( STATUS "CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}" ) + message ( STATUS "CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}" ) endif ( ) -message ( STATUS -"----------------------------------------------------------------------------" ) - +message ( STATUS "------------------------------------------------------------------------" )