[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Compiler machine compatibility
From: |
Nick Foster |
Subject: |
Re: [Discuss-gnuradio] Compiler machine compatibility |
Date: |
Fri, 08 Apr 2011 10:06:26 -0700 |
On Fri, 2011-04-08 at 12:29 -0400, Marcus D. Leech wrote:
> I have some code that lives on top of Gnu Radio, and I think I'm having
> a code-generation issue with GCC. The binaries work on all
> my machines, but on a customers machine, it raises an Illegal
> Instruction exception. I generated the code on a 32-bit Intel Core
> machine, on Fedora 12. The code is executing on a Pentium-IV class
> machine, on a Fedora 12 installation. I gather than by default
> GCC will generate code that's optimized for the machine on which the
> compile is happening. How do distributors of binaries assure
> that the code will execute correctly on older-generation hardware?
Make sure you're compiling with optimization flags appropriate for the
hardware you're planning to run on. For instance, if you spec -msse3 or
newer on a pre-Prescott P4, you'll generate instructions the CPU can't
execute. I'm pretty sure GCC won't generate these instructions unless
you specify it using these flags so make sure your automake/cmake setup
isn't doing so.
Another issue is if you compile on a 32-bit compiler it'll barf on a
64-bit system, and this might generate an illegal instruction error.
This is the reason package maintainers keep a 32-bit and 64-bit version
of their packages. If you want to make code that runs on a 64-bit system
from your 32-bit system, you'll have to use a 64-bit GCC installation (I
think GCC is the same for either, but you need 64-bit libc) and use -m64
as a compile flag.
--n
>
>
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio