Opened 10 months ago

Closed 9 months ago

Last modified 8 months ago

#15268 closed defect (fixed)

ncurses fails to build on Solaris/SPARC

Reported by: jpflori Owned by:
Priority: critical Milestone: sage-5.13
Component: packages: standard Keywords: spkg ncurses solaris
Cc: vbraun, jdemeyer Merged in: sage-5.13.beta3
Authors: Jean-Pierre Flori Reviewers: Volker Braun
Report Upstream: Fixed upstream, but not in a stable release. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

I get the following errors on a system Solaris/SPARC (SunOS whocares 5.10 Generic_139555-08 sun4v sparc SUNW,T5140):

gnatmake -P../../../Ada95/src/library.gpr -XBUILD_DIR=`cd ..;pwd` -XSOURCE_DIR=`cd ..;pwd` -XSOURCE_DIR2=`cd ../../../Ada95/src;pwd` -XLIB_NAME=AdaCurses -XSONAME=libAdaCurses.so.1 -XLIB_KIND=static
gcc -c -g -O2 -gnatafno -gnatVa -gnatwa -I- -gnatA /infres/post/flori/sage-5.12+infres1/spkg/build/ncurses-5.9.p1/src/Ada95/src/terminal_interface-curses-aux.adb
terminal_interface-curses.ads:347:41: size for "Character_Attribute_Set" too small, minimum allowed is 32
terminal_interface-curses.ads:367:33: size for "Attr" too small, minimum allowed is 32
terminal_interface-curses.ads:369:38: size for "Attributed_Character" too small, minimum allowed is 64
gnatmake: "/infres/post/flori/sage-5.12+infres1/spkg/build/ncurses-5.9.p1/src/Ada95/src/terminal_interface-curses-aux.adb" compilation error
make[2]: *** [../lib/libAdaCurses.a] Error 4

and

