how to maintain multiple active versions of a port (e.g. octave)?

Ryan Schmidt ryandesign at
Fri Sep 23 06:28:39 PDT 2016

On Sep 23, 2016, at 08:01, Ray Zimmerman <rz10 at> wrote:
> I am the developer of a Matlab/Octave package that I need to test against multiple versions of Matlab and Octave. I’ve been using MacPorts to build and install Octave on my system and was wondering what is the best way to …
> (1) keep older versions of a port when the port is updated to use a new version of the sources. E.g. the octave port was using octave 3.8.0 sources and has recently changed to 4.0.3. How can I keep the 3.8.0 version available (I can create differently named symlinks to point to the binaries), while allowing MacPorts to build and install the new octave 4.0.3?

Most ports are not meant to be used that way. Most ports are only provided in a single version. 

In situations where there is a need to have multiple versions, multiple ports are offered and specifically engineered to install in separate locations that don't interfere with one another. The php, python, perl, gcc, llvm, clang ports are examples of this method. 

If there is a need to do this with the octave ports, the maintainer of the octave port would have to do that, or someone would have to help him do it or do it for him if he doesn't want to or have time. There are also lots of octave module ports, which would then probably have to be offered for each octave version. So this would be a major undertaking. 

Such an undertaking can be worthwhile. I'm glad I went to the effort to do it for the php ports. In other instances it might not make sense. We did it for the perl ports but are having second thoughts about that and may have to go to the additional effort of undoing it. So before such an effort is undertaken for octave we should be very sure that it's necessary and will be beneficial. 

> (2) build a previous version of a port, again without eliminating the current version. E.g. I recently upgraded to OS X Sierra and had to rebuild all of my ports, so now I have octave 4.0.3, but I’d like to go back and re-install 3.8.0, which I need for testing (without eliminating 4.0.3).

To build a previous version of a port:

You can have multiple versions of a port installed at the same time, but only one active and usable at a time. You can switch between them by activating whichever one you want at the moment, but this may have consequences for any other installed ports that depend on the port whose version you're switching. 

More information about the macports-users mailing list