Discussion:
GNU autoconf configure script on cross-compiling to nearly identical target platform
Wirawan Purwanto
2013-01-29 21:18:48 UTC
Permalink
In the GNU autoconf-generated configure script, there is a variable
called "cross_compiling". This will be set to "yes" when you
cross-compile. Now in most cases this is detected by the mechanism
there, for example if we cross-compile from linux to mingw, or from
amd64 to an arm machine. But there are subtle cases where this won't
be detected, which is common in computational cluster. This is the
case with many Cray machines. The front-end, where we compile, is a
standard Linux platform with a relatively recent AMD64 Opteron
processor. But the compute nodes, where we target the compilation for,
have Compute Node Linux OS (a specially stripped-down LInux) and sport
the newest AMD64 Opteron processor, whose instruction set supersedes
the front-end one. As a result, the generated executable must not be
run on the front end.

How do I go about in this case, telling the configure script that this
is a cross compilation? I believe that in all cases, they will give
the same "x86_64-unknown-linux-gnu" build and target host triplets.
--
Wirawan Purwanto
Research Scientist
College of William and Mary
Physics Department
Williamsburg, VA 23187
Paul Eggert
2013-01-30 02:30:42 UTC
Permalink
Post by Wirawan Purwanto
I believe that in all cases, they will give
the same "x86_64-unknown-linux-gnu" build and target host triplets.
How about if you use a different triple for the compute node?
"x86_64-wm-linux-gnu", say.
Nick Bowler
2013-01-30 14:44:49 UTC
Permalink
Hello,
Post by Wirawan Purwanto
How do I go about in this case, telling the configure script that this
is a cross compilation? I believe that in all cases, they will give
the same "x86_64-unknown-linux-gnu" build and target host triplets.
Aside from using different triples as suggested by Paul, it is also
possible to force configure to run in cross compilation mode by
explicitly setting cross_compiling to yes, for example:

./configure cross_compiling=yes

(I often use this feature for testing configure scripts)

Cheers,
--
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)
Loading...