-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Library libgfortran not found after installing gfortran #8539
Comments
Please provide the output of |
|
Does the problem persist if you use GCC instead of LLVM-GCC:
|
Yes, it persists. (didn't mean to close the issue just now - I fell foul of some keyboard shortcut)
|
Hmm... have you upgraded XCode since installing GFortran? |
Ummm, not sure.
The XCode startup window says it is Version 4.1 (4B110), which I now realize is not the latest. I will try upgrading and see if that changes things. |
Homebrew's GFortran won't work with XCode 4.2 since all non-LLVM compilers have been removed and GFortran is not an LLVM compiler. |
Oh - so I would have been better off staying with Xcode 4.1? |
Yeah, I wouldn't recommend upgrading to 4.2 unless you are building software for the Mac App Store or the iTunes Store. |
I've run into this issue as well. I'm compiling a C++ program which links to libgfortran during Should the brew for gfortran install a I realize I could easily symlink it to Thanks. |
The libraries are installed to the
The directory is set up in a specific way so that compilers can locate the right libraries for the right architectures---which allows you to build universal binaries. The problem is, only I think this problem can be fixed by setting the
|
Anything to do here? Caveats or something? |
Yeah, a caveat that One unknown that needs to be tested is what |
I fear that |
The stupid question, I have: Why does I should add a note in the caveats of the new gfortran formula, if that would solve the linking issues you had. |
I think it doesn't work because that lib folder has different subdirectories for each architecture. So one would need to include a different path depending on the |
@rwest Homebrew updated their gfortran to version 4.7 yesterday. Please brew update and try again. Let us know how it goes. |
I don't think my new gfortran formula helps here. It's basically still the same issue. Linking with gfortran works but other compiler don't know about the location of the gfortran libs. @rwest any progress or ideas? |
@Sharpie |
Not all versions of GCC behave like that. For example:
I'm still convinced that setting |
Also,
|
Ok, it was just an idea out of the blue. Let's forget about it. We should close this issue and perhaps add a caveat to the gfortran formula? |
@Sharpie perhaps you can add a little caveat, so we can finally close this issue? |
Just wanted to say that I'd be much obliged if someone could "fix" this. I'm not a programmer by trade or education, and just had to compile something for work and was having huge problems until I stumbled onto this thread. Thankfully, setting library_path worked fine, but the thought that there was something "wrong" with my homebrew installation hadn't even crossed my mind until I found this page (ironically because homebrew usually works so smoothly). In future, if I were to brew install gcc45 and use that gcc instead of Apple's, would it have avoided this issue? |
@samueljohn thank you, your explanation's much appreciated |
I has similar issues myself, it seems the remains of a non-homebrew installed gfortran (installed from a source tarball) were conflicting with the Homebrew installed gfortran. I had to do a lot of manual cleaning out of files, most particularly removing the non-homebrew /usr/bin/gfortran I noticed in ENV.rb if |
I get what is probably this problem attempting to build sage: https://gist.github.com/awreece/4981412 |
@Sharpie you know more about gfortran than, me. Want to add a proper caveat to gfortran? In homebrew-science, there is the following line, which is also related to the gfortran library: It seems to work but I don't know if that is a hack or solution. |
@awreece if you set the |
@samueljohn Actually, I managed to get it to work a while back after rebuilding gcc from homebrew/dupes and doing some other stuff. Unfortunately, I don't think I can reproduce the steps I took to fix the issue :-/ |
Closing because of the age of this issue, and because various reporters have found reasons or workarounds. Any new issues should come up as new issues, with appropriate documentation. |
I also ran into this problem, when attempting to use brew-installed gcc 4.8.2 to compile external code (not managed in the brew repos). My workaround was to install GFortran 4.8.2 from https://gcc.gnu.org/wiki/GFortranBinaries and set the compiler flag |
After installing gfortran, I have the following libraries:
And I have the link
/usr/local/lib/gcc -> ../Cellar/gfortran/4.2.4-5666.3/lib/gcc
so that they can be found at
However, when I try to build things with, for example,
/usr/bin/llvm-gcc -bundle -undefined dynamic_lookup ... -lgfortran ...
I get:It is failing to find any libgfortan.a.
Various workarounds are described by other people who have had this problem, for example:
https://github.com/zk00006/OpenTLD/wiki/InstallingOctave-Mac
http://eris.liralab.it/wiki/Homebrew
http://obspy.org/wiki/InstallingDependenciesMac
What is the best way to solve this?
The text was updated successfully, but these errors were encountered: