Skip to content

Commit b0c0d61

Browse files
Merge pull request #545 from DrTimothyAldenDavis/dev2
GraphBLAS 8.3.0: rmm_wrap, static lib. ParU: misc cleanup. root-cmakelists workflow. UMFPACK: stale include files. Use same version for SPQR, and its GPU libraries
2 parents f38d677 + 734b56b commit b0c0d61

23 files changed

+102
-758
lines changed

.github/workflows/root-cmakelists.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: root-cmakelists
55
on:
66
workflow_dispatch:
77
push:
8-
# branches-ignore:
9-
# - '**/dev2'
10-
# - '**/*dev2'
8+
branches-ignore:
9+
- '**/dev2'
10+
- '**/*dev2'
1111
pull_request:
1212

1313
concurrency: ci-root-cmakelists-${{ github.ref }}

GraphBLAS/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ if ( BUILD_STATIC_LIBS )
304304
target_compile_definitions ( GraphBLAS_static PRIVATE "SUITESPARSE_CUDA" )
305305
endif ( )
306306

307+
if ( WIN32 )
308+
# On Windows, don't use __declspec ( dllimport ) for static library.
309+
target_compile_definitions ( GraphBLAS_static PUBLIC GB_STATIC )
310+
endif ( )
311+
307312
if ( NOT NJIT )
308313
# Make sure compressed sources are built before library
309314
add_dependencies ( GraphBLAS_static grb_jitpackage )

GraphBLAS/CUDA/CMakeLists.txt

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -243,26 +243,26 @@ set_target_properties(graphblascuda_test PROPERTIES CUDA_ARCHITECTURES "52;75;80
243243

244244
include(GoogleTest)
245245

246-
add_dependencies(graphblascuda_test GraphBLAS)
247-
add_dependencies(graphblascuda_test GraphBLAS_CUDA)
248-
add_dependencies(graphblascuda_test gtest_main)
249-
add_dependencies(graphblascuda_test rmm_wrap)
250-
251-
target_link_libraries(graphblascuda_test
252-
PUBLIC
253-
GraphBLAS
254-
GraphBLAS_CUDA
255-
rmm_wrap
256-
CUDA::cudart_static
257-
CUDA::nvrtc
258-
${ADDITIONAL_DEPS}
259-
PRIVATE
260-
gtest_main)
261-
262-
target_include_directories(graphblascuda_test
263-
PUBLIC
264-
rmm_wrap
265-
${ADDITIONAL_INCLUDES}
266-
${CUDAToolkit_INCLUDE_DIRS}
267-
${GRAPHBLAS_CUDA_INCLUDES})
246+
if ( ENABLE_SHARED_LIBS )
247+
target_link_libraries ( graphblascuda_test PUBLIC GraphBLAS )
248+
else ( )
249+
target_link_libraries ( graphblascuda_test PUBLIC GraphBLAS_static )
250+
endif ( )
251+
252+
target_link_libraries ( graphblascuda_test
253+
PUBLIC
254+
GraphBLAS_CUDA
255+
RMM_wrap
256+
CUDA::cudart_static
257+
CUDA::nvrtc
258+
${ADDITIONAL_DEPS}
259+
PRIVATE
260+
gtest_main )
261+
262+
target_include_directories ( graphblascuda_test
263+
PUBLIC
264+
rmm_wrap
265+
${ADDITIONAL_INCLUDES}
266+
${CUDAToolkit_INCLUDE_DIRS}
267+
${GRAPHBLAS_CUDA_INCLUDES} )
268268

GraphBLAS/Config/GB_config.h

Lines changed: 0 additions & 69 deletions
This file was deleted.

GraphBLAS/Config/GraphBLAS.h.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@
9696
#define GB_GLOBAL extern __declspec ( dllexport )
9797
#elif defined ( GB_STATIC )
9898
// Compiling the user application on Windows, importing symbols from
99-
// a static GraphBLAS library on Windows. The user application must do:
100-
// #define GB_STATIC
101-
// #include "GraphBLAS.h"
99+
// a static GraphBLAS library on Windows. The user application must
100+
// define GB_STATIC (e.g., with the pre-processor flag -DGB_STATIC) for
101+
// all compilation units that include "GraphBLAS.h".
102102
#define GB_GLOBAL extern
103103
#else
104104
// Compiling the user application on Windows, importing symbols from

GraphBLAS/Config/GraphBLAS.pc.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ Requires.private: @GRAPHBLAS_STATIC_MODULES@
1717
Libs: -L${libdir} -lgraphblas
1818
Libs.private: @GRAPHBLAS_STATIC_LIBS@
1919
Cflags: -I${includedir}
20+
Cflags.private: -DGB_STATIC

GraphBLAS/Include/GraphBLAS.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@
9696
#define GB_GLOBAL extern __declspec ( dllexport )
9797
#elif defined ( GB_STATIC )
9898
// Compiling the user application on Windows, importing symbols from
99-
// a static GraphBLAS library on Windows. The user application must do:
100-
// #define GB_STATIC
101-
// #include "GraphBLAS.h"
99+
// a static GraphBLAS library on Windows. The user application must
100+
// define GB_STATIC (e.g., with the pre-processor flag -DGB_STATIC) for
101+
// all compilation units that include "GraphBLAS.h".
102102
#define GB_GLOBAL extern
103103
#else
104104
// Compiling the user application on Windows, importing symbols from

GraphBLAS/rmm_wrap/CMakeLists.txt

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,70 +8,71 @@
88

99
cmake_minimum_required ( VERSION 3.19 )
1010

11-
project(rmm_wrap VERSION 0.1)
11+
project ( rmm_wrap VERSION 0.1 )
1212

1313
# This build depends upon having RMM cmake installed from https://github.com/rapidsai/rmm.git
1414

15-
set(CMAKE_CXX_STANDARD 17)
16-
set(CMAKE_C_STANDARD 99)
17-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
15+
set ( CMAKE_CXX_STANDARD 17 )
16+
set ( CMAKE_C_STANDARD 99 )
17+
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )
1818

