FWIW, setting CFLAGS (or whatever other env variables you want) on the 
configure command line has the secondary benefit of recording that info in the 
first few lines of config.log.  I.e., "head config.log" will show you the exact 
command line you used to configure Open MPI, including any relevant environment 
variables:

----
$ head config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by Open MPI configure gitclone, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure CFLAGS=-DADAM_IS_GREAT=1 --prefix=/tmp
-----


> On May 4, 2018, at 4:49 PM, Moody, Adam T. <mood...@llnl.gov> wrote:
> 
> Ah, yes.  That worked.  Thanks, Howard.
> -Adam
>  
> From: users <users-boun...@lists.open-mpi.org> on behalf of Howard Pritchard 
> <hpprit...@gmail.com>
> Reply-To: Open MPI Users <users@lists.open-mpi.org>
> Date: Friday, May 4, 2018 at 1:13 PM
> To: Open MPI Users <users@lists.open-mpi.org>
> Subject: Re: [OMPI users] Debug build of v3.0.1 tarball
>  
> HI Adam, 
>  
> I think you'll have better luck setting the CFLAGS on the configure line.
>  
> try
>  
> ./configure CFLAGS="-g -O0" your other configury options.
>  
> Howard
>  
>  
> 2018-05-04 12:09 GMT-06:00 Moody, Adam T. <mood...@llnl.gov>:
>> Hi Howard,
>> I do have a make clean after the configure.  To be extra safe, I’m now also 
>> deleting the source directory and untarring for each build to make sure I 
>> have a clean starting point.
>>  
>> I do get a successful build if I add --enable-debug to configure and then do 
>> a simple make that has no CFLAGS or LDFLAGS:
>>  
>> make -j VERBOSE=1
>>  
>> So that’s good.  However, looking at the compile lines that were used, I see 
>> a -g but no -O0.  I’m trying to force the -g -O0, because our debuggers show 
>> the best info at that optimization level.
>>  
>> If I then also add a CFLAGS=”-g -O0” to my make command, I see the “-g -O0” 
>> in the compile lines, but then the pthread link error shows up:
>>  
>> make -j CFLAGS=”-g -O0” VERBOSE=1
>>  
>>   CC       opal_wrapper.o
>>   GENERATE opal_wrapper.1
>>   CCLD     opal_wrapper
>> ../../../opal/.libs/libopen-pal.so: undefined reference to `pthread_atfork'
>> collect2: error: ld returned 1 exit status
>> make[2]: *** [opal_wrapper] Error 1
>>  
>> Also setting LDFLAGS fixes that up.  Just wondering whether I’m going about 
>> it the right way in trying to get -g -O0 in the build.
>>  
>> Thanks for your help,
>> -Adam
>>  
>> From: users <users-boun...@lists.open-mpi.org> on behalf of Howard Pritchard 
>> <hpprit...@gmail.com>
>> Reply-To: Open MPI Users <users@lists.open-mpi.org>
>> Date: Friday, May 4, 2018 at 7:46 AM
>> To: Open MPI Users <users@lists.open-mpi.org>
>> Subject: Re: [OMPI users] Debug build of v3.0.1 tarball
>>  
>> HI Adam,
>>  
>> Sorry didn't notice you did try the --enable-debug flag.  That should not 
>> have
>> led to the link error building the opal dso.  Did you do a make clean after
>> rerunning configure?  
>>  
>> Howard
>>  
>>  
>> 2018-05-04 8:22 GMT-06:00 Howard Pritchard <hpprit...@gmail.com>:
>>> Hi Adam,
>>>  
>>> Did you try using the --enable-debug configure option along with your 
>>> CFLAGS options?
>>> You may want to see if that simplifies your build.
>>>  
>>> In any case, we'll fix the problems you found.
>>>  
>>> Howard
>>>  
>>>  
>>> 2018-05-03 15:00 GMT-06:00 Moody, Adam T. <mood...@llnl.gov>:
>>>> Hello Open MPI team,
>>>> I'm looking for the recommended way to produce a debug build of Open MPI 
>>>> v3.0.1 that compiles with “-g -O0” so that I get accurate debug info under 
>>>> a debugger.
>>>> So far, I've gone through the following sequence.  I started with 
>>>> CFLAGS="-g -O0" on make:
>>>> shell$ ./configure --prefix=$installdir --disable-silent-rules \
>>>>   --disable-new-dtags --enable-mpi-cxx --enable-cxx-exceptions --with-pmi
>>>> shell$ make -j CFLAGS="-g -O0" VERBOSE=1
>>>> That led to the following error:
>>>> In file included from ../../../../opal/util/arch.h:26:0,
>>>>                  from btl_openib.h:43,
>>>>                  from btl_openib_component.c:79:
>>>> btl_openib_component.c: In function 'progress_pending_frags_wqe':
>>>> btl_openib_component.c:3351:29: error: 'opal_list_item_t' has no member 
>>>> named 'opal_list_item_refcount'
>>>>              assert(0 == frag->opal_list_item_refcount);
>>>>                              ^
>>>> make[2]: *** [btl_openib_component.lo] Error 1
>>>> make[2]: *** Waiting for unfinished jobs....
>>>> make[2]: Leaving directory `.../openmpi-3.0.1/opal/mca/btl/openib'
>>>> So it seems the assert is referring to a field structure that is protected 
>>>> by a debug flag.  I then added --enable-debug to configure, which led to:
>>>> make[2]: Entering directory `.../openmpi-3.0.1/opal/tools/wrappers'
>>>>   CC       opal_wrapper.o
>>>>   GENERATE opal_wrapper.1
>>>>   CCLD     opal_wrapper
>>>> ../../../opal/.libs/libopen-pal.so: undefined reference to `pthread_atfork'
>>>> collect2: error: ld returned 1 exit status
>>>> make[2]: *** [opal_wrapper] Error 1
>>>> make[2]: Leaving directory `.../openmpi-3.0.1/opal/tools/wrappers'
>>>> Finally, if I also add LDFLAGS="-lpthread" to make, I get a build:
>>>> shell$ ./configure --prefix=$installdir --enable-debug 
>>>> --disable-silent-rules \
>>>>   --disable-new-dtags --enable-mpi-cxx --enable-cxx-exceptions --with-pmi
>>>> shell$ make -j CFLAGS="-g -O0" LDFLAGS="-lpthread" VERBOSE=1
>>>> Am I doing this correctly?
>>>> Is there a pointer to the configure/make flags for this?
>>>> I did find this page that describes the developer build from a git clone, 
>>>> but that seemed a bit overkill since I am looking for a debug build from 
>>>> the distribution tarball instead of the git clone (avoid the autotools 
>>>> nightmare):
>>>> https://www.open-mpi.org/source/building.php
>>>> Thanks.
>>>> -Adam
>>>>  
>>>> _______________________________________________
>>>> users mailing list
>>>> users@lists.open-mpi.org
>>>> https://lists.open-mpi.org/mailman/listinfo/users
>>>  
>>  
>> 
>> _______________________________________________
>> users mailing list
>> users@lists.open-mpi.org
>> https://lists.open-mpi.org/mailman/listinfo/users
>  
> _______________________________________________
> users mailing list
> users@lists.open-mpi.org
> https://lists.open-mpi.org/mailman/listinfo/users


-- 
Jeff Squyres
jsquy...@cisco.com

_______________________________________________
users mailing list
users@lists.open-mpi.org
https://lists.open-mpi.org/mailman/listinfo/users

Reply via email to