Re: [mpir-devel] problem with "make check" mpir 2.6.0

53 views
Skip to first unread message

Bill Hart

unread,
Nov 15, 2012, 10:13:39 AM11/15/12
to mpir-...@googlegroups.com
Hi Elias,

this might be to do with the virtual box, as we've tested on a large
number of real machines and not encountered this yet.

You may have to tell mpir's configure what the machine actually is by
passing a --build=whatever

Can you tell us what ./config.guess says on your system. Also, could
you attach a copy of the config.log.

Can you also attach the output of cat /proc/cpuinfo

Thanks,

Bill.

On 15 November 2012 14:13, Elias <elias.ts...@gmail.com> wrote:
> Dear developers,
> when I do a make check with mpir 2.6.0, I get the following error
> /bin/bash: line 1: 17730 Illegal instruction (core dumped) "$tst" >
> t-get_d.log-t 2>&1
> I am running lubuntu 12.10 using a virtual box in mac os lion.
> The compiler is gcc 4.6
> Probably this causes problem in the installation of flint, but I will send
> another email for this.
>
> Can you please help me with this?
>
> best,
>
> -- Elias
>
> --
> You received this message because you are subscribed to the Google Groups
> "mpir-devel" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/mpir-devel/-/YAi4NCxUpWAJ.
> To post to this group, send email to mpir-...@googlegroups.com.
> To unsubscribe from this group, send email to
> mpir-devel+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mpir-devel?hl=en.

Jean-Pierre Flori

unread,
Nov 15, 2012, 10:22:09 AM11/15/12
to mpir-...@googlegroups.com, goodwi...@googlemail.com
I remember that we had problem with Sage built within Virtualbox, because although Virtualbox exposes the right type of processor and so gcc uses the right set of instructions, it does not really give you access to the complete set of instructions, whence potential SIGILL arising.
Not sure how this was dealt with in Sage, but you might find some hints on sage-devel or the Sage's trac.
Or this could be unrelated.

Bill Hart

unread,
Nov 15, 2012, 10:24:55 AM11/15/12
to mpir-...@googlegroups.com
Yes, you should only get invalid instruction errors when it is
compiling for the wrong machine. So either MPIR detected it
incorrectly, or the virtual machine is configured incorrectly, or
there is a compiler bug. The latter is a distinct possibility. gcc
4.6.0 is pretty buggy.

Bill.

Elias

unread,
Nov 15, 2012, 11:02:33 AM11/15/12
to mpir-...@googlegroups.com, goodwi...@googlemail.com

If I configure with the option CFLAGS="-O2 -march=native"
then there is no problem. So probably, it is a problem of virtual box.

This was suggested in sage-devel mailing list. Thanks Jean-Pierre.

-- Elias

leif

unread,
Nov 15, 2012, 11:06:19 AM11/15/12
to mpir-...@googlegroups.com
Bill Hart wrote:
> Yes, you should only get invalid instruction errors when it is
> compiling for the wrong machine. So either MPIR detected it
> incorrectly, or the virtual machine is configured incorrectly, or
> there is a compiler bug. The latter is a distinct possibility. gcc
> 4.6.0 is pretty buggy.


I guess it's a VirtualBox problem, not being able to "translate" -- or
rather not knowing -- the offending (presumably newer) instructions.

