Building OpenMPI 1.3 for OpenSolaris
OpenMPI is part of ClusterTools 8 for Solaris, there is also an open source version which can be downloaded, I utilized MPI in a variety of projects. Here are my notes for building and running with the library for OpenSolaris using Sun Studio 12 for compilation.
Getting started
-
OpenSolaris 2008.11
-
OpenMPI 1.3
-
Studio 12 compilers
-
GNU utilities
OpenMPI 1.3 can be obtained at: http://openmpi.org/
For OpenSolaris, use the package manager and the opensolaris.org repository to download the Studio 12 compilers for C/C++ and GNU utilities, the repository is great and as a developer on OpenSolaris, you should get use to this tool to manage your environment, it is a fantastic addition, I use it heavily.
Building OpenMPI 1.3
# gzip -d openmpi-1.3.tar.gz
# tar xvf openmpi-1.3.tar
This is a basic delivery of source, it utilizes configure for the environment build. Configure will pick up the Studio compilers by setting the enviroment variables: CC, CFLAGS, CXX, CXXFLAGS, F77, FFLAGS
# export CC=/export/home/langston/COMPILER/SUNWspro/bin/cc
# export CXX=/export/home/langston/COMPILER/SUNWspro/bin/CC
# export F77=/export/home/langston/COMPILER/SUNWspro/bin/f77
With /export/home/langston/COMPILER/SUNWspro where I have Sun Studio 12 installed.
# configure
# gmake
Installing OpenMPI and running an example
# gmake install
With configure, you can set up to install openmpi in any directory, by default, it goes to /usr/local, with /usr/local, you will need root access to write to the directory.
Make sure you have that path in your PATH, in my case, /usr/local/bin , this will find things such as mpicc
Make sure you have LD_LIBRARY_PATH set with /usr/local/lib include
# export PATH=$PATH:/usr/local/bin
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
# cd examples
langston@alpha:~/OPENMPI/openmpi-1.3/examples$ gmake hello_c
mpicc -g hello_c.c -o hello_c
langston@alpha:~/OPENMPI/openmpi-1.3/examples$ ldd hello_c
libmpi.so.0 => /usr/local/lib/libmpi.so.0
libopen-rte.so.0 => /usr/local/lib/libopen-rte.so.0
libopen-pal.so.0 => /usr/local/lib/libopen-pal.so.0
libsocket.so.1 => /lib/libsocket.so.1
libnsl.so.1 => /lib/libnsl.so.1
libm.so.2 => /lib/libm.so.2
libthread.so.1 => /lib/libthread.so.1
libc.so.1 => /lib/libc.so.1
libmp.so.2 => /lib/libmp.so.2
libmd.so.1 => /lib/libmd.so.1
libscf.so.1 => /lib/libscf.so.1
libuutil.so.1 => /lib/libuutil.so.1
libgen.so.1 => /lib/libgen.so.1
langston@alpha:~/OPENMPI/openmpi-1.3/examples$ which orterun
/usr/local/bin/orterun
langston@alpha:~/OPENMPI/openmpi-1.3/examples$ orterun -np 4 hello_c
[alpha:10443] mca: base: component_find: unable to open /usr/local/lib/openmpi/mca_ras_dash_host: file not found (ignored)
[alpha:10443] mca: base: component_find: unable to open /usr/local/lib/openmpi/mca_ras_gridengine: file not found (ignored)
[alpha:10443] mca: base: component_find: unable to open /usr/local/lib/openmpi/mca_ras_localhost: file not found (ignored)
[alpha:10443] mca: base: component_find: unable to open /usr/local/lib/openmpi/mca_errmgr_hnp: file not found (ignored)
[alpha:10443] mca: base: component_find: unable to open /usr/local/lib/openmpi/mca_errmgr_orted: file not found (ignored)
[alpha:10443] mca: base: component_find: unable to open /usr/local/lib/openmpi/mca_errmgr_proxy: file not found (ignored)
[alpha:10443] mca: base: component_find: unable to open /usr/local/lib/openmpi/mca_iof_proxy: file not found (ignored)
[alpha:10443] mca: base: component_find: unable to open /usr/local/lib/openmpi/mca_iof_svc: file not found (ignored)
--------------------------------------------------------------------------
[[54489,1],0]: A high-performance Open MPI point-to-point messaging module
was unable to find any relevant network interfaces:
Module: uDAPL
Host: alpha
Another transport will be used instead, although this may result in
lower performance.
--------------------------------------------------------------------------
Hello, world, I am 3 of 4
Hello, world, I am 2 of 4
Hello, world, I am 1 of 4
Hello, world, I am 0 of 4
[alpha:10443] 3 more processes have sent help message help-mpi-btl-base.txt / btl:no-nics
[alpha:10443] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages
langston@alpha:~/OPENMPI/openmpi-1.3/examples$
Caveats
-
For Sun, a great alternative is to use ClusterTools 8, it is based on OpenMPI 1.3
