-
Notifications
You must be signed in to change notification settings - Fork 77
/
Makefile
170 lines (136 loc) · 5.94 KB
/
Makefile
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
167
168
169
#
# Modified 2020.04.25 for the new direcory structure. Bo Sundman
#
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 1. select getkey version
# 2. select GNUPLOT terminal
#
# 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
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
#==============================================================================#
# IMPORTRANT 1:
# To have the command line editing and history feature on your OS
# you must uncomment the appropriate line after the header getkey.o:
# Default is Linux
getkey.o:
echo "Do not forget to uncomment the correct line below for your OS"
# compile utilities/GETKEY for command line editing
# uncomment the line for the kind of Linux system you have
# Mac >>
#$(C) -c $(FCOPT) -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
# If you have not uncommented any getkey.c line above COMMENT next line
# and also remove the -Dlixed option for the metlib4.F90
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
# IMPORTANT 2: select GNUPLOT terminal
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 -Dx11 for X11 plot drivers DEFAULT
# use -Dlixhlp for online help in Linux
# use -Dmachlp for online help in MacOS (browser)
$(FC) -c $(FCOPT) -Dx11 -Dlixhlp 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) ./examples/TQ4lib/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 !!
# static: $(FC) -o $(EXE) $(FCOPT) -static-libgfortran pmain1.F90 $(OBJS) liboceq.a
#$(FC) -o $(EXE) $(FCOPT) src/pmain1.F90 $(OBJS) libs/liboceq.a
$(FC) -o $(EXE) $(FCOPT) src/pmain1.F90 pmon6.o smp2.o ftinyopen.o tinyopen.o tinyfiledialogs.o getkey.o libs/liboceq.a