forked from CRAVA/crava
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makeheader
76 lines (64 loc) · 2.4 KB
/
Makeheader
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
#
# The available CRAVA compiler directives are
# -DBIGENDIAN (needed for IRIX, SUNOS, etc...)
#
CDIR = -DFLENS_FIRST_INDEX=0
CXX = g++
CC = gcc
GCCNEW = $(shell expr `gcc -dumpversion | sed s/\\.//` \>= 46)
GCCWARNING := -Wall -pedantic -Wno-long-long -Werror
#
# The directive -fno-strict-aliasing has been included to avoid a following compilator error:
# segy/traceheader.cpp: In member function ‘int NRLib::TraceHeader::GetInt32(int) const’:
# segy/traceheader.cpp:519: error: dereferencing type-punned pointer will break strict-aliasing rules
#
GXXWARNING = -Wall -pedantic -Woverloaded-virtual -Wno-long-long -Wold-style-cast -Werror -fno-strict-aliasing
PROGRAM = cravarun
GRAMMAR = grammar
OPT = -O2
DEBUG =
PURIFY =
#Marit/Alf: Dette virker ikke under Ubuntu
#Da må vi prøve å fikse det for ubuntu med statisk linking. Tester denne på ubuntu når jeg får tid.
ATLASLFLAGS = -L/lib64 -lgfortran -lpthread -Wl,/usr/lib64/atlas/liblapack.a,/usr/lib64/libblas.a,/usr/lib64/atlas/libcblas.a,/usr/lib64/atlas/libatlas.a
# Dynamic linking of all libraries, does not work on standard RHEL5 due to missing cblas and atlas
#ATLASLFLAGS = -L/usr/lib64/atlas -L/usr/lib64/atlas/atlas -L/lib64 -llapack -lblas -lcblas -latlas -lgfortran -lpthread
mode = all
ifeq ($(GCCNEW),1)
GXXWARNING += -Wno-unused-but-set-variable
endif
ifeq ($(mode),debug)
# Don't use -O2 (makes it impossible to set breakpoints)
DEBUG = -g
OPT = -O0
endif
ifeq ($(mode),profile)
# Don't use -ggdb here
DEBUG = -g
PROFILE = -pg
endif
ifeq ($(mode),purify)
# Don't use -ggdb here
DEBUG = -g
OPT = -O0
PROGRAM = cravarun.purify
PURIFY = purify -best-effort
endif
ifeq ($(lib),mkl)
ATLASLFLAGS =
MKLINCLUDE := /nr/prog/intel/Compiler/mkl/include
MKLPATH := /nr/prog/intel/Compiler/mkl/lib/intel64
MKLLFLAGS := -L$(MKLPATH) -I$(MKLINCLUDE) -Wl,--start-group $(MKLPATH)/libmkl_intel_lp64.a \
$(MKLPATH)/libmkl_sequential.a $(MKLPATH)/libmkl_core.a -Wl,--end-group \
-lpthread -ldl
endif
OPT := $(strip $(OPT))
PROFILE := $(strip $(PROFILE))
DEBUG := $(strip $(DEBUG))
CDIR := $(strip $(CDIR))
PURIFY := $(strip $(PURIFY))
EXTRAFLAGS = $(strip $(OPT) $(PROFILE) $(DEBUG) $(CDIR))
CFLAGS = $(GCCWARNING)
CXXFLAGS = $(GXXWARNING)
CPPFLAGS = $(EXTRAFLAGS)
LFLAGS = $(EXTRALFLAGS) $(PROFILE) $(ATLASLFLAGS)$(MKLLFLAGS) $(DEBUG) -lm