aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2014-05-15 21:05:00 +0100
committerMike McQuaid2014-05-16 17:42:07 +0100
commit0d9c4aa7ec14dd3363bfe18975f47f72a762242b (patch)
treef1cdc93aac611460b12a86a5db660440d6d28278 /Library
parentc61e1d016a119c0a0eb451c626b7b51beb2eb58b (diff)
downloadhomebrew-0d9c4aa7ec14dd3363bfe18975f47f72a762242b.tar.bz2
Remove gfortran in favour of gcc formula.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/gfortran.rb126
1 files changed, 0 insertions, 126 deletions
diff --git a/Library/Formula/gfortran.rb b/Library/Formula/gfortran.rb
deleted file mode 100644
index 723cbf0a9..000000000
--- a/Library/Formula/gfortran.rb
+++ /dev/null
@@ -1,126 +0,0 @@
-require 'formula'
-
-class Gfortran < Formula
- homepage 'http://gcc.gnu.org/wiki/GFortran'
- url 'http://ftpmirror.gnu.org/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2'
- mirror 'http://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2'
- sha1 '810fb70bd721e1d9f446b6503afe0a9088b62986'
-
- bottle do
- revision 1
- sha1 'b0e7a0c7b6b0472b6cea9e73b2312df48f7c6c82' => :mavericks
- sha1 '45d4f1b8c492a7c5abd67685a9bbfc408e474458' => :mountain_lion
- sha1 '2d09223b679cdaa28fe3d9c192b65cec56353db9' => :lion
- end
-
- option 'enable-profiled-build', 'Make use of profile guided optimization when bootstrapping GCC'
- option 'check', 'Run the make check fortran. This is for maintainers.'
- option 'enable-multilib', 'Build with multilib support' if MacOS.prefer_64_bit?
-
- depends_on 'gmp'
- depends_on 'libmpc'
- depends_on 'mpfr'
- depends_on 'cloog'
- depends_on 'isl'
-
- # http://gcc.gnu.org/install/test.html
- depends_on 'dejagnu' if build.include? 'check'
-
- def install
- # Sandbox the GCC lib, libexec and include directories so they don't wander
- # around telling small children there is no Santa Claus. This results in a
- # partially keg-only brew following suggestions outlined in the "How to
- # install multiple versions of GCC" section of the GCC FAQ:
- # http://gcc.gnu.org/faq.html#multiple
- gfortran_prefix = prefix/'gfortran'
-
- args = [
- # Sandbox everything...
- "--prefix=#{gfortran_prefix}",
- # ...except the stuff in share...
- "--datarootdir=#{share}",
- # ...and the binaries...
- "--bindir=#{bin}",
- "--enable-languages=fortran",
- "--with-system-zlib",
- # ...opt_prefix survives upgrades and works even if `brew unlink gmp`
- "--with-gmp=#{Formula['gmp'].opt_prefix}",
- "--with-mpfr=#{Formula['mpfr'].opt_prefix}",
- "--with-mpc=#{Formula['libmpc'].opt_prefix}",
- "--with-cloog=#{Formula['cloog'].opt_prefix}",
- "--with-isl=#{Formula['isl'].opt_prefix}",
- # ...and disable isl and cloog version checks in case they upgrade
- "--disable-cloog-version-check",
- "--disable-isl-version-check",
- # ...we build the stage 1 gcc with clang (which is know to fail checks)
- "--enable-checking=release",
- "--disable-stage1-checking",
- # ...speed up build by stop building libstdc++-v3
- "--disable-libstdcxx",
- "--enable-lto",
- # ...disable translations avoid conflict with brew install gcc --enable-nls
- '--disable-nls'
- ]
-
- # https://github.com/Homebrew/homebrew/issues/19584#issuecomment-19661219
- if build.include? 'enable-multilib' and MacOS.prefer_64_bit?
- args << '--enable-multilib'
- else
- args << '--disable-multilib'
- end
-
- mkdir 'build' do
- unless MacOS::CLT.installed?
- # For Xcode-only systems, we need to tell the sysroot path.
- # 'native-system-header's will be appended
- args << "--with-native-system-header-dir=/usr/include"
- args << "--with-sysroot=#{MacOS.sdk_path}"
- end
-
- system '../configure', *args
-
- if build.include? 'enable-profiled-build'
- # Takes longer to build, may bug out. Provided for those who want to
- # optimise all the way to 11.
- system 'make profiledbootstrap'
- else
- system 'make bootstrap'
- end
-
- system "make"
- system "make check-fortran" if build.include? 'check'
- system 'make install'
- end
-
- # This package installs a whole GCC suite. Removing non-fortran components:
- bin.children.reject{ |p| p.basename.to_s.match(/gfortran/) }.each(&:unlink)
- info.children.reject{ |p| p.basename.to_s.match(/gfortran/) }.each(&:unlink)
- man1.children.reject{ |p| p.basename.to_s.match(/gfortran/) }.each(&:unlink)
- man7.rmtree # dupes: fsf fundraising and gpl
- (share/"gcc-#{version}").rmtree # dupes: libstdc++ pretty printer, will be added by gcc* formula
- end
-
- test do
- fixture = <<-EOS.undent
- integer,parameter::m=10000
- real::a(m), b(m)
- real::fact=0.5
-
- do concurrent (i=1:m)
- a(i) = a(i) + fact*b(i)
- end do
- print *, "done"
- end
- EOS
- Pathname('in.f90').write(fixture)
- system "#{bin}/gfortran -c in.f90"
- system "#{bin}/gfortran -o test in.o"
- assert_equal 'done', `./test`.strip
- end
-
- def caveats; <<-EOS.undent
- Formulae that require a Fortran compiler should use:
- depends_on :fortran
- EOS
- end
-end