error compiling ntl in sage 7.3.beta8

134 views
Skip to first unread message

chris wuthrich

unread,
Jul 19, 2016, 7:21:54 AM7/19/16
to sage-devel

Trying to compile sage 7.3.beta8 on CentOS6.8, I ran into a problem compiling ntl 9.8.1.

Not sure what to include. Just ask.

Chris


Host system:
Linux pmlapsag01 2.6.32-642.1.1.el6.x86_64 #1 SMP Tue May 31 21:57:07 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
****************************************************
C compiler: gcc
C compiler version:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/sageadm/sage/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.3/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../src/configure --prefix=/home/sageadm/sage/local --with-local-prefix=/home/sageadm/sage/local --with-gmp=/home/sageadm/sage/local --with-mpfr=/home/sageadm/sage/local --with-mpc=/home/sageadm/sage/local --with-system-zlib --disable-multilib --disable-nls --enable-languages=c,c++,fortran --disable-libitm
Thread model: posix
gcc version 4.9.3 (GCC)
****************************************************

Applying patches to NTL.

....

config.status: executing libtool commands

Configuring NTL.
***** checking for libtool *****
libtool (GNU libtool) 2.4.2
Written by Gordon Matzigkeit < ... >, 1996

Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
***** libtool OK *****

*** checking -march=native flag
CXXAUTOFLAGS=" -march=native"
*** -march=native works
CXXAUTOFLAGS=" -march=native"

[ntl-9.8.1.p0] Tuning and building NTL.
[ntl-9.8.1.p0] make[3]: Entering directory `/home/sageadm/sage/local/var/tmp/sage/build/ntl-9.8.1.p0/src/ntl/src'
[ntl-9.8.1.p0] make setup1
[ntl-9.8.1.p0] make[4]: Entering directory `/home/sageadm/sage/local/var/tmp/sage/build/ntl-9.8.1.p0/src/ntl/src'
[ntl-9.8.1.p0] g++ -I../include -I.  -march=native -O2 -g   -c MakeDescAux.c
[ntl-9.8.1.p0] g++ -I../include -I.  -march=native -O2 -g   -L/home/sageadm/sage/local/lib -Wl,-rpath,/home/sageadm/sage/local/lib  -o MakeDesc MakeDesc.c MakeDescAux.o -lm
[ntl-9.8.1.p0] /tmp/ccPRNw4z.s: Assembler messages:
[ntl-9.8.1.p0] /tmp/ccPRNw4z.s:873: Error: no such instruction: `shlx %r12,%rax,%rax'
[ntl-9.8.1.p0] /tmp/ccPRNw4z.s:932: Error: no such instruction: `shlx %r12,%rax,%rax'

...

[ntl-9.8.1.p0] /tmp/ccPRNw4z.s:4374: Error: no such instruction: `shlx %rax,%r15,%r15'
[ntl-9.8.1.p0] /tmp/ccPRNw4z.s:4791: Error: no such instruction: `shlx %r13,%rdx,%rdx'
[ntl-9.8.1.p0] make[4]: *** [setup1] Error 1

leif

unread,
Jul 19, 2016, 11:35:55 AM7/19/16
to sage-...@googlegroups.com
chris wuthrich wrote:
>
> Trying to compile sage 7.3.beta8 on CentOS6.8, I ran into a problem
> compiling ntl 9.8.1.
>
> Not sure what to include. Just ask.

Huh, dead old toolchain on a recent Intel machine.

Update binutils (which include the GNU assember), or disable
'-march=native' in NTL. (There's some 'configure' flag to NTL to not
use it...)


-leif

P.S.: That's a known bug (NTL not checking whether the assembler can
cope with GCC's output in case of '-march=native'), but this so far has
hit us only on MacOS X.
> [ntl-9..8.1.p0] make[4]: Entering directory

leif

unread,
Jul 19, 2016, 12:40:36 PM7/19/16
to sage-...@googlegroups.com
leif wrote:
> chris wuthrich wrote:
>>
>> Trying to compile sage 7.3.beta8 on CentOS6.8, I ran into a problem
>> compiling ntl 9.8.1.
>>
>> Not sure what to include. Just ask.

