forked from JanThorbecke/OpenSource
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMake_include_OSX
153 lines (129 loc) · 4.06 KB
/
Make_include_OSX
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# 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
#############################################################################
# Some convenient abbreviations
B = $(ROOT)/bin
I = $(ROOT)/include
L = $(ROOT)/lib
########################################################################
# 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
#############################################################################
# BLAS and LAPACK libraries
# and FFT LIBRARIES
MKLLIB=${MKLROOT}/lib
OPTC += -DMKL -I$(MKLROOT)/include -I$(MKLROOT)/include/fftw
#for GNU compilers
#you might need to add intel64 to : ${MKLROOT}/lib/intel64
#BLAS = -L${MKLROOT}/lib/ -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl
#for GNU/clang on OSX
BLAS = -Wl,-rpath ${MKLLIB} -L${MKLROOT}/lib/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl
#on linux you want to use groups and MKL is in lib/intel64
#MKLLIB=${MKLROOT}/lib/intel64
#BLAS = -Wl,-rpath ${MKLLIB} -Wl,--start-group -L${MKLLIB} -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread -lm -ldl
#for intel compilers
#BLAS = -mkl
#############################################################################
# AMD ACML 4.4.0
#AMDROOT = /home/thorbcke/amdsdk/v1.0/acml/open64_64
#OPTC += -DACML440 -I$(AMDROOT)/include
#BLAS = -L$(AMDROOT)/lib -lacml -lfortran -lffio -lrt -lm
#Intel MKL
#LIBARIES
LIBS= -L$L -lgenfft $(BLAS)
########################################################################
# 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) $<