Plotting with Octave after most recent MAC OSX update - macos

Hi I just recently downloaded the most recent snow leopard update. Then I tried to plot something using Octave which has been installed on my computer for months (and plotting has worked all that time) Even since I installed the update, and I try to plot using octave I get the following error:
dyld: Library not loaded: /usr/X11/lib/libfreetype.6.dylib
Referenced from: /usr/X11R6/lib/libfontconfig.1.dylib
Reason: Incompatible library version: libfontconfig.1.dylib requires version 13.0.0 or later, but libfreetype.6.dylib provides version 10.0.0
dyld: Library not loaded: /usr/X11/lib/libfreetype.6.dylib
Referenced from: /usr/X11R6/lib/libfontconfig.1.dylib
Reason: Incompatible library version: libfontconfig.1.dylib requires version 13.0.0 or later, but libfreetype.6.dylib provides version 10.0.0
/Applications/Gnuplot.app/Contents/Resources/bin/gnuplot: line 71: 865 Trace/BPT trap GNUTERM="${GNUTERM}" GNUPLOT_HOME="${GNUPLOT_HOME}" PATH="${PATH}" DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}" HOME="${HOME}" GNUHELP="${GNUHELP}" DYLD_FRAMEWORK_PATH="${DYLD_FRAMEWORK_PATH}" GNUPLOT_PS_DIR="${GNUPLOT_PS_DIR}" DISPLAY="${DISPLAY}" GNUPLOT_DRIVER_DIR="${GNUPLOT_DRIVER_DIR}" "${ROOT}/bin/gnuplot-4.2.6" "$#"
/Applications/Gnuplot.app/Contents/Resources/bin/gnuplot: line 71: 871 Trace/BPT trap GNUTERM="${GNUTERM}" GNUPLOT_HOME="${GNUPLOT_HOME}" PATH="${PATH}" DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}" HOME="${HOME}" GNUHELP="${GNUHELP}" DYLD_FRAMEWORK_PATH="${DYLD_FRAMEWORK_PATH}" GNUPLOT_PS_DIR="${GNUPLOT_PS_DIR}" DISPLAY="${DISPLAY}" GNUPLOT_DRIVER_DIR="${GNUPLOT_DRIVER_DIR}" "${ROOT}/bin/gnuplot-4.2.6" "$#"
error: you must have gnuplot installed to display graphics; if you have gnuplot installed in a non-standard location, see the 'gnuplot_binary' function
I'm really not sure what to do. I'm way out of my league here.

The "note for MacOSX users" is no longer on the Octave homepage, and the workaround described in Marco's post didn't work for me either, but this did:
Open /Applications/Gnuplot.app/Contents/Resources/bin/gnuplot in a text
editor. Use the editor search-and-replace feature to replace
"DYLD_LIBRARY_PATH" with "DYLD_FALLBACK_LIBRARY_PATH". There are four
instances that need to be replaced.
This is from the readme for the Octave MacOSX Binary. Note that it says it's for Lion users, but I'm running 10.6.8 and it worked for me.

I've recently build Octave and GNUplot on Lion using homebrew. Seems to work well. Here are some notes
Install Xcode from AppStore and HomeBrew (see Link)
Run 'brew install octave" and wait until graphicsmagick fails to compile
Run the command "brew install --use-clang --HEAD graphicsmagick". You might be asked to install Mercurial, just follow the instructions. You may also be asked to install fortran, so "brew install gfortran"
Run the command "brew install octave" again
Install Aquaterm
Now run "brew install gnuplot"
You now have the latest Octave installed. Just type octave from the terminal
To test the install run the following commands at the Octave command prompt
setenv("GNUTERM", "x11");
x = linspace(-10, 10, 100);
y = sin(x);
plot(x,y);

See the note for users of Mac OS X 10.6 on http://octave.sourceforge.net/. The changes solve the problem also in 10.5.8.

We updated freetype in OSX 10.6.5 and fontconfig, which links against freetype, wants this newer version. Gnuplot is failing to load because their developers are setting DYLD_LIBRARY_PATH which is forcing our libfontconfig to try using their libfreetype, which it cant.
This is a bug in Gnuplot.app ... developers should NEVER be setting DYLD_LIBRARY_PATH in shipping products!

