Skip to content

Commit

Permalink
added OpenMPI support for sherpa
Browse files Browse the repository at this point in the history
  • Loading branch information
pmillet committed Jul 18, 2017
1 parent 7ba6fcf commit f296865
Show file tree
Hide file tree
Showing 7 changed files with 148 additions and 44 deletions.
61 changes: 49 additions & 12 deletions autotools.spec
@@ -1,25 +1,44 @@
### RPM external autotools 1.1
### RPM external autotools 1.2
## INITENV SET M4 %{i}/bin/m4
# We keep all of them together to simplify the "requires" statements.
%define autoconf_version 2.68
%define automake_version 1.11.4
%define autoconf_version 2.69
%define automake_version 1.14.1
%define automake_maj %(echo %{automake_version} | cut -f1,2 -d.)
%define libtool_version 2.4.2
%define m4_version 1.4.17
%define gettext_version 0.19.2
%define gettext_version 0.19.4
%define pkgconfig_version 0.28
Source0: http://ftpmirror.gnu.org/autoconf/autoconf-%{autoconf_version}.tar.gz
Source1: http://ftpmirror.gnu.org/automake/automake-%{automake_version}.tar.gz
Source2: http://ftpmirror.gnu.org/libtool/libtool-%{libtool_version}.tar.gz
Source3: http://ftp.gnu.org/gnu/m4/m4-%{m4_version}.tar.bz2
Source4: http://ftp.gnu.org/pub/gnu/gettext/gettext-%{gettext_version}.tar.gz

Patch0: gettext-0.19.2-fix-darwin
Source5: http://pkgconfig.freedesktop.org/releases/pkg-config-%{pkgconfig_version}.tar.gz

%prep
%setup -D -T -b 0 -n autoconf-%{autoconf_version}
%setup -D -T -b 1 -n automake-%{automake_version}
%setup -D -T -b 2 -n libtool-%{libtool_version}
%setup -D -T -b 3 -n m4-%{m4_version}
%setup -D -T -b 4 -n gettext-%{gettext_version}
%patch0 -p1
%setup -D -T -b 5 -n pkg-config-%{pkgconfig_version}

# Update config.{guess,sub} scripts
rm -f %{_tmppath}/config.{sub,guess}
curl -L -k -s -o %{_tmppath}/config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
curl -L -k -s -o %{_tmppath}/config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
for CONFIG_GUESS_FILE in $(find $RPM_BUILD_DIR -name 'config.guess')
do
rm -f $CONFIG_GUESS_FILE
cp %{_tmppath}/config.guess $CONFIG_GUESS_FILE
chmod +x $CONFIG_GUESS_FILE
done
for CONFIG_SUB_FILE in $(find $RPM_BUILD_DIR -name 'config.sub')
do
rm -f $CONFIG_SUB_FILE
cp %{_tmppath}/config.sub $CONFIG_SUB_FILE
chmod +x $CONFIG_SUB_FILE
done

%build
export PATH=%i/bin:$PATH
Expand Down Expand Up @@ -57,7 +76,19 @@ pushd %_builddir/gettext-%{gettext_version}
--disable-acl \
--disable-java \
--disable-dependency-tracking \
--disable-silent-rules
--disable-silent-rules \
--with-included-glib \
--with-included-libunistring \
--with-included-libcroco
make %makeprocesses && make install
popd
pushd %_builddir/pkg-config-%{pkgconfig_version}
./configure --prefix %i \
--disable-silent-rules \
--disable-dependency-tracking \
--disable-host-tool \
--with-internal-glib \
--disable-shared
make %makeprocesses && make install
popd

Expand All @@ -74,19 +105,25 @@ grep -l -R '/bin/perl' %{i} | xargs -n1 sed -ideleteme -e 's;exec [^ ]*/perl;exe
find %{i} -name '*deleteme' -delete

%install
echo "Foo"
# NOP

%define drop_files %{i}/share/{man,doc,info}

%post
%{relocateConfig}bin/aclocal
%{relocateConfig}bin/aclocal-1.11
%{relocateConfig}bin/aclocal-%{automake_maj}
%{relocateConfig}bin/autoconf
%{relocateConfig}bin/autoheader
%{relocateConfig}bin/autom4te
%{relocateConfig}bin/automake
%{relocateConfig}bin/automake-1.11
%{relocateConfig}bin/automake-%{automake_maj}
%{relocateConfig}bin/autoreconf
%{relocateConfig}bin/autoscan
%{relocateConfig}bin/autoupdate
%{relocateConfig}bin/ifnames
%{relocateConfig}bin/libtoolize
%{relocateConfig}share/autoconf/autom4te.cfg
%{relocateConfig}share/automake-1.11/Automake/Config.pm
%{relocateConfig}share/automake-%{automake_maj}/Automake/Config.pm
%{relocateConfig}bin/gettextize
%{relocateConfig}lib/gettext/user-email
%{relocateConfig}bin/autopoint
1 change: 1 addition & 0 deletions cmssw-tool-conf.spec
Expand Up @@ -148,6 +148,7 @@ Requires: freetype-toolfile

# Only for INTEL/AMD platforms.
%if %isamd64
Requires: openmpi-toolfile
Requires: tkonlinesw-toolfile
Requires: py2-cx-oracle-toolfile
Requires: oracle-toolfile
Expand Down
29 changes: 29 additions & 0 deletions openmpi-2.1.1-disable-lsf-support.patch
@@ -0,0 +1,29 @@
--- a/config/orte_check_lsf.m4 2017-05-10 17:40:48.000000000 +0200
+++ b/config/orte_check_lsf.m4 2017-05-22 11:00:48.652372379 +0200
@@ -26,7 +26,7 @@
# ORTE_CHECK_LSF(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([ORTE_CHECK_LSF],[
- if test -z "$orte_check_lsf_happy" ; then
+ AS_IF([test -z "$orte_check_lsf_happy"],[
AC_ARG_WITH([lsf],
[AC_HELP_STRING([--with-lsf(=DIR)],
[Build LSF support])])
@@ -34,6 +34,7 @@
AC_ARG_WITH([lsf-libdir],
[AC_HELP_STRING([--with-lsf-libdir=DIR],
[Search for LSF libraries in DIR])])
+ AS_IF([test "$with_lsf" != "no"],[
OPAL_CHECK_WITHDIR([lsf-libdir], [$with_lsf_libdir], [libbat.*])

# Defaults
@@ -123,7 +124,8 @@
LIBS="$orte_check_lsf_$1_save_LIBS"

OPAL_SUMMARY_ADD([[Resource Managers]],[[LSF]],[$1],[$orte_check_lsf_happy])
- fi
+ ],[orte_check_lsf_happy=no])
+ ])