You may give us the output of 'as --version'.


> Huh, dead old toolchain on a recent Intel machine.
>
> Update binutils (which include the GNU assember), or disable
> '-march=native' in NTL. (There's some 'configure' flag to NTL to not
> use it...)

While you cannot pass options directly to NTL's 'configure' (without
editing build/pkgs/ntl-*/spkg-install), you could for example do

$ env SAGE_FAT_BINARY=yes ./sage -i ntl
$ make # continue the build without "fat" binary enabled


(I *thought* there was also an "experimental" binutils Sage package, but
that doesn't seem to be the case, at least there isn't any on the
official Sage mirrors.)


> P.S.: That's a known bug (NTL not checking whether the assembler can
> cope with GCC's output in case of '-march=native'), but this so far has
> hit us only on MacOS X.

Cf. https://trac.sagemath.org/ticket/20779#comment:4 ff.


-leif

leif

unread,
Jul 19, 2016, 1:15:31 PM7/19/16
to sage-...@googlegroups.com
leif wrote:
> leif wrote:
>> chris wuthrich wrote:
>>>
>>> Trying to compile sage 7.3.beta8 on CentOS6.8, I ran into a problem
>>> compiling ntl 9.8.1.
>>>
>>> Not sure what to include. Just ask.
>
> You may give us the output of 'as --version'.

P.P.S.: Maybe

$ head -25 /proc/cpuinfo

and perhaps

$ ./sage --sh -c 'gcc -v -Q -march=native -c -x c /dev/null -o
/dev/null' 2>&1 | grep ' -m'

as well.


-leif

chris wuthrich

unread,
Jul 19, 2016, 4:25:26 PM7/19/16
to sage-devel

 Thanks a lot, leif, for the help.

I will ask the sysadmin to update binutils.

Your idea with SAGE_FAT_BINARY seems to get around the problem, by now.

If it still helps for #20779:

sageadm@pmlapsag01:~/sage$ as --version
GNU assembler version 2.20.51.0.2-5.44.el6 20100205
Copyright 2009 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-redhat-linux'.


--
sageadm@pmlapsag01:~/sage$ head -25 /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 63
model name      : Intel(R) Xeon(R) CPU E5-2660 v3 @ 2.60GHz
stepping        : 2
microcode       : 46
cpu MHz         : 2593.993
cache size      : 25600 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 15
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm ida arat epb xsaveopt pln pts dtherm fsgsbase bmi1 avx2 smep bmi2 invpcid
bogomips        : 5187.98
clflush size    : 64
cache_alignment : 64
address sizes   : 42 bits physical, 48 bits virtual
power management:

--

Volker Braun

unread,
Jul 19, 2016, 6:16:33 PM7/19/16
to sage-devel
On Tuesday, July 19, 2016 at 5:35:55 PM UTC+2, leif wrote:
Huh, dead old toolchain on a recent Intel machine.

Centos/Redhat 6 is from 2010 and supported until 2020...

If you want to get good performance for recent hardware you'd need something fresher, of course.

leif

unread,
Jul 19, 2016, 6:55:54 PM7/19/16
to sage-...@googlegroups.com
chris wuthrich wrote:
>
> Thanks a lot, leif, for the help.
>
> I will ask the sysadmin to update binutils.

Well, in this case Sage built and used its own GCC (currently 4.9.3)
because at least /the default one/ on your system is outdated as well.

You may ask the sysadmin whether already a newer version is available on
your system (you could use for Sage by changing your PATH or setting CC,
CPP, CXX and FC accordingly), and if not, ask him to install one (along
with newer versions of its prerequisites such as GMP, MPFR, MPC, and
other updated toolchain parts such as binutils) to be optionally used
for performance reasons (and also e.g. C++11 support).

The CPU is a "Haswell-EP" which supports (among other extensions) AVX2
and BMI2 (where "shlx" belongs to), so it's worth to use a more recent
compiler on it, as Volker mentioned.


-leif

Travis Scrimshaw