I had the same problem and took me a while to find the "note for users of Mac OS X 10.6". I copy them here:
NOTES FOR SNOW LEOPARD USERS
1 - mkoctfile
Since OSX 10.6 the Apple shipped version of gcc builds by default 64bit binaries
As the libraries included with Octave.app version 3.2.3 are 32bit, you need to apply
the following patch in order for mkoctfile to work:
1.1) open the folder /Applications in the finder
1.2) right-click on Octave.app and select "show package contents"
1.3) navigate to /Applications/Octave.app/Contents/Resources/bin
1.4) right-click on the file "mkoctfile" and select "Open with -> Other ... -> TextEdit.app"
1.5) right after the line:
# along with this program; If not, see <http://www.gnu.org/licenses/>.
add the lines
CFLAGS="-m32 ${CFLAGS}"
FFLAGS="-m32 ${FFLAGS}"
CPPFLAGS="-m32 ${CPPFLAGS}"
CXXFLAGS="-m32 ${CXXFLAGS}"
LDFLAGS="-m32 ${LDFLAGS}"
and save.
2 - Gnuplot.app
An update to system libraries introduced with OSX 10.6.5 has broken the functionality
of the Gnuplot.app included with the Octave.app distribution, in order to use Gnuplot.app
on OSX 10.6.5 and later, you can use the fix described below:
2.1) open the folder /Applications in the finder
2.2) right-click on Gnuplot.app and select "show package contents"
2.3) navigate to /Applications/Gnuplot.app/Contents/Resources/bin
2.4) right-click on the file "gnuplot" and select "Open with -> Other ... -> TextEdit.app"
2.5) change the line:
DYLD_LIBRARY_PATH="${ROOT}/lib:${DYLD_LIBRARY_PATH}"
to
DYLD_LIBRARY_PATH="${ROOT}/lib"
and save.
NOTES FOR LEOPARD USERS
An update to system libraries introduced with OSX 10.5.8 has broken the functionality
of the Gnuplot.app included with the Octave.app distribution, in order to use Gnuplot.app
on OSX 10.5.8 and later, you can use the same fix described above for OSX 10.6.5.

I tried the above and it did not help. The source of the problem seems to be the version of gnuplot that comes with the Octave.app install.
I installed gnuplot directly with 'brew' and then I removed gnuplot from my Applications folder. Once that change was made, Octave was able to find the newer version of gnuplot that was compiled with the correct dependencies.

If you don't mind using MacPorts, you can install octave by the following command. And it will be a 64-bit version.
sudo port install octave-devel

I just want to share my experience regarding this issue.
I had similar problem today when I tried to use Octave/Gnuplot in Mac OS X (10.7.5, Lion) and none of the solutions above worked for me.
However I found another solution that did work, which is described in https://github.com/jyr/MNPP/issues/28. Basically, I did the following:
sudo cp /usr/X11/lib/libfreetype.* /Applications/Gnuplot.app/Contents/Resources/lib