AS_IF([test "$orte_check_lsf_happy" = "yes"],
[$1_LIBS="[$]$1_LIBS $orte_check_lsf_LIBS"
23 changes: 23 additions & 0 deletions openmpi-toolfile.spec
@@ -0,0 +1,23 @@
### RPM external openmpi-toolfile 1.0
Requires: openmpi

%prep

%build

%install
mkdir -p %i/etc/scram.d
cat << \EOF_TOOLFILE >%i/etc/scram.d/openmpi.xml
<tool name="openmpi" version="@TOOL_VERSION@">
<lib name="mpi"/>
<client>
<environment name="OPENMPI_BASE" default="@TOOL_ROOT@"/>
<environment name="LIBDIR" default="$OPENMPI_BASE/lib"/>
<environment name="INCLUDE" default="$OPENMPI_BASE/include"/>
</client>
<runtime name="PATH" value="$OPENMPI_BASE/bin" type="path"/>
<runtime name="OPAL_PREFIX" value="$OPENMPI_BASE"/>
</tool>
EOF_TOOLFILE

## IMPORT scram-tools-post
19 changes: 19 additions & 0 deletions openmpi.spec
@@ -0,0 +1,19 @@
### RPM external openmpi 2.1.1
Source: http://www.open-mpi.org/software/ompi/v2.1/downloads/%{n}-%{realversion}.tar.gz
Patch1: openmpi-2.1.1-disable-lsf-support
BuildRequires: autotools
%prep
%setup -q -n %{n}-%{realversion}
%patch1 -p1
sed -i -e 's|#!/usr/bin/perl|#!/usr/bin/env perl|' ./opal/asm/generate-asm.pl
sed -i -e 's|#!/usr/bin/perl|#!/usr/bin/env perl|' opal/asm/generate-all-asm.pl
sed -i -e 's|/usr/bin/perl|/usr/bin/env perl|' ./Doxyfile
sed -i -e 's|/usr/bin/perl|/usr/bin/env perl|' ./orte/Doxyfile
./autogen.pl --force
./configure --prefix=%i --without-lsf --disable-libnuma

%build
make %{makeprocesses}

%install
make install
41 changes: 21 additions & 20 deletions sherpa-toolfile.spec
Expand Up @@ -9,26 +9,27 @@ Requires: sherpa
mkdir -p %i/etc/scram.d
cat << \EOF_TOOLFILE >%i/etc/scram.d/sherpa.xml
<tool name="sherpa" version="@TOOL_VERSION@">
<lib name="SherpaMain"/>
<lib name="ToolsMath"/>
<lib name="ToolsOrg"/>
<client>
<environment name="SHERPA_BASE" default="@TOOL_ROOT@"/>
<environment name="BINDIR" default="$SHERPA_BASE/bin"/>
<environment name="LIBDIR" default="$SHERPA_BASE/lib/SHERPA-MC"/>
<environment name="INCLUDE" default="$SHERPA_BASE/include/SHERPA-MC"/>
</client>
<runtime name="CMSSW_FWLITE_INCLUDE_PATH" value="$SHERPA_BASE/include" type="path"/>
<runtime name="SHERPA_SHARE_PATH" value="$SHERPA_BASE/share/SHERPA-MC" type="path"/>
<runtime name="SHERPA_INCLUDE_PATH" value="$SHERPA_BASE/include/SHERPA-MC" type="path"/>
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path"/>
<use name="HepMC"/>
<use name="lhapdf"/>
<use name="qd"/>
<use name="blackhat"/>
<use name="fastjet"/>
<use name="sqlite"/>
<use name="openloops"/>
<lib name="SherpaMain"/>
<lib name="ToolsMath"/>
<lib name="ToolsOrg"/>
<client>
<environment name="SHERPA_BASE" default="@TOOL_ROOT@"/>
<environment name="BINDIR" default="$SHERPA_BASE/bin"/>
<environment name="LIBDIR" default="$SHERPA_BASE/lib/SHERPA-MC"/>
<environment name="INCLUDE" default="$SHERPA_BASE/include/SHERPA-MC"/>
</client>
<runtime name="CMSSW_FWLITE_INCLUDE_PATH" value="$SHERPA_BASE/include" type="path"/>
<runtime name="SHERPA_SHARE_PATH" value="$SHERPA_BASE/share/SHERPA-MC" type="path"/>
<runtime name="SHERPA_INCLUDE_PATH" value="$SHERPA_BASE/include/SHERPA-MC" type="path"/>
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path"/>
<use name="HepMC"/>
<use name="lhapdf"/>
<use name="qd"/>
<use name="blackhat"/>
<use name="fastjet"/>
<use name="sqlite"/>
<use name="openmpi"/>
<use name="openloops"/>
</tool>
EOF_TOOLFILE

Expand Down
18 changes: 6 additions & 12 deletions sherpa.spec
Expand Up @@ -3,21 +3,13 @@
%define branch cms/v%realversion
%define github_user cms-externals
Source: git+https://github.com/%github_user/%{n}.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}-%{tag}.tgz
Requires: hepmc lhapdf blackhat sqlite fastjet openssl
Requires: hepmc lhapdf blackhat sqlite fastjet openssl openmpi
BuildRequires: mcfm

%if "%(case %cmsplatf in (slc*) echo true ;; (*) echo false ;; esac)" == "true"
Requires: openloops
%endif

%if "%{?cms_cxx:set}" != "set"
%define cms_cxx g++
%endif

%if "%{?cms_cxxflags:set}" != "set"
%define cms_cxxflags -O2 -std=c++0x
%endif

%prep
%setup -q -n %{n}-%{realversion}

Expand All @@ -44,10 +36,12 @@ esac
--enable-lhapdf=$LHAPDF_ROOT \
--enable-blackhat=$BLACKHAT_ROOT \
${OPENLOOPS_ROOT+--enable-openloops=$OPENLOOPS_ROOT}\
--enable-mpi=$OPENMPI_ROOT \
--with-sqlite3=$SQLITE_ROOT \
CXX="%cms_cxx" \
CXXFLAGS="-fuse-cxa-atexit $ARCH_CMSPLATF %cms_cxxflags -I$LHAPDF_ROOT/include -I$BLACKHAT_ROOT/include -I$OPENSSL_ROOT/include" \
LDFLAGS="-ldl -L$BLACKHAT_ROOT/lib/blackhat -L$QD_ROOT/lib -L$OPENSSL_ROOT/lib"
CXX="g++" \
MPICXX="${OPENMPI_ROOT}/bin/mpic++" \
CXXFLAGS="-fuse-cxa-atexit $ARCH_CMSPLATF -O2 -std=c++0x -I$LHAPDF_ROOT/include -I$BLACKHAT_ROOT/include -I$OPENSSL_ROOT/include -I$OPENMPI_ROOT/include/" \
LDFLAGS="-ldl -L$BLACKHAT_ROOT/lib/blackhat -L$QD_ROOT/lib -L$OPENSSL_ROOT/lib -L$OPENMPI_ROOT/lib/"

make %{makeprocesses}

Expand Down

0 comments on commit f296865

Please sign in to comment.