Unless they originate from hand-written assembly code, you can also pass
the desired target CPU type in CFLAGS, with '-march=...' and
'-mtune=...'. (See GCC's documentation for valid arguments.)

IIRC, /proc/cpuinfo (from within VirtualBox) may still show processor
features VirtualBox doesn't support.

You may also try MPIR's '--enable-fat' configure option, which makes
MPIR to some extent select the used instruction set at run-time,
although VirtualBox might still report the "wrong" CPU type there.


-leif
--
() The ASCII Ribbon Campaign
/\ Help Cure HTML E-Mail

Elias

unread,
Nov 15, 2012, 11:21:09 AM11/15/12
to mpir-...@googlegroups.com, goodwi...@googlemail.com
Hi Bill,
the ./config.guess gives
sandybridge-unknown-linux-gnu

the cpuinfo is
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i5-2557M CPU @ 1.70GHz
stepping        : 7
cpu MHz         : 1688.048
cache size      : 6144 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc up rep_good nopl pni monitor ssse3 lahf_lm
bogomips        : 3376.09
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:


and the first lines of config.log are (I am sorry, I can not attach a file)

  $ ./configure --prefix=/home/elias/ --enable-cxx=yes --enable-gmpcompat=yes CC=gcc-4.6 CXX=g++-4.6

## --------- ##
## Platform. ##
## --------- ##

hostname = aeolus-lu64
uname -m = x86_64
uname -r = 3.5.0-18-generic
uname -s = Linux
uname -v = #29-Ubuntu SMP Fri Oct 19 10:26:51 UTC 2012

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/lib/lightdm/lightdm
PATH: /usr/local/sbin
PATH: /usr/local/bin


-- Elias

leif

unread,
Nov 15, 2012, 11:34:23 AM11/15/12
to mpir-...@googlegroups.com
So what does

$ gcc-4.6 -march=native -v -c -x c /dev/null -o /dev/null 2>&1 | grep -w cc1

give (especially the '-m...' parameters passed to 'cc1'), in contrast to
what MPIR used (shown by 'configure', the lines after 'using ABI="...") ?


By the way, Ubuntu's "GCC 4.6" is presumably Ubuntu's GCC 4.6.3, which
is quite different to FSF's GCC 4.6.3, i.e., besides some other changes
contains parts from the 4.7 branch.


-leif


> On Thursday, November 15, 2012 4:13:40 PM UTC+1, Bill Hart wrote:
>
> Hi Elias,
>
> this might be to do with the virtual box, as we've tested on a large
> number of real machines and not encountered this yet.
>
> You may have to tell mpir's configure what the machine actually is by
> passing a --build=whatever
>
> Can you tell us what ./config.guess says on your system. Also, could
> you attach a copy of the config.log.
>
> Can you also attach the output of cat /proc/cpuinfo
>
> Thanks,
>
> Bill.
>
> On 15 November 2012 14:13, Elias <elias.ts...@gmail.com
> <javascript:>> wrote:
> > Dear developers,
> > when I do a make check with mpir 2.6.0, I get the following error
> > /bin/bash: line 1: 17730 Illegal instruction (core dumped)
> "$tst" >
> > t-get_d.log-t 2>&1
> > I am running lubuntu 12.10 using a virtual box in mac os lion.
> > The compiler is gcc 4.6
> > Probably this causes problem in the installation of flint, but I
> will send
> > another email for this.
> >
> > Can you please help me with this?
> >
> > best,
> >
> > -- Elias
> >
> > --
> > You received this message because you are subscribed to the
> Google Groups
> > "mpir-devel" group.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msg/mpir-devel/-/YAi4NCxUpWAJ
> <https://groups.google.com/d/msg/mpir-devel/-/YAi4NCxUpWAJ>.
> > To post to this group, send email to mpir-...@googlegroups.com
> <javascript:>.
> > To unsubscribe from this group, send email to
> > mpir-devel+...@googlegroups.com <javascript:>.
> > For more options, visit this group at
> > http://groups.google.com/group/mpir-devel?hl=en
> <http://groups.google.com/group/mpir-devel?hl=en>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "mpir-devel" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/mpir-devel/-/MLIfpiTcmYwJ.
> To post to this group, send email to mpir-...@googlegroups.com.
> To unsubscribe from this group, send email to
> mpir-devel+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mpir-devel?hl=en.


Elias

unread,
Nov 15, 2012, 11:49:02 AM11/15/12
to mpir-...@googlegroups.com


On Thursday, November 15, 2012 5:34:33 PM UTC+1, leif wrote:
So what does

$ gcc-4.6 -march=native -v -c -x c /dev/null -o /dev/null 2>&1 | grep -w cc1


 /usr/lib/gcc/x86_64-linux-gnu/4.6/cc1 -quiet -v -imultilib . -imultiarch x86_64-linux-gnu /dev/null -march=corei7-avx -mno-cx16 -msahf -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx -mno-sse4.2 -mno-sse4.1 -mno-rdrnd -mno-f16c -mno-fsgsbase --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=corei7-avx -quiet -dumpbase null -auxbase-strip /dev/null -version -fstack-protector -o /tmp/ccdLHpEj.s

give (especially the '-m...' parameters passed to 'cc1'), in contrast to
what MPIR used (shown by 'configure', the lines after 'using ABI="...") ?


By the way, Ubuntu's "GCC 4.6" is presumably Ubuntu's GCC 4.6.3, which
is quite different to FSF's GCC 4.6.3, i.e., besides some other changes  
contains parts from the 4.7 branch.


This is a very good point. I didn't notice.

-- Elias
 

leif

unread,
Nov 15, 2012, 12:14:48 PM11/15/12
to mpir-...@googlegroups.com
Elias wrote:
>
>
> On Thursday, November 15, 2012 5:34:33 PM UTC+1, leif wrote:
>
> So what does
>
> $ gcc-4.6 -march=native -v -c -x c /dev/null -o /dev/null 2>&1 |
> grep -w cc1
>
>
> /usr/lib/gcc/x86_64-linux-gnu/4.6/cc1 -quiet -v -imultilib .
> -imultiarch x86_64-linux-gnu /dev/null -march=corei7-avx -mno-cx16
> -msahf -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp
> -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx -mno-sse4.2
> -mno-sse4.1 -mno-rdrnd -mno-f16c -mno-fsgsbase --param l1-cache-size=32
> --param l1-cache-line-size=64 --param l2-cache-size=6144
> -mtune=corei7-avx -quiet -dumpbase null -auxbase-strip /dev/null
> -version -fstack-protector -o /tmp/ccdLHpEj.s


Thanks. So GCC is pretty smart detecting the features actually
supported... (Note the many '-mno-...' parameters.)

I guess MPIR just passed '-march=corei7-avx' (Sandy Bridge), which led
GCC to emitting instructions supported by the CPU, but not VirtualBox
(or whatever virtual machine you're using).

FWIW, /proc/cpuinfo seems to correctly reflect what the VM is capable of:

> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc up rep_good nopl pni monitor ssse3 lahf_lm



-leif


>
> give (especially the '-m...' parameters passed to 'cc1'), in
> contrast to
> what MPIR used (shown by 'configure', the lines after 'using
> ABI="...") ?
>
>
> By the way, Ubuntu's "GCC 4.6" is presumably Ubuntu's GCC 4.6.3, which
> is quite different to FSF's GCC 4.6.3, i.e., besides some other changes
>
> contains parts from the 4.7 branch.
>
>
> This is a very good point. I didn't notice.
>
> -- Elias

Bill Hart

unread,
Nov 15, 2012, 12:25:06 PM11/15/12
to Elias, mpir-...@googlegroups.com
Hi Elias,

I can't see any serious problems there. So I guess it is a virtual box issue.

The only problem I can see is that you have CC=gcc-4.6 instead of
CC="gcc-4.6 -std=gnu99", though if it compiles, then this is probably
not a problem.

You should also see what other options are passed to GCC when
configuring automatically, i.e. configure without overriding CFLAGS
and see what CFLAGS it uses. Simply replace the -march option but
leave the other options as they are.

For example, on my machine it uses:

CFLAGS="-m64 -O2 -march=k8 -mtune=k8"

So I would overwrite that with

CFLAGS="-m64 -O2 -march=native -mtune=native"

presumably. Anyhow, the options you are using are probably ok. Note
that you can't use -O3 with gcc-4.6 due to bugs in the compiler.

Bill.

Elias

unread,
Nov 15, 2012, 3:11:59 PM11/15/12
to mpir-...@googlegroups.com, Elias, goodwi...@googlemail.com
I think the problem is solved.
Thank you all for your help.

-- Elias
Reply all
Reply to author
Forward
0 new messages