Skip to content

Commit

Permalink
add clang support for Dehnen
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Charles Lambert committed Nov 15, 2020
1 parent 3551ef3 commit 571653b
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ src/nbody/evolve/hackcode/hackcode1/hackforce_qp
src/nbody/evolve/sellwood/code1/galaxy
src/nbody/evolve/sellwood/code1/galaxy.a

# more
install.config.log
install.distclean.log
install.glnemo2.log
install.pgplot.log
local/
nemo-config
nemo_start.py
src/nbody/evolve/sellwood/code1/galaxy13
src/nbody/glnemo/src/.moc/
src/nbody/glnemo/src/Users/
tars
usr/boily/magalie/magalie.exe
usr/dehnen/utils/inc/inc
usr/dehnen/utils/make.sh

# ignore Denhen's directories
usr/dehnen/falcON/acc/
usr/dehnen/falcON/bin/
Expand Down
3 changes: 3 additions & 0 deletions usr/dehnen/falcON/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ endif
# this should be set by a configure file
#

ifeq ($(COMPILER),)
COMPILER := gcc# # GNU compiler g++
endif
#COMPILER := icc# # intel compiler icpc
#COMPILER := clang# # llvm compiler clang++


#
# 3 activate options (some only apply to proprietary and private versions)
#
Expand Down
2 changes: 1 addition & 1 deletion usr/dehnen/falcON/inc/public/tensor_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ namespace falcON {
}
tX sv add(symset3D<ORDER,X>&C, const X*v, D_ARG)
{
symset3D<ORDER,X>&F;
symset3D<ORDER,X>&F();
ass(F,v,ARG_D);
C += F;
}
Expand Down
5 changes: 5 additions & 0 deletions usr/dehnen/falcON/makedefs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ LIMITED_WARNINGS := -Wextra -Winit-self
-include ../utils/make.gcc
endif

# clang compiler
ifeq ($(COMPILER),clang)
-include ../utils/make.clang
endif

# Portland group compiler
ifeq ($(COMPILER),pgi)
-include ../utils/make.pgi
Expand Down
82 changes: 82 additions & 0 deletions usr/dehnen/utils/make.clang
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

0 comments on commit 571653b

Please sign in to comment.