Eigen really doesn't need gfortran. I promise. #12800

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
6 participants

If you don't believe me, see b2c7bf2.

Contributor

adamv commented Jun 15, 2012

@Sharpie care to comment?

Contributor

adamv commented Jun 19, 2012

Should we add gmp/gsl/fftw deps, possibly optional? Eigen is picking them up.

Contributor

adamv commented Jun 19, 2012

There is at least an optional dependency on Fortran:

-- The Fortran compiler identification is GNU
-- Check for working Fortran compiler: /usr/local/bin/gfortran
-- Check for working Fortran compiler: /usr/local/bin/gfortran  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/local/bin/gfortran supports Fortran 90
-- Checking whether /usr/local/bin/gfortran supports Fortran 90 -- yes
Contributor

Sharpie commented Jun 19, 2012

The ENV.fortran was added due to #9878. So, if you want to pull ENV.fortran, you must figure out how to disable the part of the Eigen build that uses Fortran.

Contributor

adamv commented Jun 19, 2012

It compiled for me with no Fortran compiler available, FWIW.

Ditto.

~ $ which gfortran
gfortran not found
~ $ brew uninstall eigen
Uninstalling /usr/local/Cellar/eigen/3.0.5...
~ $ brew install eigen
Warning: You have Xcode 4.1, which is outdated.
Please install Xcode 4.3.
==> Downloading http://bitbucket.org/eigen/eigen/get/3.0.5.tar.bz2
Already downloaded: /Library/Caches/Homebrew/eigen-3.0.5.tar.bz2
==> cmake .. -Dpkg_config_libdir=/usr/local/Cellar/eigen/3.0.5/lib -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/eigen/3.0.5 -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev -DCMAKE_BUILD_TYPE=Release
==> make install
/usr/local/Cellar/eigen/3.0.5: 281 files, 3.3M, built in 26 seconds

Contributor

Sharpie commented Jun 19, 2012

Compiling with no Fortran compiler is not a problem. As shown in #9878, if one compiles and there is a broken Fortran compiler everything blows up.

So, either we keep ENV.fortran so Eigen always finds a working Fortran compiler, or we figure out how to disable the bits of the build process that require Fortran---those are the choices.

Why is Eigen using cmake vs merely moving the header files to the appropriate directory? It's not like there's actually a build process going on here.

Replacing the troublesome cmake script with a straight forward `cp -r' would be one solution.

From INSTALL

Eigen consists only of header files, hence there is nothing to compile
before you can use it. Moreover, these header files do not depend on your
platform, they are the same for everybody.

You can use right away the headers in the Eigen/ subdirectory. In order
to install, just copy this Eigen/ subdirectory to your favorite location.
If you also want the unsupported features, copy the unsupported/
subdirectory too.

Contributor

Sharpie commented Jun 19, 2012

Why is Eigen using cmake vs merely moving the header files to the appropriate directory?

Dunno. @MikeMcQuaid, you seem to be the original author in 092bc98---any reason we should use CMake over a straight copy?

Owner

MikeMcQuaid commented Jun 19, 2012

If the install output is literally identical I don't see any good reason. Do check that though first as there could be some basic configuration going on for a config header or something.

The only differences I see between the raw "eigen" and "unsuported" directories and those installed is the addition of an eigen3.pc pkgconfig file and an empty "INSTALL_RECEIPT.json" file.

If someone else would be so kind as to verify this, I'll go ahead and build a recipe that doesn't use cmake.

Contributor

adamv commented Jun 28, 2012

It looks like as long as we can generate the .pc file the contents are the same as moving.

Contributor

zhouyan commented Jul 3, 2012

I thought the problem was solved as in mxcl#10240 and that still works for me.
The only reason eigen check for fortran is to build some of the tests and benchmarks. Disable all of them shall prevent eigen from even trying to find fortran, broken or not, it does not matter. Unfortunately my machine always has a fortran compiler. So I cannot really test if a missing Fortran or broken one cause problem., so removed that pull request.

The bottom line is that eigen does not build anything when you run make install after the configuration. It merely move some files

Contributor

adamv commented Jul 3, 2012

@zhouyan "closed the pull request 2 months ago" looks like that request was closed before anything was pulled.

Contributor

zhouyan commented Jul 3, 2012

@adamv yeah, I closed it because I cannot test when fortran is broken. So afraid of broken things for others I left it alone. But I think the method mentioned in the last comment of that pull request shall work, if any one can test it when fortran is missing or broken

adamv was assigned Oct 5, 2012

Contributor

adamv commented Oct 5, 2012

Also, if this is headers-only and no libs, it ought to be specified as a :build dependency.

xanview commented Oct 11, 2012

I came here because I wanted to install opencv which requires eigen which for some reason depends on gfortran?

I removed this line from the /usr/local/Library/Formula/eigen.rb formula:

ENV.fortran

Now eigen and more importantly opencv installs fine without fortran :)

adamv closed this in 273d996 Oct 19, 2012

Contributor

adamv commented Oct 19, 2012

Sorry for the delay in acting on this.

Contributor

Sharpie commented Oct 19, 2012

Sorry for the delay in acting on this.

Well, the delay was caused because no one submitted a pull request that actually fixed the issue. ENV.fortran was added in response to #9878. So, now we've reverted that and traded convenience for a bug (albiet, an obscure one).

I could not reproduce #9878.

Ian

Sent from my iPhone

On Oct 19, 2012, at 15:59, Charlie Sharpsteen notifications@github.com
wrote:

Sorry for the delay in acting on this.

Well, the delay was caused because no one submitted a pull request that
actually fixed the issue. ENV.fortran was added in response to
#9878mxcl#9878.
So, now we've reverted that and traded convenience for a bug (albiet, an
obscure one).


Reply to this email directly or view it on
GitHubhttps://github.com/mxcl/homebrew/pull/12800#issuecomment-9616528.

Contributor

Sharpie commented Oct 19, 2012

I could not reproduce #9878.

Probably because you have a working fortran compiler.

The bug shows up when a user has a broken compiler somewhere else in the path. ENV.fortran compensates by selecting a Homebrew compiler which is more likely to be in a working state.

So, the resolutions we decided on were to either:

  • Figure out which CMake flags were necessary to disable the testsuite and thus make sure a Fortran compiler, broken or not, was never even drug into the build.
  • Ditch CMake and just copy everything since Eigen is supposedly a header-only library.

Neither of these solutions were presented in a pull request, hence the issue just sat open.

@snakeyroc3 snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this pull request Dec 17, 2012

@adamv adamv eigen: do not depend on fortran
Closes #12800.
069dd36

xu-cheng 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.