unread,
Jul 20, 2016, 1:01:36 AM7/20/16
to sage-devel
Just FYI - Tom Roby and I ran into this problem today trying to get 7.3.beta8 to build on OS X 10.9. So a fix before 7.3 is released would be good and appreciated.

Best,
Travis

leif

unread,
Jul 20, 2016, 11:47:01 PM7/20/16
to sage-...@googlegroups.com
I've made a blocker ticket [1] for Sage 7.3 with a probably preliminary
fix/work-around; a better solution for MacOS X (and not just the NTL
package) will come later, on #20779.

#21064 is ready for testing by the way / needs review.


-leif

[1] https://trac.sagemath.org/ticket/21064


Travis Scrimshaw

unread,
Jul 21, 2016, 1:14:09 AM7/21/16
to sage-devel
   Another point of reference/FYI, this failed when I was trying to get Sage 7.3.beta8 from scratch to install on Mac 10.11 (IIRC) with Jang Soo Kim (who I hope will post here his build log for NTL). For reference, command-line tools are installed. So it doesn't seem to just be old versions of OS X.

Best,
Travis

Francois Bissey

unread,
Jul 21, 2016, 1:17:48 AM7/21/16
to sage-...@googlegroups.com
Works out of the box on my Mac 10.11 machine. Definitely want logs.

François
> --
> 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+...@googlegroups.com.
> To post to this group, send email to sage-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

leif

unread,
Jul 21, 2016, 4:15:05 AM7/21/16
to sage-...@googlegroups.com
Francois Bissey wrote:
> Works out of the box on my Mac 10.11 machine. Definitely want logs.

And the analogue of /proc/cpuinfo...


-leif

Travis Scrimshaw

unread,
Jul 21, 2016, 11:58:59 AM7/21/16
to sage-devel
Here is Jang Soo's build log.

Best,
Travis

ntl-9.8.1.p0.log

Travis Scrimshaw

unread,
Jul 21, 2016, 11:59:59 AM7/21/16
to sage-devel
PS - Applying the fix to the shared flags allowed NTL to compile.

Francois Bissey

unread,
Jul 21, 2016, 3:41:19 PM7/21/16
to sage-...@googlegroups.com
I guess there could be the possibility that he has an older version of Xcode
somehow.
What does
as —version
report?

François
> --
> 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+...@googlegroups.com.
> To post to this group, send email to sage-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
> <ntl-9.8.1.p0.log>

Travis Scrimshaw

unread,
Jul 21, 2016, 5:19:21 PM7/21/16
to sage-devel
Here is the analog of /proc/cpuinfo (AFAIK):

