Skip to content

Commit

Permalink
Remove hard-coded cuda paths from CMakeLists and move source files to…
Browse files Browse the repository at this point in the history
… source directory.
  • Loading branch information
alexlee-gk committed Nov 12, 2014
1 parent 4ddc1b8 commit 7f5fea7
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 53 deletions.
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 2.8)
project(lfd)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")

# http://cmake.3232098.n2.nabble.com/Default-value-for-CMAKE-BUILD-TYPE-td7550756.html
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif()

set(CMAKE_CXX_FLAGS "-fPIC")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(BUILD_SHARED_LIBS true)

# external libraries
find_package(CUDA REQUIRED)
find_package(Boost COMPONENTS python REQUIRED)

include("${CMAKE_SOURCE_DIR}/cmake/boost-python.cmake")

add_subdirectory(src)
2 changes: 1 addition & 1 deletion lfd/tpsopt/boost-python.cmake → cmake/boost-python.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function(boost_python_module NAME)
find_package(PythonLibs 2 REQUIRED)
find_package(Boost COMPONENTS python REQUIRED)
find_package(PythonLibs REQUIRED)
find_package(Numpy)


Expand Down
File renamed without changes.
50 changes: 0 additions & 50 deletions lfd/tpsopt/CMakeLists.txt

This file was deleted.

2 changes: 0 additions & 2 deletions lfd/tpsopt/determineNumpyPath.py

This file was deleted.

5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include_directories(
${CMAKE_SOURCE_DIR}/src
)

add_subdirectory(tpsopt)
9 changes: 9 additions & 0 deletions src/tpsopt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Append current NVCC flags by something, eg comput capability
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --gpu-architecture sm_20)

## template for cuda -> boost python
cuda_add_library(tps SHARED tps.cu)
target_link_libraries(tps ${CUDA_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES})

boost_python_module(cuda_funcs cuda_funcs.cpp)
target_link_libraries(cuda_funcs tps)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7f5fea7

Please sign in to comment.