Skip to content

Commit

Permalink
GraphBLAS_CUDA: Create pkg-config file
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuetzel committed Sep 13, 2023
1 parent 0ede6c4 commit 4ea290f
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 3 deletions.
7 changes: 4 additions & 3 deletions GraphBLAS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ if ( NOT NSTATIC )
add_library ( GraphBLAS_static STATIC ${GRAPHBLAS_SOURCES} )

set_target_properties ( GraphBLAS_static PROPERTIES
VERSION ${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB}
OUTPUT_NAME graphblas
SOVERSION ${GraphBLAS_VERSION_MAJOR}
VERSION ${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB}
OUTPUT_NAME graphblas
SOVERSION ${GraphBLAS_VERSION_MAJOR}
C_STANDARD 11
C_STANDARD_REQUIRED ON )

Expand All @@ -280,6 +280,7 @@ if ( NOT NSTATIC )

if ( SUITESPARSE_CUDA )
add_dependencies ( GraphBLAS_static GraphBLAS_CUDA )
set ( GRAPHBLAS_STATIC_MODULES "${GRAPHBLAS_STATIC_MODULES} GraphBLAS_CUDA )
# add_dependencies ( GraphBLAS_static rmm_wrap )
endif ( )
endif ( )
Expand Down
30 changes: 30 additions & 0 deletions GraphBLAS/CUDA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ add_library ( GraphBLAS_CUDA SHARED ${GRAPHBLAS_CUDA_SOURCES} )

set_target_properties ( GraphBLAS_CUDA PROPERTIES
VERSION ${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB}
OUTPUT_NAME graphblascuda
SOVERSION ${GraphBLAS_VERSION_MAJOR}
C_STANDARD 11
C_STANDARD_REQUIRED ON )
Expand Down Expand Up @@ -113,6 +114,35 @@ install ( FILES
${CMAKE_CURRENT_BINARY_DIR}/GraphBLAS_CUDAConfigVersion.cmake
DESTINATION ${SUITESPARSE_LIBDIR}/cmake/GraphBLAS )

#-------------------------------------------------------------------------------
# create pkg-config file
#-------------------------------------------------------------------------------

if ( NOT MSVC )
set ( prefix "${CMAKE_INSTALL_PREFIX}" )
set ( exec_prefix "\${prefix}" )
cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE )
if (SUITESPARSE_LIBDIR_IS_ABSOLUTE)
set ( libdir "${SUITESPARSE_LIBDIR}")
else ( )
set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}")
endif ( )
cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE )
if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE)
set ( includedir "${SUITESPARSE_INCLUDEDIR}")
else ( )
set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}")
endif ( )
configure_file (
Config/GraphBLAS_CUDA.pc.in
GraphBLAS_CUDA.pc
@ONLY
NEWLINE_STYLE LF )
install ( FILES
${CMAKE_CURRENT_BINARY_DIR}/GraphBLAS_CUDA.pc
DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig )
endif ( )

#-------------------------------------------------------------------------------
# test suite for the CUDA kernels
#-------------------------------------------------------------------------------
Expand Down
17 changes: 17 additions & 0 deletions GraphBLAS/CUDA/Config/GraphBLAS_CUDA.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# GraphBLAS_CUDA, Copyright (c) 2017-2023, Timothy A. Davis.
# All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

# FIXME: Which flags do we need to statically link CUDA?

Name: GraphBLAS_CUDA
URL: https://github.com/DrTimothyAldenDavis/SuiteSparse
Description: CUDA support library for GraphBLAS in SuiteSparse
Version: @GraphBLAS_VERSION_MAJOR@.@GraphBLAS_VERSION_MINOR@.@GraphBLAS_VERSION_SUB@
Libs: -L${libdir} -lgraphblascuda
Cflags: -I${includedir}
1 change: 1 addition & 0 deletions GraphBLAS/Config/GraphBLAS.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Name: GraphBLAS
URL: https://github.com/DrTimothyAldenDavis/SuiteSparse
Description: Complete implementation of the GraphBLAS standard in SuiteSparse
Version: @GraphBLAS_VERSION_MAJOR@.@GraphBLAS_VERSION_MINOR@.@GraphBLAS_VERSION_SUB@
Requires.private: @GRAPHBLAS_STATIC_MODULES@
Libs: -L${libdir} -lgraphblas
Libs.private: @GRAPHBLAS_STATIC_LIBS@
Cflags: -I${includedir}

0 comments on commit 4ea290f

Please sign in to comment.