Skip to content

Commit

Permalink
Merge pull request rapidsai#48 from ChuckHastings/bug_googletest_abi_…
Browse files Browse the repository at this point in the history
…build_issue

[REVIEW] [BUG] ABI fixes
  • Loading branch information
afender authored Feb 4, 2019
2 parents 2992ac2 + 5999e47 commit 36aa07e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
22 changes: 11 additions & 11 deletions cmake/Modules/ConfigureGoogleTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
#=============================================================================
# Download and unpack googletest at configure time

#set(GTEST_CMAKE_ARGS " -Dgtest_build_samples=ON"
# " -DCMAKE_VERBOSE_MAKEFILE=ON")
set(GTEST_CMAKE_ARGS " -Dgtest_build_samples=ON"
" -DCMAKE_VERBOSE_MAKEFILE=ON")

#if(NOT CMAKE_CXX11_ABI)
# message(STATUS "GTEST: Disabling the GLIBCXX11 ABI")
# list(APPEND GTEST_CMAKE_ARGS " -DCMAKE_C_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0")
# list(APPEND GTEST_CMAKE_ARGS " -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0")
#elseif(CMAKE_CXX11_ABI)
# message(STATUS "GTEST: Enabling the GLIBCXX11 ABI")
# list(APPEND GTEST_CMAKE_ARGS " -DCMAKE_C_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=1")
# list(APPEND GTEST_CMAKE_ARGS " -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=1")
#endif(NOT CMAKE_CXX11_ABI)
if(NOT CMAKE_CXX11_ABI)
message(STATUS "GTEST: Disabling the GLIBCXX11 ABI")
list(APPEND GTEST_CMAKE_ARGS " -DCMAKE_C_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0")
list(APPEND GTEST_CMAKE_ARGS " -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0")
elseif(CMAKE_CXX11_ABI)
message(STATUS "GTEST: Enabling the GLIBCXX11 ABI")
list(APPEND GTEST_CMAKE_ARGS " -DCMAKE_C_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=1")
list(APPEND GTEST_CMAKE_ARGS " -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=1")
endif(NOT CMAKE_CXX11_ABI)

configure_file(${CMAKE_SOURCE_DIR}/cmake/Templates/GoogleTest.CMakeLists.txt.cmake ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/thirdparty/googletest-download/CMakeLists.txt)

Expand Down
2 changes: 1 addition & 1 deletion cmake/Templates/GoogleTest.CMakeLists.txt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ ExternalProject_Add(googletest
SOURCE_DIR "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/thirdparty/googletest-src"
BINARY_DIR "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/thirdparty/googletest-build"
INSTALL_DIR "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/thirdparty/googletest-install"
CMAKE_ARGS -Dgtest_build_samples=ON -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/thirdparty/googletest-install
CMAKE_ARGS ${GTEST_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/thirdparty/googletest-install
)
10 changes: 10 additions & 0 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ project(CUGRAPH_TESTS LANGUAGES C CXX CUDA)

set(CMAKE_CUDA_FLAGS "-shared -cudart shared")

if(CMAKE_CXX11_ABI)
message(STATUS "cuGraph test: Enabling the GLIBCXX11 ABI")
else()
message(STATUS "cuGraph test: Disabling the GLIBCXX11 ABI")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler -D_GLIBCXX_USE_CXX11_ABI=0")
endif(CMAKE_CXX11_ABI)


###################################################################################################
# - add nvgraph -----------------------------------------------------------------------------------
#if(NOT TARGET NVGRAPH AND NVG_PLUGIN)
Expand Down
5 changes: 3 additions & 2 deletions src/tests/grmat/grmat_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class Tests_Grmat : public ::testing::TestWithParam<Grmat_Usecase> {
int rmat_scale = 0, edge_factor = 0, undirected = false;
char* argv[32] = {0};
int argc = 0;
std::string tmp_argv = param.argv;
std::string tmp_argv(param.argv.c_str());
get_array_of_strings (argv, (char *)tmp_argv.c_str(), argc);
rmat_scale = atoi(strrchr(argv[1], '=')+1);
edge_factor = atoi(strrchr(argv[2], '=')+1);
Expand Down Expand Up @@ -171,7 +171,8 @@ class Tests_Grmat : public ::testing::TestWithParam<Grmat_Usecase> {
int rmat_scale = 0, edge_factor = 0, undirected = false;;
char* argv[32] = {0};
int argc = 0;
std::string tmp_argv = param.argv;
std::string tmp_argv(param.argv.c_str());

get_array_of_strings (argv, (char *)tmp_argv.c_str(), argc);

rmat_scale = atoi(strrchr(argv[1], '=')+1);
Expand Down

0 comments on commit 36aa07e

Please sign in to comment.