Octave + GNUPlot + Aquaterm + Mac OS 10.6 - macos

I'm attempting to do all of my MatLab based homework assignments in Octave - the opensource representation of MatLab.
However, I'm having problems getting graphs to plot and I think it's a simple linking problem. I am running:
-Mac OS X Snow Leopard (10.6)
-Octave 3.2.2
-Aquaterm 1.0.1
-GNUPlot 4.0
Here is an example of the errors that I am getting from my shell:
Mr-Buffalo:~ buffingtonr$ gnuplot
dyld: Library not loaded: /usr/local/lib/libaquaterm.1.0.0.dylib
Referenced from: /usr/local/bin/gnuplot
Reason: image not found
Trace/BPT trap
octave-3.2.2:1> f = inline('x^2')
f(x) = x^2
octave-3.2.2:5> ezplot(f)
dyld: Library not loaded: /usr/local/lib/libaquaterm.1.0.0.dylib
Referenced from: /usr/local/bin/gnuplot
Reason: image not found
dyld: Library not loaded: /usr/local/lib/libaquaterm.1.0.0.dylib
Referenced from: /usr/local/bin/gnuplot
Reason: image not found
error: you must have gnuplot installed to display graphics; if you have gnuplot installed in a non-standard location, see the 'gnuplot_binary' function
octave-3.2.2:6>
I don't have the unix foundation necessary to trouble shoot this. Any suggestions/fixes?

the problem could be related to this
http://macresearch.org/gnuplot-aquaterm-snow-leopard-1061
in the answer: Fri, 2009-09-18 01:59 — TeGa

You have aquaterm 1.0.1 installed, and gnuplot is referencing 1.0.0, which you apparently do not have installed on your system.
I'm not terribly familiar with installing a library on a Mac, but you might be able to just grab the 1.0.0 .dmg file from the Aquaterm files page on Sourceforge.
Alternatively, the newest version of octave or gnuplot might reference the newer library, so you might be able to just upgrade one of those instead.
It's a real hack, but I saw a couple places (including this mailing list) suggesting you just link 1.0.0 to your 1.0.1 library. This isn't usually acceptable, because there's no guarantee the libraries are cross-compatible. It would at least be a quick fix so you can get your homework done in time!

New Progress
When I investigated '/usr/local/lib/', I found that there was a symbolic-link in the directory:
aquaterm-1.0.0 -> /Library/Frameworks/AquaTerm.framework/Versions/A/AquaTerm
So I created a similar sym-link to make the file gnuplot is looking for (...1.0.1) point to the default AquaTerm location:
aquaterm-1.0.1 -> /Library/Frameworks/AquaTerm.framework/Versions/A/AquaTerm
This fixes the gnuplot launching issue. I verified that gnuplot successfully plots on its own by plotting a function:
Terminal type set to 'x11'
gnuplot> plot sin(x)
Now I get new errors in Octave:
octave-3.2.2:7> ezplot(f=inline('sin(x)'))
gnuplot> set terminal aqua enhanced title "Figure 1"
^
line 0: You can't change the terminal in multiplot mode
gnuplot> if (exists("GPVAL_TERM")) print GPVAL_TERM; else print NaN
^
line 0: invalid expression
error: Invalid call to strcat. Correct usage is:
-- Function File: strcat (S1, S2, ...)
However, I have verified that gnuplot 4.0 is installed and does, in fact, plot graphs. So now it seems the error is in the communication between Octave and GNUPlot. I will try updating to a newer version of gnuplot if possible and report back.
-Buffalo

This worked for me:
Step 1:
Replace /Library/Frameworks/AquaTerm.framework with /opt/local/Library/Frameworks/AquaTerm.framework. This will ensure that the correct 64 bit AquaTerm libraries get referenced by the gnuplot compilation
Step 2:
Replace /Applications/AquaTerm.app with /Applications/MacPorts/AquaTerm.app. This will ensure that the correct 64-bit AquaTerm binary is in the correct location
source:
http://slashusr.wordpress.com/2010/01/17/gnuplot-with-aquaterm-on-osx-snow-leopard/

Related

Unable to use dcmtk commands like dcmodify and dcmscale

