Problem with gfortran: unable to obtain libquadmath for Mac Big Sur

Viewed 1174

I recently bought the McBook Air with M1 processor and Big Sur as Os.

I am trying to build a library which requires gcc and gfortran. I did not have gfotran, so I run a

brew install gcc

which led to the following libraries under the home-brew installing path (/opt/homebrew/Cellar):

list of libraries downloaded with gcc

However I cannot find the libquadmath.dylib. I also tried to download this

gfortran experimental release for ARM Big Sur

Nothing, I cannot seem to be able to have the libquadmath.dylib.

I am fairly new to all this, this is my first Mac, and I haven't been working with C++ (just Python).

I am sorry if this question looks rather silly, but I cannot seem to find a workaround. Does anyone have had the same experience/problems?

Thanks a lot! Monica

1 Answers

I am running an Intel Mac on MacOS Big Sur and I had the same issue.

Apparently all gfortran libraries are stored inside the gcc directory (or Cellar if you are using Homebrew).

For me the issue was that /usr/local/gfortran/lib/libquadmath.0.dylib was missing even though all gfortran dependencies were installed inside the gcc directory.

Using locate libquadmath.0.dylib I could find all files with that name on my system. The first time you run locate it will take a while and will generate a search index in the background.

I found that /usr/local/lib/gcc/11/libquadmath.0.dylib exists and I could just add a link to the existing files:

ln /usr/local/lib/gcc/11/libquadmath.0.dylib /usr/local/gfortran/lib/libquadmath.0.dylib

Before being able to create the link I had to create the directory /usr/local/gfortran/lib/.

Related