Octave issue with package installation

(Irwish) #1


if you want to install the current version of “control” package to octave. The compile process will be interrupt:

ld: warning: directory not found for option '-L/usr/local/Cellar/gcc/7.2.0/lib/gcc/7/gcc/x86_64-apple-darwin16.7.0/7.2.0'
ld: warning: directory not found for option '-L/usr/local/Cellar/gcc/7.2.0/lib/gcc/7/gcc/x86_64-apple-darwin16.7.0/7.2.0/../../..'
ld: library not found for -lgfortran 

The install path of the current version of gfortran is included in the gcc package of homebrew. But the path /usr/local/Cellar/gcc/7.2.0/lib/gcc/7/gcc/x86_64-apple-darwin16.7.0/7.2.0/../../.. doesn’t exists. The current version of gfortran (that is not compiled from source) is available under /usr/local/Cellar/gcc/7.2.0/lib/gcc/7/gcc/x86_64-apple-darwin14.5.0/7.2.0../../.. .

Is it possible, that the current package version of octave, that’s available in brew, will be provide the wrong default path to this library? Did i something wrong?

The command that’s executed at the install process of the control package is:

mkoctfile -p FLIBS

This provides the wrong default path to the gfortran library:

-L/usr/local/Cellar/gcc/7.2.0/lib/gcc/7/gcc/x86_64-apple-darwin16.7.0/7.2.0 -L/usr/local/Cellar/gcc/7.2.0/lib/gcc/7/gcc/x86_64-apple-darwin16.7.0/7.2.0/../../.. -lgfortran -lquadmath -lm

To solve the problem export the $FLIBS variabel with the correct path before you start the installation of a package.

To exclude misunderstandings here the information to my installation.
brew info gcc

gcc: stable 7.2.0 (bottled), HEAD
GNU compiler collection
/usr/local/Cellar/gcc/7.2.0 (1,486 files, 290.0MB) *
  Poured from bottle on 2017-09-27 at 14:14:53
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/gcc.rb
==> Dependencies
Required: gmp ✔, libmpc ✔, mpfr ✔, isl ✔
==> Options
        Build just-in-time compiler
        Build with native language support (localization)
        Install HEAD version

brew info octave

octave: stable 4.2.1 (bottled), HEAD
High-level interpreted language for numerical computing
/usr/local/Cellar/octave/4.2.1_7 (2,182 files, 37.6MB) *
  Poured from bottle on 2017-12-06 at 11:30:34
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/octave.rb
==> Dependencies
Build: automake ✔, autoconf ✔, gnu-sed ✔, pkg-config ✔
Required: arpack ✔, epstool ✔, fftw ✔, fig2dev ✔, fltk ✔, fontconfig ✔, freetype ✔, ghostscript ✔, gl2ps ✔, glpk ✔, gnuplot ✔, graphicsmagick ✔, hdf5 ✔, libsndfile ✔, libtool ✔, pcre ✔, portaudio ✔, pstoedit ✔, qhull ✔, qrupdate ✔, readline ✔, suite-sparse ✔, veclibfort ✔
==> Requirements
Required: fortran ✔
Optional: java >= 1.6 ✔
==> Options
        Build with java support
        Install HEAD version