# How to install on M2 Mac?

**URL:** <https://community.freefem.org/t/how-to-install-on-m2-mac/2382>\
**Category:** FreeFEM installation\
**Created:** [April 6, 2023, 6:28am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382 "2023-04-06T06:28:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ogawa](https://avatars.discourse-cdn.com/v4/letter/o/ecc23a/32.png) [@ogawa](https://community.freefem.org/u/ogawa)\
**Post date:** [April 6, 2023, 6:28am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/1 "2023-04-06T06:28:30Z")

</div>

I installed Freefemv4.12 on my m2 mac and got the following error.  
Are there any libraries that need to be pre-installed?

# filerc : .zprofile ./Install-app.sh: line 48: 1446 Killed: 9 /Applications/FreeFem++.app/Contents/ff-$ver/bin/FreeFem++ /Applications/FreeFem++.app/Contents/ff-$ver/share/FreeFEM/$ver/examples/tutorial/Laplace.edp Create Link of example and Doc

/Users/iberico  
Error missing install missing lib ??

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [April 6, 2023, 6:29am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/2 "2023-04-06T06:29:23Z")

</div>

You should compile from the sources: [GitHub - FreeFem/FreeFem-sources: FreeFEM source code](https://github.com/FreeFem/FreeFem-sources#freefem). The success rate is higher.

---

<div class="post-metadata">

**Author:** ![ogawa](https://avatars.discourse-cdn.com/v4/letter/o/ecc23a/32.png) [@ogawa](https://community.freefem.org/u/ogawa)\
**Post date:** [April 7, 2023, 2:21am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/3 "2023-04-07T02:21:18Z")

</div>

I have tried compiling from source code.  
However, the Automatic configuration part did not work.  
It says to enter “autoreconf -i” but I could not figure out how to install autoconf.  
Is it different from autoconf?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [April 7, 2023, 4:58am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/4 "2023-04-07T04:58:32Z")

</div>

If you are using Homebrew, you could use `brew install automake`.

---

<div class="post-metadata">

**Author:** ![ogawa](https://avatars.discourse-cdn.com/v4/letter/o/ecc23a/32.png) [@ogawa](https://community.freefem.org/u/ogawa)\
**Post date:** [April 7, 2023, 7:13am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/5 "2023-04-07T07:13:30Z")

</div>

I was able to install automake from homebrew.  
In addition, the installation was performed including PETSc.  
Sudo make install has also been executed.

However, when I ran “test.edp”, I got a segmentation fault and could not calculate.

I typed “FreeFem++ test.edp” and ran it.

If there are any additional options please let me know.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [April 7, 2023, 11:27am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/6 "2023-04-07T11:27:35Z")

</div>

If you go into `examples/hpddm` and type `make check`, what do you get?

---

<div class="post-metadata">

**Author:** ![ogawa](https://avatars.discourse-cdn.com/v4/letter/o/ecc23a/32.png) [@ogawa](https://community.freefem.org/u/ogawa)\
**Post date:** [April 8, 2023, 6:59am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/7 "2023-04-08T06:59:23Z")

</div>

EXAMPLE was executed.  
The result was that all 106 files were SKIP.  
Since this is not an error, does this mean that the installation is working correctly?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [April 8, 2023, 7:03am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/8 "2023-04-08T07:03:54Z")

</div>

No, they should not be skipped, they should pass. Did you properly followed all steps from `README.md` that I sent earlier?

---

<div class="post-metadata">

**Author:** ![ogawa](https://avatars.discourse-cdn.com/v4/letter/o/ecc23a/32.png) [@ogawa](https://community.freefem.org/u/ogawa)\
**Post date:** [April 10, 2023, 12:32am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/9 "2023-04-10T00:32:55Z")

</div>

I understand.  
What is the address to send it to?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [April 10, 2023, 5:46am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/10 "2023-04-10T05:46:43Z")

</div>

I’m sorry, I don’t understand your question.

---

<div class="post-metadata">

**Author:** ![ogawa](https://avatars.discourse-cdn.com/v4/letter/o/ecc23a/32.png) [@ogawa](https://community.freefem.org/u/ogawa)\
**Post date:** [April 11, 2023, 1:49am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/11 "2023-04-11T01:49:29Z")

</div>

I’m sorry.  
I want to send you the README.md file, please let me know the email address to send it to.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [April 11, 2023, 4:38am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/12 "2023-04-11T04:38:45Z")

</div>

I’m not sure I understand why you’d want me to send this file, it’s available on GitHub for everyone.

---

<div class="post-metadata">

**Author:** ![ogawa](https://avatars.discourse-cdn.com/v4/letter/o/ecc23a/32.png) [@ogawa](https://community.freefem.org/u/ogawa)\
**Post date:** [April 12, 2023, 12:54am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/13 "2023-04-12T00:54:06Z")

</div>

The command was executed again from the beginning.  
As a result, I ran “make check” on “examples/hpddm” and got “XFAIL” on all 106 files.

Should I erase all files and start over?  
I have done up to make install, but how do I uninstall if necessary?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [April 12, 2023, 4:28am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/14 "2023-04-12T04:28:51Z")

</div>

Sorry for all the trouble, I think this is not specific to your machine.  
For good measure, could you please try the following.

```auto
$ cd examples/tutorial
$ ../../src/nw/FreeFem++-nw Laplace.edp -v

```

Do you have a segmentation fault running this?  
If so, could you please try to start from scratch and do the following.

```auto
$ rm -rf FreeFem-sources
$ git clone -b develop https://github.com/FreeFem/FreeFem-sources
$ cd FreeFem-sources
$ autoreconf -i
$ ./configure --disable-optim
$ make
$ cd examples/tutorial
$ ../../src/nw/FreeFem++-nw Laplace.edp -v

```

If you don’t have a segmentation fault anymore, do the following.

```auto
$ cd ../../
$ cd 3rdparty/ff-petsc
$ make petsc-slepc
$ cd ../../
$ ./reconfigure
$ make
$ cd examples/hpddm
$ make check

```

Do you still get either `XFAIL` or `SKIP` then?

---

<div class="post-metadata">

**Author:** ![ogawa](https://avatars.discourse-cdn.com/v4/letter/o/ecc23a/32.png) [@ogawa](https://community.freefem.org/u/ogawa)\
**Post date:** [April 12, 2023, 5:03am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/15 "2023-04-12T05:03:56Z")

</div>

An error occurred at the following location.

* * *

```
       UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):

```

* * *

```
                              Error running make on MMG

```

* * *

PETSc installation has failed.  
The preceding “Laplace.edp” was executed successfully.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [April 12, 2023, 5:07am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/16 "2023-04-12T05:07:44Z")

</div>

Could you please `rm -rf 3rdparty/ff-petsc/petsc-3*` and also delete the previous `ff-petsc` folder (presumably in `/usr/local/` if you didn’t configure with a `--prefix`) and try again? If it still fails, please send `3rdparty/ff-petsc/petsc-3*/configure.log`).

---

<div class="post-metadata">

**Author:** ![ogawa](https://avatars.discourse-cdn.com/v4/letter/o/ecc23a/32.png) [@ogawa](https://community.freefem.org/u/ogawa)\
**Post date:** [April 12, 2023, 5:24am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/17 "2023-04-12T05:24:19Z")

</div>

I send you the contents of “configure.log” because of the error.  
The following is the result.

Executing: uname -s

stdout: Darwin

=============================================================================================

Configuring PETSc to compile on your system

=============================================================================================

================================================================================

================================================================================

Starting configure run at Wed, 12 Apr 2023 14:20:35 +0900

Configure Options: --configModules=PETSc.Configure --optionsModule=config.compilerOptions --prefix=/usr/local/ff-petsc/r --with-debugging=0 COPTFLAGS=“-O3 -mtune=native” CXXOPTFLAGS=“-O3 -mtune=native” FOPTFLAGS=“-O3 -mtune=native” --with-ssl=0 --with-x=0 --with-fortran-bindings=0 --with-cudac=0 --with-tau-perfstubs=0 --download-slepc --download-hpddm --download-slepc-commit=4aa7bc16b5f5adead49296eedfacc504ccc5cb71 --with-cc=/usr/local/ff-petsc/r/bin/mpicc --with-cxx=/usr/local/ff-petsc/r/bin/mpicxx --with-fc=/usr/local/ff-petsc/r/bin/mpif90 --with-scalar-type=real --with-blaslapack-include= --with-blaslapack-lib=“-framework Accelerate” --download-metis --download-ptscotch --download-hypre --download-parmetis --download-superlu --download-suitesparse --download-tetgen --download-mmg --download-parmmg --download-slepc-configure-arguments=–download-arpack --download-scalapack --download-mumps PETSC\_ARCH=fr

Working directory: /Users/iberico/my\_program/02\_Freefem/FreeFem-sources/3rdparty/ff-petsc/petsc-3.19.0

Machine platform:

uname\_result(system=‘Darwin’, node=‘ibericonoMac-mini.local’, release=‘22.4.0’, version=‘Darwin Kernel Version 22.4.0: Mon Mar 6 20:59:58 PST 2023; root:xnu-8796.101.5~3/RELEASE\_ARM64\_T6020’, machine=‘arm64’)

Python version:

3.9.6 (default, Mar 10 2023, 20:16:38)

[Clang 14.0.3 (clang-1403.0.22.14.1)]

================================================================================

Environmental variables

MANPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/share/man:/Library/Developer/CommandLineTools/usr/share/man:/Library/Developer/CommandLineTools/Toolchains/XcodeDefault.xctoolchain/usr/share/man:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/share/man:/Library/Developer/CommandLineTools/usr/share/man:/Library/Developer/CommandLineTools/Toolchains/XcodeDefault.xctoolchain/usr/share/man:

TERM=xterm-256color

SHELL=/bin/sh

USER=root

SUDO\_USER=iberico

SUDO\_UID=501

SSH\_AUTH\_SOCK=/private/tmp/com.apple.launchd.2taFNXOxvG/Listeners

\_\_CF\_USER\_TEXT\_ENCODING=0x0:1:14

MAKELEVEL=1

MFLAGS=

MAIL=/var/mail/root

PATH=/Applications/FreeFem++.app/Contents/ff-4.12/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin

PWD=/Users/iberico/my\_program/02\_Freefem/FreeFem-sources/3rdparty/ff-petsc/petsc-3.19.0

LANG=en\_US.UTF-8

SHLVL=1

HOME=/Users/iberico

SUDO\_COMMAND=/usr/bin/make petsc-slepc

LOGNAME=root

SUDO\_GID=20

OLDPWD=/Users/iberico/my\_program/02\_Freefem/FreeFem-sources/3rdparty/ff-petsc

\_=./configure

SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

CPATH=/usr/local/include

LIBRARY\_PATH=/usr/local/lib

Files in path provided by default path

Warning accessing /Applications/FreeFem++.app/Contents/ff-4.12/bin gives errors: [Errno 2] No such file or directory: ‘/Applications/FreeFem++.app/Contents/ff-4.12/bin’

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [April 12, 2023, 5:32am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/18 "2023-04-12T05:32:25Z")

</div>

You need to attach the file. But first, please, try to tidy up your machine.

1. Why is there a reference to `/Applications/FreeFem++.app`? Remove that.
2. Remove `/Users/iberico/my_program/02_Freefem/FreeFem-sources`.
3. Remove `/usr/local/ff-petsc`.

Then, restart from scratch.

```auto
$ git clone -b develop https://github.com/FreeFem/FreeFem-sources
$ cd FreeFem-sources
$ autoreconf -i
$ ./configure --disable-optim
$ cd 3rdparty/ff-petsc
$ make petsc-slepc
$ cd ../../
$ ./reconfigure
$ make
$ cd examples/hpddm
$ make check

```

---

<div class="post-metadata">

**Author:** ![ogawa](https://avatars.discourse-cdn.com/v4/letter/o/ecc23a/32.png) [@ogawa](https://community.freefem.org/u/ogawa)\
**Post date:** [April 12, 2023, 7:00am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/19 "2023-04-12T07:00:54Z")

</div>

It was as follows.  
PASS: 94  
SKIP: 9  
XFAIL: 4

XFAIL:  
stokes-fieldsplit-2d-PETSc.edp  
laplace-adapt-3d-PETSc.edp  
transfer.edp  
helmholtz-mg-2d-PETSc-complex.edp

SKIP:  
Schur-complement-PETSc.edp  
distributed-parmmg.edp  
laplace-adapt-dist-3d-PETSc.edp  
maxwell-mg-3d-PETSc-complex.edp  
helmholtz-3d-surf-PETSc-complex.edp  
helmholtz-3d-line-PETSc-complex.edp  
helmholtz-coupled-2d-PETSc-complex.edp  
helmholtz-dense-3d-line-PETSc-complex.edp  
maxwell-3d-surf-PETSc-complex.edp

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [April 12, 2023, 7:10am UTC](https://community.freefem.org/t/how-to-install-on-m2-mac/2382/20 "2023-04-12T07:10:04Z")

</div>

Much better! I wouldn’t worry too much about those failures.

[Next page](https://community.freefem.org/t/how-to-install-on-m2-mac/2382.md?page=2)
