[mvapich-discuss] How do I build -O0?

Pavan Balaji balaji at mcs.anl.gov
Tue Dec 1 19:23:12 EST 2009


Hmm.. This seems to work with the MPICH2 trunk. We did fix some
configure issues in the 1.1 series of MPICH2. I know that MVAPICH2 is
being upgraded to the MPICH2-1.2 series; so I think it should work
correctly in the next release.

 -- Pavan

On 12/01/2009 06:07 PM, Adam Moody wrote:
> Hi Pavan and Johnathan,
> Thanks for the quick replies.  I've tried each of your suggestions, but
> I still ended up with the -g -O2 working its way into the build.  One
> method that does seem to work is to set CFLAGS="" and then set
> MPICH2LIB_CFLAGS and company to "-g -O0", but this feels clumbsy.  After
> a number of tries, I still couldn't get the documented method of setting
> --diable-fast or --enable-fast=O0 to work.
> -Adam
> 
> The following to do the trick, but it feels sort of like a hack given
> there is a documented way to do it:
> 
> #!/bin/bash
> 
> export PREFIX=`pwd`
> export CC=gcc
> export CXX=g++
> export F77=gfortran
> export F90=gfortran
> export MPICH2LIB_CFLAGS="-g -O0"
> export MPICH2LIB_CXXFLAGS="-g -O0"
> export MPICH2LIB_FFLAGS="-g -O0"
> export MPICH2LIB_F90FLAGS="-g -O0"
> export CFLAGS=""
> 
>           ./configure \
>             --prefix=$PREFIX \
>             --enable-sharedlibs=gcc \
>             --enable-f77 --enable-f90 --enable-cxx \
>             --enable-error-checking=runtime --enable-error-messages=all
> --enable-nmpi-as-mpi \
>             --enable-debuginfo \
>             --disable-fast --enable-g=dbg \
>             --with-pmi=slurm --with-pm=no \
>             --with-rdma=gen2 --with-ib-include=/usr/include
> --with-ib-lib=/usr/lib64 \
>             --enable-registration-cache --enable-limic2 \
>             --enable-romio --with-file-system=lustre+nfs+ufs \
>             --disable-mpe --without-mpe
> 
> 
> Pavan Balaji wrote:
> 
>> Use the --disable-fast configure option or --enable-fast=O0.
>>
>> -- Pavan
>>
>> On 12/01/2009 01:42 PM, Adam Moody wrote:
>>  
>>
>>> Hello MVAPICH team,
>>> I'm trying to get a "-g -O0" build of MVAPICH2-1.4 so that I see correct
>>> line numbers in the MPI source under a debugger like TotalView.  I'm
>>> using the following settings, which I think should work based on the
>>> help info in the configure command:
>>>   #!/bin/bash
>>>   export PREFIX=`pwd`
>>>   export CC=gcc
>>>   export CXX=g++
>>>   export F77=gfortran
>>>   export F90=gfortran
>>>   export MPICH2LIB_CFLAGS="-g -O0"
>>>   export MPICH2LIB_CXXFLAGS="-g -O0"
>>>   export MPICH2LIB_FFLAGS="-g -O0"
>>>   export MPICH2LIB_F90FLAGS="-g -O0"
>>>   export CONFIG_FLAGS="--disable-fast --enable-g=dbg
>>> --enable-error-checking=runtime --enable-error-messages=all
>>> --enable-nmpi-as-mpi"
>>>   ./configure \
>>>       --prefix=$PREFIX \
>>>       --enable-sharedlibs=gcc \
>>>       --enable-f77 --enable-f90 --enable-cxx \
>>>       $CONFIG_FLAGS \
>>>       --enable-debuginfo \
>>>       --with-pmi=slurm --with-pm=no \
>>>       --with-rdma=gen2 --with-ib-include=/usr/include
>>> --with-ib-lib=/usr/lib64 \
>>>       --enable-registration-cache --enable-limic2 \
>>>       --enable-romio --with-file-system=lustre+nfs+ufs \
>>>       --disable-mpe --without-mpe
>>>
>>> I'm building the MVAPICH2-1.4 tarball from:
>>>   http://*mvapich.cse.ohio-state.edu/download/mvapich2/mvapich2-1.4.tgz
>>>
>>> It seems to do the correct thing with --enable-g=dbg and
>>> MPICH2LIB_CFLAGS as an extra "-g -g -O0" gets appended to the CFLAGS,
>>> but there is this leading "-g -O2" that I can't get rid of (see below):
>>>
>>> === configuring in channels/mrail
>>> (/usr/global/tools/mpi/checkouts/llnl/mvapich2-1.4-r3536/mvapich2-1.4/src/mpid/ch3/channels/mrail)^M
>>>
>>>
>>> configure: running /bin/sh ./configure --disable-option-checking
>>> '--prefix=/usr/global/tools/mpi/checkouts/llnl/mvapich2-1.4-r3536/mvapich2-1.4'
>>> '--enable-sharedlibs=gcc' '--enable-f77' '--enable-f90' '--enable-cxx'
>>> '--disable-fast' '--enable-g=dbg' '--enable-error-checking=runtime'
>>> '--enable-error-messages=all' '--enable-nmpi-as-mpi'
>>> '--enable-debuginfo' '--with-pmi=slurm' '--with-pm=no'
>>> '--with-rdma=gen2' '--with-ib-include=/usr/include'
>>> '--with-ib-lib=/usr/lib64' '--enable-registration-cache'
>>> '--enable-limic2' '--enable-romio' '--with-file-system=lustre+nfs+ufs'
>>> '--disable-mpe' '--without-mpe' 'CC=gcc' 'F77=gfortran' 'F90=gfortran'
>>> 'CXX=g++' 'MPICH2LIB_CFLAGS=-g -O0' 'MPICH2LIB_CXXFLAGS=-g -O0'
>>> 'MPICH2LIB_FFLAGS=-g -O0' 'MPICH2LIB_F90FLAGS=-g -O0'
>>> '--enable-header-caching' 'CFLAGS=-g -O2 -g -g -O0' 'LIBS=-lpthread '
>>> 'CPPFLAGS=-I/usr/include ' --cache-file=/dev/null --srcdir=.
>>>
>>> I think I could perhaps set CFLAGS explicitly to "-g -O0", but this then
>>> forces "-g -O0" into the MPI wrapper scripts like mpicc, which I don't
>>> want.  I'd just like the MPI library itself to build with -O0, not the
>>> application code.  Is there a way to do this?  I can't seem to find the
>>> right flag or environment variable.
>>> Thanks,
>>> -Adam
>>> _______________________________________________
>>> mvapich-discuss mailing list
>>> mvapich-discuss at cse.ohio-state.edu
>>> http://*mail.cse.ohio-state.edu/mailman/listinfo/mvapich-discuss
>>>   
>>
>>  
>>

-- 
Pavan Balaji
http://www.mcs.anl.gov/~balaji


More information about the mvapich-discuss mailing list