mxcl/homebrew — Issue #9043: Can't get Octave to install (gfortran dependency)
Author: romeovs
Created: 2011-12-08 16:24:43+00:00
State: open

I keep getting the following error:

romeovs:~ » brew install --use-clang octave
==> Installing octave dependency: dotwrp
==> Cloning https://github.com/tenomoto/dotwrp.git
Updating /Users/romeovs/Library/Caches/Homebrew/dotwrp--git
Error: This formula requires a fortran compiler, but we could not find one by
looking at the FC environment variable or searching your PATH for `gfortran`.
Please take one of the following actions:

- Decide to use the build of gfortran 4.2.x provided by Homebrew using
`brew install gfortran`

- Choose another Fortran compiler by setting the FC environment variable:
export FC=/path/to/some/fortran/compiler
Using an alternative compiler may produce more efficient code, but we will
not be able to provide support for build errors.

Even after I tried `brew install gfortran`. My`brew doctor` output is:

romeovs:~ » brew doctor
Your system is raring to brew.

The strange thing this is that `which gfortran` gives me nothing wile `man gfortran` does print the fortan man page. `mdfind gfortran` delivers:

...
/usr/local/Cellar/gfortran/4.2.4-5666.3/share/man/man1/gfortran-4.2.1
/usr/local/Cellar/gfortran/4.2.4-5666.3/bin/i686-apple-darwin11-gfortran-4.2.1
/usr/local/Cellar/gfortran/4.2.4-5666.3/bin/gfortran-4.2
/usr/local/Cellar/gfortran
...

so if I do `export FC = /usr/local/Cellar/gfortran/4.2.4-5666.3/bin/i686-apple-darwin11-gfortran-4.2.1` I can procede with `brew install octave` yet I get the following error:

brew install octave (12-08 17:17)
==> Installing octave dependency: dotwrp
==> Cloning https://github.com/tenomoto/dotwrp.git
Updating /Users/romeovs/Library/Caches/Homebrew/dotwrp--git
==> Building with an alternative Fortran compiler. This is unsupported.
Warning: No Fortran optimization information was provided. You may want to consider
setting FCFLAGS and FFLAGS or pass the `--default-fortran-flags` option to
`brew install` if your compiler is compatible with GCC.

If you like the default optimization level of your compiler, ignore this
warning.
==> /usr/local/Cellar/gfortran/4.2.4-5666.3/bin/i686-apple-darwin11-gfortran-4.2.1 -fno-underscoring -c
==> /usr/bin/ar -cru libdotwrp.a dotwrp.o
==> /usr/bin/ranlib libdotwrp.a
/usr/local/Cellar/dotwrp/1.0: 3 files, 12K, built in 2 seconds
==> Installing octave dependency: qrupdate
==> Downloading http://downloads.sourceforge.net/qrupdate/qrupdate-1.1.1.tar.gz
######################################################################## 100.0%
==> Building with an alternative Fortran compiler. This is unsupported.
Warning: No Fortran optimization information was provided. You may want to consider
setting FCFLAGS and FFLAGS or pass the `--default-fortran-flags` option to
`brew install` if your compiler is compatible with GCC.

If you like the default optimization level of your compiler, ignore this
warning.
==> make -j 1 install
/usr/local/bin/gfortran -O3 -march=core2 -w -pipe -fPIC -c caxcpy.f
make: /usr/local/bin/gfortran: No such file or directory
make: *** [caxcpy.o] Error 1
==> Exit Status: 2
http://github.com/mxcl/homebrew/blob/master/Library/Formula/qrupdate.rb#L25
==> Environment
HOMEBREW_VERSION: 0.8
HEAD: 4cc61cb31ef1b3dec1974f98cd20322fefb31732
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: quad-core 64-bit sandybridge
OS X: 10.7.2
Kernel Architecture: x86_64
Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode: 4.2.1
GCC-4.0: N/A
GCC-4.2: build 5666
LLVM: build 2336
Clang: 3.0-211.1
MacPorts or Fink? false
X11 installed? true
==> Build Flags
CC: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
CXX: /usr/bin/llvm-g++ => /usr/llvm-gcc-4.2/bin/llvm-g++-4.2
LD: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
CFLAGS: -O3 -march=core2 -w -pipe
CXXFLAGS: -O3 -march=core2 -w -pipe
MAKEFLAGS: -j4

Error: Failed executing: make -j 1 install

Same thing for `export FC = /usr/local/Cellar/gfortran/4.2.4-5666.3/bin/gfortran-4.2`.

I'm in the dark here (I'm not a computer genius).