gcc -c -I./ -I../../../Ada95/samples -I../src -I../../../Ada95/samples/../src -gnatpn -O3 -I../../../Ada95/samples -I- /infres/post/flori/sage-5.12+infres1/spkg/build/ncurses-5.9.p1/src/Ada95/samples/tour.adb
gcc -c -gnatpg -I./ -I../../../Ada95/samples -I../src -I../../../Ada95/samples/../src -gnatpn -O3 -I../../../Ada95/samples -I- /local/packages/gnat-pro-6.0.1/lib/gcc/sparc-sun-solaris2.8/4.1.2/adainclude/s-stalib.adb
gcc -c -I./ -I../../../Ada95/samples -I../src -I../../../Ada95/samples/../src -gnatpn -O3 -I../../../Ada95/samples -I- /infres/post/flori/sage-5.12+infres1/spkg/build/ncurses-5.9.p1/src/Ada95/samples/sample.adb
terminal_interface-curses.ads:347:41: size for "Character_Attribute_Set" too small, minimum allowed is 32
terminal_interface-curses.ads:367:33: size for "Attr" too small, minimum allowed is 32
terminal_interface-curses.ads:369:38: size for "Attributed_Character" too small, minimum allowed is 64
gnatmake: "/infres/post/flori/sage-5.12+infres1/spkg/build/ncurses-5.9.p1/src/Ada95/samples/sample.adb" compilation error
make[2]: *** [tour] Error 4
make[2]: Leaving directory `/infres/post/flori/sage-5.12+infres1/spkg/build/ncurses-5.9.p1/src/narrow/Ada95/samples'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/infres/post/flori/sage-5.12+infres1/spkg/build/ncurses-5.9.p1/src/narrow/Ada95'
make: *** [all] Error 2
Error building ncurses (narrow).

(#15080 does not help.)

Use spkg at:

Apply trac_15080.patch to $SAGE_LOCAL/bin.

Attachments (2)

ncurses-5.9.p2.diff (2.6 KB) - added by jpflori 9 months ago.
Spkg diff, for review only.
trac_15080.patch (391 bytes) - added by jdemeyer 9 months ago.

Download all attachments as: .zip

Change History (22)

comment:1 Changed 10 months ago by jpflori

A quick search found http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14997 which looks of interest. I'll try lowering the optimization level.

comment:2 Changed 10 months ago by jdemeyer

Obviously, we need a lot more information in the ticket description, in particular Solaris version, gcc version, full build log of ncurses... because it works on some Solaris/SPARC systems.

Can we simply disable the "Ada" part of ncurses, that is almost certainly not needed.

Last edited 10 months ago by jdemeyer (previous) (diff)

comment:3 Changed 10 months ago by vbraun

Agree, just configure without ada (possibly none of the skynet machines has ada, which is why we haven't noticed before?)

  --without-ada           suppress check for Ada95, don't build demo

comment:4 Changed 10 months ago by jpflori

  • Description modified (diff)

Disabling ada by passing --without-ada solves this, but it fails when building the wide version of ncurses (enabled by #15080):

/infres/post/flori/sage-5.12+infres1/local/bin/g++ -I../c++ -I../include -I../../c++ -DHAVE_CONFIG_H   -D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED -D_FILE_OFFSET_BITS=64  -DNDEBUG -I. -I../include -I../../c++/../include -I/infres/post/flori/sage-5.12+infres1/local/include  -fPIC -c ../../c++/demo.cc -o ../obj_s/demo.o
In file included from /infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/iso/stdlib_iso.h:39:0,
                 from /usr/include/stdlib.h:18,
                 from ../../c++/internal.h:53,
                 from ../../c++/cursesm.cc:34:
/infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications  and pre-2001 POSIX applications"
In file included from /infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/iso/stdlib_iso.h:39:0,
                 from /usr/include/stdlib.h:18,
                 from ../../c++/internal.h:53,
                 from ../../c++/cursesw.cc:42:
/infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications  and pre-2001 POSIX applications"
In file included from /infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/iso/stdlib_iso.h:39:0,
                 from /usr/include/stdlib.h:18,
                 from ../../c++/internal.h:53,
                 from ../../c++/cursesp.cc:34:
/infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications  and pre-2001 POSIX applications"
In file included from /infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/iso/stdlib_iso.h:39:0,
                 from /usr/include/stdlib.h:18,
                 from ../../c++/internal.h:53,
                 from ../../c++/cursespad.cc:34:
/infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications  and pre-2001 POSIX applications"
In file included from /infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/iso/stdlib_iso.h:39:0,
                 from /usr/include/stdlib.h:18,
                 from ../../c++/internal.h:53,
                 from ../../c++/cursesf.cc:34:
/infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications  and pre-2001 POSIX applications"
In file included from /infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/iso/stdlib_iso.h:39:0,
                 from /usr/include/stdlib.h:18,
                 from ../../c++/internal.h:53,
                 from ../../c++/cursesapp.cc:35:
/infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications  and pre-2001 POSIX applications"
In file included from /infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/iso/stdlib_iso.h:39:0,
                 from /usr/include/stdlib.h:18,
                 from ../../c++/internal.h:53,
                 from ../../c++/demo.cc:41:
/infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications  and pre-2001 POSIX applications"
In file included from /infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/iso/stdlib_iso.h:39:0,
                 from /usr/include/stdlib.h:18,
                 from ../../c++/internal.h:53,
                 from ../../c++/cursesmain.cc:34:
/infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications  and pre-2001 POSIX applications"
In file included from /infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/iso/stdlib_iso.h:39:0,
                 from /usr/include/stdlib.h:18,
                 from ../../c++/internal.h:53,
                 from ../../c++/cursslk.cc:34:
/infres/post/flori/sage-5.12+infres1/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications  and pre-2001 POSIX applications"
make[1]: *** [../obj_s/cursesp.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [../obj_s/cursesmain.o] Error 1
make[1]: *** [../obj_s/cursslk.o] Error 1
make: *** [all] Error 2
Error building ncurses (wide).

Maybe this Solaris install is ill configured.

comment:5 Changed 10 months ago by jpflori

I guess the "/usr/include/stdlib.h" might be the problem. I think I already had problems on this machine with Singular including stuff from /usr/include and stumbling upon an old version of GCC which was problematic/incompatible.

comment:7 Changed 10 months ago by jpflori

...which is already done by SPARC_fixes.patch...

comment:8 Changed 10 months ago by jpflori

I see: when the wide version is built, -DXOPEN_SOURCE_EXTENDED is passed again (don't know yet from where though).

So getting a narrow version by disabling ada is easy. Not sure about the wide version yet, nor if that's even possible.

comment:9 Changed 10 months ago by jpflori

The configure output lines

checking if you want wide-character code... yes
checking if we must define _XOPEN_SOURCE_EXTENDED... yes

make it doubtful.

comment:10 Changed 9 months ago by jpflori

Not sure where my post went, but here was the solution I used: in case wide characters have to be used, _XOPEN_SOURCE_EXTENDED should be added to CFLAGS (so that gcc gets it) and not to CPPFLAGS (or g++ will get it). See: https://bitbucket.org/lmnd/lmnd-prefix/src/5901f00d116284a75b9142d13f06ea60df568758/sys-libs/ncurses/ncurses-5.9-r02.1.ebuild?at=lmnd#cl-75

comment:11 Changed 9 months ago by jpflori

I've reported the two problems upstream. Thomas is very reactive and I'm sure it will be fixed in a few days, so we could just package the dev release then (and that would also fix the ncurses issue from #15317).

Still packaging an spkg for testing in between (without the #15317 fix).

Changed 9 months ago by jpflori

Spkg diff, for review only.

comment:12 Changed 9 months ago by jpflori

  • Authors set to Jean-Pierre Flori
  • Description modified (diff)
  • Status changed from new to needs_review

Spkg uploaded at:

Builds ok on x86_64/Ubuntu and sparc/Solaris.

comment:13 Changed 9 months ago by vbraun

  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

lgtm

comment:14 Changed 9 months ago by jdemeyer

  • Dependencies #15080 deleted

comment:15 Changed 9 months ago by jdemeyer

  • Status changed from positive_review to needs_work
  • Work issues set to .hgignore

If you close #15080 as duplicate, you should copy the patch also!

Changed 9 months ago by jdemeyer

comment:16 Changed 9 months ago by jdemeyer

  • Description modified (diff)
  • Status changed from needs_work to positive_review

comment:17 Changed 9 months ago by vbraun

Thanks, forgot!

comment:18 Changed 9 months ago by jdemeyer

  • Work issues .hgignore deleted

comment:19 Changed 9 months ago by jdemeyer

  • Merged in set to sage-5.13.beta3
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:20 Changed 8 months ago by jpflori

  • Report Upstream changed from N/A to Fixed upstream, but not in a stable release.

The remaining XOPEN_SOURCE_EXTENDED problem is fixed upstream:

Note: See TracTickets for help on using tickets.