diff options
author | Nicolas Bock <nicolasbock@gmail.com> | 2013-05-12 15:15:19 -0600 |
---|---|---|
committer | Nicolas Bock <nicolasbock@gmail.com> | 2013-05-15 13:15:11 -0600 |
commit | ceb04847f9ff0c8a99ad79b2ef66364bd491e4df (patch) | |
tree | 04178dc6226afea3c5d07e63b04dfdd29ebdad29 /sci-physics/lammps | |
parent | Moved a variable definition. (diff) | |
download | sci-ceb04847f9ff0c8a99ad79b2ef66364bd491e4df.tar.gz sci-ceb04847f9ff0c8a99ad79b2ef66364bd491e4df.tar.bz2 sci-ceb04847f9ff0c8a99ad79b2ef66364bd491e4df.zip |
Added mpi use flag.
This ebuild builds either the serial version (without the mpi use flag), or the parallel version.
Package-Manager: portage-2.2.0_alpha174
Diffstat (limited to 'sci-physics/lammps')
-rw-r--r-- | sci-physics/lammps/ChangeLog | 5 | ||||
-rwxr-xr-x | sci-physics/lammps/files/Makefile.gentoo-serial.patch | 111 | ||||
-rw-r--r-- | sci-physics/lammps/lammps-20130512.ebuild | 73 | ||||
-rw-r--r-- | sci-physics/lammps/metadata.xml | 2 |
4 files changed, 45 insertions, 146 deletions
diff --git a/sci-physics/lammps/ChangeLog b/sci-physics/lammps/ChangeLog index 93b671728..f502d8449 100644 --- a/sci-physics/lammps/ChangeLog +++ b/sci-physics/lammps/ChangeLog @@ -2,6 +2,11 @@ # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 15 May 2013; Nicolas Bock <nicolasbock@gmail.com> lammps-20130512.ebuild + -files/Makefile.gentoo-serial.patch: + Added mpi use flag. This ebuild builds either the serial version (without the + mpi use flag), or the parallel version. + 10 May 2013; Nicolas Bock <nicolasbock@gmail.com> lammps-20130512.ebuild: Moved a variable definition. diff --git a/sci-physics/lammps/files/Makefile.gentoo-serial.patch b/sci-physics/lammps/files/Makefile.gentoo-serial.patch deleted file mode 100755 index 7b9267cec..000000000 --- a/sci-physics/lammps/files/Makefile.gentoo-serial.patch +++ /dev/null @@ -1,111 +0,0 @@ ---- /dev/null 2013-04-18 18:31:27.695818552 -0600 -+++ src/MAKE/Makefile.gentoo-serial 2013-05-09 15:24:20.000000000 -0600 -@@ -0,0 +1,108 @@ -+# gentoo-serial = Gentoo, serial code -+ -+SHELL = /bin/sh -+ -+# --------------------------------------------------------------------- -+# compiler/linker settings -+# specify flags and libraries needed for your compiler -+ -+CC = g++ -+CCFLAGS = -g -O # -Wunused -+SHFLAGS = -fPIC -+DEPFLAGS = -M -+ -+LINK = g++ -+LINKFLAGS = -g -O -+LIB = -+SIZE = size -+ -+ARCHIVE = ar -+ARFLAGS = -rc -+SHLIBFLAGS = -shared -+ -+# --------------------------------------------------------------------- -+# LAMMPS-specific settings -+# specify settings for LAMMPS features you will use -+# if you change any -D setting, do full re-compile after "make clean" -+ -+# LAMMPS ifdef settings, OPTIONAL -+# see possible settings in doc/Section_start.html#2_2 (step 4) -+ -+LMP_INC = -DLAMMPS_GZIP -+ -+# MPI library, REQUIRED -+# see discussion in doc/Section_start.html#2_2 (step 5) -+# can point to dummy MPI library in src/STUBS as in Makefile.serial -+# INC = path for mpi.h, MPI compiler settings -+# PATH = path for MPI library -+# LIB = name of MPI library -+ -+MPI_INC = -I../STUBS -+MPI_PATH = -L../STUBS -+MPI_LIB = -lmpi_stubs -+ -+# FFT library, OPTIONAL -+# see discussion in doc/Section_start.html#2_2 (step 6) -+# can be left blank to use provided KISS FFT library -+# INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings -+# PATH = path for FFT library -+# LIB = name of FFT library -+ -+FFT_INC = -+FFT_PATH = -+FFT_LIB = -+ -+# JPEG library, OPTIONAL -+# see discussion in doc/Section_start.html#2_2 (step 7) -+# only needed if -DLAMMPS_JPEG listed with LMP_INC -+# INC = path for jpeglib.h -+# PATH = path for JPEG library -+# LIB = name of JPEG library -+ -+JPG_INC = -+JPG_PATH = -+JPG_LIB = -+ -+# --------------------------------------------------------------------- -+# build rules and dependencies -+# no need to edit this section -+ -+include Makefile.package.settings -+include Makefile.package -+ -+EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) -+EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) -+EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB) -+ -+# Path to src files -+ -+vpath %.cpp .. -+vpath %.h .. -+ -+# Link target -+ -+$(EXE): $(OBJ) -+ $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) -+ $(SIZE) $(EXE) -+ -+# Library targets -+ -+lib: $(OBJ) -+ $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) -+ -+shlib: $(OBJ) -+ $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ -+ $(OBJ) $(EXTRA_LIB) $(LIB) -+ -+# Compilation rules -+ -+%.o:%.cpp -+ $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< -+ -+%.d:%.cpp -+ $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ -+ -+# Individual dependencies -+ -+DEPENDS = $(OBJ:.o=.d) -+sinclude $(DEPENDS) diff --git a/sci-physics/lammps/lammps-20130512.ebuild b/sci-physics/lammps/lammps-20130512.ebuild index dd8c6c444..dcb882e98 100644 --- a/sci-physics/lammps/lammps-20130512.ebuild +++ b/sci-physics/lammps/lammps-20130512.ebuild @@ -4,7 +4,9 @@ EAPI=5 -inherit eutils +FORTRAN_NEEDED="package-meam" + +inherit eutils fortran-2 LAMMPSDATE="12May13" @@ -15,51 +17,56 @@ SRC_URI="http://lammps.sandia.gov/tars/lammps-${LAMMPSDATE}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="lammps-gzip lammps-memalign package-meam package-dipole package-rigid" +IUSE="doc examples gzip lammps-memalign mpi package-dipole package-meam package-rigid" -DEPEND="" +DEPEND="mpi? ( virtual/mpi )" RDEPEND="${DEPEND}" S="${WORKDIR}/${PN}-${LAMMPSDATE}" -src_prepare() { - epatch "${FILESDIR}/Makefile.gentoo-serial.patch" - - LAMMPS_INCLUDEFLAGS="" - use lammps-gzip && LAMMPS_INCLUDEFLAGS+=" -DLAMMPS_GZIP" +lmp_emake() { + local LAMMPS_INCLUDEFLAGS= + use gzip && LAMMPS_INCLUDEFLAGS+=" -DLAMMPS_GZIP" use lammps-memalign && LAMMPS_INCLUDEFLAGS+=" -DLAMMPS_MEMALIGN" - # Patch up the patch. - sed -i \ - -e "s/ARCHIVE\s*=.*$/ARCHIVE = $(tc-getAR)/" \ - -e "s/CC\s*=.*$/CC = $(tc-getCXX)/" \ - -e "s/CCFLAGS\s*=.*$/CCFLAGS = ${CXXFLAGS}/" \ - -e "s/LINK\s*=.*$/LINK = $(tc-getCXX)/" \ - -e "s/LINKFLAGS\s*=.*$/LINKFLAGS = ${LDFLAGS}/" \ - -e "s/LMP_INC\s*=.*$/LMP_INC = ${LAMMPS_INCLUDEFLAGS}/" \ - "${S}/src/MAKE/Makefile.gentoo-serial" - - # Patch up other makefiles. - use package-meam && sed -i \ - -e "s/ARCHIVE\s*=.*$/ARCHIVE = $(tc-getAR)/" \ - -e "s/F90\s*=.*$/F90 = $(tc-getFC)/" \ - -e "s/F90FLAGS\s*=.*$/F90FLAGS = ${FCFLAGS}/" \ - -e "s/LINK\s*=.*$/LINK = $(tc-getFC)/" \ - -e "s/LINKFLAGS\s*=.*$/LINKFLAGS = ${LDFLAGS}/" \ - "${S}/lib/meam/Makefile.gfortran" + # Note: The lammps makefile uses CC to indicate the C++ compiler. + emake \ + ARCHIVE=$(tc-getAR) \ + CC=$(use mpi && echo mpic++ || echo $(tc-getCXX)) \ + F90=$(use mpi && echo mpif90 || echo $(tc-getFC)) \ + LINK=$(use mpi && echo mpic++ || echo $(tc-getCXX)) \ + CCFLAGS="${CXXFLAGS}" \ + F90FLAGS="${FCFLAGS}" \ + LINKFLAGS="${LDFLAGS}" \ + LMP_INC="${LAMMPS_INCLUDEFLAGS}" \ + MPI_INC=$(use mpi || echo -I../STUBS) \ + MPI_PATH=$(use mpi || echo -L../STUBS) \ + MPI_LIB=$(use mpi || echo -lmpi_stubs) \ + "$@" } src_compile() { - emake -C src stubs - use package-meam && { - emake -C src yes-meam - emake -j1 -C lib/meam -f Makefile.gfortran - } + # Compile stubs for serial version. + use mpi || lmp_emake -C src stubs + + # Build optional packages. + if use package-meam; then + lmp_emake -C src yes-meam + lmp_emake -j1 -C lib/meam -f Makefile.gfortran + fi use package-dipole && emake -C src yes-dipole use package-rigid && emake -C src yes-rigid - emake -C src gentoo-serial + + # Compile. + lmp_emake -C src serial } src_install() { - newbin "$S/src/lmp_gentoo-serial" "lmp-serial" + newbin "$S/src/lmp_serial" "lmp" + if use examples; then + insinto "/usr/share/doc/${PF}" + doins -r examples + fi + dodoc README + use doc && dohtml -r docs/*.html } diff --git a/sci-physics/lammps/metadata.xml b/sci-physics/lammps/metadata.xml index 4b180209a..b5e2ddd5d 100644 --- a/sci-physics/lammps/metadata.xml +++ b/sci-physics/lammps/metadata.xml @@ -16,8 +16,6 @@ code is designed to be easy to modify or extend with new functionality. </longdescription> <use> - <flag name="lammps-gzip">The read_data and dump commands will read/write - gzipped files</flag> <flag name="lammps-memalign">Enables the use of the posix_memalign() call instead of malloc() when large chunks or memory are allocated by LAMMPS</flag> |