sysctl -a | grep machdep.cpu
machdep
.cpu.max_basic: 13
machdep
.cpu.max_ext: 2147483656
machdep
.cpu.vendor: GenuineIntel
machdep
.cpu.brand_string: Intel(R) Core(TM) i7-4558U CPU @ 2.80GHz
machdep
.cpu.family: 6
machdep
.cpu.model: 69
machdep
.cpu.extmodel: 4
machdep
.cpu.extfamily: 0
machdep
.cpu.stepping: 1
machdep
.cpu.feature_bits: 9221959987971750911
machdep
.cpu.leaf7_feature_bits: 10155
machdep
.cpu.extfeature_bits: 142473169152
machdep
.cpu.signature: 263761
machdep
.cpu.brand: 0
machdep
.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C
machdep
.cpu.leaf7_features: SMEP ERMS RDWRFSGS TSC_THREAD_OFFSET BMI1 AVX2 BMI2 INVPCID FPU_CSDS
machdep
.cpu.extfeatures: SYSCALL XD 1GBPAGE EM64T LAHF LZCNT RDTSCP TSCI
machdep
.cpu.logical_per_package: 16
machdep
.cpu.cores_per_package: 8
machdep
.cpu.microcode_version: 23
machdep
.cpu.processor_flag: 6
machdep
.cpu.mwait.linesize_min: 64
machdep
.cpu.mwait.linesize_max: 64
machdep
.cpu.mwait.extensions: 3
machdep
.cpu.mwait.sub_Cstates: 286531872
machdep
.cpu.thermal.sensor: 1
machdep
.cpu.thermal.dynamic_acceleration: 1
machdep
.cpu.thermal.invariant_APIC_timer: 1
machdep
.cpu.thermal.thresholds: 2
machdep
.cpu.thermal.ACNT_MCNT: 1
machdep
.cpu.thermal.core_power_limits: 1
machdep
.cpu.thermal.fine_grain_clock_mod: 1
machdep
.cpu.thermal.package_thermal_intr: 1
machdep
.cpu.thermal.hardware_feedback: 0
machdep
.cpu.thermal.energy_policy: 1
machdep
.cpu.xsave.extended_state: 7 832 832 0
machdep
.cpu.xsave.extended_state1: 1 0 0 0
machdep
.cpu.arch_perf.version: 3
machdep
.cpu.arch_perf.number: 4
machdep
.cpu.arch_perf.width: 48
machdep
.cpu.arch_perf.events_number: 7
machdep
.cpu.arch_perf.events: 0
machdep
.cpu.arch_perf.fixed_number: 3
machdep
.cpu.arch_perf.fixed_width: 48
machdep
.cpu.cache.linesize: 64
machdep
.cpu.cache.L2_associativity: 8
machdep
.cpu.cache.size: 256
machdep
.cpu.tlb.inst.large: 8
machdep
.cpu.tlb.data.small: 64
machdep
.cpu.tlb.data.small_level1: 64
machdep
.cpu.tlb.shared: 1024
machdep
.cpu.address_bits.physical: 39
machdep
.cpu.address_bits.virtual: 48
machdep
.cpu.core_count: 2
machdep
.cpu.thread_count: 4
machdep
.cpu.tsc_ccc.numerator: 0
machdep
.cpu.tsc_ccc.denominator: 0


Also we have

$ as -v
Apple Inc version cctools-870, GNU assembler version 1.38

Best,
Travis

Francois Bissey

unread,
Jul 21, 2016, 5:22:41 PM7/21/16
to sage-...@googlegroups.com

> On 22/07/2016, at 09:19, Travis Scrimshaw <tsc...@ucdavis.edu> wrote:
>
> Also we have
>
> $ as -v
> Apple Inc version cctools-870, GNU assembler version 1.38
>

OK that’s definitely an older version of the Xcode toolchain.
Here I have
Mirage:~ fbissey$ as --version
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin


François

leif

unread,
Jul 21, 2016, 6:19:46 PM7/21/16
to sage-...@googlegroups.com
Unfortunately nobody seems to be reading the output of Sage's
'configure' (nor its README.txt?); there (in 'configure.ac' that is) we
have:

if [ $DARWIN_VERSION -gt 10 ]; then
echo "You are using OS X Lion (or later)."
echo "You are strongly advised to install Apple's latest Xcode"
echo "unless you already have it. You can install this using"
echo "the App Store. Also, make sure you install Xcode's"
echo "Command Line Tools -- see Sage's README.txt."

Perhaps we should add an explicit check of the assembler there...

(In addition, the GCC spkg should IMHO check it, not just on Darwin.)


Just saying,

-leif


chris wuthrich

unread,
Aug 19, 2016, 12:39:03 PM8/19/16
to sage-devel

The original problem in this thread was resolved, but then there were other problems with compiling sage 7.3 on CentOS6.8. I decided to install the devtools and it worked fine.

Maybe somewhere in the installation guidelines, one could add that for CentOS it is recommended to install devtoolset-4 and autotools-latest and to compile after "scl enable devtoolset-4 autotools-latest bash".

Chris

leif

unread,
Aug 20, 2016, 9:25:04 AM8/20/16
to sage-...@googlegroups.com
chris wuthrich wrote:
>
> The original problem in this thread was resolved, but then there were
> other problems with compiling sage 7.3 on CentOS6.8.

Could you sketch them?

Missing prerequisites, and/or further outdated/too old/insufficient
versions?


FWIW, (system) Python 2.6 compatibility (to bootstrap Sage) has been
reestablished in 7.3 AFAIK, while Sage's 'configure' still lacks a
corresponding test (and presumably a couple more).


-leif
Reply all
Reply to author
Forward
0 new messages