| 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 : Downloading and compiling extra libraries |
| 18 |
# LICENSE : LGPLv3 |
| 19 |
# ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE |
| 20 |
# AUTHORS : ... |
| 21 |
# E-MAIL : ... |
| 22 |
|
| 23 |
SUBDIRS=blas arpack umfpack |
| 24 |
EXTRA_DIST= \ |
| 25 |
./nlopt/Make.inc ./nlopt/Makefile \ |
| 26 |
./f2c/Makefile \ |
| 27 |
./f2c/Makefile-MacOs \ |
| 28 |
./f2c/f2c.h-int \ |
| 29 |
./f2c/fort77.sed \ |
| 30 |
./f2c/tt.f \ |
| 31 |
./fftw/Makefile.am \ |
| 32 |
./fftw/Makefile.in \ |
| 33 |
./gmm/Makefile \ |
| 34 |
./gmm/cxxflags \ |
| 35 |
./headers-sparsesolver.inc \ |
| 36 |
./metis/Makefile \ |
| 37 |
./metis/Makefile-metis.in \ |
| 38 |
./metis/metis-5.1.patch \ |
| 39 |
./mmg3d/Makefile \ |
| 40 |
./mmg3d/patch-mmg3dv4.diff \ |
| 41 |
./mshmet/Makefile \ |
| 42 |
./mshmet/Makefile-mshmet.inc \ |
| 43 |
./mshmet/mshmet.2011.03.06.patch \ |
| 44 |
./mshmet/mshmet.2012.04.25_i586.patch \ |
| 45 |
./mshmet/mshmetlib-internal.h \ |
| 46 |
./mshmet/mshmetlib.c \ |
| 47 |
./mshmet/mshmetlib.h \ |
| 48 |
./mumps/Makefile \ |
| 49 |
./mumps-seq/Makefile-mumps-5.0.2.inc \ |
| 50 |
./mumps-seq/Makefile \ |
| 51 |
./mumps/Makefile-mumps-5.0.2.inc \ |
| 52 |
./parmetis/Makefile-parmetis.in \ |
| 53 |
./parmetis/makefile \ |
| 54 |
./parmetis/parmetis-4.0.3.patch \ |
| 55 |
./scalapack/Makefile \ |
| 56 |
./scalapack/SLmake-scalapack.inc \ |
| 57 |
./scotch/Makefile \ |
| 58 |
./scotch/Makefile-scotch.inc \ |
| 59 |
./scotch/scotch_6.0.4.patch \ |
| 60 |
./superlu/Makefile \ |
| 61 |
./superlu/patch-superlu-5.2.2 \ |
| 62 |
./superlu/make.inc \ |
| 63 |
./tetgen/Makefile \ |
| 64 |
./mmg/Makefile \ |
| 65 |
./parmmg/Makefile \ |
| 66 |
./yams/Makefile \ |
| 67 |
./yams/freeyams.2012.02.05.patch \ |
| 68 |
./yams/freeyams.2012.02.05-return-values.patch \ |
| 69 |
./yams/makefile-yams.inc \ |
| 70 |
./yams/yamslib.c \ |
| 71 |
./yams/yamslib.h \ |
| 72 |
./yams/yamslib_internal.h \ |
| 73 |
ipopt/Makefile \ |
| 74 |
ipopt/Makefile.inc.in \ |
| 75 |
ipopt/patch-IpBlas \ |
| 76 |
ff-petsc/Makefile \ |
| 77 |
ff-petsc/Makefile-PETSc.inc \ |
| 78 |
ff-petsc/Makefile.complex \ |
| 79 |
getall |
| 80 |
|
| 81 |
# FFCS: See [[file:../../../configure.ac::tools_problems_all_platforms]] for reasons why some tools may be deactivated |
| 82 |
|
| 83 |
MPI_SOFT= @TOOL_COMPILE_scalapack@ @TOOL_COMPILE_parmetis@ @TOOL_COMPILE_parmmg@ @TOOL_COMPILE_mumps@ |
| 84 |
|
| 85 |
LIST_SOFT= @DOWNLOAD_FFTW@ @TOOL_COMPILE_tetgen@ @TOOL_COMPILE_metis@ @TOOL_COMPILE_superlu@ \ |
| 86 |
@TOOL_COMPILE_scotch@ @TOOL_COMPILE_mshmet@ \ |
| 87 |
@TOOL_COMPILE_yams@ @TOOL_COMPILE_mmg3d@ @TOOL_COMPILE_mmg@ @TOOL_COMPILE_gmm@ \ |
| 88 |
@TOOL_COMPILE_nlopt@ @TOOL_COMPILE_mumps_seq@ \ |
| 89 |
@TOOL_COMPILE_ipopt@ @TOOL_COMPILE_libpthread_google@ |
| 90 |
|
| 91 |
all-recursive: bin lib include pkg |
| 92 |
|
| 93 |
lib: |
| 94 |
mkdir lib |
| 95 |
bin: |
| 96 |
mkdir bin |
| 97 |
include: |
| 98 |
mkdir include |
| 99 |
pkg: |
| 100 |
mkdir pkg |
| 101 |
# ALH - /3rdparty/yams and /3rdparty/mshmet need /src/libMesh/libmesh.a but /src is compiled after /download, so we |
| 102 |
# need to compile it now |
| 103 |
|
| 104 |
lib/libMesh.a:lib include |
| 105 |
cd ../src/libMesh && $(MAKE) $(AM_MAKEFLAGS) |
| 106 |
test -f ../src/libMesh/libMesh.a |
| 107 |
mkdir -p include/libMesh |
| 108 |
cp ../src/libMesh/*h include/libMesh |
| 109 |
echo libMesh LD -L@DIR@/lib -lMesh > lib/WHERE.libMesh |
| 110 |
echo libMesh INCLUDE -I@DIR@/include/libMesh >> lib/WHERE.libMesh |
| 111 |
cp ../src/libMesh/libMesh.a lib/libMesh.a |
| 112 |
|
| 113 |
all-local:bin lib include lib/libMesh.a pkg $(DOWNLOADCOMPILE) install-other |
| 114 |
|
| 115 |
install-other: tag-install-other |
| 116 |
|
| 117 |
tag-install-other: |
| 118 |
if test -n "$(TOOL_COMPILE_hpddm)"; then $(MAKE) install-hpddm; else true; fi |
| 119 |
if test -n "$(TOOL_COMPILE_htool)"; then $(MAKE) install-htool; else true; fi |
| 120 |
if test -n "$(TOOL_COMPILE_bemtool)"; then $(MAKE) install-boost install-bemtool; else true; fi |
| 121 |
touch tag-install-other |
| 122 |
|
| 123 |
WHERE-OTHER: lib/WHERE.hpddm lib/WHERE.htool lib/WHERE.bemtool lib/WHERE.boost |
| 124 |
WHERE-LD: tag-compile-pkg WHERE-OTHER |
| 125 |
touch ../plugin/seq/WHERE_LIBRARY-config ../plugin/seq/WHERE_LIBRARY |
| 126 |
-grep LD ../plugin/seq/WHERE_LIBRARY ../plugin/seq/WHERE_LIBRARY-config >WHERE-LD |
| 127 |
|
| 128 |
# BEGIN HPDDM |
| 129 |
install-hpddm: ./getall |
| 130 |
if test -n "$(TOOL_COMPILE_hpddm)"; then ./getall -o hpddm -a; $(MAKE) include/hpddm/done.tag lib/WHERE.hpddm; else true; fi |
| 131 |
reinstall-hpddm: ./getall |
| 132 |
-rm lib/WHERE.hpddm |
| 133 |
-rm ./pkg/hpddm.zip |
| 134 |
-rm -rf include/hpddm |
| 135 |
-test -n "$(TOOL_COMPILE_hpddm)" && $(MAKE) install-hpddm || true |
| 136 |
include/hpddm/done.tag: ./pkg/hpddm.zip |
| 137 |
-if test -f ./pkg/hpddm.zip ; then \ |
| 138 |
cd include; rm -rf hpddm hpddm-*; unzip -q ../pkg/hpddm.zip; mv hpddm-* hpddm; touch hpddm/done.tag; \ |
| 139 |
else true; fi |
| 140 |
lib/WHERE.hpddm: ./getall |
| 141 |
if test -d include/hpddm/include; then \ |
| 142 |
echo hpddm LD -L@DIR@/lib > $@; \ |
| 143 |
echo hpddm INCLUDE -I@DIR@/include/hpddm/include >> $@; \ |
| 144 |
elif test -d include/hpddm/src; then \ |
| 145 |
echo hpddm LD -L@DIR@/lib > $@; \ |
| 146 |
echo hpddm INCLUDE -I@DIR@/include/hpddm/src >> $@; \ |
| 147 |
else true; fi |
| 148 |
#end HPDDM |
| 149 |
|
| 150 |
# begin HTOOL |
| 151 |
install-htool: ./getall |
| 152 |
if test -n "$(TOOL_COMPILE_htool)"; then ./getall -o htool -a; $(MAKE) include/htool/done.tag lib/WHERE.htool; else true; fi |
| 153 |
reinstall-htool: ./getall |
| 154 |
-rm lib/WHERE.htool |
| 155 |
-rm ./pkg/htool.zip |
| 156 |
-rm -rf include/htool |
| 157 |
-test -n "$(TOOL_COMPILE_htool)" && $(MAKE) install-htool || true |
| 158 |
include/htool/done.tag: ./pkg/htool.zip |
| 159 |
-if test -f ./pkg/htool.zip; then \ |
| 160 |
cd include; rm -rf htool htool-*; unzip -q ../pkg/htool.zip; mv htool-* htool; touch htool/done.tag; \ |
| 161 |
else true; fi |
| 162 |
lib/WHERE.htool: ./getall |
| 163 |
if test -d include/htool/include; then \ |
| 164 |
echo htool LD -L@DIR@/lib > $@; \ |
| 165 |
echo htool INCLUDE -I@DIR@/include/htool/include >> $@; \ |
| 166 |
else true; fi |
| 167 |
# end HTOOL |
| 168 |
|
| 169 |
# begin BEMTOOL |
| 170 |
install-bemtool: ./getall |
| 171 |
if test -n "$(TOOL_COMPILE_bemtool)"; then ./getall -o bemtool -a; $(MAKE) include/BemTool/done.tag lib/WHERE.bemtool; else true;fi |
| 172 |
reinstall-bemtool:./getall |
| 173 |
-rm lib/WHERE.bemtool |
| 174 |
-rm ./pkg/bemtool.zip |
| 175 |
-rm -rf include/BemTool |
| 176 |
-test -n "$(TOOL_COMPILE_bemtool)" && $(MAKE) install-bemtool || true |
| 177 |
include/BemTool/done.tag: ./pkg/bemtool.zip |
| 178 |
-if test -f ./pkg/bemtool.zip; then \ |
| 179 |
cd include; rm -rf BemTool BemTool-*; unzip -q ../pkg/bemtool.zip; mv BemTool-* BemTool; touch BemTool/done.tag; \ |
| 180 |
else true; fi |
| 181 |
lib/WHERE.bemtool: ./getall |
| 182 |
if test -d include/BemTool/; then \ |
| 183 |
echo bemtool LD -L@DIR@/lib > $@; \ |
| 184 |
echo bemtool INCLUDE -I@DIR@/include/BemTool/ >> $@ ; \ |
| 185 |
else true; fi |
| 186 |
# end BEMTOOL |
| 187 |
|
| 188 |
# begin BOOST |
| 189 |
install-boost: ./getall |
| 190 |
if test -n "$(TOOL_COMPILE_bemtool)"; then ./getall -o Boost -a; $(MAKE) boost/done.tag lib/WHERE.boost; else true; fi |
| 191 |
reinstall-boost: ./getall |
| 192 |
-rm lib/WHERE.boost |
| 193 |
-rm ./pkg/boost_for_bemtool.tar.gz |
| 194 |
-rm -rf boost |
| 195 |
-test -n "$(TOOL_COMPILE_bemtool)" && $(MAKE) install-boost || true |
| 196 |
boost/done.tag: ./pkg/boost_for_bemtool.tar.gz |
| 197 |
if test -f ./pkg/boost_for_bemtool.tar.gz; then \ |
| 198 |
rm -rf boost boost_*; tar xzf pkg/boost_for_bemtool.tar.gz; mv boost_for_bemtool boost; \ |
| 199 |
else true; fi |
| 200 |
touch boost/done.tag |
| 201 |
lib/WHERE.boost: ./getall |
| 202 |
if test -d boost/include; then \ |
| 203 |
echo boost INCLUDE -I@DIR@/boost/include >> $@ ; \ |
| 204 |
else true; fi |
| 205 |
# end BOOST |
| 206 |
|
| 207 |
# to reinstall mpi under window afer clean |
| 208 |
reinstall-msmpi: |
| 209 |
-if test -f "$$MSMPI_INC"/mpif.h; then \ |
| 210 |
echo " copy msmpi in 3rdparty form $$MSMPI_INC and $$MSMPI_LIB64 or $$MSMPI_LIB32"; \ |
| 211 |
mkdir -p include/msmpi; \ |
| 212 |
mkdir -p lib/msmpi; \ |
| 213 |
cp "$$MSMPI_INC"/*.h include/msmpi; \ |
| 214 |
sed 's/INT_PTR_KIND()/@SIZEOF_PTR@/' <"$$MSMPI_INC"/mpif.h > include/msmpi/mpif.h; \ |
| 215 |
sed 's/MPI_Status array_of_statuses\[\]/MPI_Status\* array_of_statuses/' < "$$MSMPI_INC"/mpi.h > include/msmpi/mpi.h; \ |
| 216 |
grep KIND include/msmpi/mpif.h; \ |
| 217 |
test "@SIZEOF_PTR@" -eq 8 && cp "$$MSMPI_INC"/x64/*.h include/msmpi && cp "$$MSMPI_LIB64"/*.lib lib/msmpi; \ |
| 218 |
test "@SIZEOF_PTR@" -eq 4 && cp "$$MSMPI_INC"/x86/*.h include/msmpi && cp "$$MSMPI_LIB32"/*.lib lib/msmpi; \ |
| 219 |
fi |
| 220 |
# FFCS: need to stop at the first error to make sure that all libraries are correctly compiled |
| 221 |
compile-dir: |
| 222 |
@echo "\n\n ****** $(COMPILEDIR) ****** \n\n"; |
| 223 |
@if [ 0 -eq `egrep ':$(COMPILEDIR) *LD' WHERE-LD | wc -l` ]; then \ |
| 224 |
cd $(COMPILEDIR) && $(MAKE) $(DIRTARGET); \ |
| 225 |
else \ |
| 226 |
echo $(COMPILEDIR) is in WHERE- files; \ |
| 227 |
fi |
| 228 |
compile-pkg: tag-compile-pkg WHERE-LD |
| 229 |
|
| 230 |
# FFCS: need to stop at the first error to make sure that all libraries are correctly compiled |
| 231 |
tag-compile-pkg: bin lib include pkg FORCE |
| 232 |
@if [ -n "$(WGET)" ]; then \ |
| 233 |
for d in $(LIST_SOFT); do $(MAKE) compile-dir COMPILEDIR=$$d || exit 1; done; \ |
| 234 |
if [ -n "$(MPICC)" ]; then \ |
| 235 |
for d in $(MPI_SOFT); do $(MAKE) compile-dir COMPILEDIR=$$d || exit 1; done; \ |
| 236 |
fi; \ |
| 237 |
fi |
| 238 |
$(MAKE) install-hpddm install-htool install-bemtool install-boost |
| 239 |
touch tag-compile-pkg |
| 240 |
FORCE: |
| 241 |
|
| 242 |
re-install: |
| 243 |
$(MAKE) compile-pkg DIRTARGET=install |
| 244 |
WHERE: |
| 245 |
$(MAKE) compile-pkg DIRTARGET=WHERE |
| 246 |
install-exec-local: |
| 247 |
$(mkinstalldirs) -m 755 "$(DESTDIR)$(ff_prefix_dir)/lib" |
| 248 |
$(mkinstalldirs) -m 755 "$(DESTDIR)$(ff_prefix_dir)/bin" |
| 249 |
$(mkinstalldirs) -m 755 "$(DESTDIR)$(ff_prefix_dir)/include" |
| 250 |
cp -rp lib "$(DESTDIR)$(ff_prefix_dir)" |
| 251 |
cp -rp include "$(DESTDIR)$(ff_prefix_dir)" |
| 252 |
cp -rp bin "$(DESTDIR)$(ff_prefix_dir)" |
| 253 |
-if test -f boost/done.tag; then \ |
| 254 |
$(mkinstalldirs) -m 755 "$(DESTDIR)$(ff_prefix_dir)/boost"; \ |
| 255 |
cp -rp boost "$(DESTDIR)$(ff_prefix_dir)"; \ |
| 256 |
fi |
| 257 |
clean-local: |
| 258 |
-rm -rf tag-* include lib bin WHERE-LD |
| 259 |
-mkdir include lib bin |
| 260 |
-rm */FAIT */FAIRE |
| 261 |
# FFCS - make sure that all directories are cleaned. Thisis especially important under Windows because there is no |
| 262 |
# compilation dependencies control there (see |
| 263 |
# [[file:c:/cygwin/home/alh/ffcs/dist/configure.ac::dependency_tracking]]) |
| 264 |
for d in $(LIST_SOFT) $(MPI_SOFT); do $(MAKE) clean -C $$d; done |