-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
69 lines (59 loc) · 2.03 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
65
66
67
68
69
cmake_minimum_required(VERSION 2.8)
project(scia_retrieval CXX C)
file(GLOB scia_SRC *.cpp *.c)
find_library(OPENBLAS openblas PATHS ${OPENBLAS_LIBS})
if (OPENBLAS)
get_filename_component(ob_PATH ${OPENBLAS} PATH)
message("openblas found at ${OPENBLAS} in ${ob_PATH}.")
set(BLAS openblas)
else ()
message("openblas not found, using blas.")
set(BLAS blas)
endif ()
find_library(SUNPERF sunperf PATHS /opt/SUNWspro/lib/amd64 ${SUNPERF_LIBS})
if (SUNPERF)
get_filename_component(sp_PATH ${SUNPERF} PATH)
message("sunperf found at ${SUNPERF} in ${sp_PATH}.")
set(linalg_LIBS ${BLAS} sunperf)
else ()
message("sunperf not found, using lapack and ${BLAS}.")
set(linalg_LIBS lapack ${BLAS})
endif ()
find_library(NOEM NOEM PATHS ${NOEM_LIBS})
if (NOEM)
get_filename_component(noem_PATH ${NOEM} PATH)
message("NOEM model found at ${NOEM} in ${noem_PATH}.")
add_definitions(-DHAVE_NOEM)
set(noem_LIB NOEM)
else ()
message("NOEM model not found.")
endif ()
link_directories(/usr/lib64
/usr/local/lib/amd64
${noem_PATH} ${ob_PATH} ${sp_PATH})
include(CheckIncludeFileCXX)
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES} ${EIGEN3_INCLUDES}")
check_include_file_cxx("Eigen/Dense" HAVE_EIGEN3)
if (HAVE_EIGEN3)
include_directories(${EIGEN3_INCLUDES})
add_definitions(-DHAVE_EIGEN3)
endif ()
include(FindHDF5)
if (HDF5_FOUND)
include_directories(${HDF5_INCLUDE_DIRS})
link_directories(${HDF5_LIBRARY_DIRS})
add_definitions(-DHAVE_HDF5)
endif ()
include_directories(.)
add_definitions(-O2 -march=native -g -pedantic -Wall -Wextra -Wshadow)
add_definitions(-std=gnu++0x)
add_definitions(-ffast-math -fno-builtin)
add_definitions(-ftree-vectorize -mveclibabi=svml)
#add_definitions(-DDEBUG_NO_MATRICES)
#add_definitions(-DDEBUG_RETRIEVAL_MATRICES)
add_definitions(-fopenmp -D_GLIBCXX_PARALLEL)
#add_definitions(-Wconversion -Wformat)
#add_definitions(-Wfloat-equal)
add_definitions(`${CMAKE_CURRENT_SOURCE_DIR}/git_version_flags.sh`)
add_executable(scia_retrieval ${scia_SRC})
target_link_libraries(scia_retrieval ${linalg_LIBS} ${noem_LIB} netcdf z gomp)