forked from karpathy/llm.c
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
36 lines (29 loc) · 966 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
31
32
33
34
35
36
cmake_minimum_required(VERSION 3.14)
project(llm.cpp LANGUAGES C CXX CUDA)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CUDA_STANDARD 17)
set(BUILD_SHARED_LIBS OFF)
# add_compile_options(-Ofast -march=native)
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Ofast -march=native")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast -march=native")
find_program(CCACHE_PROGRAM ccache)
if (CCACHE_PROGRAM)
set(CMAKE_C_COMPILER_LAUNCHER ccache)
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
set(CMAKE_CUDA_COMPILER_LAUNCHER ccache)
endif ()
enable_testing()
include_directories(.)
# Abseil
set(ABSL_PROPAGATE_CXX_STD ON)
add_subdirectory(third_party/abseil-cpp)
# GoogleTest
add_subdirectory(third_party/googletest)
# Eigen
set(EIGEN3_INCLUDE_DIR third_party/eigen)
add_definitions(-DEIGEN_DONT_PARALLELIZE)
#add_definitions(-DEIGEN_DONT_VECTORIZE)
add_definitions(-DEIGEN_USE_THREADS)
include_directories(${EIGEN3_INCLUDE_DIR})
add_subdirectory(llmc)
add_subdirectory(llmcpp)