| 1 |
<!-----------------------------------------------------------------------------------> |
| 2 |
<!--- This file is part of FreeFEM. ---> |
| 3 |
<!--- Laboratoire Jacques-Louis Lions ---> |
| 4 |
<!--- Sorbonne Université, UMR 7598, Paris, F-75005 France ---> |
| 5 |
<!--- ---> |
| 6 |
<!--- FreeFEM is free software: you can redistribute it and/or modify ---> |
| 7 |
<!--- it under the terms of the GNU Lesser General Public License as published by ---> |
| 8 |
<!--- the Free Software Foundation, either version 3 of the License, or ---> |
| 9 |
<!--- (at your option) any later version. ---> |
| 10 |
<!--- ---> |
| 11 |
<!--- FreeFEM is distributed in the hope that it will be useful, ---> |
| 12 |
<!--- but WITHOUT ANY WARRANTY; without even the implied warranty of ---> |
| 13 |
<!--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ---> |
| 14 |
<!--- GNU Lesser General Public License for more details. ---> |
| 15 |
<!--- ---> |
| 16 |
<!--- You should have received a copy of the GNU Lesser General Public License ---> |
| 17 |
<!--- along with FreeFEM. If not, see <http://www.gnu.org/licenses/>. ---> |
| 18 |
<!-----------------------------------------------------------------------------------> |
| 19 |
|
| 20 |
# How to compile FreeFem++ on MacOSX |
| 21 |
|
| 22 |
## Sep 2023 |
| 23 |
|
| 24 |
The mac version is compiled with the script: |
| 25 |
|
| 26 |
``` bash |
| 27 |
bin/compile-version-MacOS gitbranch path-where-to-compile configure-parameter |
| 28 |
``` |
| 29 |
|
| 30 |
`configure-parameter` can take the following values: |
| 31 |
|
| 32 |
+ generic for --enable-generic |
| 33 |
+ debug for --enable-debug |
| 34 |
+ optim for --enable-optim |
| 35 |
|
| 36 |
and exact: |
| 37 |
```bash |
| 38 |
bin/compile-version-MacOS master $HOME/tmp generic |
| 39 |
``` |
| 40 |
|
| 41 |
## Feb 2022 |
| 42 |
|
| 43 |
The Version 4.10 is compiled Under Monteray (Apple M1: arm64e) and on (Apple : x86) |
| 44 |
|
| 45 |
### for Apple M1 (arm64e) |
| 46 |
|
| 47 |
Add with Homebrew |
| 48 |
|
| 49 |
1. Install Homebrew |
| 50 |
|
| 51 |
See [install Homebrew](https://brew.sh/index_fr) |
| 52 |
|
| 53 |
2. Install these brew packages to compile FreeFEM++ |
| 54 |
|
| 55 |
```bash |
| 56 |
brew install \ |
| 57 |
aom gettext jpeg libx11 pango \ |
| 58 |
autoconf giflib jpeg-xl libxau pcre \ |
| 59 |
automake glib libavif libxcb pixman \ |
| 60 |
bdw-gc gmp libcerf libxdmcp pkg-config \ |
| 61 |
bison gnuplot libevent libxext [email protected] \ |
| 62 |
brotli gnutls libffi libxrender qt@5 \ |
| 63 |
ca-certificates gobject-introspection libidn2 lua readline \ |
| 64 |
cairo graphite2 libmpc lzo sqlite \ |
| 65 |
emacs gsl libnghttp2 m4 szip \ |
| 66 |
flex guile libpng make unbound \ |
| 67 |
fontconfig harfbuzz libpthread-stubs mpdecimal webp \ |
| 68 |
freetype hdf5 libtasn1 mpfr wget \ |
| 69 |
fribidi icu4c libtiff nettle xorgproto \ |
| 70 |
gcc imath libtool openexr xz \ |
| 71 |
gd isl libunistring [email protected] zip \ |
| 72 |
gdbm jansson libvmaf p11-kit zstd |
| 73 |
``` |
| 74 |
|
| 75 |
3. Download the sources of FreeFEM++ with git |
| 76 |
|
| 77 |
```bash |
| 78 |
git clone [email protected]:FreeFem/FreeFem-sources.git ff++ |
| 79 |
``` |
| 80 |
or the develop version |
| 81 |
|
| 82 |
```bash |
| 83 |
git clone -b develop [email protected]:FreeFem/FreeFem-sources.git ff++ |
| 84 |
``` |
| 85 |
4. Compile FreeFem++ without PETSc and MPI |
| 86 |
|
| 87 |
```bash |
| 88 |
cd ff++ |
| 89 |
autoreconf -i |
| 90 |
./configure --enable-summary --enable-download_arpack --prefix=/Applications/FreeFem++.app/Contents/ff-4.10/ --enable-download --enable-optim --enable-m64 F77=gfortran FC=gfortran --enable-maintainer-mode |
| 91 |
make |
| 92 |
sudo make install |
| 93 |
``` |
| 94 |
|
| 95 |
4. Compile FreeFem++ with PETSc and MPI |
| 96 |
|
| 97 |
```bash |
| 98 |
cd ff++ |
| 99 |
autoreconf -i |
| 100 |
./configure --enable-summary --enable-download_arpack --prefix=/Applications/FreeFem++.app/Contents/ff-4.10/ --enable-download --enable-optim --enable-m64 F77=gfortran FC=gfortran --enable-maintainer-mode |
| 101 |
cd 3rdparty/ff-petsc |
| 102 |
make |
| 103 |
``` |
| 104 |
follow the output |
| 105 |
```bash |
| 106 |
cd - |
| 107 |
./reconfigure |
| 108 |
make -j 20 |
| 109 |
# check your version ... |
| 110 |
make -j 20 check |
| 111 |
# to install in /Applications/FreeFem++.app/Contents/ff-4.10/ |
| 112 |
sudo make install -j 20 |
| 113 |
|
| 114 |
``` |
| 115 |
|
| 116 |
|
| 117 |
## _october 2015_ (oldies) |
| 118 |
|
| 119 |
The version 3.41 is compiled Under Yosemite (10.10.5), |
| 120 |
xcode 7.0.1 + previous install of latex and with other brew install |
| 121 |
|
| 122 |
|
| 123 |
Add installer Intel ifort compiler (ifort version 15.0.2 with mkl), |
| 124 |
build mpich, libgsl, hdf5 |
| 125 |
|
| 126 |
The configure option used for all softwares are: |
| 127 |
```bash |
| 128 |
mpich-3.1.4: ./configure 'FC=ifort' 'F77=ifort' '-prefix=/usr/local/ff++/mpich' |
| 129 |
gsl-1.16 ./configure 'CC=clang' '--prefix=/usr/local/ff++/mpich/' |
| 130 |
hdf5-1.8.14 ./configure '--enable-cxx' 'CC=clang' 'CXX=clang++' '--prefix=/usr/local/ff++/mpich' |
| 131 |
PETSc ./configure '--CFLAGS=-O2' '--COPTFLAGS=-O3' '--CXXFLAGS=-O2 -std=c++11' \ |
| 132 |
'--CXXOPTFLAGS=-O3' '--FFLAGS=-O2' '--FOPTFLAGS=-O3' '--download-fftw' \ |
| 133 |
'--download-hypre' '--download-metis' '--download-ml' '--download-mumps' \ |
| 134 |
'--download-parmetis' '--download-ptscotch' '--download-scalapack' \ |
| 135 |
'--download-suitesparse' '--download-superlu' '--prefix=/usr/local/ff++/mpich/petsc' \ |
| 136 |
'--with-blas-lapack-lib=-L/opt/intel/mkl/lib -lmkl_intel_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_sequential -lm -lpthread' '--with-mpi-dir=/usr/local/ff++/mpich' 'PETSC_ARCH=arch-ff++' |
| 137 |
FreeFem++: ./configure '--prefix=/usr/local/ff++/mpich/3.41' '--enable-download' '--enable-optim' '--enable-m64' \ |
| 138 |
'F77=ifort' 'FC=ifort' '--enable-maintainer-mode' '--with-mkl=/opt/intel/mkl/lib' \ |
| 139 |
'--with-petsc=/usr/local/ff++/mpich/petsc/lib/petsc/conf/petscvariables' '-with-hdf5=/usr/local/ff++/mpich/bin/h5cc' \ |
| 140 |
'--with-gsl-prefix=/usr/local/ff++/mpich/' '--disable-pastix' |
| 141 |
``` |
| 142 |
|
| 143 |
Please read INNOVATION file to see recent changes and news |
| 144 |
|
| 145 |
Plus all previous install with brew install |
| 146 |
```bash |
| 147 |
499 brew install wget |
| 148 |
500 brew install autoconf |
| 149 |
501 brew install automake |
| 150 |
504 brew install cmake |
| 151 |
505 brew install gfortran |
| 152 |
506 brew install gcc |
| 153 |
540 brew install m4 |
| 154 |
585 brew install pkg-config |
| 155 |
588 brew install gobject-introspection |
| 156 |
``` |
| 157 |
|
| 158 |
LateX is install form [https://tug.org/mactex/mactex-download.html](https://tug.org/mactex/mactex-download.html). |
| 159 |
|
| 160 |
## To compile a full version of FreeFem++ under MacOS |
| 161 |
|
| 162 |
Under Yosemite (10.10.2, xcode 6.2 form scratch) |
| 163 |
|
| 164 |
* install Xcode, do clang to install command line |
| 165 |
* With brew install |
| 166 |
```bash |
| 167 |
499 brew install wget |
| 168 |
500 brew install autoconf |
| 169 |
501 brew install automake |
| 170 |
504 brew install cmake |
| 171 |
505 brew install gfortran |
| 172 |
506 brew install gcc |
| 173 |
540 brew install m4 |
| 174 |
585 brew install pkg-config |
| 175 |
588 brew install gobject-introspection |
| 176 |
``` |
| 177 |
* Install brew |
| 178 |
|
| 179 |
Under Mavericks (10.9, xcode 5.0.2 form scratch) |
| 180 |
|
| 181 |
* Install Xcode 5.0.2, and the xcode command line tools, |
| 182 |
install Auxiliary Tools for Xcode (for PackageMaker) |
| 183 |
* Install Xcode command line |
| 184 |
```bash |
| 185 |
xcode-select --install |
| 186 |
``` |
| 187 |
* Install gcc-4.9 form [http://hpc.sourceforge.net](http://hpc.sourceforge.net) |
| 188 |
```bash |
| 189 |
curl -O http://prdownloads.sourceforge.net/hpc/gfortran-4.9-bin.tar.gz?download |
| 190 |
sudo tar zxvf gfortran-4.9-bin.tar.gz -C / |
| 191 |
``` |
| 192 |
* Install autoconf and automake (not in Xcode) |
| 193 |
|
| 194 |
I use the macport distribution form [http://www.macports.org](http://www.macports.org) |
| 195 |
```bash |
| 196 |
sudo port install autoconf |
| 197 |
sudo port install automake |
| 198 |
``` |
| 199 |
Or with brew tool |
| 200 |
4) Install TeX from [ctan](http://mirrors.ctan.org/systems/mac/mactex/MacTeX.pkg) |
| 201 |
5) Install openmpi form the [source](http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.5.tar.bz2) |
| 202 |
```bash |
| 203 |
./configure 'CC=clang' 'CXX=clang++' 'FC=gfortran' 'F77=gfortran' --enable-ltdl-convenience |
| 204 |
make |
| 205 |
sudo make install |
| 206 |
``` |
| 207 |
6) Install gsl |
| 208 |
```bash |
| 209 |
curl -O http://ftp.gnu.org/gnu/gsl/gsl-1.15.tar.gz |
| 210 |
tar zxvf gsl-1.15.tar.gz |
| 211 |
cd gsl-1.15. |
| 212 |
./configure CC=clang |
| 213 |
make |
| 214 |
sudo make install |
| 215 |
``` |
| 216 |
7) Install git from the web [https://sourceforge.net/projects/git-osx-installer/](https://sourceforge.net/projects/git-osx-installer/) |
| 217 |
|
| 218 |
8) Download the sources |
| 219 |
```bash |
| 220 |
git clone [email protected]:FreeFem/FreeFem-sources.git |
| 221 |
``` |
| 222 |
9) Compile FreeFem++ |
| 223 |
```bash |
| 224 |
cd FreeFem-sources |
| 225 |
./configure '-with-suffix=macos-10.9' '-without-fltk' '--enable-download' '--enable-optim' 'MPIRUN=/usr/local/bin/mpirun' '--enable-m64' '--without-x' 'CC=clang' 'CXXFLAGS=-std=c++11' 'CXX=clang++' 'F77=/usr/local/bin/gfortran' 'FC=/usr/local/bin/gfortran' 'MPICXX=/usr/local/bin/mpic++' 'MPICC=/usr/local/bin/mpicc' 'MPIFC=/usr/local/bin/mpif90' '--enable-maintainer-mode' |
| 226 |
make |
| 227 |
sudo make install |
| 228 |
``` |