-
Notifications
You must be signed in to change notification settings - Fork 77
/
Makefile-MacOS
167 lines (132 loc) · 5.68 KB
/
Makefile-MacOS
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#
# Modified but not tested for the new directory structure
#
OBJS=getkey.o M_getkey.o ftinyopen.o tinyopen.o tinyfiledialogs.o metlib4.o oclablas.o ocnum.o minpack1.o gtp3.o matsmin.o smp2.o pmon6.o
LIBS=liboctq.o liboctqisoc.o liboctqcpp.o
EXE=oc6P
#
# IMPORTANT check at the getkey.o: label
#
# echo "Do not forget to uncomment a line for your OS"
#
#=============================================================================#
# original provided by Matthias Strathmann including OC examples
# NOTE getkey.o : you have to select which getkey routine to compile
#=============================================================================#
FC=gfortran
#=============================================================================#
# For MacOS
C=cc
#=============================================================================#
# For other Unix dialects
#C=gcc
#=============================================================================#
CPP=g++
FCOPT= -O2 -fopenmp -fPIC
# for debugging
#FCOPT= -fbounds-check -finit-local-zero
# no parallel
#FCOPT= -O2
#FC=ifort
#FCOPT= -check bounds -zero
EX1PATH = ./examples/TQ4lib/F90/crfe
EX2PATH = ./examples/TQ4lib/F90/feni
EX3PATH = ./examples/TQ4lib/Cpp/Matthias/crfe
EX4PATH = ./examples/TQ4lib/Cpp/Matthias/feni
EX5PATH = ./examples/TQ4lib/Cpp/Matthias
#=============================================================================#
#Available compilation flags: all, OCASI, OCASIEXAMPLES, clean
.PHONY : all OCASI OCASIEXAMPLES clean
#Compiles OpenCalphad to use as standalone Thermodynamic Equilibrium Calculation
#software.
# ************************************
# OC now requires GNUPLOT 5.2 or later
# ************************************
# To have the command line editing and history feature on your OS
# you must uncomment the appropriate line after the header getkey.o:
all: $(OBJS) $(EXE)
#Compiles the OCASI interfaces of OpenCalphad, so third party software can
#interact with OpenCalphad. Interfaces are provided in C++ and Fortran, and
#additional interfaces are available in C and Python.
OCASI:
make $(OBJS) $(LIBS)
ar sq liboctq-f90.a liboctq.o $(OBJS)
ar sq liboctq-isoc.a liboctqisoc.o liboctq.o $(OBJS)
ar sq liboctqcpp.a liboctqcpp.o liboctqisoc.o liboctq.o $(OBJS)
$(CPP) -shared liboctqcpp.o liboctqisoc.o liboctq.o $(OBJS) -o $(EXE)_OCASI.so -lgfortran
#Compiles the OCASI interface and various examples.
OCASIEXAMPLES:
make OCASI
$(FC) -o $(EX1PATH)/tqex1 $(EX1PATH)/TQ1-crfe.F90 liboctq-f90.a -fopenmp
$(FC) -o $(EX2PATH)/tqex2 $(EX2PATH)/TQ2-feni.F90 liboctq-f90.a -fopenmp
$(CPP) -o $(EX3PATH)/tqex1 $(EX3PATH)/tqex1.cpp liboctqcpp.a -lgfortran -fopenmp
$(CPP) -o $(EX4PATH)/tqex2 $(EX4PATH)/tqex2.cpp liboctqcpp.a -lgfortran -fopenmp
$(CPP) -o $(EX5PATH)/tqex3 $(EX5PATH)/tqex3.cpp liboctqcpp.a -lgfortran -fopenmp
clean:
rm -r *.mod *.a $(LIBS) $(OBJS) linkoc $(EXE)_OCASI.so $(EXE) $(EX1PATH)/tqex1 $(EX2PATH)/tqex2 $(EX3PATH)/tqex1 $(EX4PATH)/tqex2 $(EX5PATH)/tqex3
#==============================================================================#
# To have the command line editing and history feature on your OS
# you must uncomment the appropriate line after the header getkey.o:
getkey.o:
echo "The line below for MacOS is used"
# compile utilities/GETKEY for command line editing
# This makefile use MacOS own cc compiler
# Mac >>
$(C) -c -DBSD src/utilities/GETKEY/getkey.c
# Linux >>
#$(C) -c -DLinux src/utilities/GETKEY/getkey.c
# other UNIX systems >>
#$(C) -c -DG77 src/utilities/GETKEY/getkey.c
# CYGWIN >>
#$(C) -c -DCYGWIN src/utilities/GETKEY/getkey.c
M_getkey.o:
$(FC) -c $(FCOPT) src/utilities/GETKEY/M_getkey.F90
tinyfiledialogs.o:
$(C) -c src/utilities/TINYFILEDIALOGS/tinyfiledialogs.c
tinyopen.o:
$(C) -c src/utilities/TINYFILEDIALOGS/tinyopen.c
ftinyopen.o:
$(FC) -c $(FCOPT) src/utilities/TINYFILEDIALOGS/ftinyopen.F90
metlib4.o: src/utilities/metlib4.F90
$(FC) -c $(FCOPT) src/models/ocparam.F90
# lixed for command line editing, tinyfd for open files
# lixhlp for browser help on Linux and MacOS
$(FC) -c $(FCOPT) -Dlixed -Dtinyfd -Dlixhlp src/utilities/metlib4.F90
oclablas.o: src/numlib/oclablas.F90
$(FC) -c $(FCOPT) src/numlib/oclablas.F90
ocnum.o: src/numlib/ocnum.F90
$(FC) -c $(FCOPT) -DNOLAPACK src/numlib/ocnum.F90
minpack1.o: src/numlib/minpack1.F90
$(FC) -c $(FCOPT) src/numlib/minpack1.F90
gtp3.o: src/models/gtp3.F90
$(FC) -c $(FCOPT) src/models/gtp3.F90
matsmin.o: src/minimizer/matsmin.F90
$(FC) -c $(FCOPT) src/minimizer/matsmin.F90
smp2.o: src/stepmapplot/smp2.F90
# Remove -Dnotwin if compiled on Windows (for spawning)
$(FC) -c $(FCOPT) -Dnotwin src/stepmapplot/smp2.F90
pmon6.o: src/userif/pmon6.F90
# default wxt graphical driver
# use -Dqtplt for Qt or (also smaller window)
# use -Daqplt for aqua plot drivers (also smaller window)
# use -Dlixhlp for online help in Linux
# use -Dmachlp for online help in MacOS (browser)
$(FC) -c $(FCOPT) -Dqtplt -Dmachlp src/userif/pmon6.F90
liboctq.o: ./examples/TQ4lib/Cpp/liboctq.F90
$(FC) -c -g $(FCOPT) ./examples/TQ4lib/Cpp/liboctq.F90
liboctqisoc.o: ./examples/TQ4lib/Cpp/Matthias/liboctqisoc.F90
$(FC) -c -g $(FCOPT) ./examples/TQ4lib/Cpp/Matthias/liboctqisoc.F90
liboctqcpp.o: ./examples/TQ4lib/Cpp/Matthias/liboctqcpp.cpp
$(CPP) -c -g $(FCOPT) ./examplesTQ4lib/Cpp/Matthias/liboctqcpp.cpp
$(EXE):
# Add date of linking to main program
cp src/pmain1.F90 src/pmain1-save.F90
$(FC) -o linkoc src/linkocdate.F90
./linkoc
rm src/pmain1-save.F90
# create library liboceq.a
mkdir -p libs
ar sq libs/liboceq.a metlib4.o oclablas.o ocnum.o gtp3.o matsmin.o minpack1.o
# If getkey.o is undefined below
# you have forgotten to uncomment a line above at getkey.o !!
$(FC) -o $(EXE) $(FCOPT) src/pmain1.F90 $(OBJS) libs/liboceq.a