dyld: Library not loaded - how to use ln - s properly? - osx-mavericks

I literally just got my MacBook back from the repair shop and although (nearly) everything is nice and dandy, I can't launch Gromacs to run some simulations :(
I'm getting the following error:
dyld: Library not loaded: /usr/local/lib/libfftw3f.3.dylib
Referenced from: /usr/local/gromacs/bin/grompp
Reason: image not found
Trace/BPT trap: 5
From another very similar thread here, I saw the ln -s solution so I looked for the libfftw3f.3.dylib file and found it in this path /usr/local/Cellar/fftw/3.3.4/lib/libfftw3f.3.dylib
Should I try the line ln -s /usr/local/Cellar/fftw/3.3.4/lib/libfftw3f.3.dylib /usr/local/lib/libfftw3f.3.dylib or is there a chance I'll break the computer?! Sorry, I'm not much of a programmer and in the past I have messed it up quite badly while learning/working so particularly now that I only just got it back (HDD problem, I didn't break it this time!) I'm even more hesitant.
Would be great if someone could let me know what they think?

You should recompile gromacs to run with whatever has been changed on your system.

Related

Compilation fails using Chapel on a mac

Using a stock install of Chapel (via Homebrew) on a Mac running Big Sur. Tried to compile one of the example programs:
chpl /usr/local/Cellar/chapel/1.27.0/libexec/examples/hello.chpl
followed with
mv: rename /var/folders/81/9s9zv6450td9kgh_znllq52000037c/T//chpl-username.deleteme-nJkMMc/hello.tmp to hello: No such file or directory
error: mv /var/folders/81/9s9zv6450td9kgh_znllq52000037c/T//chpl-username.deleteme-nJkMMc/hello.tmp hello
error: Make Binary - Linking
Looks like a simple fix, but would appreciate suggestions. (And annoyingly, am trying to (eventually!) do a local compile of a package I contributed to)
R.
As noted and verified in the comments above, this seems to have been a recently discovered issue in our code base that can be worked around in homebrew for the time being by doing a brew update. It ought to be fixed in a more principled manner in Chapel 1.28.0 and onwards. If others see this failure mode going forward, please consider opening a GitHub issue on the Chapel repository so that we can help you work through it.

How can I install qcl on OSX?

The answer to this question might be easy for some of you but I haven't been able to figure it out. There is very little information on this topic on the web, I guess it doesn't interest a lot of people.
I'm trying to install qcl on my mac. However, I have no clue how to do so. I know I should compile it in a certain way (through GCC?), but I don't know how.
Here's where the installation files are : http://tph.tuwien.ac.at/~oemer/qcl.html
I also tried installing it through homebrew (brew install homebrew/science/qcl). But when I do so, I get an error when trying to run it (by typing qcl in the terminal). Here's the error in question :
dyld: Symbol not found: __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev
Referenced from: /usr/local/bin/qcl
Expected in: /usr/lib/libstdc++.6.dylib
in /usr/local/bin/qcl
Abort trap: 6
I'd really like to figure out a solution to the problem on my own but I guess my CS knowledge is insufficient. I need your help.
Thank you in advance for all your answers !

Unix "open ." not working because of libtiff?

I recently installed libtiff, since installing libtiff, "/usr/bin/open" no longer works and I am getting the following error. I have no idea how to fix this?
dyld: Symbol not found: __cg_TIFFClientOpen
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /usr/local/lib/libTIFF.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
[1] 1184 trace trap open .
It is hard to say with any certainty from the information given, but a not-too-wild guess is that libtiff was installed in such a way that various system components find the newly installed libtiff, rather than the system one that they expect (which is probably a completely different library that just happens to have the same name).
The obvious way to do that would be by modifying any of the multitude of environment variables that affect how the dynamic linker works (run 'man dyld' for details). Running 'env | grep DYLD_' should show you if this is the case. If there are such variables set, you will then have to figure out where they get set, and fix that.
As far as I can tell, any installation which relies on DYLD_* variables being set, system-wide, for routine operations, is broken, because it will very likely cause problems like this.

Mac system can't find Ruby file to execute

I'm trying to execute my Ruby file that just prints out a string of text: this is literally the file:
puts "System Initialized"
but I keep getting an error every time I try it.
When I execute it, it looks like this:
My-Mac-mini:event_manager my_name$ ruby lib\event_manager.rb
The error message is as follows:
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
Referenced from: /Users/crystalchoi/.rvm/rubies/ruby-2.1.3/bin/ruby
Reason: image not found
Trace/BPT trap: 5
I'm pretty new to using a Mac when it comes to programming, and I'm following a tutorial to do this, so I'm not sure what I'm doing wrong.
If anyone can help me decipher this error message and let me know how to correct it or can point me in the right direction, I would be very grateful.
ruby lib\event_manager.rb
Mac OS, like other *nix-based systems, uses / to separate the path components of files. Only Windows uses \. Instead use:
ruby lib/event_manager.rb
A Ruby tutorial isn't going to help a whole lot unless you understand the *nix command-line so you can move around and execute things, so I'd STRONGLY suggest you learn a lot more about how *nix works. Having developed on Linux for years, I have had to use my command-line knowledge just as much as my programming-language skills daily.
Does the specified library (/usr/local/lib/libgmp.10.dylib) exist?
I just checked and I could not find it at all.
GMP (libgmp) is an optional dependency of ruby. When you installed ruby, it was configured to use GMP, but you don't have the library file (/usr/local/lib/libgmp.10.dylib)
That's OK, you can get GMP ( The GNU Multiple Precision Arithmetic Library) from homebrew.
brew update
brew install gmp
You may need to re-install ruby afterward.
See https://superuser.com/questions/820364/ruby-installation-issues-with-rvm where other people had the same problem.
Advanced
If you're compiling ruby the old school way (./configure && make) then you could try using the --without-gmp config. option.
See https://bugs.ruby-lang.org/issues/8796

How do I link to a missing dylib in Terminal?

I am a little nervous to mess with anything in the terminal because of my small amount of experience of getting anything right on the first try. Which is why I'm asking.
I'm trying to run shp2pgsql with fresh install of OSX Mavericks. I've installed Postgres 9.3 v2.1.0-2 with PostGIS 2.1.
The error I'm getting is:
dyld: Library not loaded: #loader_path/../lib/libintl.8.dylib
Referenced from: /Library/PostgreSQL/9.3/bin/shp2pgsql
Reason: image not found
Trace/BPT trap: 5
I've looked at
http://librelist.com/browser//homebrew/2013/5/15/missing-dylib-files/#85200742c00af0a239140b02f860d987 which suggests that brew install gettext. This has installed libintl.8.dylib at:
/usr/local/Cellar/gettext/0.18.3.1/lib/libintl.8.dylib
I have found some resources on how to make symbolic (?) links, but I'm unsure if this is the appropriate solution or even how to do it in this specific case since shp2pgsql is referencing:
#loader_path/../lib/libintl.8.dylib
Thank you!
-Nicholas
The "loader" is /Library/PostgreSQL/9.3/bin/shp2pgsql. That makes dyld's notion of the #loader_path equal to /Library/PostgreSQL/9.3/bin. Substituting that into the library reference transforms #loader_path/../lib/libintl.8.dylib to /Library/PostgreSQL/9.3/bin/../lib/libintl.8.dylib. Simplifying that, we get /Library/PostgreSQL/9.3/lib/libintl.8.dylib. So that's where Postgres apparently expects its libintl library to be located.
If it's not there, that suggests the Postgres install is broken. You'd have to take that up with whoever provided it.
It's possible that you can work around this by setting a dyld environment variable. For example, you could try export DYLD_LIBRARY_PATH=/usr/local/lib before invoking Postgres. However, this will cause Postgres to use a different library than it was linked against, which isn't guaranteed to work.
You have to recompile shp2pgsql program. As you upgraded your system and libraries, you have now to recompile your program to those new libraries.

Resources