[petsc-dev] problem building on Mira

Barry Smith bsmith at mcs.anl.gov
Sat Jun 28 12:35:38 CDT 2014


   Jed and Matt, stop bickering and actual look through the configure.log to determine how this is happening and how to fix it.

The first time _GNU_SOURCE is used in 
TEST configureFeatureTestMacros from PETSc.utilities.featureTestMacros

Executing: mpixlc_r -c -o /tmp/petsc-ByVZS6/PETSc.utilities.featureTestMacros/conftest.o -I/tmp/petsc-ByVZS6/config.libraries -I/tmp/petsc-ByVZS6/config.compilers -I/tmp/petsc-ByVZS6/config.setCompilers -I/tmp/petsc-ByVZS6/config.headers -I/tmp/petsc-ByVZS6/PETSc.utilities.cacheDetails -I/tmp/petsc-ByVZS6/config.functions -I/tmp/petsc-ByVZS6/PETSc.utilities.featureTestMacros  -O5 -qhot=level=0 -qsimd=auto -qmaxmem=-1 -qstrict -qstrict_induction  /tmp/petsc-ByVZS6/PETSc.utilities.featureTestMacros/conftest.c 
Successful compile:
Source:
#include "confdefs.h"
#include "conffix.h"
#define _GNU_SOURCE
#include <sched.h>

int main() {
cpu_set_t mset;
CPU_ZERO(&mset);;
  return 0;
}
        Defined "_GNU_SOURCE" to “1"

it does not complain about _GNU_SOURCE already being defined.

but the next time

TEST configureMissingGetdomainnamePrototype from PETSc.utilities.missing(/gpfs/mira-home/adams/petsc_public/config/PETSc/utilities/missing.py:92)
TESTING: configureMissingGetdomainnamePrototype from PETSc.utilities.missing(config/PETSc/utilities/missing.py:92)
Executing: mpixlc_r -c -o /tmp/petsc-ByVZS6/PETSc.utilities.missing/conftest.o -I/tmp/petsc-ByVZS6/config.compilers -I/tmp/petsc-ByVZS6/config.setCompilers -I/tmp/petsc-ByVZS6/config.headers -I/tmp/petsc-ByVZS6/PETSc.utilities.cacheDetails -I/tmp/petsc-ByVZS6/config.functions -I/tmp/petsc-ByVZS6/PETSc.utilities.featureTestMacros -I/tmp/petsc-ByVZS6/config.libraries -I/tmp/petsc-ByVZS6/config.types -I/tmp/petsc-ByVZS6/PETSc.utilities.missing  -O5 -qhot=level=0 -qsimd=auto -qmaxmem=-1 -qstrict -qstrict_induction  /tmp/petsc-ByVZS6/PETSc.utilities.missing/conftest.c 
Successful compile:
Source:
#include "confdefs.h"
#include "conffix.h"
#define _BSD_SOURCE
#define _GNU_SOURCE

it does complain

"/tmp/petsc-ByVZS6/PETSc.utilities.missing/conftest.cc", line 4.9: 1540-0848 (S) The macro name "_GNU_SOURCE" is already defined with a different definition.

So either _GNU_SOURCE is now being defined in “confdefs.h” or  “conffix.h” which it should not be or something is different about this compile to get it to be defined.

What is different about this compile? Well the #define _BSD_SOURCE
Could they be doing something so perverse as automatically setting _GNU_SOURCE if _BSD_SOURCE is being defined?

Someone with an account on that machine needs to log in and try to manually reproduce the problem.

  Barry




On Jun 28, 2014, at 10:55 AM, Jed Brown <jed at jedbrown.org> wrote:

> Matthew Knepley <knepley at gmail.com> writes:
> 
>> On Sat, Jun 28, 2014 at 8:00 AM, Mark Adams <mfadams at lbl.gov> wrote:
>> 
>>> And this is the configure log.
>>> 
>> 
>> Here is the problem:
>> 
>> Executing: mpixlcxx_r -c -o
>> /tmp/petsc-ByVZS6/PETSc.utilities.missing/conftest.o
>> -I/tmp/petsc-ByVZS6/config.compilers
>> -I/tmp/petsc-ByVZS6/config.setCompilers
>> -I/tmp/petsc-ByVZS6/config.functions -I/tmp/petsc-ByVZS6/config.types
>> -I/tmp/petsc-ByVZS6/PETSc.utilities.missing  -O5 -qhot=level=0 -qsimd=auto
>> -qmaxmem=-1 -qstrict -qstrict_induction -+
>> /tmp/petsc-ByVZS6/PETSc.utilities.missing/conftest.cc
>> Possible ERROR while running compiler: exit code 256
>> stderr:
>> "/tmp/petsc-ByVZS6/PETSc.utilities.missing/conftest.cc", line 4.9:
>> 1540-0848 (S) The macro name "_GNU_SOURCE" is already defined with a
>> different definition.
>> Source:
>> #include "confdefs.h"
>> #include "conffix.h"
>> #define _BSD_SOURCE
>> #define _GNU_SOURCE
>> 
>> #ifdef PETSC_HAVE_UNISTD_H
>> #include <unistd.h>
>> #endif
>> #ifdef PETSC_HAVE_NETDB_H
>> #include <netdb.h>
>> #endif
>> 
>> int main() {
>> 
>> int (*getdomainname_ptr)(char*,size_t) = getdomainname;
>> char test[10];
>> if (getdomainname_ptr(test,10)) return 1;
>> ;
>>  return 0;
>> }
>>          Compile failed inside link
>> 
>> Jed, what is going on with the _GNU_SOURCE crap?
> 
> Who defined it before us?  The man page for getdomainname says that
> _BSD_SOURCE must be defined.  Some other functions we look for require
> _GNU_SOURCE.
> 
> The problem with skipping the feature test macros is that we fail to
> detect something that actually exists, and may cause problems later.
> This is especially annoying when we test for a function using the
> linker, then fail to find it in the header because it is only defined
> when suitable feature test macros are defined.




More information about the petsc-dev mailing list