forked from sundmanbo/opencalphad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
174 lines (135 loc) · 4.82 KB
/
Makefile.am
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
170
171
172
173
174
AUTOMAKE_OPTIONS = subdir-objects
.NOTPARALLEL:
SUBDIRS=
DIST_SUBDIRS=
AM_FCFLAGS=-Dnotwin @OPENMP_FCFLAGS@
bin_PROGRAMS= OC
lib_LTLIBRARIES= libOC.la
lib_LTLIBRARIES+= libOPENCALPHAD.la
if WITH_PYTHON
# SUBDIRS+= OCisoCbinding/pyOC
PYTHONdir=$(prefix)/python
dist_PYTHON_DATA = OCisoCbinding/pyOC/pyOC.py \
OCisoCbinding/pyOC/pyOCUnitTest.py \
OCisoCbinding/pyOC/example.ipynb \
OCisoCbinding/pyOC/example.py
libpyOC_la_SOURCES = OCisoCbinding/pyOC/pyOC.f90
libpyOC_la_FCFLAGS = -I.
libpyOC_la_DEPENDENCIES = libOPENCALPHAD.la
lib_LTLIBRARIES += libpyOC.la
endif
EXTRA_DIST=src/models/gtp3A.F90 \
src/models/gtp3B.F90 \
src/models/gtp3C.F90 \
src/models/gtp3D.F90 \
src/models/gtp3E.F90 \
src/models/gtp3F.F90 \
src/models/gtp3G.F90 \
src/models/gtp3H.F90 \
src/models/gtp3X.F90 \
src/models/gtp3Y.F90 \
src/models/gtp3Z.F90 \
src/models/ocparam.F90 \
src/stepmapplot/smp2A.F90 \
src/stepmapplot/smp2B.F90 \
OCisoCbinding/octqc.h \
doc/manual/ochelp.html\
doc/manual/ochelp.pdf
manualdir=$(pkgdatadir)/doc/manual
dist_manual_SCRIPTS = \
doc/manual/ochelp.html\
doc/manual/ochelp.pdf
#############################################
# files used to build the libOC.la library
# It is then used to build the OC executable
# and the libOPENCALPHAD.la shared library
#############################################
libOC_la_SOURCES= \
src/models/ocparam.F90 \
src/utilities/metlib4.F90
OC_FCFLAGS=
if WITH_OCHELP
OC_FCFLAGS+= -Dlixed -Dtinyfd -Dlixhlp
endif
if WITH_OCPLOT
OC_FCFLAGS+= -Dx11
endif
if WITH_LAPACK
OC_FCFLAGS +=-Dnotwin
#LAPACKLIBS = -L$(LAPACKLIB) -llapack -L$(LAPACKLIB) -lrefblas
LAPACKLIBS = -llapack -lblas
else
OC_FCFLAGS +=-Dnotwin -DNOLAPACK
AM_FCFLAGS += -DNOLAPACK
libOC_la_SOURCES +=src/numlib/oclablas.F90
endif
libOC_la_SOURCES +=src/numlib/ocnum.F90 \
src/numlib/minpack1.F90 \
src/models/gtp3.F90 \
src/minimizer/matsmin.F90
########################################
# files used to build the OC executable
########################################
BUILT_SOURCES=libOC.la
OC_SOURCES= \
src/stepmapplot/smp2.F90 \
src/userif/pmon6.F90 \
src/pmain1.F90
OC_LDADD=libOC.la @OPENMPLIB@ $(LAPACKLIBS)
OC_DEPENDENCIES=libOC.la
###########################################################
# files used to build the libOPENCALPHAD.la shared library
###########################################################
libOPENCALPHAD_la_SOURCES= \
OCisoCbinding/liboctq.F90 \
OCisoCbinding/liboctqisoc.F90
libOPENCALPHAD_la_LIBADD=libOC.la @OPENMPLIB@
libOPENCALPHAD_la_DEPENDENCIES=libOC.la
############################################################
# Some targets for standalone execution
############################################################
if WITH_PYTHON
PYTHON_MODN = rawpyOC
F90WRAP = ${CURDIR}/f90wrap/bin/f90wrap
F2PY = ${CURDIR}/f90wrap/bin/f2py-f90wrap
all-local: _${PYTHON_MODN}.so
f90wrap:
git clone https://github.com/jameskermode/f90wrap.git f90wrap
# cd f90wrap && $(PYTHON) setup.py install*
touch f90wrap/installedFiles
cd f90wrap && $(PYTHON) setup.py install --single-version-externally-managed --prefix $(CURDIR)/f90wrap --record $(CURDIR)/f90wrap/installedFiles
_${PYTHON_MODN}.so: export LDFLAGS=-Wl,-rpath=$(libdir) -L./.libs
_${PYTHON_MODN}.so: export NPY_DISTUTILS_APPEND_FLAGS=1
_${PYTHON_MODN}.so: libpyOC.la f90wrap
$(F90WRAP) -m $(PYTHON_MODN) $(top_srcdir)/OCisoCbinding/pyOC/pyOC.f90 #-v
$(F2PY) --fcompiler=$(FC) --build-dir . -c -m _$(PYTHON_MODN) -lOPENCALPHAD -L. -lpyOC f90wrap*.f90
ln -s _${PYTHON_MODN}*.so _${PYTHON_MODN}.so
install-data-hook: export OCPUBLICDATA=$(abs_top_srcdir)/examples/macros
install-data-hook:
cp _${PYTHON_MODN}.so $(PYTHONdir)
cp ${PYTHON_MODN}.py $(PYTHONdir)
cd $(PYTHONdir) && ${PYTHON} pyOCUnitTest.py
endif
.PHONY: doc
clean-local:
find . -name "*.mod" |xargs rm -f
find . -name "*.info" |xargs rm -f
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(bindir)
@echo "# This script is generated by make install " >$(DESTDIR)$(bindir)/envOC.sh
@echo "# Use it to set environment for running from install dir" >> $(DESTDIR)$(bindir)/envOC.sh
@echo "" >> $(DESTDIR)$(bindir)/envOC.sh
@echo "## OCHOME " >>$(DESTDIR)$(bindir)/envOC.sh
@echo "export OCHOME=$(manualdir)/" >>$(DESTDIR)$(bindir)/envOC.sh
@echo 'LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(DESTDIR)/lib' >> $(DESTDIR)$(bindir)/envOC.sh
@echo 'PATH=$(DESTDIR)$(bindir):$$PATH' >> $(DESTDIR)$(bindir)/envOC.sh
@echo "export PATH" >> $(DESTDIR)$(bindir)/envOC.sh
@echo "" >> $(DESTDIR)$(bindir)/envOC.sh
uninstall-local:
$(RM) $(DESTDIR)$(bindir)/envOC.sh
distclean-local:
$(RM) configure.ac configure build_configure.log
find . -name "Makefile.in" |xargs $(RM) -f
$(RM) -r config
CLEANFILES=envOC.sh
DISTCLEANFILES=envOC.sh