Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#26735 closed defect (fixed)

gcc fails to build with isl>=0.20

Reported by: Konrad127123 Owned by:
Priority: major Milestone: sage-8.6
Component: packages: standard Keywords: gcc, isl
Cc: Merged in:
Authors: Konrad K. Dabrowski Reviewers: Volker Braun
Report Upstream: Fixed upstream, in a later stable release. Work issues:
Branch: 7f2fa27 (Commits) Commit:
Dependencies: Stopgaps:

Description

gcc fails to compile on systems with isl>=0.20:

g++ -std=gnu++98 -fno-PIE -c   -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../src/gcc -I../../src/gcc/. -I../../src/gcc/../include -I../../src/gcc/../libcpp/include -I/home/sage/sage-8.4/local/include -I/home/sage/sage-8.4/local/include -I/home/sage/sage-8.4/local/include  -I../../src/gcc/../libdecnumber -I../../src/gcc/../libdecnumber/bid -I../libdecnumber -I../../src/gcc/../libbacktrace   -o graphite-isl-ast-to-gimple.o -MT graphite-isl-ast-to-gimple.o -MMD -MP -MF ./.deps/graphite-isl-ast-to-gimple.TPo ../../src/gcc/graphite-isl-ast-to-gimple.c
../../src/gcc/graphite-isl-ast-to-gimple.c: In function 'void ivs_params_clear(ivs_params&)':
../../src/gcc/graphite-isl-ast-to-gimple.c:98:7: error: 'isl_id_free' was not declared in this scope
       isl_id_free (it->first);
       ^~~~~~~~~~~
../../src/gcc/graphite-isl-ast-to-gimple.c:98:7: note: suggested alternative: 'isl_aff_free'
       isl_id_free (it->first);
       ^~~~~~~~~~~
       isl_aff_free
../../src/gcc/graphite-isl-ast-to-gimple.c: In member function 'tree_node* translate_isl_ast_to_gimple::gcc_expression_from_isl_ast_expr_id(tree, isl_ast_expr*, ivs_params&)':
../../src/gcc/graphite-isl-ast-to-gimple.c:293:3: error: 'isl_id_free' was not declared in this scope
   isl_id_free (tmp_isl_id);
   ^~~~~~~~~~~
../../src/gcc/graphite-isl-ast-to-gimple.c:293:3: note: suggested alternative: 'isl_aff_free'
   isl_id_free (tmp_isl_id);
   ^~~~~~~~~~~
   isl_aff_free
../../src/gcc/graphite-isl-ast-to-gimple.c: In member function 'loop* translate_isl_ast_to_gimple::graphite_create_new_loop(edge, isl_ast_node*, loop_p, tree, tree, tree, ivs_params&)':
../../src/gcc/graphite-isl-ast-to-gimple.c:629:5: error: 'isl_id_free' was not declared in this scope
     isl_id_free (res->first);
     ^~~~~~~~~~~
../../src/gcc/graphite-isl-ast-to-gimple.c:629:5: note: suggested alternative: 'isl_aff_free'
     isl_id_free (res->first);
     ^~~~~~~~~~~
     isl_aff_free
../../src/gcc/graphite-isl-ast-to-gimple.c: In member function 'edge_def* translate_isl_ast_to_gimple::translate_isl_ast_for_loop(loop_p, isl_ast_node*, edge, tree, tree, tree, ivs_params&)':
../../src/gcc/graphite-isl-ast-to-gimple.c:669:53: error: 'isl_id_get_user' was not declared in this scope
       ast_build_info *for_info = (ast_build_info *) isl_id_get_user (id);
                                                     ^~~~~~~~~~~~~~~
../../src/gcc/graphite-isl-ast-to-gimple.c:669:53: note: suggested alternative: 'isl_arg_user'
       ast_build_info *for_info = (ast_build_info *) isl_id_get_user (id);
                                                     ^~~~~~~~~~~~~~~
                                                     isl_arg_user
../../src/gcc/graphite-isl-ast-to-gimple.c:672:7: error: 'isl_id_free' was not declared in this scope
       isl_id_free (id);
       ^~~~~~~~~~~
../../src/gcc/graphite-isl-ast-to-gimple.c:672:7: note: suggested alternative: 'isl_aff_free'
       isl_id_free (id);
       ^~~~~~~~~~~
       isl_aff_free
../../src/gcc/graphite-isl-ast-to-gimple.c: In member function 'edge_def* translate_isl_ast_to_gimple::translate_isl_ast_node_user(isl_ast_node*, edge, ivs_params&)':
../../src/gcc/graphite-isl-ast-to-gimple.c:876:31: error: 'isl_id_get_user' was not declared in this scope
   poly_bb_p pbb = (poly_bb_p) isl_id_get_user (name_id);
                               ^~~~~~~~~~~~~~~
../../src/gcc/graphite-isl-ast-to-gimple.c:876:31: note: suggested alternative: 'isl_arg_user'
   poly_bb_p pbb = (poly_bb_p) isl_id_get_user (name_id);
                               ^~~~~~~~~~~~~~~
                               isl_arg_user
../../src/gcc/graphite-isl-ast-to-gimple.c:882:3: error: 'isl_id_free' was not declared in this scope
   isl_id_free (name_id);
   ^~~~~~~~~~~
../../src/gcc/graphite-isl-ast-to-gimple.c:882:3: note: suggested alternative: 'isl_aff_free'
   isl_id_free (name_id);
   ^~~~~~~~~~~
   isl_aff_free
../../src/gcc/graphite-isl-ast-to-gimple.c: In function 'isl_id* ast_build_before_for(isl_ast_build*, void*)':
../../src/gcc/graphite-isl-ast-to-gimple.c:2886:19: error: 'isl_space_dim' was not declared in this scope
   int dimension = isl_space_dim (schedule_space, isl_dim_out);
                   ^~~~~~~~~~~~~
../../src/gcc/graphite-isl-ast-to-gimple.c:2886:19: note: suggested alternative: 'isl_aff_dim'
   int dimension = isl_space_dim (schedule_space, isl_dim_out);
                   ^~~~~~~~~~~~~
                   isl_aff_dim
../../src/gcc/graphite-isl-ast-to-gimple.c:2890:3: error: 'isl_space_free' was not declared in this scope
   isl_space_free (schedule_space);
   ^~~~~~~~~~~~~~
../../src/gcc/graphite-isl-ast-to-gimple.c:2890:3: note: suggested alternative: 'isl_aff_free'
   isl_space_free (schedule_space);
   ^~~~~~~~~~~~~~
   isl_aff_free
../../src/gcc/graphite-isl-ast-to-gimple.c:2891:16: error: 'isl_id_alloc' was not declared in this scope
   isl_id *id = isl_id_alloc (isl_ast_build_get_ctx (build), "", for_info);
                ^~~~~~~~~~~~
../../src/gcc/graphite-isl-ast-to-gimple.c:2891:16: note: suggested alternative: 'isl_mat_alloc'
   isl_id *id = isl_id_alloc (isl_ast_build_get_ctx (build), "", for_info);
                ^~~~~~~~~~~~
                isl_mat_alloc
make[5]: *** [Makefile:1099: graphite-isl-ast-to-gimple.o] Error 1

This is fixed upstream in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86724 , but is not yet in any release of gcc.

Change History (12)

comment:1 Changed 2 years ago by Konrad127123

  • Branch set to u/Konrad127123/gcc_fails_to_build_with_isl__0_20

comment:2 Changed 2 years ago by Konrad127123

  • Authors set to Konrad K. Dabrowski
  • Commit set to 7f2fa27f3813b09cc0285784026703fbe772014f
  • Status changed from new to needs_review

New commits:

7f2fa27Make gcc build with isl>=0.20.

comment:3 Changed 2 years ago by vdelecroix