System: M1 MacBook air
I created a duplicate terminal that runs with rosetta 2 for installing dcmtk since it's not available for apple chips yet. In the duplicate terminal, I was able to install dcmtk successfully.
On running dcmodify, I get
dyld: Library not loaded: #rpath/libdcmdata.16.dylib
Referenced from: /usr/local/homebrew/bin/dcmodify
Reason: image not found
zsh: abort dcmodify
dcmscale also gives throws a similar error.
dyld: Library not loaded: #rpath/libdcmimage.16.dylib
Referenced from: /usr/local/homebrew/bin/dcmscale
Reason: image not found
zsh: abort dcmscale
How do I fix these errors?
Edit-1: Reinstalling DCMTK made no difference. The error still persists.
Edit-2: I have attached the logs for brew info dcmtk
Since you are using the terminal with rosetta 2, try adding export PATH="/usr/local/homebrew/bin:$PATH" in ~/.bashrc file
If this doesn't work, add export PATH="/usr/local/homebrew/bin:$PATH" in ~/.zshrc file
Adding these paths should work

dyld: Library not loaded: #rpath/libnetcdf.13.dylib ...Reason: image not found : GMT on MacOS Big Sur

I installed GMT4 from the source code on my Mac machine. Now, when I try using any command (e.g. pscoast) from GMT, It results into following error:
"dyld: Library not loaded: #rpath/libnetcdf.13.dylib
Referenced from: **********/GMT4.5.16/bin/pscoast
Reason: image not found
Abort trap: 6"
How to solve this issue?
As suggested here, the problem might be due to the fact that GMT expects libnetcdf to be built with different options than it is actually built on your machine. I had a similar problem when downloading ncview. My libnetcdf was built with conda-forge so installing ncview with conda-forgehelped.
If you're using conda as well, you can type conda list in a shell to see what was used to build the packages, and then maybe conda remove GMT to install it

libproj not loaded while installing sumo on macOS

I was going through the Flow installation and when I typed sumo --version into the terminal I got the following error message:
dyld: Library not loaded: /usr/local/opt/proj/lib/libproj.13.dylib
Referenced from: /Users/apple/sumo_binaries/bin/sumo
Reason: image not found
I've tried reinstalling sumo but the problem persisted.
How can I solve this issue?
I've found a fix for the problem.
Type the following into the terminal:
ln -s /usr/local/opt/proj/lib/libproj.15.dylib /usr/local/opt/proj/lib/libproj.13.dylib
Open up the directory mentioned above and make sure both libraries show (even if one of them is a shortcut) and rerun the sumo installation.
Note: you may have to change the paths depending on where your libproj.15.dylib is located.

Plot function not working in Octave

I was trying to use plot(x,y) function of octave but couldn't use it.
Keep getting this error:
warning: function ./test.m shadows a core library function
Fontconfig warning: ignoring UTF-8: not a valid region tag
Tried using setenv("GNUTERM","X11"); before using plot(x,y) function, that didn't work.
Saw some couple of stackoverflow and other solutions (this, this, this and this) but didn't help much.
There wer some site which talks about adding something like this setenv GNUTERM x11to append in .octaverc file, but unfortunately I don't have .octaverc.
ikis-MacBook-Pro:Cellar ikis $ find octave -name ".octaverc"
ikis-MacBook-Pro:Cellar ikis $
Can any one help with this.
OS: Yosemite
Octave version: GNU Octave, version 4.0.0

ImageMagick on Mac OSX Snow Leopard. Is there any way to get it to compile and run?

