Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/cunn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2017-07-14 23:27:20 +0300
committerSoumith Chintala <soumith@gmail.com>2017-07-19 18:23:21 +0300
commita4381e1e4b2e07bfc5ecb73feab345ed8394fc04 (patch)
treec03432e016ce71dcf1fa57a9b47dacc662ffb294
parent27d79db5ac8f9fa3995ac43f876e4eb146d99913 (diff)
Static linking against libstdc++ in Binary Build mode
-rw-r--r--lib/THCUNN/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/THCUNN/CMakeLists.txt b/lib/THCUNN/CMakeLists.txt
index d4777bf..6047d97 100644
--- a/lib/THCUNN/CMakeLists.txt
+++ b/lib/THCUNN/CMakeLists.txt
@@ -29,6 +29,11 @@ IF(NOT CUDA_FOUND)
FIND_PACKAGE(CUDA 6.5 REQUIRED)
ENDIF()
+IF ($ENV{TH_BINARY_BUILD})
+ MESSAGE(STATUS "TH_BINARY_BUILD detected. Statically linking libstdc++")
+ SET(CMAKE_CXX_FLAGS "-static-libstdc++ ${CMAKE_CXX_FLAGS}")
+ENDIF()
+
# Detect CUDA architecture and get best NVCC flags
IF(NOT COMMAND CUDA_SELECT_NVCC_ARCH_FLAGS OR MSVC)
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/select_compute_arch.cmake)