-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
108 lines (86 loc) · 3.22 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)
PROJECT(AlphaImpute)
enable_language (Fortran)
FIND_PACKAGE(Doxygen)
OPTION(RUN_TESTS "Run and compile tests"
OFF)
OPTION(USE_HDF5 "Use hdf"
OFF)
# option to have cluster preprocessor
set(CLUSTER 0 CACHE STRING "cluster size")
# add the cluster option specfied above to the preprocessor
add_definitions(-DCLUSTER=${CLUSTER})
# Add our local modlues to the module path
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/alphacmakefiles/cmake/modules")
# for OSX remove RPATH for certain compilers
set(CMAKE_MACOSX_RPATH 0)
# INCLUDE(${CMAKE_MODULE_PATH}/setVersion.cmake)
include(${CMAKE_MODULE_PATH}/GetGitRevisionDescription.cmake)
git_describe(VERSION)
# Define the executable name
SET(ALPHAIMPUTEEXE AlphaImpute)
MESSAGE("Prog name ${ALPHAIMPUTEEXE}")
# Define the library names we require
SET(AHLIB alphahouse)
SET(APLIB alphaphase)
SET(AMLPLIB alphamlp)
SET(AHMMLIB alphahmm)
SET(FERLIB ferdosi)
# Define some directories
SET(SRC ${CMAKE_SOURCE_DIR}/src)
SET(OBJ ${CMAKE_SOURCE_DIR}/objs)
SET(BIN ${CMAKE_SOURCE_DIR}/bin)
SET(TESTS ${CMAKE_SOURCE_DIR}/tests)
SET(SRCALPHAIMPUTE ${SRC}/)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BIN})
INCLUDE(${CMAKE_MODULE_PATH}/findDoxygen.cmake)
# Defined libary source
# Uncomment if it is required that Fortran 90 is supported
IF(NOT CMAKE_Fortran_COMPILER_SUPPORTS_F90)
MESSAGE(FATAL_ERROR "Fortran compiler does not support F90")
ENDIF(NOT CMAKE_Fortran_COMPILER_SUPPORTS_F90)
# Set some options the user may choose
# Uncomment the below if you want the user to choose a parallelization library
OPTION(USE_MPI "Use the MPI library for parallelization" OFF)
OPTION(USE_OPENMP "Use OpenMP for parallelization" ON)
if (${RUN_TESTS})
SET(testDeps ${SRC}/AlphaImputeSpecFileModule.f90
${SRC}/global.f90
)
endif (${RUN_TESTS})
# set(_files "test.pf")
INCLUDE(${CMAKE_MODULE_PATH}/SetParallelizationLibrary.cmake)
INCLUDE(${CMAKE_MODULE_PATH}/findMKL.cmake)
# Setup the LAPACK libraries. This also takes care of peculiarities, such as
# the fact the searching for MKL requires a C compiler, and that the results
# are not stored in the cache.
#INCLUDE(${CMAKE_MODULE_PATH}/SetUpLAPACK.cmake)
if (${USE_HDF5})
INCLUDE(${CMAKE_MODULE_PATH}/findHDF5.cmake)
endif(${USE_HDF5})
# This INCLUDE statement executes code that sets the compile flags for DEBUG,
# RELEASE, and TESTING. You should review this file and make sure the flags
# are to your liking.
INCLUDE(${CMAKE_MODULE_PATH}/SetFortranFlags.cmake)
# define the library locations that we require
SET(SRCAH ./alphahouse/src/)
SET(SRCAP ./alphaphase/src/)
SET(SRCAHMM ./alphahmm/src/)
SET(SRCFER ./ferdosi/src/)
# Have the .mod files placed in the OBJ folder
SET(CMAKE_Fortran_MODULE_DIRECTORY ${OBJ})
# compile the libraries we need
ADD_SUBDIRECTORY(${SRCAH} ${OBJ}/AH)
ADD_SUBDIRECTORY(${SRCAP} ${OBJ}/AP)
ADD_SUBDIRECTORY(${SRCAHMM} ${OBJ}/AHMM)
ADD_SUBDIRECTORY(${SRCFER} ${OBJ}/FER)
# TODO add tests to correct location
ADD_SUBDIRECTORY(${SRCALPHAIMPUTE} ${BIN})
# Add a distclean target to the Makefile
ADD_CUSTOM_TARGET(distclean
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_MODULE_PATH}/distclean.cmake
)
# if we have decided to run tests...
if (${RUN_TESTS})
INCLUDE(${CMAKE_MODULE_PATH}/findPFUnit.cmake)
endif(${RUN_TESTS})