Commit 51f1391f authored by Jean-Eric Campagne's avatar Jean-Eric Campagne
Browse files

(JEC) 13/4/15 modification to accept Linux-g++

parent fa88fe90
GCCDIR = /opt/rh/devtoolset-3/root/usr/bin/
# Flag preprocesseur
CPPFLAGS = -DLinux
# Def compilateur C et flags
CC = $(GCCDIR)gcc
# Replace [CNFPHFLF] by specific compilation flags below (done by configure)
CFLAGS = -Wall -Wpointer-arith -Wmissing-prototypes -O -g -fPIC
# Def compilateur C++ et flags
CXX = $(GCCDIR)g++
# Flag de warning -Wsynth NON inclus par defaut (04/2007)
###CXXFLAGS = -Wall -Wpointer-arith -O -g -fPIC CNFPHFLF
CXXFLAGS = -Wall -Wpointer-arith -O3 -g -fPIC -fopenmp -fno-common
# flags specifiques pour templates repository...
CXXTEMPFLG =
# Compilo fortran
#FC = g77
FC = $(GCCDIR)gfortran
FFLAGS =
# Pour fabriquer les lib .a
AR = ar
ARFLAGS = -rcs
# Ordres de compilation
CCOMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) -c
CXXCOMPILE = $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c
FCCOMPILE = $(FC) $(FFLAGS) -c
# Extension de nom pour les librairies partagees
SLEXT = so
# Fabrication de librairies partagees
CMDSHLCXX = $(CXX) $(CXXFLAGS) $(CXXTEMPFLG) -shared
# Liste de librairie de base, necessaire pour libsophya
#SOPBASELIBS = -lstdc++ -lpthread -lm -lc -ldl
#LIBFORT = -lg2c
LIBFORT = -lgfortran
# Commande de link pour creation dexecutables
CXXLINK = $(CXX) $(CXXFLAGS)
CLINK = $(CC) $(CFLAGS)
FCLINK = $(FC) $(FFLAGS)
# Commande de link pour creation de module pouvant etre charge dynamiquement
CXXDLL = $(CXX) $(CXXFLAGS) -shared
include Linux_g++_make.inc
# ===== Libsharp =====
SHARPDIR = /Users/campagne/Travail/kits/libsharp-code/auto/
SHARPDIR = /exp/opera/kits/libsharp-code/auto/
SHARPLIB = $(SHARPDIR)/lib
SHARPINC = $(SHARPDIR)/include
SHARPLIBN = -lsharp -lc_utils -lfftpack
......@@ -12,10 +12,21 @@ EXE = ./Objs/
# Define our target list
.PHONY: default
default: lagsht_testsuite
default: makedir lagsht_testsuite
.PHONY: all
all : lagsht_testsuite
all : makedir lagsht_testsuite
.PHONY: check
check : makedir lagsht_testsuite
$(OBJ)lagsht_testsuite -t 1 -n 1024
@paste lagWeights-1024-Func.txt lagWeights-1024-Func.txt.TEST | awk '{x=($$1-$$2)/$$2;y=(x<0?-x:x);if(max==""){max=y};if(y>max){max=y};sum+=(x<0?-x:x)} END {print "Weight Test: Max Err. ",max,"Abs. Relativ. Err =",sum/NR}'
@paste lagNodes-1024-Func.txt lagNodes-1024-Func.txt.TEST | awk '{x=($$1-$$2)/$$2;y=(x<0?-x:x);if(max==""){max=y};if(y>max){max=y};sum+=(x<0?-x:x)} END {print "Nodes Test: Max Err. ",max,"Abs. Relativ. Err =",sum/NR}'
.PHONY: makedir
makedir :
mkdir -p $(OBJ)
.PHONY: tidy
tidy :
......@@ -23,7 +34,7 @@ tidy :
.PHONY: clean
clean :
rm -f ./Objs/*
rm -f $(OBJ)/*
#C++ common Objects
CXXOBJ = $(OBJ)laguerreBuilder.o \
......@@ -42,22 +53,21 @@ CXXHDR = lagsht_exceptions.h \
walltimer.h
CXX = g++
CPPFLAGS = -DDarwin
CXXFLAGS = -Wa,-q -march=native -fno-common -O3 -fopenmp
#CXX = g++
#CPPFLAGS = -DDarwin
#CXXFLAGS = -Wa,-q -march=native -fno-common -O3 -fopenmp
CPPFLAGS += -I$(SHARPINC) -I/opt/local/include
LDFLAGS += -L$(SHARPLIB) $(SHARPLIBN) -lm
CXXCOMPILE = $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c
CXXLINK = $(CXX) $(CXXFLAGS) -bind_at_load
#CXXCOMPILE = $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c
#CXXLINK = $(CXX) $(CXXFLAGS) -bind_at_load
#C++ rule for compiling
$(OBJ)%.o: %.cc $(CXXHDR)
echo "compile... $@ depend $^",
$(CXXCOMPILE) -c $< -o $@
######################
......@@ -72,17 +82,6 @@ $(EXE)lagsht_testsuite : $(OBJ)lagsht_testsuite.o $(CXXOBJ)
$(OBJ)lagsht_testsuite.o: lagsht_testsuite.cc $(CXXHDR)
echo "compile... $@"
$(CXXCOMPILE) -c $< -o $@
######################
.PHONY: laguerre
laguerre: $(EXE)laguerre
echo '---- laguerre made'
$(EXE)laguerre : $(OBJ)laguerre.o
echo "Link..."
$(CXXLINK) -o $@ $(OBJ)laguerre.o
$(OBJ)laguerre.o: laguerre.cc
echo "compile... $@"
$(CXXCOMPILE) -c $< -o $@
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment