From 77ad1a4898b252bd71a8a671e65ed91774f6268a Mon Sep 17 00:00:00 2001 From: Szilard Pall Date: Tue, 9 Oct 2012 00:54:56 +0200 Subject: [PATCH] force C++ linking of the gpu_utils Commit c0180203d4247d5e6 forced C++ linkage of all main functions. But Carlo Camilloni reported that this can still give linker errors. This should enforce C++ linkage also of libgmx. Change-Id: I9a82637b792d727ea95e1dc6990099b621fc8ef2 --- src/gmxlib/gpu_utils/CMakeLists.txt | 2 +- src/gmxlib/gpu_utils/dummy.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 src/gmxlib/gpu_utils/dummy.cpp diff --git a/src/gmxlib/gpu_utils/CMakeLists.txt b/src/gmxlib/gpu_utils/CMakeLists.txt index 660d98732b..1ad107dfdb 100644 --- a/src/gmxlib/gpu_utils/CMakeLists.txt +++ b/src/gmxlib/gpu_utils/CMakeLists.txt @@ -50,7 +50,7 @@ endif() CUDA_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) set(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE OFF) -file(GLOB GPU_UTILS_SOURCES *.cu) +file(GLOB GPU_UTILS_SOURCES *.cu dummy.cpp) CUDA_ADD_LIBRARY(gpu_utils STATIC ${GPU_UTILS_SOURCES} OPTIONS ${_os_def} RELWITHDEBINFO -g diff --git a/src/gmxlib/gpu_utils/dummy.cpp b/src/gmxlib/gpu_utils/dummy.cpp new file mode 100644 index 0000000000..aa1d4efdf9 --- /dev/null +++ b/src/gmxlib/gpu_utils/dummy.cpp @@ -0,0 +1,3 @@ +/* This source file has the sole purpose to force C++ linking of the gpu_utils + * static archive, otherwise the exception handling code generated inside + * memtestG80 will cause undefined symbols at linking. */ -- 2.22.0