jotwo
jotwo

Reputation: 79

MacPorts is unusable

I've recently installed MacPorts as explained on MacPorts website. All the process went well. The .profile file in my home directory has been updated (in this file the paths "/opt/local/bin" and "/opt/local/sbin" are added to the environment variable PATH) and all the macports files are in the directory "/opt". When I type "which port" in the shell, it returns "/opt/local/bin/port".

But something weird happens when I ask to install the port "octave-devel" (I've installed MacPorts to use Octave on my Mac in the first place). So when I enter the command "sudo port install octave-devel +atlas+docs" (as explained in GNU Octave wiki) in the terminal and type my password, the shell replies "Error: Port octave-devel not found". However the port "octave-devel" seems to exist because I've found its description on this page of the macports website.

Because I had to use Octave quickly I first wanted to uninstall MacPorts and install Fink instead and I tried the method described on the MacPorts website but after I typed "sudo port -fp uninstall installed" it returned "Error: No ports matched the given expression". I couldn't even uninstall this software! I really think that it is a problem of MacPorts itself and not the octave port but I can't find what exactly.

Eventually I used Octave on a Windows computer but it annoys me not to know what is wrong with MacPorts on my computer. And mainly, I want to be capable to use GNU Octave on my Mac because I need it for school.

Thank you in advance and happy holidays.

Upvotes: 1

Views: 3624

Answers (5)

Bitcon
Bitcon

Reputation: 141

I had a similar problem with MacPorts. I would recommend using HomeBrew instead. Here are the commands to install Octave on HomeBrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew update

brew upgrade

brew install octave

Upvotes: -1

user1505070
user1505070

Reputation: 41

I also ran into problems installing Octave using Macports on OSX 10.10.1 and solved them, similar to @Tom_N_PDX and @isak.

Short version

I got it working using one of the options described by @isak.

More detailed version

Running sudo port install octave failed because of the missing Fortran compiler problem.

I next installed Fortran using Macports sudo port install gcc48 and then tried re-installing Octave

sudo port clean octave    
sudo port install octave

This "hung" on Atlas, as others have mentioned, although I now realize it just takes a long time and I killed it before it finished. Likely it would have worked, as the output said it had found Fortran

Selected C compiler: /usr/bin/clang

Selected F77 compiler: gfortran48

I then installed atlas separately, using the +gcc48 flag, as suggested by @isak

sudo port install atlas +gcc48

but it displayed the same compiler information as above (consistent with my conjecture that the above would have worked). This process took about 4 hours. You can monitor the progress of the task in the logfile (found with the command sudo port logfile atlas), which reassures you it's doing something and not "hung". (Oddly the output does halt mid-message, but it always eventually resumed. Also there were a lot of warning messages.)

Last, running the following worked:

sudo port clean octave
sudo port install +arpack

I actually first tried without the +arpack option and it worked but I got the following message, consistent with @isak's answer

WARNING: Dependency 'arpack' is installed with the +accelerate variant, using Apple's Vector Libraries which have some known bugs that can cause Octave to crash if using certain functions in arpack. The +atlas variant does not have these issues with Octave, but does take many hours to compile even on modern hardware.

When I reinstalled Octave with the +arpack flag it took less than a minute (because I had already installed Atlas).

Upvotes: 0

Tom_N_PDX
Tom_N_PDX

Reputation: 56

Trying to install Octave using MacPorts I ran into a similar problem.

Summary

My solution was to first clean & build atlas separately using gcc47 instead of the default mpclang34. Then to build the default octave.

Details

This is on a MacBook running an older OS (10.7.5), the standard Octave (3.8.2) package failed to build - it hung on building the atlas dependency.

Solution:

sudo port clean atlas
sudo port -v install atlas +gcc48
sudo port -v install octave +atlas+docs 

Upvotes: 1

isak
isak

Reputation: 41

I'm not sure which version of OSX you are running, however, I have octave (not octave-devel) version 3.6.4 installed via macports on a machine running OSX 10.9.1. This was built using:

sudo port install octave

which yields a known bug building the atlas dependency that results from a missing fortran compiler. At this point you have two options. Before attempting to install octave first try to install atlas separately, either overriding the standard clang compiler with the gcc4x flag, or install atlas using:

sudo port install atlas +nofortran

which runs fine using clang. With atlas installed, octave should build to completion although there is a possibility that you will find an error regarding the use of arpack by apple as a vector library. Using +arpack is preferred, so it may be useful to load this by hand as well before starting your octave install.

Upvotes: 3

Daydreamer1987
Daydreamer1987

Reputation: 11

I'm currently going through the process of installing Octave via MacPorts. I used the following command which I found on Shifteleven.com:

sudo port install octave-devel +gcc45

It seems to be working so far. You also need to make sure you've installed the Xcode command line tools, which is something that I forgot to do the first time I tried.

Upvotes: 0

Related Questions