-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
44 lines (39 loc) · 1.25 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.6)
PROJECT(FOSolverS)
ENABLE_LANGUAGE(Fortran C)
# compiler & linker arguments
SET(CMAKE_Fortran_COMPILER mpif90)
SET(CMAKE_Fortran_FLAGS "-Wall -Ofast -march=native -fopenmp")
SET(CMAKE_C_COMPILER mpicc)
SET(CMAKE_C_FLAGS "-Wall -Ofast -march=native -fopenmp -std=c11")
SET(CMAKE_EXE_LINKER_FLAGS "-Wall -Ofast -march=native -fopenmp")
SET(CMAKE_SHARED_LINKER_FLAGS "-Wall -Ofast -march=native -fopenmp")
# module, executable & lib output directories
SET(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/include)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
# include/library directories
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include)
LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lib)
# external packages
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeModules)
# BLAS
FIND_PACKAGE(BLAS)
# LAPACK
FIND_PACKAGE(LAPACK)
# SUNDIALS
FIND_PACKAGE(SUNDIALS)
IF(SUNDIALS_FOUND)
INCLUDE_DIRECTORIES(${SUNDIALS_INCLUDE_DIRS})
ENDIF(SUNDIALS_FOUND)
# umfpack
FIND_PACKAGE(UMFPACK)
# matheval
FIND_PACKAGE(MATHEVAL)
IF(MATHEVAL_FOUND)
INCLUDE_DIRECTORIES(${MATHEVAL_INCLUDE_DIR})
ENDIF(MATHEVAL_FOUND)
# METIS
FIND_PACKAGE(METIS)
# subdirectories
ADD_SUBDIRECTORY(src)