* [gentoo-commits] proj/sci:master commit in: sci-physics/lammps/files/, sci-physics/lammps/
@ 2013-05-10 16:01 Nicolas Bock
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Bock @ 2013-05-10 16:01 UTC (permalink / raw
To: gentoo-commits
commit: 617aa8caae1d7cb83836d530be7174ce5e10ad2a
Author: Nicolas Bock <nicolasbock <AT> gmail <DOT> com>
AuthorDate: Fri May 10 16:00:08 2013 +0000
Commit: Nicolas Bock <nicolasbock <AT> gmail <DOT> com>
CommitDate: Fri May 10 16:00:08 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=617aa8ca
Added first draft version of lammps.
For now this is only the serial version.
Package-Manager: portage-2.2.0_alpha174
---
sci-physics/lammps/ChangeLog | 9 ++
.../lammps/files/Makefile.gentoo-serial.patch | 111 ++++++++++++++++++++
sci-physics/lammps/lammps-20130512.ebuild | 36 +++++++
sci-physics/lammps/metadata.xml | 19 ++++
4 files changed, 175 insertions(+), 0 deletions(-)
diff --git a/sci-physics/lammps/ChangeLog b/sci-physics/lammps/ChangeLog
new file mode 100644
index 0000000..d717a18
--- /dev/null
+++ b/sci-physics/lammps/ChangeLog
@@ -0,0 +1,9 @@
+# ChangeLog for sci-physics/lammps
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*lammps-20130512 (10 May 2013)
+
+ 10 May 2013; Nicolas Bock <nicolasbock@gmail.com>
+ +files/Makefile.gentoo-serial.patch, +lammps-20130512.ebuild, +metadata.xml:
+ Added first draft version of lammps. For now this is only the serial version.
diff --git a/sci-physics/lammps/files/Makefile.gentoo-serial.patch b/sci-physics/lammps/files/Makefile.gentoo-serial.patch
new file mode 100755
index 0000000..7b9267c
--- /dev/null
+++ b/sci-physics/lammps/files/Makefile.gentoo-serial.patch
@@ -0,0 +1,111 @@
+--- /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
new file mode 100644
index 0000000..328c94e
--- /dev/null
+++ b/sci-physics/lammps/lammps-20130512.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit eutils
+
+LAMMPSDATE="12May13"
+
+DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
+HOMEPAGE="http://lammps.sandia.gov/"
+SRC_URI="http://lammps.sandia.gov/tars/lammps-${LAMMPSDATE}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PN}-${LAMMPSDATE}"
+
+src_prepare() {
+ epatch "${FILESDIR}/Makefile.gentoo-serial.patch"
+}
+
+src_compile() {
+ emake -C src ARCHIVE=$(tc-getAR) CC=$(tc-getCXX) CCFLAGS="${CXXFLAGS}" LINKFLAGS="${LDFLAGS}" stubs
+ emake -C src ARCHIVE=$(tc-getAR) CC=$(tc-getCXX) CCFLAGS="${CXXFLAGS}" LINKFLAGS="${LDFLAGS}" gentoo-serial
+}
+
+src_install() {
+ newbin "$S/src/lmp_gentoo-serial" "lmp-serial"
+}
diff --git a/sci-physics/lammps/metadata.xml b/sci-physics/lammps/metadata.xml
new file mode 100644
index 0000000..69268b8
--- /dev/null
+++ b/sci-physics/lammps/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <longdescription lang="en">
+ LAMMPS is a classical molecular dynamics code, and an acronym for
+ Large-scale Atomic/Molecular Massively Parallel Simulator.
+
+ LAMMPS has potentials for soft materials (biomolecules, polymers) and
+ solid-state materials (metals, semiconductors) and coarse-grained or
+ mesoscopic systems. It can be used to model atoms or, more generically,
+ as a parallel particle simulator at the atomic, meso, or continuum
+ scale.
+
+ LAMMPS runs on single processors or in parallel using message-passing
+ techniques and a spatial-decomposition of the simulation domain. The
+ code is designed to be easy to modify or extend with new functionality.
+ </longdescription>
+</pkgmetadata>
+
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sci-physics/lammps/files/, sci-physics/lammps/
@ 2013-05-15 20:29 Kacper Kowalik
0 siblings, 0 replies; 2+ messages in thread
From: Kacper Kowalik @ 2013-05-15 20:29 UTC (permalink / raw
To: gentoo-commits
commit: ceb04847f9ff0c8a99ad79b2ef66364bd491e4df
Author: Nicolas Bock <nicolasbock <AT> gmail <DOT> com>
AuthorDate: Sun May 12 21:15:19 2013 +0000
Commit: Kacper Kowalik <xarthisius <AT> gentoo <DOT> org>
CommitDate: Wed May 15 19:15:11 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=ceb04847
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
---
sci-physics/lammps/ChangeLog | 5 +
.../lammps/files/Makefile.gentoo-serial.patch | 111 --------------------
sci-physics/lammps/lammps-20130512.ebuild | 73 +++++++------
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 93b6717..f502d84 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 7b9267c..0000000
--- 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 dd8c6c4..dcb882e 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 4b18020..b5e2ddd 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>
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-05-15 20:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-15 20:29 [gentoo-commits] proj/sci:master commit in: sci-physics/lammps/files/, sci-physics/lammps/ Kacper Kowalik
-- strict thread matches above, loose matches on Subject: below --
2013-05-10 16:01 Nicolas Bock
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox