diff options
| author | Dave Goodell | 2012-11-28 18:05:59 -0600 |
|---|---|---|
| committer | Charlie Sharpsteen | 2012-12-01 11:31:51 -0800 |
| commit | c85821ce2814b21254642ed35b0d50553bdedddf (patch) | |
| tree | 4cf9ae0f92c99d2722bbd1b253b9c304e7fe3da0 /Library/Formula | |
| parent | c530ebe06cb106f48dd9b8bc15cf740ee5cfdd87 (diff) | |
| download | homebrew-c85821ce2814b21254642ed35b0d50553bdedddf.tar.bz2 | |
mpich2: Add option to re-enable shared libs
MPICH2 fails to build with clang because of a clang (and/or ld) bug with
Xcode 4.5.1. Issue originally reported to homebrew in #15533, "fixed"
by disabling shared libraries altogether in bcb64c7.
- Add an `--enable-shared` option
- Add a `fails_with :clang` when building shared libs
- Upstream is aware of the issue, but has no workaround besides using
`llvm-gcc` when building shared libs
- MacPorts is using a similar workaround at this time.
- Tested on 10.7.5 with Xcode 4.5.2 with and without `--enable-shared`
Closes #16299.
Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/mpich2.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Library/Formula/mpich2.rb b/Library/Formula/mpich2.rb index 130f2166a..00a69d72e 100644 --- a/Library/Formula/mpich2.rb +++ b/Library/Formula/mpich2.rb @@ -15,6 +15,18 @@ class Mpich2 < Formula end option 'disable-fortran', "Do not attempt to build Fortran bindings" + option 'enable-shared', "Build shared libraries" + + # fails with clang from Xcode 4.5.1 on 10.7 and 10.8 (see #15533) + fails_with :clang do + build 421 + cause <<-EOS.undent + Clang generates code that causes the linker to segfault when building + MPICH2 with shared libraries. Specific message: + + collect2: ld terminated with signal 11 [Segmentation fault: 11] + EOS + end if build.include? 'enable-shared' def install if build.head? @@ -36,6 +48,11 @@ class Mpich2 < Formula ENV.fortran end + # MPICH2 configure defaults to "--disable-shared" + if build.include? 'enable-shared' + args << "--enable-shared" + end + system "./configure", *args system "make" system "make install" |
