Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Can't get Octave to install (gfortran dependency) #9043

Closed
romeovs opened this issue Dec 8, 2011 · 5 comments
Closed

Can't get Octave to install (gfortran dependency) #9043

romeovs opened this issue Dec 8, 2011 · 5 comments

Comments

@romeovs
Copy link

romeovs commented Dec 8, 2011

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. Mybrew 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).

@walchko
Copy link

walchko commented Dec 10, 2011

I have the same issue! I installed gfortran, but Octave refuses to install.

@walchko
Copy link

walchko commented Dec 10, 2011

ok ... I created the environment variable:

export FC=/usr/local/bin/gfortran-4.2

Next, qruptdate is looking for gfortran so I made a symbolic link from gfortran-4.2 binary

ln -s /usr/local/bin/gfortran-4.2 /usr/local/bin/gfortran

That seems to have fixed it. I would suggest gfortran formula telling users to update env and create a symbolic link

@Sharpie
Copy link
Contributor

Sharpie commented Dec 18, 2011

The GFortran formula does create a symbolic link from gfortran-4.2 -> gfortran. If which gfortran is returning empty after brew install gfortran, then then installation is incomplete for some reason.

Try re-installing GFortran. If you get the same problem, post the results of brew install -v gfortran so we can see if the links are getting created properly.

@eager
Copy link
Contributor

eager commented Jan 3, 2012

I can confirm this issue, with the latest Xcode installed on 10.7.2.

brew --config says GCC-4.2 is build 5666, which means the Lion install logic is pre-empted by the Xcode 3.26--4.1 conditional. I would guess the cause of confusion is that /usr/bin/gcc symlinks to llvm-gcc-4.2, build 5658. /usr/bin/gcc-4.2, which is the path brew uses to determine gcc_42_build, is still 5666.

codedreality added a commit to codedreality/homebrew that referenced this issue Jan 4, 2012
Upgrading xcode to version 4.2 (llvm/clang) leaves the old gcc-4.2
binary on the system, resulting that it will be wrongly detected as
a build 5666. This fix will not set a build number if xcode version is
>= 4.2

See issue Homebrew#9043 and Homebrew#9395
@Sharpie Sharpie closed this as completed in b0d5029 Jan 6, 2012
@Sharpie
Copy link
Contributor

Sharpie commented Jan 6, 2012

Allright, this should be fixed. The problem was appearing for users who upgraded from XCode 4.1 or earlier as they will still have gcc-4.2 binaries hanging around and this was confusing the installation logic which incorrectly assumed that any user with 4.2 has no vanilla GCC.

wesen pushed a commit to wesen/homebrew that referenced this issue Jan 8, 2012
Check for XCode >= 4.2 on Lion first before casing the GCC build in the install
section as this is the order in which the  download section selects which Lion
binaries to fetch.

Without this change, a leftover `gcc-4.2` installation can fool the logic into
thinking the 5666-3 binaries were downloaded instead of the full GCC-4.2 suite.
This causes the wrong installation steps to be executed which leaves users
without some important symlinks.

Closes Homebrew#9398.
Fixes Homebrew#9395.
Fixes Homebrew#9043.
Sharpie added a commit to Sharpie/homebrew that referenced this issue Sep 12, 2012
Check for XCode >= 4.2 on Lion first before casing the GCC build in the install
section as this is the order in which the  download section selects which Lion
binaries to fetch.

Without this change, a leftover `gcc-4.2` installation can fool the logic into
thinking the 5666-3 binaries were downloaded instead of the full GCC-4.2 suite.
This causes the wrong installation steps to be executed which leaves users
without some important symlinks.

Closes Homebrew#9398.
Fixes Homebrew#9395.
Fixes Homebrew#9043.
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
Check for XCode >= 4.2 on Lion first before casing the GCC build in the install
section as this is the order in which the  download section selects which Lion
binaries to fetch.

Without this change, a leftover `gcc-4.2` installation can fool the logic into
thinking the 5666-3 binaries were downloaded instead of the full GCC-4.2 suite.
This causes the wrong installation steps to be executed which leaves users
without some important symlinks.

Closes Homebrew#9398.
Fixes Homebrew#9395.
Fixes Homebrew#9043.
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants