Bug #817

GMT-4.5.14 fails to compile on Solaris

Added by Remko about 2 years ago. Updated almost 2 years ago.

Status:ClosedStart date:2015-11-18
Priority:NormalDue date:
Assignee:Remko% Done:

100%

Category:-Estimated time:1.00 hour
Target version:Candidate for next bugfix release
Affected version:4.5.x Platform:other

Description

Related to forum message GMT-4.5.14 Compiler or options invalid by Wolfgang

System = SunOS
Release = 5.10
KernelID = Generic_150401-29
Machine = i86pc

gcc -O2 -Wall -m64 -fPIC -fno-strict-aliasing -std=c99 -I/opt/csw/include -I/opt/csw/include -DGMT_SHARE_PATH=\"/opt/GMT-4.5.14/share\" -DGMT_GSHHG_PATH=\"/opt/GMT-4.5.14/src/gshhg-gmt-2.3.4\" -DTRIANGLE_D -DUSE_GDAL -c gmt_io.c
In file included from /usr/include/iso/ctype_iso.h:30:0,
from /usr/include/ctype.h:18,
from gmt.h:63,
from gmt_io.c:84:
/opt/csw/lib/gcc/i386-pc-solaris2.10/4.9.2/include-fixed/sys/feature_tests.h:346:2: Fehler: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications"
#error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
^
Error code 1
make: Fatal error: Command failed for target `gmt_io.o'
Current working directory /opt/GMT-4.5.14/src/gmt-4.5.14/src
Error code 1
make: Fatal error: Command failed for target `gmt'

History

#2 Updated by Remko about 2 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
  • Estimated time set to 1.00
  • Platform set to other
This affected only GMT4. No declarations of _POSIX_SOURCE or _XOPEN_SOURCE were used in GMT5.
This appears a known problem with Solaris.
The solution was
  1. Replace
    #define _XOPEN_SOURCE
    by
    #ifdef __FreeBSD__
    #define _XOPEN_SOURCE
    #else
    #define _XOPEN_SOURCE 600
    #endif
  2. Remove
    #define _POSIX_SOURCE 1

#3 Updated by Paul almost 2 years ago

  • Status changed from Resolved to Closed

Closing this issue.

Also available in: Atom PDF