-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathArch.mk
More file actions
109 lines (92 loc) · 2.68 KB
/
Arch.mk
File metadata and controls
109 lines (92 loc) · 2.68 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
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
100
101
102
103
104
105
106
107
108
# Baselibs Build System
#
# System/site dependent options.
#
# REVISION HISTORY:
#
# 08Aug2008 da Silva Moved here from GNUmakefile for better CM.
#
#-------------------------------------------------------------------------
#
# ----------------
# Compiler
# ----------------
#
# Intel
# -----
ifneq ($(wildcard $(shell which ifort 2> /dev/null)),)
CPPFLAGS += -DpgiFortran
endif
ifneq ($(wildcard $(shell which ifx 2> /dev/null)),)
CPPFLAGS += -DpgiFortran
endif
# PGI
# ---
ifneq ($(wildcard $(shell which nvfortran 2> /dev/null)),)
CPPFLAGS += -DpgiFortran
PGI_FLAG = -PGI
endif
ifneq ($(wildcard $(shell which pgfortran 2> /dev/null)),)
CPPFLAGS += -DpgiFortran
PGI_FLAG = -PGI
endif
#
# ----------------
# Modules
# ----------------
#
ifneq ($(LMOD_CMD),)
LMODULECMD = $(LMOD_CMD)
else
MODULECMD = $(shell which modulecmd 2> /dev/null)
endif
#
# ----------------
# Python
# ----------------
#
PYTHON := $(dir $(shell which python3))../
#
# ----------------
# Linux
# ----------------
#
ifeq ($(ARCH),Linux)
SITE := $(patsubst discover%,NCCS,$(SITE))
SITE := $(patsubst dali%,NCCS,$(SITE))
SITE := $(patsubst borg%,NCCS,$(SITE))
SITE := $(patsubst pfe%,NAS,$(SITE))
SITE := $(patsubst afe%,NAS,$(SITE))
SITE := $(patsubst athfe%,NAS,$(SITE))
# This detects compute nodes at NAS
ifneq ($(shell uname -n | egrep 'r[0-9]*i[0-9]*n[0-9]*'),)
SITE := NAS
endif
ifneq ($(shell uname -n | egrep 'r[0-9]*c[0-9]*t[0-9]*n[0-9]*'),)
SITE := NAS
endif
ifneq ($(shell uname -n | egrep 'x[0-9]*c[0-9]*s[0-9]*b[0-9]*n[0-9]*'),)
SITE := NAS
endif
CFLAGS := -fPIC
export CFLAGS
# Gentoo and Fedora put tiprc files in a weird place
ifneq (,$(wildcard /usr/include/tirpc/.))
INC_EXTRA += -I/usr/include/tirpc
LIB_EXTRA += -ltirpc
endif
ifeq ($(SITE),NCCS)
ENABLE_GPFS = --enable-gpfs
LINK_GPFS = -lgpfs
# On SLES15 at NCCS we need to link to libtirpc
OS_VERSION := $(shell grep VERSION_ID /etc/os-release | cut -d= -f2 | cut -d. -f1 | sed 's/"//g')
ifeq ($(OS_VERSION),15)
LIB_EXTRA += -ltirpc
endif
endif
ifeq ($(findstring gfortran,$(notdir $(FC))),gfortran)
FFLAGS += -fno-second-underscore
FCFLAGS += -fno-second-underscore
CPPFLAGS += -DgFortran
endif
endif