forked from cjlin1/liblinear
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (49 loc) · 2.04 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
project("liblinear")
cmake_minimum_required(VERSION 2.8)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
find_package(PkgConfig REQUIRED)
SET( LINKING_MODE SHARED)
#SET( LINKING_MODE STATIC)
MESSAGE("Linking mode: ${LINKING_MODE}")
#add_definitions(
# -std=c++11
#)
SET( CMAKE_CXX_FLAGS_RELEASE " -fPIC -Ofast -ffast-math -funroll-all-loops -fpeel-loops -ftracer -funswitch-loops -funit-at-a-time" CACHE STRING "" FORCE)
SET( CMAKE_CXX_FLAGS_DEBUG "${GOP_WARNING_FLAGS} -fPIC -g3 -O0" CACHE STRING "" FORCE )
SET( CMAKE_C_FLAGS_RELEASE " -fPIC -Ofast -ffast-math -funroll-all-loops -fpeel-loops -ftracer -funswitch-loops -funit-at-a-time" CACHE STRING "" FORCE)
SET( CMAKE_C_FLAGS_DEBUG "${GOP_WARNING_FLAGS} -fPIC -g3 -O0" CACHE STRING "" FORCE )
find_package(OpenMP)
if (OPENMP_FOUND)
MESSAGE("USING OPENMP")
add_definitions(-DENABLED_OPENMP)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
FIND_PACKAGE(Boost REQUIRED)
FIND_PACKAGE(Boost COMPONENTS regex REQUIRED)
FIND_PACKAGE(Boost COMPONENTS program_options REQUIRED)
FIND_PACKAGE(Boost COMPONENTS filesystem REQUIRED)
#FIND_PACKAGE(Boost COMPONENTS gil REQUIRED)
#FIND_PACKAGE(Boost COMPONENTS thread REQUIRED)
FIND_PACKAGE(Boost COMPONENTS system REQUIRED)
#FIND_PACKAGE(Boost COMPONENTS iostreams REQUIRED)
include_directories(
"${Boost_INCLUDE_DIRS}"
)
link_directories(
"/opt/local/lib"
"/usr/local/lib"
)
# defining linear library name and include path
SET(LINEAR_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/linear)
SET(LINEAR_LIBRARIES linear)
INCLUDE_DIRECTORIES(${LINEAR_INCLUDE_PATH})
# defining linear library name and include path
SET(BLAS_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/blas)
SET(BLAS_LIBRARIES blas)
INCLUDE_DIRECTORIES(${BLAS_INCLUDE_PATH})
# add lib subdirecory with libraries
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib)
# add apps subdirecories with applications
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/apps/train)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/apps/predict)