aboutsummaryrefslogtreecommitdiff
path: root/reproduce/software/make/atlas-single.mk
blob: 61ae9a1e9a514453cf8c685d89f26b5dc7ae5f3d (plain)
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
# Rules to build ATLAS shared libraries for single threads on GNU/Linux
#
# ------------------------------------------------------------------------
#                      !!!!! IMPORTANT NOTES !!!!!
#
# This Makefile will be run during the initial `./project configure'
# script. It is not included into the reproduction pipe after that.
#
# ------------------------------------------------------------------------
#
# Copyright (C) 2019-2020 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
# This Makefile is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This Makefile is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
# Public License for more details.
#
# A copy of the GNU General Public License is available at
# <http://www.gnu.org/licenses/>.

ORIGLDFLAGS := $(LDFLAGS)

include Make.inc

all: libatlas.so libf77blas.so libcblas.so libblas.so liblapack.so.3.6.1

libatlas.so: libatlas.a
	ld $(ORIGLDFLAGS) $(LDFLAGS) -shared -soname $@ -o $@ \
	   --whole-archive libatlas.a --no-whole-archive -lc $(LIBS)

libf77blas.so : libf77blas.a libatlas.so
	ld $(ORIGLDFLAGS) $(LDFLAGS) -shared -soname libblas.so.3 \
	   -o $@ --whole-archive libf77blas.a --no-whole-archive \
	   $(F77SYSLIB) -L. -latlas

libcblas.so : libcblas.a libatlas.so libblas.so
	ld $(ORIGLDFLAGS) $(LDFLAGS) -shared -soname $@ -o $@ \
	    --whole-archive libcblas.a -L. -latlas -lblas

libblas.so: libf77blas.so
	ln -s $< $@

liblapack.so.3.6.1 : liblapack.a libcblas.so libblas.so
	ld $(ORIGLDFLAGS) $(LDFLAGS) -shared -soname liblapack.so.3 \
	   -o $@ --whole-archive liblapack.a --no-whole-archive \
	   $(F77SYSLIB) -L. -lcblas -lblas

liblapack.so.3: liblapack.so.3.6.1
	ln -s $< $@