-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
52 lines (42 loc) · 2.38 KB
/
Copy pathCMakeLists.txt
File metadata and controls
52 lines (42 loc) · 2.38 KB
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
cmake_minimum_required(VERSION 2.8)
include_directories(algo_wrapper/)
project(sparse-auc C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_FLAGS "-Wall -Wextra")
set(CMAKE_C_FLAGS_DEBUG "-g")
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -O3 -fPIC -lpython2.7 -pthread")
set(ROOT /network/rit/lab/ceashpc/bz383376/opt/)
set(NUMPY env-python2.7.14/lib/python2.7/site-packages/numpy/core/include/)
set(OPENBLAS_INCLUDE_DIR "${ROOT}openblas-0.3.1/include")
set(OPENBLAS_INCLUDE "${ROOT}openblas-0.3.1/include")
set(OPENBLAS_LIB "${ROOT}openblas-0.3.1/lib/")
set(NUMPY_INCLUDE "/network/rit/lab/ceashpc/bz383376/opt/${NUMPY}")
set(PYTHON_LIBRARY "${ROOT}python-2.7.14/lib/libpython2.7.so")
set(PYTHON_INCLUDE "${ROOT}python-2.7.14/include/python2.7/")
set(LOSS algo_wrapper/loss.c algo_wrapper/loss.h)
include_directories(${OPENBLAS_INCLUDE_DIR})
find_package(PythonLibs 2.7 REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
add_executable(test_loss algo_wrapper/loss_test.c ${LOSS})
target_link_libraries(test_loss python2.7 -std=c11 -Wall -O3
-I${OPENBLAS_INCLUDE} -L${OPENBLAS_LIB} -lm -lpython2.7 -lopenblas -lpthread)
add_executable(test_l1ballproj algo_wrapper/condat_l1ballproj.c)
target_link_libraries(test_l1ballproj -Wall -O3 -lm)
add_executable(test_kth_selection algo_wrapper/test_kth_selection.c
algo_wrapper/kth_selection.c algo_wrapper/kth_selection.h)
target_link_libraries(test_kth_selection -Wall -O3 -lm)
add_executable(test_case algo_wrapper/test_case.c)
target_link_libraries(test_case -Wall -O3 -lm)
add_executable(sparse_wrapper algo_wrapper/main_wrapper.c
algo_wrapper/auc_opt_methods.h algo_wrapper/auc_opt_methods.c
algo_wrapper/fast_pcst.c algo_wrapper/fast_pcst.h algo_wrapper/loss.c algo_wrapper/loss.h)
target_link_libraries(sparse_wrapper python2.7 -std=c11 -Wall -Wextra -O3
-I${OPENBLAS_INCLUDE} -I${NUMPY_INCLUDE} -I${PYTHON_INCLUDE} -L${OPENBLAS_LIB}
-lm -lpython2.7 -lopenblas -lpthread)
add_library(sparse_module SHARED algo_wrapper/main_wrapper.c
algo_wrapper/auc_opt_methods.h algo_wrapper/auc_opt_methods.c
algo_wrapper/fast_pcst.c algo_wrapper/fast_pcst.h algo_wrapper/loss.c algo_wrapper/loss.h)
target_link_libraries(sparse_module python2.7 -std=c11 -Wall -Wextra -O3
-I${OPENBLAS_INCLUDE} -I${NUMPY_INCLUDE} -I${PYTHON_INCLUDE} -L${OPENBLAS_LIB}
-lm -lpython2.7 -lopenblas -lpthread)