-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathCMakeLists.txt
25 lines (23 loc) · 960 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
cmake_minimum_required(VERSION 2.8.9)
project(FALCON C)
set(BLA_VENDOR Intel10_64lp)
find_package(BLAS REQUIRED)
find_library(MEMKIND_LIB memkind /usr/lib64 DEFAULT_PATH)
if(MEMKIND_LIB)
else(MEMKIND_LIB)
unset(MEMKIND_LIB_FOUND)
message(FATAL_ERROR "Cannot find MEMKIND RUNTIME LIBRARY")
endif (MEMKIND_LIB)
find_package(OpenMP REQUIRED)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -xhost -restrict")
set (CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
endif()
set(FALCON_LIB_SRCS "${CMAKE_SOURCE_DIR}/src/falcon.c")
include_directories("${CMAKE_SOURCE_DIR}/include")
add_library(falcon SHARED ${FALCON_LIB_SRCS})
target_link_libraries(falcon ${BLAS_LIBRARIES} ${MEMKIND_LIB})
set(EXAMPLE_SRCS "${CMAKE_SOURCE_DIR}/example/vgg_winograd.c")
add_executable(vgg_winograd ${EXAMPLE_SRCS})
target_link_libraries(vgg_winograd falcon ${BLAS_LIBRARIES} ${MEMKIND_LIB})