19-
find_package(CUDA REQUIRED)
19+
find_package ( CUDAToolkit REQUIRED )
2020

21-
set(EXTERNAL_INCLUDES_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/external_includes)
21+
set ( EXTERNAL_INCLUDES_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/external_includes )
2222

23-
IF(NOT EXISTS ${EXTERNAL_INCLUDES_DIRECTORY})
24-
file(MAKE_DIRECTORY ${EXTERNAL_INCLUDES_DIRECTORY})
25-
endif()
23+
if ( NOT EXISTS ${EXTERNAL_INCLUDES_DIRECTORY} )
24+
file ( MAKE_DIRECTORY ${EXTERNAL_INCLUDES_DIRECTORY} )
25+
endif ( )
2626

27-
IF(NOT EXISTS ${EXTERNAL_INCLUDES_DIRECTORY}/spdlog)
28-
execute_process(
29-
COMMAND git clone "https://github.com/gabime/spdlog.git" --branch v1.10.0 --recursive spdlog
30-
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/external_includes)
31-
endif()
27+
if ( NOT EXISTS ${EXTERNAL_INCLUDES_DIRECTORY}/spdlog )
28+
execute_process (
29+
COMMAND git clone "https://github.com/gabime/spdlog.git" --branch v1.10.0 --recursive spdlog
30+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/external_includes )
31+
endif ( )
3232

33-
set(SPDLOG_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/external_includes/spdlog/include)
34-
include_directories(${SPDLOG_INCLUDE_DIR})
33+
set ( SPDLOG_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/external_includes/spdlog/include )
34+
include_directories ( ${SPDLOG_INCLUDE_DIR} )
3535

36-
IF(NOT EXISTS ${EXTERNAL_INCLUDES_DIRECTORY}/rmm)
37-
execute_process(
38-
COMMAND git clone "https://github.com/rapidsai/rmm.git" --branch branch-21.10 --recursive rmm
39-
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/external_includes)
36+
if ( NOT EXISTS ${EXTERNAL_INCLUDES_DIRECTORY}/rmm )
37+
execute_process (
38+
COMMAND git clone "https://github.com/rapidsai/rmm.git" --branch branch-21.10 --recursive rmm
39+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/external_includes )
4040
endif()
4141

42-
set(RMM_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/external_includes/rmm/include)
43-
include_directories(${RMM_INCLUDE_DIR})
42+
set ( RMM_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/external_includes/rmm/include )
43+
include_directories ( ${RMM_INCLUDE_DIR} )
4444

45-
add_library(rmm_wrap rmm_wrap.cpp rmm_wrap.hpp rmm_wrap.h)
45+
add_library ( RMM_wrap rmm_wrap.cpp rmm_wrap.hpp rmm_wrap.h )
4646

47-
set_target_properties (rmm_wrap PROPERTIES
48-
VERSION ${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB}
49-
SOVERSION ${GraphBLAS_VERSION_MAJOR}
50-
C_STANDARD 11
51-
C_STANDARD_REQUIRED ON
52-
PUBLIC_HEADER "rmm_wrap.h" )
47+
set_target_properties ( RMM_wrap PROPERTIES
48+
VERSION ${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB}
49+
OUTPUT_NAME rmm_wrap
50+
SOVERSION ${GraphBLAS_VERSION_MAJOR}
51+
PUBLIC_HEADER "rmm_wrap.h"
52+
WINDOWS_EXPORT_ALL_SYMBOLS ON )
5353

54-
add_executable(rmm_wrap_test rmm_wrap_test.c rmm_wrap.cpp rmm_wrap.hpp rmm_wrap.h)
54+
add_executable ( rmm_wrap_test rmm_wrap_test.c rmm_wrap.cpp rmm_wrap.hpp rmm_wrap.h )
5555

56-
set(RMM_WRAP_LIBS ${EXTRA_LIBS} ${CUDA_LIBRARIES})
57-
set(RMM_WRAP_INCLUDES ${PROJECT_BINARY_DIR}
58-
${SPDLOG_INCLUDE_DIR}
59-
${RMM_INCLUDE_DIR}
60-
${CUDA_INCLUDE_DIRS}
61-
${CONDA_PREFIX}/include
62-
${PROJECT_SOURCE_DIR}/include)
56+
set ( RMM_WRAP_LIBS ${EXTRA_LIBS} CUDA::cudart_static )
57+
set ( RMM_WRAP_INCLUDES ${PROJECT_BINARY_DIR}
58+
${SPDLOG_INCLUDE_DIR}
59+
${RMM_INCLUDE_DIR}
60+
${CUDA_INCLUDE_DIRS}
61+
${CONDA_PREFIX}/include
62+
${PROJECT_SOURCE_DIR}/include )
6363

64-
target_link_libraries(rmm_wrap PUBLIC ${RMM_WRAP_LIBS})
65-
target_include_directories(rmm_wrap PUBLIC "${RMM_WRAP_INCLUDES}")
64+
target_link_libraries ( RMM_wrap PRIVATE ${RMM_WRAP_LIBS} )
65+
target_include_directories ( RMM_wrap PRIVATE "${RMM_WRAP_INCLUDES}" )
6666

67-
target_link_libraries(rmm_wrap_test PUBLIC ${RMM_WRAP_LIBS})
68-
target_include_directories(rmm_wrap_test PUBLIC "${RMM_WRAP_INCLUDES}")
67+
target_link_libraries ( rmm_wrap_test PUBLIC ${RMM_WRAP_LIBS} )
68+
target_include_directories ( rmm_wrap_test PUBLIC "${RMM_WRAP_INCLUDES}" )
6969

7070
#-------------------------------------------------------------------------------
7171
# installation location
7272
#-------------------------------------------------------------------------------
7373

74-
install ( TARGETS rmm_wrap
74+
install ( TARGETS RMM_wrap
75+
EXPORT GraphBLASTargets
7576
LIBRARY DESTINATION ${SUITESPARSE_LIBDIR}
7677
ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR}
7778
RUNTIME DESTINATION ${SUITESPARSE_BINDIR}

ParU/Demo/paru_demo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,11 @@ int main(int argc, char **argv)
278278
#endif // calling umfpack
279279

280280
// Writing results to a file
281-
#if 1
281+
#if 0
282282
if (info == PARU_SUCCESS)
283283
{
284284
FILE *res_file;
285-
char res_name[] = "../Demo/Res/res.txt";
285+
char res_name[] = "../build/Res/res.txt";
286286
res_file = fopen(res_name, "a");
287287
if (res_file == NULL)
288288
{

ParU/Demo/paru_democ.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,11 @@ int main(int argc, char **argv)
284284
#endif // calling umfpack
285285

286286
// Writing results to a file
287-
#if 1
287+
#if 0
288288
if (info == PARU_SUCCESS)
289289
{
290290
FILE *res_file;
291-
char res_name[] = "../Demo/Res/res.txt";
291+
char res_name[] = "../build/Res/res.txt";
292292
res_file = fopen(res_name, "a");
293293
if (res_file == NULL)
294294
{

0 commit comments

Comments
 (0)