It seems that I have more trouble getting standard Unix things to run on Snow Leopard than any other platform--including Windows cygwin
For the past couple of days, I've been trying to get ImageMagick to run on Snow Leopard.
The most obvious way, Mac Ports, fails:
tppllc-Mac-Pro:ImageMagick-sl swirsky$ sudo port install imagemagick
---> Computing dependencies for p5-locale-gettext
---> Configuring p5-locale-gettext
Error: Target org.macports.configure returned: configure failure: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_perl_p5-locale-gettext/work/gettext-1.05" && /opt/local/bin/perl Makefile.PL INSTALLDIRS=vendor " returned error 2
Command output: checking for gettext... no
checking for gettext in -I/opt/local/include -arch i386 -L/opt/local/lib -lintl...gettext function not found. Please install libintl at Makefile.PL line 18.
no
Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade xorg-libXt failed
Before reporting a bug, first run the command again with the -d flag to get complete output.
tppllc-Mac-Pro:ImageMagick-sl swirsky$
Not wanting to spend another two days figuring out why my libintl doesn't have a "gettext" function, I tried a different route: the script mentioned here: http://github.com/masterkain/ImageMagick-sl
This script downloads and installs an ImageMagic independently of MacPorts issues
tppllc-Mac-Pro:ImageMagick-sl swirsky$ /usr/local/bin/convert
dyld: Library not loaded: /opt/local/lib/libiconv.2.dylib
Referenced from: /opt/local/lib/libfontconfig.1.dylib
Reason: Incompatible library version: libfontconfig.1.dylib requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0
Trace/BPT trap
It downloads everything and compiles fine, but fails when I try to run it, with the message above.
So now I'm two steps away from ImageMagick, trying to get a newer libiconv on my machine.
I downloaded the latest libiconv, compiled and built it. I put the resulting library in /opt/local/lib, and I still get the same error message:
tppllc-Mac-Pro:.libs swirsky$ sudo mv libiconv.2.dylib /opt/local/lib/libiconv.2.dylib
tppllc-Mac-Pro:.libs swirsky$ convert
dyld: Library not loaded: /opt/local/lib/libiconv.2.dylib
Referenced from: /opt/local/lib/libfontconfig.1.dylib
Reason: Incompatible library version: libfontconfig.1.dylib requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0
Trace/BPT trap
Now here's something interesting. The error message shows it's looking in /opt/local/lib/libiconv.2.dylib.
otools -L shows that this does implement 8.0.0:
tppllc-Mac-Pro:.libs swirsky$ otool -L /opt/local/lib/libiconv.2.dylib
/opt/local/lib/libiconv.2.dylib:
/usr/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)
tppllc-Mac-Pro:.libs swirsky$
And, for good measure, I set the DYLD_LIBRARY_PATH to make sure this directory is the one for dynamic libraries.
So even though I do have a library that provides 8.0.0, it's being seen as 7.0.0! Any ideas why this would happen?
So here's my question: Is it possible to get ImageMagick to run on OSX Snow Leopard? Are there any binary distributions that have static libraries baked in so I don't have to worry about these issue/
This worked for me:
sudo brew install imagemagick
You may also try the ImageMagick install script located here:
http://github.com/masterkain/ImageMagick-sl
It helped me a lot. May be needed to change some library versions inside the script.
I've seen this exact error with this exact library in multiple situations. It was, in every case, an instance where either the individual or an script they were using was setting the DYLD_LIBRARY_PATH variable.
Make sure this variable is not being set as it overrides loading the explicitly linked libraries with those at that path.
If the DYLD_* must be set, use the more sane DYLD_FALLBACK_LIBRARY_PATH. Which will attempt to load the explicitly linked libraries first, then fallback to the user declared ones.
I did notice on your initial build that it was not finding the gettext library in macports. So make sure those are installed.
My google showed up a few hits, and the first or second one had a link to the binary.
I was finally able to get my "macports" installation consistent enough to get imagemagick installed and running. I had to manually delete my /opt/local/ directores where the files lived, and clean out some other dependencies.
It seems that the dynamic linker is pulling in the system libiconv.2.dylib (which has compatibility version 7.0.0). Without seeing your entire build process it's hard to know for sure why this is, but I'm suspicious of your libiconv build; note that in the following failure:
tppllc-Mac-Pro:.libs swirsky$ otool -L /opt/local/lib/libiconv.2.dylib
/opt/local/lib/libiconv.2.dylib:
/usr/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)
your libiconv.2.dylib seems to think that its install path is /usr/local/lib, not /opt/local/lib. This probably why the dynamic linker isn't finding it; it's looking for it in /usr/local/lib, not finding it, and falling back on the system library in /usr/lib. Try setting the install path for your libiconv.2.dylib so that it's load commands tell the linker to look for it in /opt/local/lib, and that may resolve the issue.
I had the same problem, and solved it by uninstalling then reinstalling libiconv using Macports. Then everything works fine (I also have /opt/local/lib/ as the first entry in my DYLD_LIBRARY_PATH variable)
Strange. I'm pretty happy with my macports - and everything is compiled without errors. I can only advice - use macports.
ImageMagick #6.6.9-9_0+graphviz+hdri+jpeg2+mpeg+perl+q16+rsvg+wmf (active)

Resources