Debian Codegraph @

3rdparty/arpack/Makefile.am

raw
1 ############################################################################
2 # This file is part of FreeFEM. #
3 # #
4 # FreeFEM is free software: you can redistribute it and/or modify #
5 # it under the terms of the GNU Lesser General Public License as #
6 # published by the Free Software Foundation, either version 3 of #
7 # the License, or (at your option) any later version. #
8 # #
9 # FreeFEM is distributed in the hope that it will be useful, #
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
12 # GNU Lesser General Public License for more details. #
13 # #
14 # You should have received a copy of the GNU Lesser General Public License #
15 # along with FreeFEM. If not, see <http://www.gnu.org/licenses/>. #
16 ############################################################################
17 # SUMMARY : Makefile for downloaded ARPACK
18 # LICENSE : LGPLv3
19 # ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE
20 # AUTHORS : ...
21 # E-MAIL : ...
22
23 all-local:$(DOWNLOAD_ARPACK)
24 EXTRA_DIST=ARmake.m4 arpack-patch-lapack.tar.gz veclib_zdotc.f veclib_cdotc.f
25
26 PKGCOMMON_PACKTITLE=ARPACK
27 include ../common.mak
28
29 # nothing specific to do for [[file:../common.mak::reinstall]]
30
31 reinstall::install
32
33 # Downloading and compiling ARPACK
34 # --------------------------------
35 .NOTPARALLEL:
36
37 # set in configure
38 #ARPACKLIB=ARPACK/libarpack_ff++.a
39 DIRPKG=../pkg
40 ARPACK96_TAR_GZ=$(DIRPKG)/arpack96.tar.gz
41 PATCH_TAR_GZ=$(DIRPKG)/patch.tar.gz
42
43 PKGCOMMON_PACKAGES=$(ARPACK96_TAR_GZ) $(PATCH_TAR_GZ)
44
45 # FFCS: need to add $(RANLIB) under mingw64 to avoid "archive has no index" error
46
47 compilepkg::$(ARPACKLIB)
48
49 ARPACK/ARmake.inc:ARPACK/ARmake.incnew
50 if diff -q ARPACK/ARmake.incnew ARPACK/ARmake.inc ; then echo No Modif skip compile of arpack ; else cp ARPACK/ARmake.incnew ARPACK/ARmake.inc; fi
51
52 $(ARPACKLIB):ARPACK/ARmake.inc
53 case '$(BLASLIBS)' in *vecLib*|*Accelerate*|*mkl*) $(F77) -c $(FFLAGS) veclib_zdotc.f -o ARPACK/SRC/veclib_zdotc.o ;; esac;
54 case '$(BLASLIBS)' in *vecLib*|*Accelerate*|*mkl*) $(F77) -c $(FFLAGS) veclib_cdotc.f -o ARPACK/SRC/veclib_cdotc.o ;; esac;
55 mkdir -p ../include ../lib
56 if [ -n '@FF_LAPACKdir@' ] ; then \
57 $(F77) -c `echo $(FFLAGS)\ |sed -e s/-O.\*\ // ` ARPACK/LAPACK/dlamch.f -o ARPACK/LAPACK/dlamch.o; \
58 fi; \
59 cd ARPACK && $(MAKE) lib
60 if test -n '@FF_LAPACKdir@' ; then \
61 $(AR) $(ARFLAGS) $(LAPACK_arpack_LIB) ARPACK/SRC/*.o ARPACK/UTIL/*.o ARPACK/LAPACK/*.o ;\
62 $(RANLIB) $(LAPACK_arpack_LIB) ;\
63 else \
64 $(AR) $(ARFLAGS) $(ARPACKLIB) ARPACK/SRC/*.o ARPACK/UTIL/*.o ;\
65 fi
66
67 ARPACK/ARmake.incnew: $(ARPACK96_TAR_GZ) $(PATCH_TAR_GZ) ARmake.m4 Makefile
68 -rm -rf ARPACK
69 gunzip -c $(ARPACK96_TAR_GZ) | tar xf -
70 gunzip -c $(PATCH_TAR_GZ) | tar xf -
71 gunzip -c arpack-patch-lapack.tar.gz | tar xf -
72 case '$(BLASLIBS)' in *vecLib*|*Accelerate*|*mkl*) \
73 for i in ARPACK/LAPACK/zlatrs.f ARPACK/LAPACK/ztrsyl.f ARPACK/SRC/zgetv0.f ARPACK/SRC/znaitr.f ARPACK/SRC/znaup2.f ARPACK/SRC/zneupd.f;\
74 do mv $$i $$i.cpy; sed -e 's/ZDOTC/ZZDOTC/' -e 's/zdotc/zzdotc/' <$$i.cpy >$$i;rm $$i.cpy; \
75 done; \
76 for i in ARPACK/LAPACK/clatrs.f ARPACK/LAPACK/ctrsyl.f ARPACK/SRC/cgetv0.f ARPACK/SRC/cnaitr.f ARPACK/SRC/cnaup2.f ARPACK/SRC/cneupd.f;\
77 do mv $$i $$i.cpy; sed -e 's/CDOTC/CCDOTC/' -e 's/cdotc/ccdotc/' <$$i.cpy >$$i;rm $$i.cpy; \
78 done; \
79 esac
80 for i in ARPACK/SRC/*.f ; do \
81 mv $$i $$i.cpy; sed -e 's/, second/, secnd2/' -e 's/call *second/call secnd2/' <$$i.cpy >$$i;rm $$i.cpy; done
82 for i in ARPACK/UTIL/second.f; do \
83 mv $$i $$i.cpy; cat $$i.cpy| sed 's/ SECOND *(/ secnd2(/'|grep -v EXTERNAL >$$i;rm $$i.cpy; done
84 m4 -DFF_BLASLIB="$(BLASLIB)" \
85 -DFF_ARPACKLIB="$(ARPACKLIB)" \
86 -DFF_LAPACK_arpack_LIB="$(LAPACK_arpack_LIB)" \
87 -DFF_FC="@F77@" \
88 -DFF_FFLAGS="@FFLAGS@" \
89 -DFF_LAPACKdir='@FF_LAPACKdir@' \
90 -DFF_LDFLAGS="@LDFLAGS@" \
91 -DFF_HOME=`pwd`/ARPACK \
92 -DFF_SECOND="@FF_SECOND@" \
93 -DFF_AR="@AR@" \
94 -DFF_ARFLAGS="@ARFLAGS@" \
95 -DFF_RANLIB="@RANLIB@" \
96 ARmake.m4 >ARPACK/ARmake.incnew
97
98
99 $(ARPACK96_TAR_GZ) $(PATCH_TAR_GZ):download
100 # ../getall -o ARPACK -a
101
102 clean-local::
103 -rm -r ARPACK ../lib/libarpack.a
104
105 # Local Variables:
106 # mode:makefile
107 # ispell-local-dictionary:"british"
108 # coding:utf-8
109 # End: