2010-02-26 09:50:15 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class OpenMpi < Formula
|
2011-03-15 19:41:49 +00:00
|
|
|
homepage 'http://www.open-mpi.org/'
|
2014-03-23 00:44:19 +00:00
|
|
|
url 'http://www.open-mpi.org/software/ompi/v1.7/downloads/openmpi-1.7.5.tar.bz2'
|
|
|
|
sha1 '4a0de91c50a51e588810cc03d48c03429f3c1006'
|
2014-02-07 05:07:22 +00:00
|
|
|
|
2013-03-26 05:31:24 +00:00
|
|
|
option 'disable-fortran', 'Do not build the Fortran bindings'
|
|
|
|
option 'enable-mpi-thread-multiple', 'Enable MPI_THREAD_MULTIPLE'
|
2013-10-09 08:53:30 +00:00
|
|
|
option :cxx11
|
2013-03-26 05:31:24 +00:00
|
|
|
|
|
|
|
conflicts_with 'mpich2', :because => 'both install mpi__ compiler wrappers'
|
2013-10-26 07:57:23 +00:00
|
|
|
conflicts_with 'lcdf-typetools', :because => 'both install same set of binaries.'
|
2013-03-26 05:31:24 +00:00
|
|
|
|
2013-06-24 03:29:13 +00:00
|
|
|
depends_on :fortran unless build.include? 'disable-fortran'
|
2014-02-26 06:04:29 +00:00
|
|
|
depends_on 'libevent'
|
2013-06-24 03:29:13 +00:00
|
|
|
|
2010-02-26 09:50:15 +00:00
|
|
|
def install
|
2013-10-09 08:53:30 +00:00
|
|
|
ENV.cxx11 if build.cxx11?
|
|
|
|
|
2012-05-17 20:57:36 +00:00
|
|
|
args = %W[
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--disable-dependency-tracking
|
2013-10-23 09:17:12 +00:00
|
|
|
--disable-silent-rules
|
2012-05-17 20:57:36 +00:00
|
|
|
--enable-ipv6
|
2014-02-26 06:04:29 +00:00
|
|
|
--with-libevent=#{Formula["libevent"].opt_prefix}
|
2012-05-17 20:57:36 +00:00
|
|
|
]
|
2012-10-21 19:47:53 +00:00
|
|
|
if build.include? 'disable-fortran'
|
2012-05-17 20:57:36 +00:00
|
|
|
args << '--disable-mpi-f77' << '--disable-mpi-f90'
|
|
|
|
end
|
2012-06-20 09:58:29 +00:00
|
|
|
|
2013-01-08 15:46:02 +00:00
|
|
|
if build.include? 'enable-mpi-thread-multiple'
|
|
|
|
args << '--enable-mpi-thread-multiple'
|
|
|
|
end
|
|
|
|
|
2012-05-17 20:57:36 +00:00
|
|
|
system './configure', *args
|
2013-10-23 09:17:12 +00:00
|
|
|
system 'make', 'all'
|
|
|
|
system 'make', 'check'
|
|
|
|
system 'make', 'install'
|
2012-06-20 09:58:29 +00:00
|
|
|
|
|
|
|
# If Fortran bindings were built, there will be a stray `.mod` file
|
|
|
|
# (Fortran header) in `lib` that needs to be moved to `include`.
|
2013-12-09 19:44:45 +00:00
|
|
|
include.install lib/'mpi.mod' if File.exist? "#{lib}/mpi.mod"
|
2012-06-20 09:58:29 +00:00
|
|
|
|
2012-08-07 18:20:52 +00:00
|
|
|
# Not sure why the wrapped script has a jar extension - adamv
|
|
|
|
libexec.install bin/'vtsetup.jar'
|
|
|
|
bin.write_jar_script libexec/'vtsetup.jar', 'vtsetup.jar'
|
2010-02-26 09:50:15 +00:00
|
|
|
end
|
|
|
|
end
|