Open MPI logo

Open MPI User's Mailing List Archives

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

From: Marcin Dulak (Marcin_Dulak_at_[hidden])
Date: 2007-04-03 08:42:30


Hi,

I found that the /etc/profile.d/openmpi-1.2.sh and
/etc/profile.d/openmpi-1.2.csh generated using openmpi.spec are incorrect.
The contents of the generated (see the details of the generation process
at the very end of my email) scripts is the following:
-------------------------------------------------------------------------------------------
/etc/profile.d/openmpi-1.2.sh
-------------------------------------------------------------------------------------------
# NOTE: This is an automatically-generated file! (generated by the
# Open MPI RPM). Any changes made here will be lost a) if the RPM is
# uninstalled, or b) if the RPM is upgraded or uninstalled.

CHANGED=0
if test -z ""; then
    PATH=${PATH}:/opt/openmpi/1.2/bin/
    CHANGED=1
fi
if test -z ""; then
    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/openmpi/1.2/lib
    CHANGED=1
fi
if test -z ""; then
    MANPATH=${MANPATH}:/opt/openmpi/1.2/man
    CHANGED=1
fi
if test "" = "1"; then
    export PATH LD_LIBRARY_PATH MANPATH
fi
-------------------------------------------------------------------------------------------
/etc/profile.d/openmpi-1.2.csh
-------------------------------------------------------------------------------------------
# NOTE: This is an automatically-generated file! (generated by the
# Open MPI RPM). Any changes made here will be lost a) if the RPM is
# uninstalled, or b) if the RPM is upgraded or uninstalled.

if ("") then
    setenv PATH ${PATH}:/opt/openmpi/1.2/bin/
endif
if ("1LD_LIBRARY_PATH") then
    if ("") then
        setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/opt/openmpi/1.2/lib
    endif
endif
if ("1MANPATH") then
    if ("") then
        setenv MANPATH ${MANPATH}:/opt/openmpi/1.2/man
    endif
endif
-------------------------------------------------------------------------------------------
The sh one is incorrect in the line
if test "" = "1"; then
which should be
if test "$CHANGED" = "1"; then

The csh one is incorrect in several places,
like 1LD_LIBRARY_PATH (comming from the missing backslash in openmpi.spec),
and the whole logic of csh seems to be incorrect as well (e.g. nothing
happens if LD_LIBRARY_PATH
is not set in the shell running the rpmbuild process!).
By the way, the dependence of the openmpi.spec file of the current
contents of the PATH etc. variables
is risky (when compiling, installing and uninstalling openmpi rpm
several times)
and I think that the user should be warned in some way by the script to
remove traces
of openmpi related variables from the shell running rpmbuild.

I attach a patch to the original 1.2 openmpi.spec file, which should fix
these problems.
I find the possibility of installation of openmpi to /opt/ very useful
and I hope that my comments help to improve it.

Marcin

Details of the rpm generation process:
I created the rpm of openmpi-1.2 using the provided buildrpm.sh and
openmpi.spec files
(I use:
RPM version 4.3.3,
GNU bash, version 3.00.15(1)-release (i686-redhat-linux-gnu)).
Here are my settings from buildrpm.sh script:

specfile="openmpi.spec"
rpmbuild_options="--define 'mflags -j4'"
configure_options="--with-tm=/usr/local FC=pgf90 F77=pgf90 CC=pgcc
CXX=pgCC CFLAGS=-Msignextend CXXFLAGS=-Msignextend
--with-wrapper-cflags=-Msignextend --with-wrapper-cxxflags=-Msignextend
FFLAGS=-Msignextend FCFLAGS=-Msignextend
--with-wrapper-fflags=-Msignextend --with-wrapper-fcflags=-Msignextend"
rpmbuild_options=${rpmbuild_options}" --define 'install_in_opt 1'
--define 'install_profile_d_scripts 1' --define 'install_modulefile 0'"