Mountain Lions can also install Octave 3.4.0 with the dmg and throw in the older 4.2 gnuplot instead from the Maxima dmg. Easiest, but not the most recent version. (A classmate's idea which worked.)

Replacing the 4 instances of "DYLD_LIBRARY_PATH" with "DYLD_FALLBACK_LIBRARY_PATH" did not work for me on Mac OS X 10.9.
However, the second option given here:
http://sourceforge.net/projects/octave/files/Octave%20MacOSX%20Binary/2011-04-21%20binary%20of%20Octave%203.4.0/
did work. i.e. using Gnuplot-4.2.6 that is bundled with Maxima DMG. Link below. http://sourceforge.net/projects/maxima/files/Maxima-MacOS/5.26.0-MacOSX/
I just copied Gnuplot.app into /Applications.

Related

Can I install emacs 24.5 on OS X El Capitan without deleting the native OS X emacs?

I want to install the latest version of emacs, but if I do this will it be in conflict with the version that comes pre-packaged with os x? Do I need to delete the native emacs? Also, it seems emacsforosx.com is a popular option, but I lot of people swear by homebrew... why would I go with one option over the other?
There is no reason to remove the system-supplied Emacs; any well-behaved, properly packaged third-party version will install fine alongside, not over, the system binaries and libraries.
Installing a current version of emacs is normal practice because the OSX provided version is outdated. You have a number of options, but I've found using the 'homebrew' method the easiest.
Due to changes in OSX 10.11, you need to take some additional steps when installing homebrew. If you already have homebrew installed, you will probably need to 'fix' the permissions on /usr/local. If you don't have homebrew installed, then there are some additional steps you will need to take to create the /usr/local path. This is documented on the hombrew site at El Capitan and Homebrew

Git for Mac fails to launch: "illegal instruction"

...I've looked pretty carefully (I believe), and have been unsuccessful at getting an installation of Git for my Mac.
For various reasons, I'm running 10.6.8 of Mac OS X and will not be changing that anytime soon.
I've already gathered and installed the bundle exposed here:
https://help.github.com/articles/set-up-git
The installation instructions are pretty clear, and it's obvious to me that the package installed. But any attempts to use the git client from the command line result in an "Illegal Instruction" error.
I've sifted pretty carefully through information available here:
http://git-scm.com/book/en/Getting-Started-Installing-Git
There is another bundle that seems to be available. It is called "GitHub for Mac 1.7.5, but it appears to require Mac OS X 10.7 or later.
Has anyone else encountered this difficulty? Must I build from source?
I'm a couple of hours of reading and hacking into this effort? Is there something obvious that I've not considered?
Yes, I've had the same exact problem, and what I did is installed an earlier build from here:
https://code.google.com/p/git-osx-installer/
I'm running 10.6.8 and installed the newest build there, 1.8.4.2
SourceForge only has 1.9.0 and 1.8.5.2
http://sourceforge.net/projects/git-osx-installer/reviews?source=navbar
Someone on the reviews said they had trouble with both and went back to 1.7. I would try that if 1.8.4.2 doesn't work.
I was able to run the config commands without an illegal instruction error, at least.
I had this problem and was able to install a working version using Homebrew.
# first uninstall the broken version
# mount the DMG for the broken version using Finder
# "type" this with the tab key! it saves typing and fixes the version number
cd /Volumes/Git\ 2.0.1\ Snow\ Leopard\ Intel\ Universal/
./uninstall.sh
# make bash forget about the uninstalled binary
hash -r
cd
# now install the working version
# assumes you have Homebrew installed
brew install git
git version
I had this today on Snow Leopard after running the suggested git installer from git-scm. Really horrible. Found that installing Macports using their old Snow Leopard package and then
sudo port install git +svn +doc +bash_completion +gitweb
installs git plus its dependencies and git now works fine; version 1.9.3 installed and working on 10.6.8.
I had the same problem. There are various methods for downloading and installing git - Try macports or homebrew. The thing that finally worked for me was having xcode 3.2.6 installed with the additional command line tools - version 3.2 that comes with the leopard install disk wasn't enough. You can install xcode etc. from the disk and then run software update to upgrade it to 3.2.6.
The latest build for Snow Leopard in the official git-osx-installer repo is Git 2.3.5 currently. You can download it from http://sourceforge.net/projects/git-osx-installer/files/git-2.3.5-intel-universal-snow-leopard.dmg/download using web browser. This installation works for me on OS X 10.6.8.
Or you can check yourself for a newer version: http://sourceforge.net/projects/git-osx-installer/files/
Yes - it seems that it does not support the older OS version (mine was 10.6.8). I upgraded to the newest Mac OS 10.9.4 (the installation will take a while), reinstalled the Git software (note that it will ask for xcode to be installed, which I proceeded), and everything works fine from there. Hope this helps.
Ref : https://help.github.com/articles/does-github-for-mac-run-on-os-x-10-6-snow-leopard
To quote:
Does GitHub for Mac run on OS X 10.6 Snow Leopard?
No, GitHub for Mac requires OS X 10.7 (Lion) or higher.
We made this decision because the app relies on a number of
technologies which are not available in Mac OS X 10.6 or earlier. We
want to provide the best experience possible for the app's users, so
we've made the choice to only support 10.7 and above, and not make
earlier versions available.

Set up g++ on OS X

I just updated to OS X Mavericks and it seems it messed up my whole compiler setup. Not only do I have to reinstall a JDK in order to use a Java compiler, I get the following error when I'm trying to compile C/C++ using GCC/G++:
/usr/local/Cellar/gcc/4.7.2/gcc/lib/gcc/x86_64-apple-darwin12.2.1/4.7.2/../../../../include/c++/4.7.2/cwchar:46:19: fatal error: wchar.h: No such file or directory
Not sure what to think other than upgrading messed it up. My question is: how do I set up g++ to compile on OS X? If it's already set up, what is the problem here?
If I can provide more information, please let me know.
Note: I've installed gcc 4.7 using homebrew, but it doesn't seem to work. When I use g++-4.7 code.cpp specifically, I get the same error.
Installing the Command Line Tools (OS X Mavericks) for Xcode - Late October 2013 solved it for me. Here is the link:
OSX: Xcode Downloads
The often mentioned xcode-select --install command kept saying it cannot find the requested software.
To clarify: You need to already have gcc-4.7 installed using Homebrew. The update to the latest version of CMD Tools only fixes compatibility issues caused by upgrading from Mountain Lion to Mavericks.

How to install Xcode 4.6 on Lion, needed for upgrading ruby with RVM

I was actually trying to update ruby on my OSX 10.7.5 with RVM, and after typing in the following command:
rvm install ruby
I got the following response:
Searching for binary rubies, this might take some time.
Checking requirements for osx.
Installing requirements for osx.
Updating system.......
Error running 'requirements_osx_brew_update_system ruby-2.0.0-p247',
please read /Users/username/.rvm/log/1381215459_ruby-2.0.0-p247/update_system.log
Requirements installation failed with status: 1.
Then, when I checked out the update_system.log, it showed me the actual code of a function called requirements_osx_brew_update_system(), which contained the following error message:
Xcode version older than 4.6.2 installed, download and install newer version from:
http://connect.apple.com
After installation open Xcode, go to Downloads and install Command Line Tools.
Then I proceeded to find an update for Xcode, but only found the latest Xcode 5.0, which is apparently incompatible with my OSX 10.7. Although ultimately my goal is to update ruby and install rails, which I'm sure there are many other ways to do, I'd still like to find out if I could possibly install Xcode 4.6.2 on my OSX 10.7.
UPDATE: Sorry folks, apparently my version of XCode is v4.6.1 so updating the command line tools will not work in all cases (I know for a fact it doesn't work if you're on XCode v4.3.3). YMMV
I ran into the same issue trying to do an rvm install. I got an error telling me that I needed XCode 4.6.2 or later.
Turns out all it needed was the latest version of the XCode command line tools. I followed the instructions for upgrading my command line tools from this macports article:
open the Xcode application
go to the Preferences window
open the Downloads section
click the Install button next to "Command Line Tools"
After doing this I was able to run my rvm install command and it didn't complain about upgrading XCode anymore (and finished successfully).
It seems you're going to have to install under Xcode 5. So go to https://developer.apple.com/downloads/ and log in with your developer ID to get to the older versions. There should be a 4.6.3 that you could potentially download, or even 4.6.2.
Or you could upgrade your OSX to 10.8.
Whichever you prefer.
I can't give you a direct link to it, since you need your developer information to log in yourself. But all the downloads you need are in the link provided above once you log in.
Open xcode and update it via the app store.
Then
xcode-select --install
This will install xcode via the command line

How should I upgrade Xcode after upgrading to OS X Lion?

I've just found out, that my homebrew doesn't work anymore after I upgraded to OS X Lion.
$ brew install clojure
Warning: Xcode is not installed! Builds may fail!
Error: No such file or directory - /usr/bin/cc
and
$ brew doctor
We couldn't detect gcc 4.2.x. Some formulae require this compiler.
We couldn't detect gcc 4.0.x. Some formulae require this compiler.
You have no /usr/bin/cc. This will cause numerous build issues. Please
reinstall Xcode.
Setting DYLD_LIBRARY_PATH can break dynamic linking.
You should probably unset it.
after some googling, I found out that I should upgrade Xcode to version 4.1. The problem is, I have version 3.2.5 installed and I can't find any way of uninstalling it.
When I look at App Store, it looks like I don't have Xcode installed at all. I'm afraid that if I install it via App Store, it will somehow conflict with the version I have currently installed. However I can't find it in Applications, and I can't find any update function either.
Software Update doesn't prompt me to update Xcode, and I also don't see it in Installed Software.
What should I do?
Thanks to the readme found at /Developer, I found a way to uninstall Xcode via
$ sudo /Developer/Library/uninstall-devtools --mode=all
edit: I just ran the installer for Xcode 4, and it detected old version of Xcode, offering me to move it to /Developer-old.
I fixed it by
In theory this should work if you have Xcode4.3 installed (in /Applications):
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/

Resources