[petsc-dev] problem building on Mira
Jed Brown
jed at jedbrown.org
Sat Jun 28 10:55:08 CDT 2014
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20140628/bcaa9f2a/attachment.sig>
More information about the petsc-dev
mailing list