Bug #1576671. The solution proposed by Dario Asprone works for me.

Sagemath does not compile in Fedora 28

El viernes, 18 de mayo de 2018, 12:24:39 (UTC+2), Dima Pasechnik escribió:
>
>
>
> On Friday, May 18, 2018 at 5:53:21 AM UTC+1, Dario Asprone wrote:
>>
>> So, summing up, I tried compiling the library on Fedora 28 64bit, which 
>> ships with gcc 8.1 by default.
>> I encountered 3 different issues, 2 already addressed by fidelbc and one 
>> more with python 3.6.1
>> While I resolved the issue with python2 in the same way fidelbc did, I 
>> couldn't find any ready-made patch for the behaviour, so I analyzed the 
>> linbox code a bit:
>> in more than one place they used the double template specialization 
>> syntax, that is:
>> template<>
>> template<typename T>
>> class Class1<Type1<T>>{
>> ...
>> }
>> This construct doesn't work with the compilers listed in the #ifdef, but 
>> it worked with gcc7 (and MSVC I think).
>> Apparently with gcc8 and the corresponding template rules tightening, 
>> this approach was made non-standard, and since removing template<> 
>> shouldn't affect compilability, in other source files that part was 
>> commented out.
>> Since it was not in that particular header file (but I don't know why), I 
>> chose to add __GNUC__ to the list of constants the #ifdef checks for. 
>> This modification is in the attached patch multiple_templates.patch
>>
>> Python-3.6.1 was quite thougher. As Dima wrote, the solution is basically 
>> loading the patch he linked. Since the patch modifies configure.ac 
>> though, the package must first be rebuilt, then the commands
>> aclocal
>> autoconf
>> autoheader
>> run in sequence, and then the modifications apported by this commands put 
>> in a patch.
>>
>
> the above can be just one line:
>
> autoreconf -ivf
>  
>
>> After doing that, the package built correctly.
>> Sadly, I don't have any more information about the cause of the error 
>> than: on Fedora 28 *crypt()*, the thread unsafe version, is broken (or 
>> at least its usage in python).
>>
>
> it appears that crypt() on Fedora 28 has a totally different 
> implementation.
>
> https://fedoraproject.org/wiki/Changes/Replace_glibc_libcrypt_with_libxcrypt
>
> This might explain why it's not visible on other distros with gcc 8.
>
>
>  
>
>> I have a few additional debug informations, but only on what happens, not 
>> on why it does.
>> The two patches to apply for python-3.6.1 are, respectively, crypt.patch 
>> and zzz_conf.patch.
>> I will now try to open a trac ticket with all the patches to fix the 
>> compilation on Fedora 28, specifying that 2 of them actually fix gcc 8.1 
>> compatibility issues in general.
>> I will also include the python2 patch, since with the current python2 
>> version compilation is still impossible.
>>
>
> your branch on trac should be dependent on the python2 fix ticket (and use 
> the branch there)
>  
>
>>
>> Il giorno venerdì 18 maggio 2018 04:24:30 UTC+1, Dima Pasechnik ha 
>> scritto:
>>>
>>> As I wrote - you need to backport the patch from 
>>> https://bugs.python.org/issue28503 
>>> <https://www.google.com/url?q=https%3A%2F%2Fbugs.python.org%2Fissue28503&sa=D&sntz=1&usg=AFQjCNESigXVaeH_9SZmQSbKTb4LZ_KiFQ>
>>> Hopefully he opens a ticket with the fix soon (he just got his trac 
>>> account fixed).
>>>
>>> On Thursday, May 17, 2018 at 10:39:46 PM UTC+1, Enrique Artal wrote:
>>>>
>>>> I would be interested on how he solved the problem!
>>>>
>>>> El jueves, 17 de mayo de 2018, 21:04:15 (UTC+2), Dima Pasechnik 
>>>> escribió:
>>>>>
>>>>> On Fedora 28 (another gcc-8 system) Dario (my student) also had 
>>>>> problem with building python3, as we were getting a broken crypt module.
>>>>> A remedy he found, after a lot of debugging, was to backport the patch 
>>>>> from
>>>>> https://bugs.python.org/issue28503 
>>>>> <https://www.google.com/url?q=https%3A%2F%2Fbugs.python.org%2Fissue28503&sa=D&sntz=1&usg=AFQjCNESigXVaeH_9SZmQSbKTb4LZ_KiFQ>
>>>>> (which uses crypt_r if available) 
>>>>>
>>>>> On Thursday, May 17, 2018 at 7:23:30 AM UTC+1, vdelecroix wrote:
>>>>>>
>>>>>> Dear F, 
>>>>>>
>>>>>> Thanks! 
>>>>>>
>>>>>> For Python 2.7-14 we will be switching for 2.7-15 that does cause any 
>>>>>> trouble with GCC 8.1.0. See [1]. 
>>>>>>
>>>>>> For linbox, there is at least [2] opened (but no patch for the 
>>>>>> moment). 
>>>>>>
>>>>>> BTW, when I did build Sage with 8.1.0 few times ago I also had 
>>>>>> troubles 
>>>>>> with fflas that you do not mention (complaints about "const void"). 
>>>>>>
>>>>>> [1] https://trac.sagemath.org/ticket/25204 
>>>>>> [2] https://trac.sagemath.org/ticket/25353 
>>>>>>
>>>>>> Vincent 
>>>>>>
>>>>>> On 17/05/2018 04:59, fidelbc wrote: 
>>>>>> > Hello all, 
>>>>>> > 
>>>>>> > Wanted to leave this note for anybody running into gcc8 compiling 
>>>>>> issues. 
>>>>>> > This was built on archlinux using their gcc 8.1.0-1 package. 
>>>>>> Fortunately 
>>>>>> > there are fixes floating around, please see attached patches. 
>>>>>> > 
>>>>>> > - Python-2.7.14 
>>>>>> > 
>>>>>> > Error (sorry for the lack of details, lost the log file:-/ ): 
>>>>>> > /bin/sh: line 5: 25857 Segmentation fault      (core dumped) ... 
>>>>>> > Fix: 
>>>>>> > Place attached patch gcc8_python.patch (also available at [1]) 
>>>>>> under 
>>>>>> > $SAGEDIR/build/pkgs/python2/patches. I guess this is now fixed at 
>>>>>> 2.7.15, 
>>>>>> > see [2]. 
>>>>>> > 
>>>>>> > 
>>>>>> > - linbox-1.5.2 
>>>>>> > 
>>>>>> > Error: 
>>>>>> > ../../linbox/matrix/densematrix/blas-transposed-matrix.h:74:8: 
>>>>>> error: too 
>>>>>> > many template-parameter-lists 
>>>>>> >    class TransposedBlasMatrix< TransposedBlasMatrix< Matrix > > : 
>>>>>> public 
>>>>>> > Matrix { 
>>>>>> >          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
>>>>>> > Fix: 
>>>>>> > Place attached patch gcc8_linbox.patch (also available at [3]) 
>>>>>> under 
>>>>>> > $SAGEDIR/build/pkgs/linbox/patches 
>>>>>> > 
>>>>>> > Best, 
>>>>>> > f 
>>>>>> > 
>>>>>> > [1]: 
>>>>>> https://mail.python.org/pipermail/python-dev/2018-January/152011.html 
>>>>>> > [2]: 
>>>>>> > 
>>>>>> https://github.com/python/cpython/commit/0b91f8a668201fc58fa732b8acc496caedfdbae0
>>>>>>  
>>>>>> > [3]: 
>>>>>> > 
>>>>>> https://git.archlinux.org/svntogit/community.git/tree/trunk/linbox-gcc8.patch?h=packages/linbox
>>>>>>  
>>>>>> > 
>>>>>>
>>>>>

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

Reply via email to