[petsc-dev] [petsc-maint #71297] Problem installing PETSc

Jed Brown jed at 59A2.org
Sat Apr 23 21:28:32 CDT 2011


On Sun, Apr 24, 2011 at 03:46, Barry Smith <bsmith at mcs.anl.gov> wrote:

> Looks like we need a patch to deal with the "illegal" placement of
> XOPEN_SOURCE and BSD_SOURCE in the source code so this issue doesn't keep
> coming up.


What exactly is the error? Note that we already changed _XOPEN_SOURCE to
_POSIX_C_SOURCE (in dev) because Open Solaris did not like the former. One
possible fix could be the ugly

#ifndef _BSD_SOURCE
#  define _BSD_SOURCE
#endif


I really do not want to put feature test macros in public headers (our usual
model with finding which header declares certain functions) because they
change which symbols are available in headers and introduce order
dependence. That is, a user writing

#include <stdlib.h>
#include <petsc.h>

would not bring in atoll(), but including petsc.h first would have it (and
lots of other symbols). I don't think a library should ever change the
language "dialect" that a user writes their code in.


I don't really understand why Solaris is having a problem with our defining
feature test macros. As far as I know, we are using them as recommended.
Searching for solaris feature test macros brings up results like the
following man page that explains how to set them.

http://www.cims.nyu.edu/cgi-systems/man.cgi?section=5&topic=standards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110424/a7010b9e/attachment.html>


More information about the petsc-dev mailing list