leif wrote:
> leif wrote:
>> Benjamin Hackl wrote:
>>> I have a very similar setup (gcc 6.1.1 20160602 on Arch Linux), and I'm
>>> struggling quite hard to build 7.2:
>>>
>> [SNIP]
>>
>>> The next failure then occurs when the Sage library modules are compiled:
>>> as I couldn't find out how to add '-std=gnu++98' for a single module,
>>
>> The "clean" way is to add
>>
>>     # distutils: extra_compile_args = -std=c++98
>>
>> (usually to included pxd files, e.g. src/sage/libs/linbox/linbox.pxd)
>> but this apparently doesn't work for modules with additional
>> extra_compile_args in src/module_list.py, so you can (or have to) add it
>> there.
>>
>>
>>> I called  CFLAGS="$CFLAGS -std=gnu++98" make  (which might be the culprit;
>>> I know too little about how the building process works ...), let it
>>> compile for a while and switched back to just "make -j4" by interrupting
>>> and restarting. This lets the compilation of the modules finish, but...
>>
>> Doesn't work for me (yet) with vanilla FSF GCC 6.1.0, I'm still getting
>> errors despite of passing '-std=c++98' (or '-std=gnu++98',
>> '-fpermissive'), e.g. in sage/matrix/matrix_modn_sparse, but not all
>> that use LinBox (some of them compile when '-std=c++98' gets added).
>>
>> Perhaps something for a cythonist, or some GCC bug that got fixed in
>> Arch's version as the module did compile for you?
> 
> Nope, just Cython weirdness, it simply got compiled as C++.
> 
> The following works for me to let the whole Sage library build with GCC
> 6.1 (without setting any flags in the environment):
> 
> diff --git a/src/module_list.py b/src/module_list.py
> index a49ed36..8441106 100644
> --- a/src/module_list.py
> +++ b/src/module_list.py
> @@ -926,7 +926,7 @@ ext_modules = [
>                libraries = ['ntl', 'linbox', 'givaro', 'mpfr', 'gmpxx',
> 'gmp'] + cblas_libs,
>                library_dirs = cblas_library_dirs,
>                include_dirs = cblas_include_dirs,
> -              extra_compile_args = ['-DDISABLE_COMMENTATOR'] +
> givaro_extra_compile_args),
> +              extra_compile_args = ['-std=c++98',
> '-DDISABLE_COMMENTATOR'] + givaro_extra_compile_args),
> 
>      Extension('sage.matrix.matrix_modn_dense_double',
>                sources = ['sage/matrix/matrix_modn_dense_double.pyx'],
> @@ -934,7 +934,7 @@ ext_modules = [
>                libraries = ['ntl', 'linbox', 'givaro', 'mpfr', 'gmpxx',
> 'gmp'] + cblas_libs,
>                library_dirs = cblas_library_dirs,
>                include_dirs = cblas_include_dirs,
> -              extra_compile_args = ["-D_XPG6", "-DDISABLE_COMMENTATOR"]
> +              extra_compile_args = ['-std=c++98', "-D_XPG6",
> "-DDISABLE_COMMENTATOR"]
>                      + m4ri_extra_compile_args + givaro_extra_compile_args),
> 
>      Extension('sage.matrix.matrix_modn_sparse',
> diff --git a/src/sage/libs/linbox/linbox.pxd
> b/src/sage/libs/linbox/linbox.pxd
> index 0afd7bf..87a5e79 100644
> --- a/src/sage/libs/linbox/linbox.pxd
> +++ b/src/sage/libs/linbox/linbox.pxd
> @@ -1,3 +1,6 @@
> +# distutils: language = c++
> +# distutils: extra_compile_args = -std=c++98
> +
>  from sage.libs.gmp.types cimport mpz_t
> 
>  include 'sage/modules/vector_modn_sparse_h.pxi'
> diff --git a/src/sage/matrix/matrix_modn_sparse.pxd
> b/src/sage/matrix/matrix_modn_sparse.pxd
> index 5273ec3..14a98e7 100644
> --- a/src/sage/matrix/matrix_modn_sparse.pxd
> +++ b/src/sage/matrix/matrix_modn_sparse.pxd
> @@ -1,3 +1,5 @@
> +# distutils: language = c
> +
>  cimport matrix_sparse
> 
>  include 'sage/modules/vector_modn_sparse_h.pxi'
> 
> 
>>> ... then I get a segfault (last few lines are at
>>> http://pastebin.com/CBXhNN9P -- and I uploaded my full install.log to
>>> http://benjamin-hackl.at/downloads/behackl-20160629.install.log).
>>>
>>> Unfortunately, the reason for this is not that obvious to me---does
>>> anyone have an idea or suggestions (besides downgrading my gcc...)? :-|
>>
>> No idea.  (All I can see is that it happens early when trying to
>> initialize libsingular.)
> 
> Now the same situation here; Sage segfaults (in initializing
> libsingular), as does './sage --singular'.
> 
> So we'd have to take a closer look at the Singular package, which
> unfortunately(?) is kind of obsolete at the moment (recently got
> downgraded from 4.x to 3.1.7p1 again.)
> 
> Seems while it /compiles/ in C++14 mode with a trivial syntactic fix,
> the resulting code is no longer functional.  I'll try to (re)build it
> with '-std=c++11' or '-std=c++98'...

Results in the same, in both cases.  (You can rebuild Singular with
'-std=c++98' by typing 'env CXX="g++ -std=c++98" ./sage -f singular';
this "works" in contrast to setting CXXFLAGS which aren't consistently
used or dropped in some places IIRC.)


-leif

-- 
You received this message because you are subscribed to the Google Groups 
"sage-release" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-release.
For more options, visit https://groups.google.com/d/optout.

Reply via email to