Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

How di I get the compiler to create executables for older Linux kernels ?

wam_iii
Beginner
990 Views
Hi, I am new to this forum, but have been using the Intel FORTRAN & C/C++ compilers since v4.5. I am using the ~latest versions ('Intel C Intel 64 Compiler XE for applications running on Intel 64, Version 12.0.3.174 Build 20110309') under FC14, 64-bit on a Q6600 configured as a server (runlevel 3) to compile some inhouse code. The code in question is mixed language, mostly C w/ some F77 leaf-routines. I have historically used ifort to do the linking so as to get the various FORTRAN libraries linked in OK. I had been using the 9.1 series of compilers for several years, but upgraded to the 12.1 series earlier this year. I notice that the earlier compiler compiled code that was compatible w/ Linux kernel 2.2.5, & would run AOK on all of the (64-bit) machines on my menagerie network (all linux boxes, but various distros & kernel versions). The 12.1 compiler produces code that is compatible w/ the host kernel, 2.6.32, & won't run on some of my other boxes w/ older kernels. How do I get the new compiler to replicate the compatibility behavior of the older (v9.1 series) compiler ? I tried switching to ICC to do the linking, & compiling & linking all C-code w/ the '-gcc-version=320' options, but the file command still reports that the resulting executables are compatible w/ kernel 2.6.32. There doesn't seem to be an analogous option under ifort, which may be my problem. Thanks in advance for your time & assistance.

0 Kudos
4 Replies
TimP
Honored Contributor III
990 Views
The usual problem with backward compatibility releates to glibc. You would deal with that by building the application on the oldest version of glibc you wish to support, and installing the compatibility libraries on the platforms with newer glibc. I don't see that you should care so much about what the file command says.
The gcc-version option probably applies to C++ library compatibility (the version of g++ which is active when you build), so would not be relevant to ifort. I suppose you could encounter run-time version compatibility problems if you are attempting dynamic link against a wide range of libstdc++, but that should apply only to your C++ code. Intel compilers prior to 12.0 required libstdc++-33 to be present, presumably assuring a degree of backward compatibility, while 12.0 works with libstdc++-41 or newer (on recent linux distros).
I suppose there remains a degree of support for g++-3.4 libraries (e.g. on Red Hat 5.x), so you might try building with g++-3.4 active underneath ifort and icpc if you don't need current C++ capability.
I wouldn't be surprised if FC14 with its own choice of g++ is less well suited to building for old distros.
0 Kudos
wam_iii
Beginner
990 Views
I don't know exactly what the problem is for me, but output from the file command for each of the compilers themselves caught my eye:


[wam@Q6600, ~, 5:37:39pm] 1163 % file /opt/intel/cce/9.1.045/bin/iccbin
/opt/intel/cce/9.1.045/bin/iccbin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped
[wam@Q6600, ~, 5:37:41pm] 1164 % file /opt/intel/cce/10.1.015/bin/iccbin
/opt/intel/cce/10.1.015/bin/iccbin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped
[wam@Q6600, ~, 5:37:42pm] 1165 % file /opt/intel/composerxe-2011.3.174/bin/intel64/icc
/opt/intel/composerxe-2011.3.174/bin/intel64/icc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.0, not stripped
[wam@Q6600, ~, 5:37:43pm] 1166 %

The compilers themselves seem to be compatible w/ quite old kernels (& associated glibc's, 2.4.0 for the newest, 2.2.5 for older versions), I am trying to figure out how to duplicate that in my own compiles. I probably didn't phrase the question well, but that is it: I am trying to duplicate what I perceive to be the very wide applicability of the compiler itself. My code is mixed C/FORTRAN 77, no C++ or anything fancy, I just want to be able to run it on *ALL* my machines w/ a minimum of fuss & muss ....
0 Kudos
wam_iii
Beginner
990 Views
P.S. to my previous reply: the file command for my code shows:

wam@Q6600, CFD, 5:44:01pm] 12876 % file /usr/local/bin/PreBFCGL.SSE3.TEST
/usr/local/bin/PreBFCGL.SSE3.TEST: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped


Let me know what else to provide or clear up.
0 Kudos
wam_iii
Beginner
990 Views
Repeating for emphasis, my code has *NO* C++ at all, just C & F77. I do indeed have gcc 3.4 installed, out of the compat-gcc-34.x86_64, version 3.4.6-20.fc14 package. Is there a way to tell icc/ifort to prefer the gcc 3.4 compiler, rather than gcc 4.5, the apparent FC14 default/std. ? The file command for those 2 executables shows:

[wam@Q6600, CFD, 9:32:23pm] 13108 % file /usr/bin/gcc
/usr/bin/gcc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped

[wam@Q6600, CFD, 9:32:51pm] 13112 % file /usr/bin/gcc34
/usr/bin/gcc34: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

Thanks in advance for any pointers.
0 Kudos
Reply