source: trunk/Makefile @ 57

Last change on this file since 57 was 57, checked in by toby, 12 years ago

fixup unit test for GSASIIspg.py; provide files & Makefile for pyspg.for

File size: 2.0 KB
Line 
1# build the compiled fortran codes needed by GSAS-II
2
3BIN = bin
4LIBS = $(BIN)/pack_f.$(SUFFIX) $(BIN)/pypowder.$(SUFFIX) $(BIN)/pyspg.$(SUFFIX) 
5SYMLIB := $(wildcard spsubs/*.for)
6#----------------------------------------------------------------------
7# linux (gfortran)
8#COMPILER=--fcompiler=gnu95
9#PACKCOPTS=--f77flags="-fno-range-check"
10#SUFFIX=so
11#F2PY=f2py
12#MOVE=mv
13#DEL=echo
14#----------------------------------------------------------------------
15# mac (gfortran)
16GSASlib = /Users/toby/software/work/gsas/2009Aug31/libgsas.a
17COMPILER=--fcompiler=gnu95 --f90exec=/usr/local/bin/gfortran
18PACKCOPTS=--f77flags="-fno-range-check"
19SUFFIX=so
20F2PY=f2py
21MOVE=mv
22DEL=echo
23#----------------------------------------------------------------------
24# windows g77
25#COMPILER=--fcompiler=gnu
26#PACKCOPTS=--f77flags="-fno-range-check"
27#SUFFIX=pyd
28#F2PY=f2py.py
29#MOVE=copy
30#DEL=del
31#----------------------------------------------------------------------
32
33ask: 
34        @echo "Use make all or choose a target: "
35        @echo " $(LIBS)"
36
37all:: $(BIN) $(LIBS)
38
39# OSX: note that this is building .so's that require libgfortran and
40# libgcc_s.1 at runtime. The former can be removed by renaming the accessed
41# libgfortran.3.dynlib. Not sure how to avoid libgcc_s.1
42# Use otool -L <file.so> to see what is required
43#
44.PHONY: $(BIN)
45        mkdir $(BIN)
46
47$(BIN)/pack_f.$(SUFFIX): pack_f.for
48        $(F2PY) -c pack_f.for -m pack_f $(COMPILER) $(PACKCOPTS)
49        $(MOVE) pack_f.$(SUFFIX) $(BIN)
50        $(DEL) pack_f.$(SUFFIX)
51
52$(BIN)/pypowder.$(SUFFIX): pypowder.for $(GSASlib)
53        $(F2PY) -c pypowder.for -m pypowder $(COMPILER) $(GSASlib)
54        $(MOVE) pypowder.$(SUFFIX) $(BIN)
55        $(DEL) pypowder.$(SUFFIX)
56
57$(BIN)/pyspg.$(SUFFIX): pyspg.for $(SYMLIB)
58        $(F2PY) -c pyspg.for $(SYMLIB) -m pyspg $(COMPILER) 
59        $(MOVE) pyspg.$(SUFFIX) $(BIN)
60        $(DEL) pyspg.$(SUFFIX)
61
62# no longer in use
63#$(BIN)/fitellipse.$(SUFFIX): fitellipse.for
64#       cd $(BIN); $(F2PY) -c ../fitellipse.for -m fitellipse --fcompiler=gfortran --f90exec=/usr/local/bin/gfortran --f77flags="-fno-range-check"
65
66
Note: See TracBrowser for help on using the repository browser.