From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhRvi-0007g4-8n for guix-patches@gnu.org; Mon, 14 Aug 2017 22:50:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dhRvf-0000Jf-3f for guix-patches@gnu.org; Mon, 14 Aug 2017 22:50:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:57146) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dhRve-0000JZ-U8 for guix-patches@gnu.org; Mon, 14 Aug 2017 22:50:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dhRve-0006yH-H2 for guix-patches@gnu.org; Mon, 14 Aug 2017 22:50:02 -0400 Subject: [bug#28045] [PATCH] gnu: Add openfoam Resent-Message-ID: Date: Mon, 14 Aug 2017 21:49:25 -0500 From: Eric Bavier Message-ID: <20170814214925.2cd96b3f@centurylink.net> In-Reply-To: <20170811110636.23339-1-pgarlick@tourbillion-technology.com> References: <20170811110636.23339-1-pgarlick@tourbillion-technology.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Paul Garlick Cc: 28045@debbugs.gnu.org Hello Paul, Thank you for the patch! I started this response before Marius's reply. I hope the two do not overlap too much: On Fri, 11 Aug 2017 12:06:36 +0100 Paul Garlick wrote: > * gnu/packages/simulation.scm: New file Would this package not fit nicely in gnu/packages/engineering.scm? > * gnu/packages/patches/openfoam-cleanup.patch: New file See comments below. > * gnu/local.mk(GNU_SYSTEM_MODULES): Add module > (dist_patch_DATA): Add patch ^ ChangeLog conventions would have this opening paren in column 0.=20 > --- > gnu/local.mk | 2 + > gnu/packages/patches/openfoam-cleanup.patch | 251 ++++++++++++++++++++++= ++++++ > gnu/packages/simulation.scm | 197 ++++++++++++++++++++++ > 3 files changed, 450 insertions(+) > create mode 100644 gnu/packages/patches/openfoam-cleanup.patch > create mode 100644 gnu/packages/simulation.scm >=20 > diff --git a/gnu/local.mk b/gnu/local.mk > index 4b2bdfe37..b00ec1ac7 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -357,6 +357,7 @@ GNU_SYSTEM_MODULES =3D \ > %D%/packages/shells.scm \ > %D%/packages/shellutils.scm \ > %D%/packages/simh.scm \ > + %D%/packages/simulation.scm \ > %D%/packages/skarnet.scm \ > %D%/packages/skribilo.scm \ > %D%/packages/slang.scm \ > @@ -866,6 +867,7 @@ dist_patch_DATA =3D \ > %D%/packages/patches/ola-readdir-r.patch \ > %D%/packages/patches/openscenegraph-ffmpeg3.patch \ > %D%/packages/patches/openexr-missing-samples.patch \ > + %D%/packages/patches/openfoam-cleanup.patch \ > %D%/packages/patches/openjpeg-CVE-2016-9850-CVE-2016-9851.patch \ > %D%/packages/patches/openjpeg-CVE-2016-9572-CVE-2016-9573.patch \ > %D%/packages/patches/openldap-CVE-2017-9287.patch \ > diff --git a/gnu/packages/patches/openfoam-cleanup.patch b/gnu/packages/p= atches/openfoam-cleanup.patch > new file mode 100644 > index 000000000..b2c0ddcd1 > --- /dev/null > +++ b/gnu/packages/patches/openfoam-cleanup.patch > @@ -0,0 +1,251 @@ > +# This patch removes all need for the ThirdParty files of OpenFOAM > + > +# Derived from easybuild patch: Ward Poelmans > +# Modified for GNU Guix: Paul Garlick > + > +diff -ur OpenFOAM-4.x-version-4.1.org/applications/utilities/mesh/manipu= lation/setSet/Allwmake OpenFOAM-4.x-version-4.1/applications/utilities/mesh= /manipulation/setSet/Allwmake > +--- OpenFOAM-4.x-version-4.1.org/applications/utilities/mesh/manipulatio= n/setSet/Allwmake > ++++ OpenFOAM-4.x-version-4.1/applications/utilities/mesh/manipulation/se= tSet/Allwmake > +@@ -9,7 +9,7 @@ > + # > + # use readline if available > + # > +-if [ -f /usr/include/readline/readline.h ] > ++if true > + then > + echo "Found -- enabling readline support." > + export COMP_FLAGS=3D"-DHAS_READLINE" > +diff -ur OpenFOAM-4.x-version-4.1.org/etc/bashrc OpenFOAM-4.x-version-4.= 1/etc/bashrc > +--- OpenFOAM-4.x-version-4.1.org/etc/bashrc > ++++ OpenFOAM-4.x-version-4.1/etc/bashrc > +@@ -43,8 +43,10 @@ > + # Please set to the appropriate path if the default is not correct. > + # > + [ $BASH_SOURCE ] && \ > +-export FOAM_INST_DIR=3D$(cd ${BASH_SOURCE%/*/*/*} && pwd -P) || \ > ++export FOAM_INST_DIR=3D$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P) ||= \ > + export FOAM_INST_DIR=3D$HOME/$WM_PROJECT > ++# For GNU Guix: set initially for build then re-set at runtime > ++# > + # export FOAM_INST_DIR=3D~$WM_PROJECT > + # export FOAM_INST_DIR=3D/opt/$WM_PROJECT > + # export FOAM_INST_DIR=3D/usr/local/$WM_PROJECT > +diff -ur OpenFOAM-4.x-version-4.1.org/etc/config.sh/CGAL OpenFOAM-4.x-ve= rsion-4.1/etc/config.sh/CGAL > +--- OpenFOAM-4.x-version-4.1.org/etc/config.sh/CGAL > ++++ OpenFOAM-4.x-version-4.1/etc/config.sh/CGAL > +@@ -36,37 +36,7 @@ > + # > + #----------------------------------------------------------------------= -------- > + > +-boost_version=3Dboost-system > +-cgal_version=3Dcgal-system > +-#cgal_version=3DCGAL-4.8 > +- > +-if [ -z "$SOURCE_CGAL_VERSIONS_ONLY" ] > +-then > +- > +- common_path=3D$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER > +- > +- export BOOST_ARCH_PATH=3D$common_path/$boost_version > +- export CGAL_ARCH_PATH=3D$common_path/$cgal_version > +- > +- if [ "$FOAM_VERBOSE" -a "$PS1" ] > +- then > +- echo "Using CGAL and boost" 1>&2 > +- echo " $cgal_version at $CGAL_ARCH_PATH" 1>&2 > +- echo " $boost_version at $BOOST_ARCH_PATH" 1>&2 > +- fi > +- > +- if [ -d "$CGAL_ARCH_PATH" -a "$cgal_version" !=3D "cgal-system" ] > +- then > +- _foamAddLib $CGAL_ARCH_PATH/lib > +- fi > +- > +- if [ -d "$BOOST_ARCH_PATH" -a "$boost_version" !=3D "boost-system" ] > +- then > +- _foamAddLib $BOOST_ARCH_PATH/lib > +- fi > +- > +- unset boost_version cgal_version common_path > +- > +-fi > ++export CGAL_ARCH_PATH=3D$CGAL_ROOT > ++export BOOST_ARCH_PATH=3D$BOOST_ROOT > + > + #----------------------------------------------------------------------= -------- > +diff -ur OpenFOAM-4.x-version-4.1.org/etc/config.sh/gperftools OpenFOAM-= 4.x-version-4.1/etc/config.sh/gperftools > +--- OpenFOAM-4.x-version-4.1.org/etc/config.sh/gperftools 2016-10-16 16:= 11:45.000000000 +0200 > ++++ OpenFOAM-4.x-version-4.1/etc/config.sh/gperftools 2017-04-10 14:51:0= 1.473221230 +0200 > +@@ -29,13 +29,13 @@ > + # > + #----------------------------------------------------------------------= -------- > + > +-version=3Dsvn > +-gperftools_install=3D$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER > +- > +-GPERFTOOLS_VERSION=3Dgperftools-$version > +-GPERFTOOLS_ARCH_PATH=3D$gperftools_install/$GPERFTOOLS_VERSION > +- > +-export PATH=3D$GPERFTOOLS_ARCH_PATH/bin:$PATH > +-export LD_LIBRARY_PATH=3D$GPERFTOOLS_ARCH_PATH/lib:$LD_LIBRARY_PATH > ++# version=3Dsvn > ++# gperftools_install=3D$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPIL= ER > ++#=20 > ++# GPERFTOOLS_VERSION=3Dgperftools-$version > ++# GPERFTOOLS_ARCH_PATH=3D$gperftools_install/$GPERFTOOLS_VERSION > ++#=20 > ++# export PATH=3D$GPERFTOOLS_ARCH_PATH/bin:$PATH > ++# export LD_LIBRARY_PATH=3D$GPERFTOOLS_ARCH_PATH/lib:$LD_LIBRARY_PATH > + > + #----------------------------------------------------------------------= -------- > +diff -ur OpenFOAM-4.x-version-4.1.org/etc/config.sh/metis OpenFOAM-4.x-v= ersion-4.1/etc/config.sh/metis > +--- OpenFOAM-4.x-version-4.1.org/etc/config.sh/metis > ++++ OpenFOAM-4.x-version-4.1/etc/config.sh/metis > +@@ -34,7 +34,7 @@ > + # > + #----------------------------------------------------------------------= -------- > + > +-export METIS_VERSION=3Dmetis-5.1.0 > +-export METIS_ARCH_PATH=3D$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMP= ILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$METIS_VERSION > ++export METIS_VERSION=3Dmetis-$METISVERSION > ++export METIS_ARCH_PATH=3D$METIS_ROOT > + > + #----------------------------------------------------------------------= -------- > +diff -ur OpenFOAM-4.x-version-4.1.org/etc/config.sh/scotch OpenFOAM-4.x-= version-4.1/etc/config.sh/scotch > +--- OpenFOAM-4.x-version-4.1.org/etc/config.sh/scotch > ++++ OpenFOAM-4.x-version-4.1/etc/config.sh/scotch > +@@ -37,7 +37,7 @@ > + # > + #----------------------------------------------------------------------= -------- > + > +-export SCOTCH_VERSION=3Dscotch_6.0.3 > +-export SCOTCH_ARCH_PATH=3D$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COM= PILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$SCOTCH_VERSION > ++export SCOTCH_VERSION=3Dscotch_$SCOTCHVERSION > ++export SCOTCH_ARCH_PATH=3D$SCOTCH_ROOT > + > + #----------------------------------------------------------------------= -------- > +diff -ur OpenFOAM-4.x-version-4.1.org/etc/config.sh/settings OpenFOAM-4.= x-version-4.1/etc/config.sh/settings > +--- OpenFOAM-4.x-version-4.1.org/etc/config.sh/settings > ++++ OpenFOAM-4.x-version-4.1/etc/config.sh/settings > +@@ -279,6 +279,9 @@ > + ;; > + system) > + # Use system compiler > ++ # Use system GMP and MPFR packages > ++ export GMP_ARCH_PATH=3D$GMP_ROOT > ++ export MPFR_ARCH_PATH=3D$MPFR_ROOT > + ;; > + *) > + echo "Warn: WM_COMPILER_TYPE=3D'$WM_COMPILER_TYPE' is unsupported" = 1>&2 > +diff -ur OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/ptscotchDec= omp/Make/options OpenFOAM-4.x-version-4.1/src/parallel/decompose/ptscotchDe= comp/Make/options > +--- OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/ptscotchDecomp/M= ake/options > ++++ OpenFOAM-4.x-version-4.1/src/parallel/decompose/ptscotchDecomp/Make/= options > +@@ -5,8 +5,7 @@ > + $(PFLAGS) $(PINC) \ > + -I$(SCOTCH_ROOT)/include \ > + -I$(SCOTCH_ARCH_PATH)/include/$(FOAM_MPI) \ > +- -I/usr/include/scotch \ > + -I../decompositionMethods/lnInclude > + > + LIB_LIBS =3D \ > +- -L$(SCOTCH_ROOT)/lib -L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) -lptscotch -l= ptscotcherrexit -lscotch ${LINK_FLAGS} -lrt > ++ -L$(SCOTCH_ROOT)/lib -L$(MPI_ARCH_PATH)/lib -lptscotch -lptscotcher= rexit -lscotch ${LINK_FLAGS} -lrt > +diff -ur OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/scotchDecom= p/Make/options OpenFOAM-4.x-version-4.1/src/parallel/decompose/scotchDecomp= /Make/options > +--- OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/scotchDecomp/Mak= e/options > ++++ OpenFOAM-4.x-version-4.1/src/parallel/decompose/scotchDecomp/Make/op= tions > +@@ -9,8 +9,7 @@ > + $(PFLAGS) $(PINC) \ > + -I$(SCOTCH_ROOT)/include \ > + -I$(SCOTCH_ARCH_PATH)/include \ > +- -I/usr/include/scotch \ > + -I../decompositionMethods/lnInclude > + > + LIB_LIBS =3D \ > +- -L$(SCOTCH_ROOT)/lib -L$(FOAM_EXT_LIBBIN) -lscotch -lscotcherrexit = -lrt > ++ -L$(SCOTCH_ROOT)/lib -lscotch -lscotcherrexit -lrt > +diff -ur OpenFOAM-4.x-version-4.1.org/wmake/src/Makefile OpenFOAM-4.x-ve= rsion-4.1/wmake/src/Makefile > +--- OpenFOAM-4.x-version-4.1.org/wmake/src/Makefile > ++++ OpenFOAM-4.x-version-4.1/wmake/src/Makefile > +@@ -33,7 +33,7 @@ > + # The Makefile use a POSIX shell > + #----------------------------------------------------------------------= -------- > +=20 > +-SHELL =3D /bin/sh > ++# SHELL =3D /bin/sh > +=20 > + #----------------------------------------------------------------------= -------- > + # Unset suffices list (suffix rules are not used) > +diff -ur OpenFOAM-4.x-version-4.1.org/wmake/makefiles/general OpenFOAM-4= .x-version-4.1/wmake/makefiles/general > +--- OpenFOAM-4.x-version-4.1.org/wmake/makefiles/general > ++++ OpenFOAM-4.x-version-4.1/wmake/makefiles/general > +@@ -33,7 +33,7 @@ > + # The Makefile uses a POSIX shell > + #----------------------------------------------------------------------= -------- > +=20 > +-SHELL =3D /bin/sh > ++# SHELL =3D /bin/sh > +=20 > +=20 > + #----------------------------------------------------------------------= -------- > +diff -ur OpenFOAM-4.x-version-4.1.org/wmake/wmake OpenFOAM-4.x-version-4= .1/wmake/wmake > +--- OpenFOAM-4.x-version-4.1.org/wmake/wmake > ++++ OpenFOAM-4.x-version-4.1/wmake/wmake > +@@ -163,7 +163,7 @@ > + then > + if [ "$WM_NCOMPPROCS" -gt 1 -a ! "$MAKEFLAGS" ] > + then > +- lockDir=3D$HOME/.$WM_PROJECT/.wmake > ++ lockDir=3D$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P)/.$WM_PR= OJECT/.wmake > +=20 > + if [ -d $lockDir ] > + then > +diff -ur OpenFOAM-4.x-version-4.1.org/wmake/wmakeScheduler OpenFOAM-4.x-= version-4.1/wmake/wmakeScheduler > +--- OpenFOAM-4.x-version-4.1.org/wmake/wmakeScheduler > ++++ OpenFOAM-4.x-version-4.1/wmake/wmakeScheduler > +@@ -53,7 +53,7 @@ > + # csh sets HOST, bash sets HOSTNAME > + : ${HOST:=3D$HOSTNAME} > +=20 > +-lockDir=3D$HOME/.$WM_PROJECT/.wmake > ++lockDir=3D$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P)/.$WM_PROJECT/.w= make > +=20 > + # Fallback - 1 core on current host > + : ${WM_HOSTS:=3D$HOST:1} > +diff -ur OpenFOAM-4.x-version-4.1.org/wmake/wmakeSchedulerUptime OpenFOA= M-4.x-version-4.1/wmake/wmakeSchedulerUptime > +--- OpenFOAM-4.x-version-4.1.org/wmake/wmakeSchedulerUptime > ++++ OpenFOAM-4.x-version-4.1/wmake/wmakeSchedulerUptime > +@@ -53,7 +53,7 @@ > + # csh sets HOST, bash sets HOSTNAME > + : ${HOST:=3D$HOSTNAME} > +=20 > +-lockDir=3D$HOME/.$WM_PROJECT/.wmake > ++lockDir=3D$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P)/.$WM_PROJECT/.w= make > + # Fallback - 1 core on current host > + : ${WM_HOSTS:=3D$HOST:1} > +=20 > +diff -ur OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/metisDecomp= /metisDecomp.C OpenFOAM-4.x-version-4.1/src/parallel/decompose/metisDecomp/= metisDecomp.C > +--- OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/metisDecomp/meti= sDecomp.C > ++++ OpenFOAM-4.x-version-4.1/src/parallel/decompose/metisDecomp/metisDec= omp.C > +@@ -67,7 +67,7 @@ > +=20 > + // Processor weights initialised with no size, only used if specifi= ed in > + // a file > +- Field processorWeights; > ++ Field processorWeights; > +=20 > + // Cell weights (so on the vertices of the dual) > + List