It is somehow annoying that the gcc package in Sage (standard package) is affected by the presence of the isl library (an optional)... Is that desirable? Is there a way to tell gcc configuration script to ignore isl?

comment:4 follow-up: Changed 2 years ago by Konrad127123

Adding --without-isl to the configure options for gcc should disable using isl. (I'm not certain how to add this option in Sage's build system.)

On the other hand, according to https://gcc.gnu.org/install/prerequisites.html, adding --without-isl disables some optimizations that anyone who has a system isl would otherwise get.

Letting gcc compile against isl is maybe not morally the nicest solution, but I don't see why it should lead to problems (beyond needing the two-line include-fix attached to this trac issue).

comment:5 in reply to: ↑ 4 ; follow-ups: Changed 2 years ago by vdelecroix

Replying to Konrad127123:

Adding --without-isl to the configure options for gcc should disable using isl. (I'm not certain how to add this option in Sage's build system.)

howto: the install script is ${SAGE_ROOT}/build/pkgs/gcc/spkg-install.

On the other hand, according to https://gcc.gnu.org/install/prerequisites.html, adding --without-isl disables some optimizations that anyone who has a system isl would otherwise get.

Letting gcc compile against isl is maybe not morally the nicest solution, but I don't see why it should lead to problems (beyond needing the two-line include-fix attached to this trac issue).

It is indeed not moral since gcc is supposed to be built *before* isl. This gcc package within Sage is only here for convenience for users with a "broken" build system. On most platforms gcc is never built. I am curious how you ended up with this issue?

I also agree that the fix you provided should be included.

What about:

  • adding the fix to isl
  • and disabling isl during gcc build (at least by default)

It might sound like two fixes for the same problem but it is to my mind much cleaner.

comment:6 in reply to: ↑ 5 Changed 2 years ago by Konrad127123

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

howto: the install script is ${SAGE_ROOT}/build/pkgs/gcc/spkg-install.

Thanks. I thought I'd looked there, but must have accidentally looked somewhere else.

I am curious how you ended up with this issue?

I proactively look for issues like this :). I got annoyed at things failing when SAGE_CHECK="yes" or due to missing build dependencies, so after (almost) every beta release, I run a script which, for every standard package foo, sets SAGE_CHECK_PACKAGES so only foo gets tested, then does make distclean && make foo and keeps track of whether this succeeds or fails.

I also agree that the fix you provided should be included.

What about:

  • adding the fix to isl
  • and disabling isl during gcc build (at least by default)

It might sound like two fixes for the same problem but it is to my mind much cleaner.

gcc-7.4 got released yesterday and is the only released version of gcc without this bug, so a cleaner solution for the first part might be to just to update gcc.

For the other part, another solution might be to just make isl a standard package and give it the same special treatment as gmp and friends, so it gets rebuilt after gcc is. That would mean the number of standard packages increases by one. Thoughts on this?

comment:7 Changed 2 years ago by vbraun

  • Reviewers set to vbraun
  • Status changed from needs_review to positive_review

IMHO if a bugfix has been upstreamed then we may just as well include it if it fixes something thats relevant to us...

comment:8 Changed 2 years ago by vbraun

  • Reviewers changed from vbraun to Volker Braun

comment:9 Changed 2 years ago by vbraun

  • Branch changed from u/Konrad127123/gcc_fails_to_build_with_isl__0_20 to 7f2fa27f3813b09cc0285784026703fbe772014f
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:10 Changed 2 years ago by slelievre

  • Commit 7f2fa27f3813b09cc0285784026703fbe772014f deleted

comment:11 Changed 2 years ago by embray

  • Milestone changed from sage-8.5 to sage-8.6

comment:12 in reply to: ↑ 5 Changed 2 years ago by Konrad127123

Replying to vdelecroix:

What about:

  • adding the fix to isl
  • and disabling isl during gcc build (at least by default)

See #26954 for a followup that replaces the fix by simply upgrading to a newer version of gcc and disables isl during the gcc build.

Note: See TracTickets for help on using tickets.