Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenFOAM with extranal cgal, metis, and paraview, with deps using intel2... #1166

Closed
wants to merge 13 commits into from
32 changes: 32 additions & 0 deletions easybuild/easyconfigs/c/CGAL/CGAL-4.5-intel-2014b-Python-2.7.8.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name = 'CGAL'
version = '4.5'

homepage = 'http://www.cgal.org/'
description = """The goal of the CGAL Open Source Project is to provide easy access to efficient
and reliable geometric algorithms in the form of a C++ library."""


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove double newline

toolchain = {'name': 'intel', 'version': '2014b'}
toolchainopts = {'strict': True}

sources = [SOURCE_TAR_BZ2]
source_urls = ['https://gforge.inria.fr/frs/download.php/file/34150/']
# The directory changes with the version (and maybe in time) ---^
# Have to accept license agreement
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop comments?

download still works, no query to accept license agreement?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is a reminder if version changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, if the version is bumped, the dowload will fails during testing, so I don't think it has a lot of value?

If you insist on including it, put it right above source_urls


pythonversion = '2.7.8'
versionsuffix = "-Python-%s" % pythonversion

dependencies = [
('GMP', '5.1.3'),
('Boost', '1.55.0', versionsuffix),
('MPFR', '3.1.2'),
('Qt', '4.8.6'),
]

