Skip to content
Snippets Groups Projects
Commit 9caf2cbc authored by Jan Thorbecke's avatar Jan Thorbecke
Browse files

adding template for Make_include

parent 2403be09
No related branches found
No related tags found
No related merge requests found
# Makefile for general rules
# To Change the compile environment to your current system you should set:
# -1- ROOT variable to the directory where you found this file
# -2- if needed use a different compiler (CC) if gcc is not available
# -3- on Solaris system use RANLIB=ranlib which is defined below
# the current directory (in vi ":r!pwd")
ROOT=/Users/jan/src/OpenSource
########################################################################
# C compiler; change this only if you are using a different C-compiler
#GNU
#CC = gcc-mp-5
CC = gcc
FC = gfortran
# Linux gcc version 4.x
OPTC = -O3 -ffast-math
#to include parallelisation with OpenMP
OPTC += -fopenmp
# for better performing code you can try:
#OPTC = -O3 -fno-trapping-math -ffast-math -funroll-all-loops -mavx -fomit-frame-pointer -mfpmath=sse -ftree-vectorizer-verbose=1
# Linux gcc version 3.x
#OPTC = -O3 -ffast-math -funroll-all-loops -mfpmath=sse
#for double precision use FFTlib and emmod
#OPTC += -DDOUBLE
#OPTF += -fdefault-double-8 -fdefault-real-8
#Cray
#CC=cc
#FC=ftn
#OPTC = -O2
#OPTF = -O2
#Intel
#CC = icc
#FC = ifort
### Linux
##OPTC = -O3 -no-prec-div -qopt-report-phase=vec,openmp
##OPTF = -O3 -no-prec-div -qopt-report-phase=vec,openmp
#OPTC = -O3 -no-prec-div -xCORE-AVX2
#OPTF = -O3 -no-prec-div -xCORE-AVX2
##to include parallelisation with OpenMP
#OPTC += -qopenmp
# Apple OSX intel 11.1.076 snow leopard 10.6.2
#OPTC = -O3 -msse3 -no-prec-div -vec-report2 -fno-builtin-__sprintf_chk
#PGI
#CC = pgcc
#FC = pgf90
#OPTC = -fast -Minfo=vect -Mvect=simd:256 -Msafeptr
#OPTC = -fast -Minfo=vect -Mvect=simd:256 -Msafeptr -Mprof=lines
#OPTF = -fast
#LDFLAGS = -fast -Minfo=vect -Mvect=simd:256 -Msafeptr
#Pathscale
#CC = cc
#FC = ftn
#OPTC = -Ofast -OPT:Ofast -fno-math-errno
#OPTF = -Ofast -OPT:Ofast -fno-math-errno
#Apple OSX clang/gcc (10.9) llvm
#CC = clang
#OPTC = -Ofast
#LDFLAGS = -Ofast
#AMD Open64
#CC = opencc
#FC = openf95
#OPTC = -Ofast
#OPTF = -Ofast
#LDFLAGS = -static -Ofast
#############################################################################
# FOR FFT LIBRARIES
#AMD ACML 4.4.0
#AMDROOT = /home/thorbcke/amdsdk/v1.0/acml/open64_64
#OPTC += -DACML440 -I$(AMDROOT)/include
#LIBSM = -L$(AMDROOT)/lib -lacml -lfortran -lffio -lrt -lm
#############################################################################
# Some convenient abbreviations
B = $(ROOT)/bin
I = $(ROOT)/include
L = $(ROOT)/lib
########################################################################
# standard CFLAGS
CFLAGS = -I$I -I.
#############################################################################
# the archiver
AR = ar
#############################################################################
# ar FLAGS
ARFLAGS = rv
#############################################################################
# ranlib definition
RANLIB = ar -s
# on Sun SOLARIS use:
#RANLIB = ranlib
.SUFFIXES : .o .c .cc .f .a .F90
.c.o :
$(CC) -c $(CFLAGS) $(OPTC) $<
.c.a :
$(CC) -c $(CFLAGS) $(OPTC) $<
$(AR) $(ARFLAGS) $@ $*.o
rm -f $*.o
.o.a :
$(AR) $(ARFLAGS) $@ $*.o
rm -f $*.o
.f.o :
$(FC) -c $(FFLAGS) $(OPTF) $<
.F90.o :
$(FC) -c $(FFLAGS) $(OPTF) $<
.f.a :
$(FC) -c $(FFLAGS) -I$I $<
$(AR) $(ARFLAGS) $@ $*.o
rm -f $*.o
.cc.a :
$(C++) -c $(C++FLAGS) -I$I $<
$(AR) $(ARFLAGS) $@ $*.o
rm -f $*.o
.cc.o :
$(C++) -c $(C++FLAGS) $<
......@@ -34,6 +34,7 @@ INSTALLATION
-------------
1) To compile and link the code you first have to set the ROOT variable in the Make_include file which can be found in the directory where you have found this README.
You can use Make_include_template as a first start: cp Make_include_template Make_include
2) Check the compiler and CFLAGS options in the file Make_include and adapt to the system you are using. The default options are set for a the GNU C-compiler on a Linux system. A Fortran or C++ compiler are not needed to compile the code. The Makefile has been tested with GNU make.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment