Skip to content

Commit dc7216b

Browse files
committed
[Code] Remove cmake configured build.hpp file
1 parent b21d55d commit dc7216b

7 files changed

Lines changed: 23 additions & 32 deletions

File tree

CMakeLists.txt

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,13 @@ cmake_minimum_required(VERSION 3.17 FATAL_ERROR)
44
project(CUBOOL LANGUAGES CXX CUDA)
55

66
# Exposed to the user build options
7-
option(CUBOOL_DEBUG "Build library in debug mode" ON)
8-
option(CUBOOL_RELEASE "Build library in release mode" OFF)
97
option(CUBOOL_WITH_CUB "Build project with locally stored CUB library" ON)
108
option(CUBOOL_WITH_NSPARSE "Build library with nsparse crs matrix multiplication backend" ON)
119
option(CUBOOL_WITH_NAIVE "Build library with naive and naive-shared dense matrix multiplication" ON)
1210
option(CUBOOL_BUILD_TESTS "Build project unit-tests with gtest" ON)
1311

14-
# Library version setup
15-
set(CUBOOL_VERSION_MAJOR 0)
16-
set(CUBOOL_VERSION_MINOR 1)
17-
18-
configure_file(
19-
${CMAKE_CURRENT_LIST_DIR}/src/cubool/build.hpp.in
20-
${CMAKE_BINARY_DIR}/src/cubool/build.hpp)
12+
set(CUBOOL_VERSION_MAJOR 1)
13+
set(CUBOOL_VERSION_MINOR 0)
2114

2215
# Configure dependencies
2316
if (CUBOOL_WITH_CUB)
@@ -81,7 +74,9 @@ add_library(cubool SHARED ${CUBOOL_SOURCES})
8174

8275
target_include_directories(cubool PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
8376
target_include_directories(cubool PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src)
84-
target_include_directories(cubool PRIVATE ${CMAKE_BINARY_DIR}/src)
77+
78+
target_compile_definitions(cubool PRIVATE CUBOOL_VERSION_MAJOR=${CUBOOL_VERSION_MAJOR})
79+
target_compile_definitions(cubool PRIVATE CUBOOL_VERSION_MINOR=${CUBOOL_VERSION_MINOR})
8580

8681
target_link_libraries(cubool PRIVATE nsparse_um)
8782
target_compile_features(cubool PUBLIC cxx_std_14)
@@ -106,7 +101,9 @@ add_library(cubool_dummy SHARED ${CUBOOL_DUMMY_SOURCES})
106101

107102
target_include_directories(cubool_dummy PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
108103
target_include_directories(cubool_dummy PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src)
109-
target_include_directories(cubool_dummy PRIVATE ${CMAKE_BINARY_DIR}/src)
104+
105+
target_compile_definitions(cubool_dummy PRIVATE CUBOOL_VERSION_MAJOR=${CUBOOL_VERSION_MAJOR})
106+
target_compile_definitions(cubool_dummy PRIVATE CUBOOL_VERSION_MINOR=${CUBOOL_VERSION_MINOR})
110107

111108
target_compile_features(cubool_dummy PUBLIC cxx_std_11)
112109

@@ -116,4 +113,10 @@ set_target_properties(cubool_dummy PROPERTIES CXX_STANDARD_REQUIRED ON)
116113
# If tests enabled, add tests sources to the build
117114
if (CUBOOL_BUILD_TESTS)
118115
add_subdirectory(tests)
119-
endif()
116+
endif()
117+
118+
# Copy scripts into binary directory
119+
file(COPY scripts DESTINATION ${CMAKE_BINARY_DIR}/)
120+
121+
# Copy python related stuff
122+
file(COPY python DESTINATION ${CMAKE_BINARY_DIR}/)

scripts/tests_run_all.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
# (Maybe exists more elegant method to do this?)
44
./tests/test_basic_cuda
55
./tests/test_library_api
6-
./tests/test_matrix_dense
6+
./tests/test_matrix_dense
7+
./tests/test_matrix_csr

src/cubool-dummy/version.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
#ifndef CUBOOL_VERSION_HPP
2828
#define CUBOOL_VERSION_HPP
2929

30-
#include <cubool/build.hpp>
31-
3230
#define CUBOOL_VERSION ((uint32_t) CUBOOL_VERSION_MAJOR << 4u) | ((uint32_t) CUBOOL_VERSION_MINOR)
3331
#define CUBOOL_VERSION_STRING #CUBOOL_VERSION_MAJOR "." #CUBOOL_VERSION_MINOR
3432

src/cubool/build.hpp.in

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

src/cubool/instance.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
/**********************************************************************************/
2626

2727
#include <cubool/instance.hpp>
28-
#include <cubool/build.hpp>
2928
#include <cubool/details/error.hpp>
3029
#include <string>
3130
#include <cstdlib>

src/cubool/matrix_base.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#define CUBOOL_MATRIX_BASE_HPP
2929

3030
#include <cubool/config.hpp>
31-
#include <cubool/build.hpp>
3231
#include <string>
3332

3433
namespace cubool {

src/cubool/version.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@
2727
#ifndef CUBOOL_VERSION_HPP
2828
#define CUBOOL_VERSION_HPP
2929

30-
#include <cubool/build.hpp>
30+
/** Defined in cmake */
31+
#define CUBOOL_MAJOR CUBOOL_VERSION_MAJOR
3132

33+
/** Defined in cmake */
34+
#define CUBOOL_MINOR CUBOOL_VERSION_MINOR
35+
36+
/** Nice utility */
3237
#define CUBOOL_VERSION ((uint32_t) CUBOOL_VERSION_MAJOR << 4u) | ((uint32_t) CUBOOL_VERSION_MINOR)
3338
#define CUBOOL_VERSION_STRING #CUBOOL_VERSION_MAJOR "." #CUBOOL_VERSION_MINOR
3439

0 commit comments

Comments
 (0)