builddeps = [
('CMake', '3.0.0'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upgrade to 3.1.0

]

moduleclass = 'numlib'

25 changes: 25 additions & 0 deletions easybuild/easyconfigs/g/GMP/GMP-5.1.3-intel-2014b.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
easyblock = 'ConfigureMake'

name = 'GMP'
version = '5.1.3'

homepage = 'http://gmplib.org/'
description = """GMP is a free library for arbitrary precision arithmetic,
operating on signed integers, rational numbers, and floating point numbers. """

toolchain = {'name': 'intel', 'version': '2014b'}

sources = [SOURCELOWER_TAR_BZ2]
source_urls = ['http://ftp.gnu.org/gnu/gmp']

# enable C++ interface
configopts = '--enable-cxx'

runtest = 'check'

sanity_check_paths = {
'files': ['lib/libgmp.%s' % SHLIB_EXT, 'include/gmp.h'],
'dirs': [],
}

moduleclass = 'math'
23 changes: 23 additions & 0 deletions easybuild/easyconfigs/m/METIS/METIS-5.1.0-intel-2014b-32bitIDX.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name = 'METIS'
version = '5.1.0'
versionsuffix = '-32bitIDX'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you clarify this versionsuffix?

The only 'special' thing I see in here is that the METIS shared libs get built?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boegel: Well, the other special thing is the absence of the METIS_IDXTYPEWIDTH.patch
For some reason OpenFOAM 2.3.0 needs 32 bit index, probably beacuse it uses fortran code. Instead of patching OpenFOAM, I made the 32bit index version of METIS.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that explains it.

Maybe add a comment right above the versionsuffix to clarify that? Something like "default 32-bit IDTYPEWIDTH, no patch used" ?


homepage = 'http://glaros.dtc.umn.edu/gkhome/metis/metis/overview'
description = """METIS is a set of serial programs for partitioning graphs, partitioning finite element meshes,
and producing fill reducing orderings for sparse matrices. The algorithms implemented in METIS are based on the
multilevel recursive-bisection, multilevel k-way, and multi-constraint partitioning schemes."""

toolchain = {'name': 'intel', 'version': '2014b'}
toolchainopts = {'optarch': True, 'pic': True}

sources = [SOURCELOWER_TAR_GZ]
source_urls = [
'http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis',
'http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/OLD',
]

builddependencies = [('CMake', '3.0.0')]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.1.0


configopts = [' ', 'shared=1 ']

moduleclass = 'math'
26 changes: 26 additions & 0 deletions easybuild/easyconfigs/m/MPFR/MPFR-3.1.2-intel-2014b.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
easyblock = 'ConfigureMake'

name = 'MPFR'
version = '3.1.2'

homepage = 'http://www.mpfr.org'
description = """The MPFR library is a C library for multiple-precision
floating-point computations with correct rounding."""

toolchain = {'name': 'intel', 'version': '2014b'}

source_urls = ['http://www.mpfr.org/mpfr-%s/' % version]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use %(version)s

sources = [SOURCELOWER_TAR_BZ2]

patches = ['MPFR_ictce_remove-deprecated-mp.patch']

dependencies = [('GMP', '5.1.3')]

runtest = 'check'

sanity_check_paths = {
'files': ['lib/libmpfr.%s' % SHLIB_EXT, 'include/mpfr.h'],
'dirs': []
}

moduleclass = 'math'
46 changes: 46 additions & 0 deletions easybuild/easyconfigs/o/OpenFOAM/OpenFOAM-2.3.0-intel-2014b.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name = 'OpenFOAM'
version = '2.3.0'

homepage = 'http://www.openfoam.com/'
description = """OpenFOAM is a free, open source CFD software package.
OpenFOAM has an extensive range of features to solve anything from complex fluid flows
involving chemical reactions, turbulence and heat transfer,
to solid dynamics and electromagnetics."""

toolchain = {'name': 'intel', 'version': '2014b'}

source_urls = ['http://downloads.sourceforge.net/foam/%(version)s']
sources = [
SOURCE_TGZ,
'ThirdParty-%(version)s.tgz',
]

paraversion = '4.2.0'

patches = [
'OpenFOAM-%(version)s_bugfix1.patch',
'cleanup-OpenFOAM-%(version)s.patch',
'OpenFOAM-%(version)s_libreadline.patch',
('cleanup-ThirdParty-%(version)s.patch', ".."), # patch should not be applied in OpenFOAM subdir
'external-3rd-OpenFOAM-%(version)s.patch',
('external-3rd-ThirdParty-%(version)s.patch', ".."),
'external_paraview_%s.patch' % paraversion,
]

dependencies = [
('CGAL', '4.5', '-Python-2.7.8'),
('libreadline', '6.3'),
('METIS', '5.1.0', '-32bitIDX'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

versionsuffix?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand this comment. Sould I use a versionsuffix for OpenFOAM? The default index for METIS is 32 bit (as it compiles in the version included in OpenFOAM), but all our versions use a patch to make the index 64 bit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, leave it, you explained the versionsuffix for METIS, so it's fine as is.

('ncurses', '5.9'),
('Paraview', paraversion),
('SCOTCH', '6.0.0_esmumps'),
]

builddependencies = [
('Bison', '3.0.2'),
('CMake', '3.0.0'),
('flex', '2.5.39'),
]

moduleclass = 'cae'

144 changes: 144 additions & 0 deletions easybuild/easyconfigs/o/OpenFOAM/external-3rd-OpenFOAM-2.3.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
#Use external CGAL and METIS (via CGAL_ROOT, BOOST_ROOT and METIS_ROOT in easyconfig)
#B. Hajgato OCT 23,2014
--- OpenFOAM-2.3.0.ORIG/etc/config/CGAL.csh 2014-02-11 12:59:42.000000000 +0100
+++ OpenFOAM-2.3.0/etc/config/CGAL.csh 2014-10-23 07:33:17.186624521 +0200
@@ -29,26 +29,36 @@
# Sourced from OpenFOAM-<VERSION>/etc/cshrc
##------------------------------------------------------------------------------

-set boost_version=boost-system
-set cgal_version=CGAL-4.3
+if ( ${?EBROOTCGAL} != 0 ) then
+ setenv BOOST_ARCH_PATH $EBROOTBOOST
+ setenv CGAL_ARCH_PATH $EBROOTCGAL
+
+elif ( ${?CGAL_ROOT} != 0 ) then
+ setenv BOOST_ARCH_PATH $CGAL_ROOT
+ setenv CGAL_ARCH_PATH $CGAL_ROOT
+
+else
+ set boost_version=boost-system
+ set cgal_version=CGAL-4.3
+
+ setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
+ setenv CGAL_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version
+
+ if ($?FOAM_VERBOSE && $?prompt) then
+ echo "Using CGAL and boost"
+ echo " $cgal_version at $CGAL_ARCH_PATH"
+ echo " $boost_version at $BOOST_ARCH_PATH"
+ endif
+
+ if ( -d "$CGAL_ARCH_PATH" ) then
+ _foamAddLib $CGAL_ARCH_PATH/lib
+ endif
+
+ if ( -d "$BOOST_ARCH_PATH" ) then
+ _foamAddLib $BOOST_ARCH_PATH/lib
+ endif

-setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
-setenv CGAL_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version
-
-if ($?FOAM_VERBOSE && $?prompt) then
- echo "Using CGAL and boost"
- echo " $cgal_version at $CGAL_ARCH_PATH"
- echo " $boost_version at $BOOST_ARCH_PATH"
-endif
-
-if ( -d "$CGAL_ARCH_PATH" ) then
- _foamAddLib $CGAL_ARCH_PATH/lib
+ unset boost_version cgal_version
endif

-if ( -d "$BOOST_ARCH_PATH" ) then
- _foamAddLib $BOOST_ARCH_PATH/lib
-endif
-
-unset boost_version cgal_version
-
# -----------------------------------------------------------------------------
--- OpenFOAM-2.3.0.ORIG/etc/config/CGAL.sh 2014-02-11 12:59:42.000000000 +0100
+++ OpenFOAM-2.3.0/etc/config/CGAL.sh 2014-10-23 07:33:00.706674383 +0200
@@ -29,29 +29,39 @@
# Sourced from OpenFOAM-<VERSION>/etc/bashrc
#------------------------------------------------------------------------------

-boost_version=boost-system
-cgal_version=CGAL-4.3
+if [ -n "${EBROOTCGAL}" ]; then
+ export CGAL_ARCH_PATH="${EBROOTCGAL}"
+ export BOOST_ARCH_PATH="${EBROOTBOOST}"
+
+elif [ -n "${CGAL_ROOT}" ]; then
+ export CGAL_ARCH_PATH="${CGAL_ROOT}"
+ export BOOST_ARCH_PATH="${CGAL_ROOT}"
+
+else
+ boost_version=boost-system
+ cgal_version=CGAL-4.3
+
+ export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
+ export CGAL_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version
+
+ if [ "$FOAM_VERBOSE" -a "$PS1" ]
+ then
+ echo "Using CGAL and boost"
+ echo " $cgal_version at $CGAL_ARCH_PATH"
+ echo " $boost_version at $BOOST_ARCH_PATH"
+ fi
+
+ if [ -d "$CGAL_ARCH_PATH" ]
+ then
+ _foamAddLib $CGAL_ARCH_PATH/lib
+ fi
+
+ if [ -d "$BOOST_ARCH_PATH" ]
+ then
+ _foamAddLib $BOOST_ARCH_PATH/lib
+ fi

-export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
-export CGAL_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version
-
-if [ "$FOAM_VERBOSE" -a "$PS1" ]
-then
- echo "Using CGAL and boost"
- echo " $cgal_version at $CGAL_ARCH_PATH"
- echo " $boost_version at $BOOST_ARCH_PATH"
-fi
-
-if [ -d "$CGAL_ARCH_PATH" ]
-then
- _foamAddLib $CGAL_ARCH_PATH/lib
+ unset boost_version cgal_version
fi

-if [ -d "$BOOST_ARCH_PATH" ]
-then
- _foamAddLib $BOOST_ARCH_PATH/lib
-fi
-
-unset boost_version cgal_version
-
# -----------------------------------------------------------------------------
--- OpenFOAM-2.3.0.ORIG/etc/config/metis.sh 2014-02-11 12:59:42.000000000 +0100
+++ OpenFOAM-2.3.0/etc/config/metis.sh 2014-10-23 07:55:07.920637398 +0200
@@ -33,7 +33,15 @@
# during the wmake process
#------------------------------------------------------------------------------

-export METIS_VERSION=metis-5.1.0
-export METIS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$METIS_VERSION
+if [ -n "${EBROOTMETIS}" ] ; then
+ export METIS_ARCH_PATH=$EBROOTMETIS
+
+elif [ -n "${METIS_ROOT}" ] ; then
+ export METIS_ARCH_PATH=$METIS_ROOT
+
+else
+ export METIS_VERSION=metis-5.1.0
+ export METIS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$METIS_VERSION
+fi

# -----------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#Use external CGAL and METIS (via CGAL_ROOT, and METIS_ROOT in easyconfig)
#B. Hajgato OCT 23,2014
--- ThirdParty-2.3.0.ORIG/Allwmake 2014-10-22 16:52:34.833435329 +0200
+++ ThirdParty-2.3.0/Allwmake 2014-10-23 08:12:41.745387953 +0200
@@ -324,32 +324,44 @@
echo ========================================
echo Build Metis decomposition

-# get METIS_VERSION, METIS_ARCH_PATH
-if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config/metis.sh`
+if [ -n "$METIS_ROOT" ]
then
- . $settings
+ METIS_ARCH_PATH=$METIS_ROOT
fi
-if [ -d "$METIS_VERSION" ]
-then

- if [ -f $METIS_ARCH_PATH/include/metis.h \
- -a -r $FOAM_EXT_LIBBIN/libmetis.so ]
- then
+if [ -f $METIS_ARCH_PATH/include/metis.h \
+ -a -r $METIS_ARCH_PATH/lib/libmetis.so ]
+then
echo " metis header in $METIS_ARCH_PATH/include"
- echo " metis libs in $FOAM_EXT_LIBBIN"
+ echo " metis libs in $METIS_ARCH_PATH/lib"
echo
+else
+ # get METIS_VERSION, METIS_ARCH_PATH
+ if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config/metis.sh`
+ then
+ . $settings
+ fi
+ if [ -d "$METIS_VERSION" ]
+ then
+
+ if [ -f $METIS_ARCH_PATH/include/metis.h \
+ -a -r $FOAM_EXT_LIBBIN/libmetis.so ]
+ then
+ echo " metis header in $METIS_ARCH_PATH/include"
+ echo " metis libs in $FOAM_EXT_LIBBIN"
+ echo
+ else
+ set -x
+ cd $METIS_VERSION || exit 1
+ make config shared=1 prefix=$METIS_ARCH_PATH
+ make -j $WM_NCOMPPROCS install
+ cp $METIS_ARCH_PATH/lib/libmetis.so $FOAM_EXT_LIBBIN
+ fi
else
- set -x
- cd $METIS_VERSION || exit 1
- make config shared=1 prefix=$METIS_ARCH_PATH
- make -j $WM_NCOMPPROCS install
- cp $METIS_ARCH_PATH/lib/libmetis.so $FOAM_EXT_LIBBIN
+ echo " optional component Metis was not found"
fi
-else
- echo " optional component Metis was not found"
fi

-
# CGAL is optional
echo ========================================
echo Build CGAL