Revision d95c58ec284cb44656e63eead6d481ce3018e3a4 authored by soumith on 05 June 2016, 23:32:22 UTC, committed by soumith on 05 June 2016, 23:32:22 UTC
1 parent e4e0a8c
CMakeLists.txt
CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
CMAKE_POLICY(VERSION 2.8)
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
FIND_PACKAGE(Torch REQUIRED)
FIND_PACKAGE(CUDA 6.5 REQUIRED)
# Detect CUDA architecture and get best NVCC flags
IF(COMMAND CUDA_SELECT_NVCC_ARCH_FLAGS)
# New CMake function, comes with FindCUDA
CUDA_SELECT_NVCC_ARCH_FLAGS(NVCC_FLAGS_EXTRA $ENV{TORCH_CUDA_ARCH_LIST})
ELSE()
# Old way of getting the flags, with extra include file
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindCudaArch.cmake)
SELECT_NVCC_ARCH_FLAGS(NVCC_FLAGS_EXTRA)
ENDIF()
LIST(APPEND CUDA_NVCC_FLAGS ${NVCC_FLAGS_EXTRA})
INCLUDE_DIRECTORIES("${Torch_INSTALL_INCLUDE}/THC")
LINK_DIRECTORIES("${Torch_INSTALL_LIB}")
FILE(STRINGS lib/THCUNN/THCUNN.h THCUNN_headers NEWLINE_CONSUME)
FILE(WRITE THCUNN_h.lua "return [[")
FILE(APPEND THCUNN_h.lua ${THCUNN_headers})
FILE(APPEND THCUNN_h.lua "]]")
FILE(GLOB luasrc *.lua)
ADD_SUBDIRECTORY(lib)
INSTALL(
FILES
${luasrc}
DESTINATION "${Torch_INSTALL_LUA_PATH_SUBDIR}/cunn")
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...