forked from se-hwan/cusadi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
30 lines (24 loc) · 840 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
cmake_minimum_required(VERSION 3.15)
project(CusADi)
# Find CUDA package
include(CheckLanguage)
check_language(CUDA)
find_package(CUDAToolkit REQUIRED)
if(CMAKE_CUDA_COMPILER)
enable_language(CUDA)
include_directories(${CUDA_INCLUDE_DIRS})
message("CUDA found")
endif()
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES 75 86)
endif()
message(${CMAKE_CUDA_ARCHITECTURES})
# Set C++ standard
set(CMAKE_CXX_STANDARD 11)
# Set CUDA flags
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}; -O3 -arch=sm_86 --use_fast_math) # Adjust architecture as needed
set(INERTIAL_QUANTITIES_SOURCE codegen/inertial_quantities.cu)
# Include directories for your header files
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_library(inertial_quantities SHARED ${INERTIAL_QUANTITIES_SOURCE})
target_link_libraries(inertial_quantities)