forked from fblumenthal/buildem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
atlas.cmake
86 lines (73 loc) · 2.93 KB
/
atlas.cmake
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
#
# Install atlas from source
#
#
# Note: The ATLAS build process uses timing tests to determine the best implementation to build for your system.
# These timing tests cannot function properly if CPU throttling is enabled on your machine.
# If the ATLAS build script detects CPU throttling on your machine, it will fail with an error like this:
#
# It appears you have cpu throttling enabled, which makes timings
# unreliable and an ATLAS install nonsensical. Aborting.
#
# If you get this error, you must temporarily disable CPU throttling (or "Turbo Boost") while ATLAS is built.
# You can do this by changing the BIOS to disable SpeedStep / Turbo Boost, which prevents the OS from
# changing CPU frequencies on the fly.
#
# On Fedora, this can be done via the cpupower command:
#
# $ cpupower frequency-info # Check current settings...
# $ sudo cpupower frequency-set -g performance
#
# See cpupower help frequency-set for more info.
#
# cpupower is contained in kernel-tools package for Fedora 17+ and in cpufrequtils for Fedora 16.
if (NOT atlas_NAME)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
include (ExternalProject)
include (ExternalSource)
include (BuildSupport)
include (FortranSupport)
external_source (lapack
3.4.2
lapack-3.4.2.tgz
61bf1a8a4469d4bdb7604f5897179478
http://www.netlib.org/lapack)
message ("Downloading ${lapack_NAME} tarball into FlyEM build area: ${BUILDEM_DIR} ...")
ExternalProject_Add(${lapack_NAME}
PREFIX ${BUILDEM_DIR}
URL ${lapack_URL}
URL_MD5 ${lapack_MD5}
UPDATE_COMMAND ""
PATCH_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
set_target_properties(${lapack_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)
external_source (atlas
3.10.0
atlas3.10.0.tar.bz2
2030aa079b8d040b93de7018eae90e2b
http://downloads.sourceforge.net/project/math-atlas/Stable/3.10.0)
message ("Installing ${atlas_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
ExternalProject_Add(${atlas_NAME}
DEPENDS ${lapack_NAME}
PREFIX ${BUILDEM_DIR}
URL ${atlas_URL}
URL_MD5 ${atlas_MD5}
UPDATE_COMMAND ""
PATCH_COMMAND ""
CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${atlas_SRC_DIR}/configure
-C if ${CMAKE_Fortran_COMPILER}
-F if ${CMAKE_Fortran_FLAGS_RELEASE}
-b 64
--shared
--prefix=${BUILDEM_DIR}
--with-netlib-lapack-tarfile=${lapack_FILE}
BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE)
TEST_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) check
INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install
)
set (ENV{ATLAS} ${BUILDEM_DIR}/lib:${BUILDEM_DIR}/lib/libtatlas.so:${BUILDEM_DIR}/lib/libsatlas.so)
set_target_properties(${atlas_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)
endif (NOT atlas_NAME)