-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile_lapack
More file actions
56 lines (47 loc) · 1.97 KB
/
Copy pathMakefile_lapack
File metadata and controls
56 lines (47 loc) · 1.97 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
53
54
55
56
SHELL=/bin/bash
ifndef LAPACK_VERSION
LAPACK_VERSION=3.6.0
endif
TARFILE=lapack-$(LAPACK_VERSION).tgz
PWD := $(shell pwd)
export LAPACKROOT=$(PWD)/lapack-$(LAPACK_VERSION)
MAJOR = $(shell echo $(LAPACK_VERSION) | awk -F. '{print $$1}')
MINOR = $(shell echo $(LAPACK_VERSION) | awk -F. '{print $$2}')
VERSION_CUT = $(shell if [[ "$(MAJOR)" -eq "3" && "$(MINOR)" -ge "9" ]] || [[ "$(MAJOR)" -gt "3" ]]; then echo ge_three_nine; else echo lt_three_nine; fi)
PYTHON2_EXISTS = $(shell if [ -f /usr/bin/python2 ]; then echo true; else echo false; fi)
all: fix_patch_target_rename $(LAPACKROOT)/.make_done
# This step is to fix legacy builds from before the misguided renaming
# of the target ".edit_makefile_done" to ".patch_done". If
# ".edit_makefile_done" is found rename it to ".patch_done".
fix_patch_target_rename:
cd $(LAPACKROOT) ; \
if [ -f .edit_makefile_done ] ; \
then mv -v .edit_makefile_done .patch_done ; \
fi
$(LAPACKROOT)/.make_done: $(LAPACKROOT)/make.inc $(LAPACKROOT)/.patch_done
$(MAKE) -C$(LAPACKROOT) $(LAPACK_MAKE_OPTIONS)
date > $@
$(LAPACKROOT)/.patch_done: $(LAPACKROOT)/make.inc
ifeq ($(VERSION_CUT), lt_three_nine)
cd $(LAPACKROOT); patch < $(BUILD_SCRIPTS)/patches/lapack/Makefile.patch
cd $(LAPACKROOT)/TESTING; patch Makefile < $(BUILD_SCRIPTS)/patches/lapack/Makefile_TESTING.patch
else
cd $(LAPACKROOT)/TESTING; patch Makefile < $(BUILD_SCRIPTS)/patches/lapack/Makefile_TESTING_3.9.0.patch
endif
ifeq ($(PYTHON2_EXISTS), true)
cd $(LAPACKROOT); patch lapack_testing.py < $(BUILD_SCRIPTS)/patches/lapack/lapack_testing.py.patch
endif
date > $@
$(LAPACKROOT)/make.inc: $(LAPACKROOT)/make.inc.example
cp -v $< $@
$(LAPACKROOT)/make.inc.example: $(LAPACKROOT)/.untar_done
$(LAPACKROOT)/.untar_done: $(TARFILE)
tar zxf $(TARFILE)
date > $@
$(TARFILE):
wget --no-check-certificate --no-verbose http://www.netlib.org/lapack/$(TARFILE)
show_env:
@echo MAJOR = $(MAJOR)
@echo MINOR = $(MINOR)
@echo VERSION_CUT = $(VERSION_CUT)
@echo PYTHON2_EXISTS = $(PYTHON2_EXISTS)