Not finding libraries

Discussion in 'Mac Programming' started by astropig, Apr 21, 2014.

  1. astropig macrumors newbie

    Joined:
    Mar 1, 2014
    #1
    On my new Mac Pro, if I do a
    gfortran test.f
    I get an error message saying that it cannot find libfortran.spec. However, the library is indeed there in /usr/local/lib. If I explicitly do a
    gfortran -L /usr/local/lib test.f
    everything works fine.

    On my MacBook Air laptop (running the same 10.9.2) I never have had to specify the library location. I've done a printenv on both machines, and while there is a lot more "stuff" on my MacBook Air, it's not clear what/where any flags are being set there. What do I have to do to make sure the Mac Pro automatically goes looking in /usr/local/lib for libraries?

    Sorry for this question being so basic.
     
  2. aly macrumors member

    Joined:
    Jul 3, 2006
    Location:
    Scotland
    #2
    I may be way off the mark. But is this not just a case of updating the PATH in your profile?

    Google for something like "Change PATH variable on Mac" and it should point you in the right direction.
     
  3. astropig thread starter macrumors newbie

    Joined:
    Mar 1, 2014
    #3
    I'm afraid not. The PATH controls where it will go looking for an executable, but my understanding (which may be flawed) is that it goes looking for libraries is controlled otherwise. Regardless, adding /usr/local/lib to my path didn't solve it, but thanks for the suggestion.
     
  4. aly, Apr 22, 2014
    Last edited: Apr 22, 2014

    aly macrumors member

    Joined:
    Jul 3, 2006
    Location:
    Scotland
    #4
    Ah sorry, I had executable in my head I wasn't thinking that you were using a library. I hope you find an answer!

    Edit: Some googling seems to suggest DYLD_LIBRARY_PATH is what needs to be updated but there is a tool for doing this rather than editing manually.
     

Share This Page