title: How do you install Octave packages on Mac OS El Capitan?
body: <p>I tried installing packages (package io from Octave Forge) on Octave on a Macbook Air. Specifically with the following command <code>pkg install -forge io</code>. But it doesn't seem to work, and the following error is printed out</p>
  
  <pre><code>/usr/local/octave/3.8.0/bin/mkoctfile-3.8.0: line 512:  1600 Segmentation 
  
  fault: 11  /usr/local/octave/3.8.0/bin/g++-mp-4.7 -c -fPIC -I/usr/local/octave/3.8.0/include/octave-3.8.0/octave/.. -I/usr/local/octave/3.8.0/include/octave-3.8.0/octave -I/usr/local/octave/3.8.0/include -pipe-Os -m64 -D_THREAD_SAFE -pthread csvexplode.cc -o csvexplode.o
  make: *** [csvexplode.oct] Error 139
  /usr/local/octave/3.8.0/bin/mkoctfile-3.8.0 csvexplode.cc
  
  pkg: error running `make' for the io package.
  error: called from 'configure_make' in file /usr/local/octave/3.8.0/share/octave/3.8.0/m/pkg/private/configure_make.m near line 82, column 9
  error: called from:
  error:   /usr/local/octave/3.8.0/share/octave/3.8.0/m/pkg/private/install.m at line 199, column 5
  error:   /usr/local/octave/3.8.0/share/octave/3.8.0/m/pkg/pkg.m at line 394, column 9
  </code></pre>
  
  <p>I have tried the following instructions:</p>
  
  <ol>
  <li><code>code-select --install</code> from the Terminal window to install the
  command line tools Install MacPorts for Mac. This is a standard
  installer that you can download from Macports.</li>
  <li><code>sudo port install gcc48</code> --> This is a Fortran compiler, which is
  necessary for installing octave-general</li>
  <li><code>sudo port install octave-general</code> [NOTE: THIS TOOK A VERY LONG TIME,
  and I had to disable Spotlight indexing...Hours on a Macbook Pro]</li>
  <li><code>sudo port install octave-control</code></li>
  <li><code>sudo port install octave-signal</code></li>
  </ol>
  
  <p>However it just stopped and the following is printed at <code>sudo port install octave-general</code>:</p>
  
  <pre><code>Warning: xcodebuild exists but failed to execute
  Warning: Xcode does not appear to be installed; most ports will likely fail to build.
  ---&gt;  Computing dependencies for octave-general
  ---&gt;  Dependencies to be installed: octave qscintilla qt4-mac dbus libmng texinfo texlive-basic texlive-bin harfbuzz-icu icu libzzip poppler openjpeg15 poppler-data potrace texlive-common xorg-libXaw xorg-libXmu xorg-libXi xorg-inputproto xorg-libXfixes xorg-fixesproto xorg-libXp xorg-printproto texlive-fonts-recommended texlive-latex transfig netpbm libnetpbm
  ---&gt;  Activating dbus @1.10.8_0
  Error: org.macports.activate for port dbus returned: Image error: /Library/LaunchAgents/org.freedesktop.dbus-session.plist already exists and does not belong to a registered port.  Unable to activate port dbus. Use 'port -f activate dbus' to force the activation.
  Error: Failed to install dbus
  Please see the log file for port dbus for details:
      /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_dbus/dbus/main.log
  Error: The following dependencies were not installed: octave qscintilla qt4-mac dbus libmng texinfo texlive-basic texlive-bin harfbuzz-icu icu libzzip poppler openjpeg15 poppler-data potrace texlive-common xorg-libXaw xorg-libXmu xorg-libXi xorg-inputproto xorg-libXfixes xorg-fixesproto xorg-libXp xorg-printproto texlive-fonts-recommended texlive-latex transfig netpbm libnetpbm
  To report a bug, follow the instructions in the guide:
      http://guide.macports.org/#project.tickets
  Error: Processing of port octave-general failed
  </code></pre>
  
  <p>I was wondering how you can install Octave packages on MacOS?</p>