force C++ linking of the gpu_utils
authorSzilard Pall <pszilard@cbr.su.se>
Mon, 8 Oct 2012 22:54:56 +0000 (00:54 +0200)
committerRoland Schulz <roland@utk.edu>
Fri, 30 Nov 2012 12:07:33 +0000 (07:07 -0500)
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
src/gmxlib/gpu_utils/dummy.cpp [new file with mode: 0644]

index 660d98732bbe88729c052a1a45c4d8138c343672..1ad107dfdbe9c174926f5bc66ed9325b8999b468 100644 (file)
@@ -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 (file)
index 0000000..aa1d4ef
--- /dev/null
@@ -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. */