forked from primme/primme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMake_flags
99 lines (87 loc) · 3.23 KB
/
Make_flags
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
#---------------------------------------------------------------
# ENVIRONMENT VARIABLES AND COMPILATION FLAGS
# for building the library and compiling the tests
#---------------------------------------------------------------
# Define the path to the created PRIMME library
MAJORVERSION := 3
VERSION := 3.2
UNAME ?= $(shell uname)
ifeq ($(UNAME), Darwin)
SLIB ?= dylib
SONAMELIBRARY ?= libprimme.$(VERSION).$(SLIB)
SONAMELIBRARYMAJOR ?= libprimme.$(MAJORVERSION).$(SLIB)
SOFLAGS ?= -dynamiclib -Wl,-install_name,$(SONAMELIBRARY) -current_version $(VERSION) -compatibility_version $(VERSION) -Wl,-undefined -Wl,dynamic_lookup
else
SLIB ?= so
SONAMELIBRARY ?= libprimme.$(SLIB).$(VERSION)
SONAMELIBRARYMAJOR ?= libprimme.$(SLIB).$(MAJORVERSION)
SOFLAGS ?= -shared -Wl,-soname,$(SONAMELIBRARYMAJOR)
endif
LIBRARY = libprimme.a
SOLIBRARY = libprimme.$(SLIB)
# Define compilers and flags
#---------------------------------------------------------------
# POSIX systems (e.g., Linux, MinGW, Cygwin)
#---------------------------------------------------------------
CC ?= cc
F77 := gfortran
FC := gfortran
DEFINES ?= -DF77UNDERSCORE
CFLAGS ?= -O -fPIC -DNDEBUG
FFLAGS ?= -fno-second-underscore -O
PRIMME_WITH_HALF ?= no
ifeq ($(PRIMME_WITH_HALF), yes)
CFLAGS += -DPRIMME_WITH_HALF
endif
PRIMME_WITH_FLOAT ?= yes
ifneq ($(PRIMME_WITH_FLOAT), yes)
CFLAGS += -DPRIMME_WITHOUT_FLOAT
endif
# GPUs compiler flags
#---------------------------------------------------------------
# MAGMADIR = /usr/local/magma-2.5.0
PRIMME_WITH_MAGMA ?= $(if $(findstring undefined,$(origin MAGMADIR)),no,yes)
CUDADIR ?= /usr/local/cuda
ifeq ($(PRIMME_WITH_MAGMA), yes)
override CFLAGS += -I$(MAGMADIR)/include -I$(CUDADIR)/include -DPRIMME_WITH_MAGMA
endif
#---------------------------------------------------------------
# IBM architectures
#CC = xlc
#F77 = xlf
#DEFINES = -DF77UNDERSCORE
#CFLAGS = -O2
#FFLAGS = -O2
#---------------------------------------------------------------
# Mac OS X
#CC = clang
#F77 = gfortran
#DEFINES = -DF77UNDERSCORE
#CFLAGS = -O2
#FFLAGS = -fno-second-underscore -O2
#---------------------------------------------------------------
# Using Intel compilers
#CC = icc
#F77 = ifort
#DEFINES = -DF77UNDERSCORE
#CFLAGS = -O2
#FFLAGS = -O2
#---------------------------------------------------------------
#---------------------------------------------------------------
# Uncomment this when building MATLAB interface (but not for Octave)
# CFLAGS += -DPRIMME_BLASINT_SIZE=64 -fPIC
#---------------------------------------------------------------
#---------------------------------------------------------------
# Creating the library and packages
#---------------------------------------------------------------
RANLIB ?= ranlib
R ?= R
PYTHON ?= $(if $(findstring 1984, $(shell python -c 'print(1984)')), \
python, \
$(if $(findstring 1984, $(shell python2 -c 'print(1984)')),python2,python3))
INSTALL_NAME_TOOL ?= /usr/bin/install_name_tool
#---------------------------------------------------------------
# Installation
#---------------------------------------------------------------
includedir ?= $(DESTDIR)$(PREFIX)/include
libdir ?= $(DESTDIR)$(PREFIX)/lib