PageRenderTime 53ms CodeModel.GetById 29ms RepoModel.GetById 0ms app.codeStats 0ms

/Library/Formula/open-mpi.rb

https://bitbucket.org/bathtub/tigerbrew
Ruby | 56 lines | 39 code | 11 blank | 6 comment | 5 complexity | 7397711348dbb07c090d71c18d77625c MD5 | raw file
  1. require 'formula'
  2. class OpenMpi < Formula
  3. homepage 'http://www.open-mpi.org/'
  4. url 'http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.5.tar.bz2'
  5. sha1 '93859d515b33dd9a0ee6081db285a2d1dffe21ce'
  6. devel do
  7. url 'http://www.open-mpi.org/software/ompi/v1.7/downloads/openmpi-1.7.2.tar.bz2'
  8. sha1 '89676c1171784b1c26e1598caf88e87f897f6653'
  9. end
  10. option 'disable-fortran', 'Do not build the Fortran bindings'
  11. option 'test', 'Verify the build with make check'
  12. option 'enable-mpi-thread-multiple', 'Enable MPI_THREAD_MULTIPLE'
  13. conflicts_with 'mpich2', :because => 'both install mpi__ compiler wrappers'
  14. depends_on :fortran unless build.include? 'disable-fortran'
  15. # Reported upstream at version 1.6, both issues
  16. # http://www.open-mpi.org/community/lists/devel/2012/05/11003.php
  17. # http://www.open-mpi.org/community/lists/devel/2012/08/11362.php
  18. fails_with :clang do
  19. build 421
  20. cause 'fails make check on Lion and ML'
  21. end if not build.devel?
  22. def install
  23. args = %W[
  24. --prefix=#{prefix}
  25. --disable-dependency-tracking
  26. --enable-ipv6
  27. ]
  28. if build.include? 'disable-fortran'
  29. args << '--disable-mpi-f77' << '--disable-mpi-f90'
  30. end
  31. if build.include? 'enable-mpi-thread-multiple'
  32. args << '--enable-mpi-thread-multiple'
  33. end
  34. system './configure', *args
  35. system 'make V=1 all'
  36. system 'make V=1 check' if build.include? 'test'
  37. system 'make install'
  38. # If Fortran bindings were built, there will be a stray `.mod` file
  39. # (Fortran header) in `lib` that needs to be moved to `include`.
  40. include.install lib/'mpi.mod' if File.exists? "#{lib}/mpi.mod"
  41. # Not sure why the wrapped script has a jar extension - adamv
  42. libexec.install bin/'vtsetup.jar'
  43. bin.write_jar_script libexec/'vtsetup.jar', 'vtsetup.jar'
  44. end
  45. end