class Lammps < Formula desc "Molecular Dynamics Simulator" homepage "https://lammps.sandia.gov/" url "https://lammps.sandia.gov/tars/lammps-7Aug19.tar.gz" # lammps releases are named after their release date. We transform it to # YYYY-MM-DD (year-month-day) so that we get a sane version numbering. # We only track stable releases as announced on the LAMMPS homepage. version "2019-08-07" sha256 "4e8342b97441deb76c2fddd8a4fd23beb718cb0910779d98e334026391ed3961" bottle do sha256 "604056c80bb3b36f0a1644388bff26f2bcdc3e2f2541247e9a7ce941b20e9bcc" => :catalina sha256 "e14fbf9e68b16804c9d86f525e92190010c580c479263eaf194ff1e23dd877b1" => :mojave sha256 "eebae98d9606af15a5281f07843ea41aeb94974a52f0023e9734aab3db430406" => :high_sierra sha256 "cd52cb03b501cb8d65f0dcf8baf3857dc13e2a2206016ef559bf5ff3eba31e1d" => :sierra end depends_on "pkg-config" => :build depends_on "fftw" depends_on "gcc" # for gfortran depends_on "jpeg" depends_on "kim-api" depends_on "libpng" depends_on "open-mpi" def install %w[serial mpi].each do |variant| cd "src" do system "make", "clean-all" system "make", "yes-standard" # Disable some packages for which we do not have dependencies, that are # deprecated or require too much configuration. %w[gpu kokkos latte mscg message mpiio poems voronoi].each do |package| system "make", "no-#{package}" end system "make", variant, "LMP_INC=-DLAMMPS_GZIP", "FFT_INC=-DFFT_FFTW3 -I#{Formula["fftw"].opt_include}", "FFT_PATH=-L#{Formula["fftw"].opt_lib}", "FFT_LIB=-lfftw3", "JPG_INC=-DLAMMPS_JPEG -I#{Formula["jpeg"].opt_include} " \ "-DLAMMPS_PNG -I#{Formula["libpng"].opt_include}", "JPG_PATH=-L#{Formula["jpeg"].opt_lib} -L#{Formula["libpng"].opt_lib}", "JPG_LIB=-ljpeg -lpng" bin.install "lmp_#{variant}" end end pkgshare.install(%w[doc potentials tools bench examples]) end test do system "#{bin}/lmp_serial", "-in", "#{pkgshare}/bench/in.lj" end end