Debian Codegraph @

etc/config/movefortranlib.in

raw
1 set -e
2 ffapp=@ff_prefix@
3 ff_prefix_dir_lib=@ff_prefix_dir_lib@
4 ff_prefix_dir_lib_mpi=@ff_prefix_dir_lib_mpi@
5 ffpp=`which FreeFem++`
6 ffsrc=@abs_top_srcdir@
7 fftmp=/tmp/ff-$$
8 mvdylib=$ffscr/bin/move-dylib
9
10 if [ "$ffpp" != "$ffapp/bin/FreeFem++" ] ; then
11 echo sorry appli must be install !!
12 echo $ffpp
13 echo $ffapp/bin/FreeFem++
14 exit 1
15 fi
16
17 mkdir $fftmp
18 cd $ffsrc
19 printf " program sizeofint\n integer i\n end\n" >$fftmp/ffff.f
20 gfortran $fftmp/ffff.f -o $fftmp/ffff
21 (export DYLD_PRINT_LIBRARIES=1;$fftmp/ffff ) 2>&1 | awk '{print $NF}'| egrep -v '/usr/lib|$fftmp/ffff' >$fftmp/list-dylib-gfortran
22 # in plugin/mpi
23 #listplugin=`for i in *dylib; do if otool -L $i| grep 'fortran' >/dev/null ;then echo -n $i, ; fi ; done`
24 listplugin=gsl,ff-Ipopt,MUMPS_mpi,PETSc,SuperLu,ff-Ipopt,ffnewuoa,function-PETSc,hpddm,hpddm_substructuring
25 (export DYLD_PRINT_LIBRARIES=1;cd plugin/mpi; ../../src/mpi/FreeFem++-mpi -check_plugin $listplugin -v 0 ;../../src/mpi/FreeFem++-mpi -check_plugin PETSc-complex.dylib -v 0 ) 2>&1 |\
26 awk '/dylib/ {print $NF}'|\
27 egrep -v '/usr/lib'| sort -u > $fftmp/ff-list-dylib
28 if grep homebrew $fftmp/ff-list-dylib >/dev/null; then
29 #
30 #
31 echo " Need of remove dylib in brew dir in freefem"
32 #
33 #
34 mkdir -k $ffapp/gnu
35 cd $ffapp/gnu
36 for i in `cat $fftmp/list-dylib-gfortran` ; do
37 cp $i $ffapp/gnu
38 done
39 $mvdylib $ffapp/gnu $ffapp/gnu/*.dylib
40 ln -s libgfortran.?.dylib libgfortran.dylib
41 ln -s libquadmath.?.dylib libquadmath.dylib
42 libemutls_w=`find /opt/homebrew -name libemutls_w.a`
43 if [ -f "$libemutls_w" ] ; then
44 cp $libemutls_w $ffapp/gnu
45 fi
46 cd
47 $mvdylib $ffapp/gnu $ffapp/ff-petsc/*/lib/*.dylib
48 else
49 echo " Ok no need the move dylibs ..."
50 fi
51
52 # check FreeFEM++
53 cd $fftmp
54 (export DYLD_PRINT_LIBRARIES=1;FreeFem++-mpi -check_plugin $listplugin -v 0 ;FreeFem++-mpi -check_plugin PETSc-complex.dylib -v 0 ) 2>&1 |\
55 awk '/dylib/ {print $NF}'|\
56 egrep -v '/usr/lib'| sort -u > $fftmp/ff-list-dylib-
57
58 set -x
59 FreeFem++-mpi -check_plugin $listplugin -v 0
60 FreeFem++-mpi -check_plugin PETSc-complex -v 0
61 FreeFem++ -check_plugin gsl,msh3,tetgen,MUMPS_seq -v 0
62 rm -r $fftmp