forked from teuben/nemo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jean-Charles Lambert
committed
Nov 15, 2020
1 parent
3551ef3
commit 571653b
Showing
5 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# -*- makefile -*- | ||
# | ||
# sets library sub-directory and flags for clang compiler | ||
# to be included by makefile | ||
# | ||
-include make.sh | ||
|
||
EXT := .clang | ||
CXX := clang++ | ||
CC := clang | ||
FC := gfortran | ||
|
||
PLATFORM := $(shell uname -m) | ||
# | ||
# Detect GCC version | ||
# | ||
empty:= | ||
space:= $(empty) $(empty) | ||
|
||
# detect OSTYPE (Linux or Darwin) | ||
OSTYPE := $(shell uname) | ||
ostype: | ||
@echo "OSTYPE = " $(OSTYPE) | ||
# set following variable to 1 if gcc > 700 | ||
API_GCC_7 := $(shell expr `echo $(GCCVERSION)` \>= 700) | ||
|
||
STDAPI=-std=c++03 | ||
|
||
# warning flags | ||
ifdef LIMITED_WARNINGS | ||
WARNING := $(LIMITED_WARNINGS) -Wshadow -Wno-format-security | ||
else | ||
WARNING := -Wextra -Winit-self -Wshadow -Wno-format-security | ||
endif | ||
ifndef TBBROOT | ||
ifdef WDutilsDevel | ||
WARNING += -Wold-style-cast | ||
endif | ||
endif | ||
#WARNING += -Wno-unknown-pragmas | ||
|
||
# it seem that coverage (to be combined with gcov) does not work for openmp) | ||
#ifdef WDutilsDevel | ||
#PROFLAGS := --coverage -fprofile-use -Wcoverage-mismatch | ||
#endif | ||
# general optimisation and warning flags | ||
OPTFLAGS := -mfpmath=sse \ | ||
$(WARNING) -O2 -fPIC \ | ||
-funroll-loops -fforce-addr $(PROFLAGS) $(RDYNAMIC) | ||
|
||
ifeq ($(NO_ARCH_NATIVE),1) | ||
ARCH_NATIVE = | ||
else | ||
ARCH_NATIVE = -march=native | ||
endif | ||
|
||
ifneq ($(OSTYPE),Darwin) | ||
OPTFLAGS += -rdynamic $(ARCH_NATIVE) | ||
endif | ||
|
||
# these are actually to be set | ||
CFLAGS := $(OPTFLAGS) | ||
|
||
WARNING += -Woverloaded-virtual | ||
OPTFLAGS += -Woverloaded-virtual | ||
|
||
ifdef CXX11 | ||
CXXFLAGS := -std=c++11 $(OPTFLAGS) | ||
else | ||
CXXFLAGS := $(STDAPI) $(OPTFLAGS) | ||
endif | ||
|
||
ifdef OPENMP | ||
CXXFLAGS += -fopenmp | ||
CFLAGS += -fopenmp | ||
LDFLAGS := -shared -fopenmp $(PROFLAGS) | ||
else | ||
LDFLAGS := -shared $(PROFLAGS) | ||
endif | ||
|
||
# end | ||
|