Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] multi-compiler builds of OpenMPI (RPM)
From: pat.o'bryant_at_[hidden]
Date: 2007-12-31 09:35:40


Jim,
    I would start with this site "http://www.rpm.org/max-rpm/". This site
gives a really good explanation of building packages using rpm. I built my
own spec file which gave me a better understanding of how RPMs work.

    What I did with my installation was to set up an rpm that built
packages for both GNU and Intel compilers. Chapter 18 at the "max-rpm" site
explains how to do this. So here is the general layout of my spec file for
OpenMPI and two compilers. Note that the end result is one high level
directory with two subdirectories, each one for a different compiler. The
only down side to this process is that "LD_LIBRARY_PATH" must be used for
both building and running OpenMPI jobs.

Hope this helps,
Pat

%package intel
Summary: OpenMPI, Intel
Group: MPI software
# Disable check for dependencies
AutoReqProv: no <== without this option, an "rpm -i .."
leads to lots of unsatisfied "requires.."
.....

%package gnu
Summary: OpenMPI, GNU
Group: MPI software
# Disable check for dependencies
AutoReqProv: no
.....

# Note only 1 prep section allowed
%prep
rm -rf $RPM_BUILD_DIR/openmpi-1.2.4_intel
rm -rf $RPM_BUILD_DIR/openmpi-1.2.4_gnu
cd $RPM_BUILD_DIR

# create directory for intel build
tar zxvf $RPM_SOURCE_DIR/openmpi-1.2.4.tar.gz
mv openmpi-1.2.4 openmpi-1.2.4_intel <== this allows
multiple extractions of gz file within source directory

# create directory for gnu build
tar zxvf $RPM_SOURCE_DIR/openmpi-1.2.4.tar.gz
mv openmpi-1.2.4 openmpi-1.2.4_gnu <== this allows
multiple extractions of gz file within source directory
.....
# Build Intel
cd $RPM_BUILD_DIR/openmpi-1.2.4_intel
./configure --prefix /usr/local/openmpi-1.2.4/intel
--with-openib=/usr/local/ofed \ <== upper level directory is
"/usr/local/openmpi-1.2.4"
--with-tm=/usr/local/pbs CC=icc CXX=icpc F77=ifort FC=ifort \
--with-threads=posix --enable-mpi-threads

# Build GNU
cd $RPM_BUILD_DIR/openmpi-1.2.4_gnu
./configure --prefix /usr/local/openmpi-1.2.4/gnu
--with-openib=/usr/local/ofed \
--with-tm=/usr/local/pbs \
--with-threads=posix --enable-mpi-threads

# Note only 1 install section allowed
%install
# Install Intel
rm -rf /usr/local/openmpi-1.2.4/intel
mkdir -p /usr/local/openmpi-1.2.4/intel
cd $RPM_BUILD_DIR/openmpi-1.2.4_intel <== unique
subdirectories from tar extract step above
make all install

# Install GNU
rm -rf /usr/local/openmpi-1.2.4/gnu
mkdir -p /usr/local/openmpi-1.2.4/gnu
cd $RPM_BUILD_DIR/openmpi-1.2.4_gnu <== unique subdirectories
from tar extract step above
make all install

%files intel <== I decided to go
with the "kitchen sink", i.e., everything, so every directory is listed.
%doc $RPM_BUILD_DIR/openmpi-1.2.4_intel/README
/usr/local/openmpi-1.2.4/intel/bin
/usr/local/openmpi-1.2.4/intel/etc
/usr/local/openmpi-1.2.4/intel/include
/usr/local/openmpi-1.2.4/intel/lib
/usr/local/openmpi-1.2.4/intel/share

%files gnu
%doc $RPM_BUILD_DIR/openmpi-1.2.4_gnu/README
/usr/local/openmpi-1.2.4/gnu/bin
/usr/local/openmpi-1.2.4/gnu/etc
/usr/local/openmpi-1.2.4/gnu/include
/usr/local/openmpi-1.2.4/gnu/lib
/usr/local/openmpi-1.2.4/gnu/share

J.W. (Pat) O'Bryant,Jr.
Business Line Infrastructure
Technical Systems, HPC
Office: 713-431-7022

                                                                           
             "Jim Kusznir"
             <jkusznir_at_gmai
             l.com> To
             Sent by: "Open MPI Users"
             users-bounces@ <users_at_[hidden]>
             open-mpi.org cc
                                                                           
                                                                   Subject
             12/30/07 11:50 [OMPI users] multi-compiler builds
             PM of OpenMPI (RPM)
                                                                           
                                                                           
             Please respond
                   to
             Open MPI Users
             <users_at_open-mp
                 i.org>
                                                                           
                                                                           
                                                                           
                                                                           

Hi all:

I'm trying to set up a ROCKS cluster (CentOS 4.5) with OpenMPI and
GCC, PGI, and Intel compilers. My understanding is that OpenMPI must
be compiled with each compiler. The result (or at least, the runtime
libs) must be in .rpm format, as that is required by ROCKS compute
node deployment system. I am also using environment modules to manage
users' environment and selecting which version of OpenMPI/compiler.

I have some questions, though.
1) am I correct in that OpenMPI needs to be complied with each
compiler that will be used with it?

I am currently trying to make rpms using the included .spec file
(contrib/dist/linux/openmpi.spec, IIRC).
2) How do I use it to build against different compilers and end up
with non-colliding namespaces, etc?
I am currently using the following command line:
rpmbuild -bb --define 'install_in_opt 1' --define 'install_modulefile
1' --define 'build_all_in_one_rpm 0' --define 'configure_options
--with-tm=/opt/torque' openmpi.spec
I am currently concerned with differentiating same version compiled
with different compilers. I origionally changed the name (--define
'_name openmpi-gcc'), but this broke the final phases of rpm building:
 RPM build errors:
    File not found:
/var/tmp/openmpi-gcc-1.2.4-1-root/opt/openmpi-gcc/1.2.4/share/openmpi-gcc
I tried changing the version with "gcc" appended, but that also broke,
and as I thought about it more, I thought that would likely induce
headaches later with rpm only letting one version installed, etc.

3) Will the resulting -runtime .rpms (for the different compiler
versions) coexist peacefully without any special environment munging
on the compute nodes, or do I need modules, etc. on all the compute
nodes as well?

4) I've never really used pgi or intel's compiler. I saw notes in the
rpm about build flag problems and "use your normal optimizations and
flags", etc. As I have no concept of "normal" for these compilers,
are there any guides or examples I should/could use for this?

And of course, I'd be grateful for any hints/tricks/etc that I didn't
ask for, as I probably still don't fully know what I'm getting into
here....there's a lot of firsts here....

Thanks!
--Jim
_______________________________________________
users mailing list
users_at_[hidden]
http://www.open-mpi.org/mailman/listinfo.cgi/users