Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: [OMPI devel] 1.5rc5: VT integration "issue" on Solaris/SPARC
From: Paul H. Hargrove (PHHargrove_at_[hidden])
Date: 2010-08-26 00:13:31


I've encountered an interesting situation on Solaris/SPARC where Open
MPI defaults to CC=gcc but the contrib'ed VampirTrace is defaulting to
CC=cc. Additionally, Open MPI on SPARC requires CFLAGS be set to get a
non-default ABI from the compiler. This leads to two different failure
modes for me...

Platform:

$ uname -a; echo; cc -V; echo; gcc --version
SunOS lem.lbl.gov 5.10 s10_69 sun4u sparc SUNW,Ultra-5_10

cc: Sun C 5.10 SunOS_sparc 2009/06/03
usage: cc [ options] files. Use 'cc -flags' for details

gcc (GCC) 3.3.2
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

As detailed elsewhere
(http://www.open-mpi.org/community/lists/devel/2010/08/8365.php) my
gcc-3.3.2 will work with either of the following:
    CFLAGS="-mv8plus -Wa,-xarch=v8plus"
or
    CFLAGS=-mcpu=v9
Where and CXXFLAGS, FFLAGS and FCFLAGS are set to match.

Starting with the first option...

$ [path_to]/openmpi-1.5rc5/configure --disable-mpi-f90 CFLAGS='-mv8plus
-Wa,-xarch=v8plus' CXXFLAGS='-mv8plus -Wa,-xarch=v8plus'
FFLAGS='-mv8plus -Wa,-xarch=v8plus'
[...]
--- vt (m4 configuration macro)
configure: OMPI configuring in ompi/contrib/vt/vt
configure: running /bin/bash
'../../../../../ompi/contrib/vt/vt/configure' --disable-option-checking
--with-openmpi-inside '--disable-mpi-f90' 'CFLAGS=-mv8plus
-Wa,-xarch=v8plus' 'CXXFLAGS=-mv8plus -Wa,-xarch=v8plus'
'FFLAGS=-mv8plus -Wa,-xarch=v8plus' --cache-file=/dev/null
--srcdir=../../../../../ompi/contrib/vt/vt --disable-option-checking
checking for a BSD-compatible install...
../../../../../ompi/contrib/vt/vt/config/install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p...
../../../../../ompi/contrib/vt/vt/config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
checking for platform... sun
checking for options file...
../../../../../ompi/contrib/vt/vt/config/defaults/sun
configure: loading options from
'../../../../../ompi/contrib/vt/vt/config/defaults/sun'
CC="cc"
CXX="CC"
F77="f77"
FC="f95"
CFLAGS="-xO3"
CXXFLAGS="-xO3"
FFLAGS="-xO3"
FCFLAGS="-xO3"
OPENMP_CFLAGS="-xopenmp -xO3 -D_REENTRANT"
PTHREAD_CFLAGS="-D_REENTRANT"
PTHREAD_LIBS="-lpthread"
enable_memtrace="no"
enable_cpuidtrace="no"
configure: builddir:
/export/home/phargrov/openmpi-1.5rc5/BLD-gcc-vt2/ompi/contrib/vt/vt
configure: srcdir: /export/home/phargrov/openmpi-1.5rc5/ompi/contrib/vt/vt
configure: detected VPATH build
checking if build filesystem is case sensitive... yes
checking for gcc... cc
checking whether the C compiler works... no
configure: error: in
`/export/home/phargrov/openmpi-1.5rc5/BLD-gcc-vt2/ompi/contrib/vt/vt':
configure: error: C compiler cannot create executables
See `config.log' for more details.
configure: /bin/bash '../../../../../ompi/contrib/vt/vt/configure'
*failed* for ompi/contrib/vt/vt
checking if contributed component vt can compile... no
[...]

The VT configure script has tried to us CC=cc and CFLAGS='-mv8plus
-Wa,-xarch=v8plus', with the unsurprising result:
  checking whether the C compiler works... no
So, VT has been disabled.

Now the second CFLAGS option and corresponding failure mode:

$ [path_to]/openmpi-1.5rc5/configure --disable-mpi-f90 CFLAGS=-mcpu=v9
CXXFLAGS=-mcpu=v9 FFLAGS=-mcpu=v9
[...]
--- vt (m4 configuration macro)
configure: OMPI configuring in ompi/contrib/vt/vt
configure: running /bin/bash
'../../../../../ompi/contrib/vt/vt/configure' --disable-option-checking
--with-openmpi-inside '--disable-mpi-f90' 'CFLAGS=-mcpu=v9'
'CXXFLAGS=-mcpu=v9' 'FFLAGS=-mcpu=v9' --cache-file=/dev/null
--srcdir=../../../../../ompi/contrib/vt/vt --disable-option-checking
checking for a BSD-compatible install...
../../../../../ompi/contrib/vt/vt/config/install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p...
../../../../../ompi/contrib/vt/vt/config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
checking for platform... sun
checking for options file...
../../../../../ompi/contrib/vt/vt/config/defaults/sun
configure: loading options from
'../../../../../ompi/contrib/vt/vt/config/defaults/sun'
CC="cc"
CXX="CC"
F77="f77"
FC="f95"
CFLAGS="-xO3"
CXXFLAGS="-xO3"
FFLAGS="-xO3"
FCFLAGS="-xO3"
OPENMP_CFLAGS="-xopenmp -xO3 -D_REENTRANT"
PTHREAD_CFLAGS="-D_REENTRANT"
PTHREAD_LIBS="-lpthread"
enable_memtrace="no"
enable_cpuidtrace="no"
configure: builddir:
/export/home/phargrov/openmpi-1.5rc5/BLD-gcc-vt/ompi/contrib/vt/vt
configure: srcdir: /export/home/phargrov/openmpi-1.5rc5/ompi/contrib/vt/vt
configure: detected VPATH build
checking if build filesystem is case sensitive... yes
checking for gcc... cc
checking whether the C compiler works... yes
[...]

What is not obvious from the output above is that VT has selected
   CC=cc
   CFLAGS=-mcpu=v9
where CC came from the file ompi/contrib/vt/vt/config/defaults/sun,
while CFLAGS came from the configure command line. Here, now, is the
part that surprised me...

$ ggrep -A67 'checking whether the C compiler works'
ompi/contrib/vt/vt/config.log
configure:4841: checking whether the C compiler works
configure:4863: cc -mcpu=v9 -I$(top_srcdir) -DINSIDE_OPENMPI
conftest.c -lsocket -lnsl -lrt -lm -lthread >&5
cc: Warning: Option -mcpu=v9 passed to ld, if ld is invoked, ignored
otherwise
                LINK EDITOR MEMORY MAP
[...link map removed...]
configure:4867: $? = 0
configure:4916: result: yes

So, the gcc "-mcpu=v9" in CFLAGS just happened, by luck, to NOT break
the "C compiler works" test and this time VT is ENabled.

$ make
[...
 Even though build completed w/o error, every object compiled under
ompi/contrib/vt generates
  cc: Warning: Option -mcpu=v9 passed to ld, if ld is invoked, ignored
otherwise
 and any link steps print a Link Map as well.
...]

$ make check
[... also OKAY...]

$ make install
[... OK except the issue reported in
http://www.open-mpi.org/community/lists/devel/2010/08/8370.php ...]

But one gets the MPI and VT wrappers using different compilers:

$ /usr/local/pkg/ompi-1.5rc5/bin/vtcc -V
cc: Sun C 5.10 SunOS_sparc 2009/06/03
usage: cc [ options] files. Use 'cc -flags' for details

$ /usr/local/pkg/ompi-1.5rc5/bin/mpicc --version
gcc (GCC) 3.3.2
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

And thus mpicc and mpicc-vt accept different options:

$ mpicc -save-temps mpi_hello.c

$ mpicc-vt -save-temps mpi_hello.c
ld: fatal: option -dy and -a are incompatible
ld: fatal: Flags processing errors

I've not tried, but I am assuming one can probably resolve these
problems by explicitly setting the compilers by adding the following to
configure: CC=gcc CXX=g++ F77=g77

So, while the situation is not impossible, it is highly inconvenient and
probably not obvious to may users.

Note that this does NOT occur with 1.4.3rc1 because the are no VT
"defaults" files loaded, and VT thus uses the same CC=gcc, etc. as Open
MPI does.

-Paul
  

-- 
Paul H. Hargrove                          PHHargrove_at_[hidden]
Future Technologies Group
HPC Research Department                   Tel: +1-510-495-2352
Lawrence Berkeley National Laboratory     Fax: +1-510-486-6900