Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcc fails to build with isl>=0.20 #26735

Closed
Konrad127123 opened this issue Nov 22, 2018 · 15 comments
Closed

gcc fails to build with isl>=0.20 #26735

Konrad127123 opened this issue Nov 22, 2018 · 15 comments

Comments

@Konrad127123
Copy link

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.

Upstream: Fixed upstream, in a later stable release.

Component: packages: standard

Keywords: gcc, isl

Author: Konrad K. Dabrowski

Branch: 7f2fa27

Reviewer: Volker Braun

Issue created by migration from https://trac.sagemath.org/ticket/26735

@Konrad127123
Copy link
Author

@Konrad127123
Copy link
Author

New commits:

7f2fa27Make gcc build with isl>=0.20.

@Konrad127123
Copy link
Author

Author: Konrad K. Dabrowski

@Konrad127123
Copy link
Author

Commit: 7f2fa27

@videlec
Copy link
Contributor

videlec commented Nov 27, 2018

comment:3

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?

@Konrad127123
Copy link
Author

comment:4

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).

@videlec
Copy link
Contributor

videlec commented Nov 27, 2018

comment:5

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.

@Konrad127123
Copy link
Author

comment:6

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?

@Konrad127123
Copy link
Author

Changed upstream from Fixed upstream, but not in a stable release. to Fixed upstream, in a later stable release.

@vbraun
Copy link
Member

vbraun commented Dec 25, 2018

Reviewer: vbraun

@vbraun
Copy link
Member

vbraun commented Dec 25, 2018

comment:7

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

@vbraun
Copy link
Member

vbraun commented Dec 25, 2018

Changed reviewer from vbraun to Volker Braun

@vbraun
Copy link
Member

vbraun commented Dec 27, 2018

Changed branch from u/Konrad127123/gcc_fails_to_build_with_isl__0_20 to 7f2fa27

@slel
Copy link
Member

slel commented Dec 28, 2018

Changed commit from 7f2fa27 to none

@embray embray modified the milestones: sage-8.5, sage-8.6 Dec 28, 2018
@Konrad127123
Copy link
Author

comment:12

Replying to @videlec:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants