Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28632 Discussions

Skipping incompatible /usr/compiler/lib/libifport.a when searching for -lifport

Norman_Binsted
Beginner
1,135 Views
I have installed ifort-11.1/073 (amd64/intel@64) with Ubuntu 10.04, and can compile successfully, but the link fails with:

skipping incompatible /usr/compiler/lib/libifport.a when searching for -lifport

and subsequently:

cannot find -lifport

0 Kudos
7 Replies
Kevin_D_Intel
Employee
1,135 Views
That's not the default installation location for the compiler's libraries.

Did you install the 073 update into that location?
If not, where did that version of the library originate?

If you are compiling with the Intel64 compiler and that is a 32-bit version of the library then that would trigger that message.
0 Kudos
Norman_Binsted
Beginner
1,135 Views
Thanks for your interest Kevin

This was a new installation using default paths

/usr/compiler/lib is the LD_LIBRARY_PATH defined in ifortvars.sh

There are no other instances of libifport.a on the machine

/usr/compiler/lib also contains libifport.so.5 which I have read elsewhere is the Intel@64/amd64 version (libifport.so.6 being the IA32 version)

There were no problems with the libraries used in compilation nor apparantly with the other libraries used in linking.

0 Kudos
Kevin_D_Intel
Employee
1,135 Views

The default path is /opt/intel/Compiler/11.1/073 so /usr/compiler/lib represents a custom installation location.

libifport.so.6 is the IA-64 (Itanium) version. Both IA-32 and Intel 64 versions of the library share the common name libifport.so.5. When both IA-32 and Intel 64 compilers are installed, their respective libraries install into "ia32" and "intel64" sub-directories under "lib".

Did you install the "_intel64" specific package?
Or the full package and only select to install the Intel 64 compiler?

What is the output for this command: ifort -V

0 Kudos
Norman_Binsted
Beginner
1,135 Views
Thanks Kevin

There were several things going wrong here:

I had run updatedb during but not after the installation so hadn't noticed the second libifport.a file.
I was also using the wrong executable - ifortbin in /usr/bin/compiler rather than ifort in /opt/intel/Compiler/11.1/073/bin/intel64

The sh script ifort in /usr/compiler/bin was also causing problems - the if (-z ENV_NAME) option doesn't seem to recognise null strings in Ubuntu

Seems to be working now thanks !

My only concern is that what I was doing before should have produced a valid 32bit executable (the .o file was i386) so the original problem remains - I will need to use this to produce code to export to 32bit machines at some stage.
0 Kudos
Kevin_D_Intel
Employee
1,135 Views

I do not have a clear picture of what all you were doing before to say for certain it should produce a valid 32-bit executable.

Again, /usr/compiler/bin is *not* created by our installation. If your compiler is installed there then whoever installed the compiler chose that as a custom installation directory.

The ifortfile shipped with the 11.1 release is not an sh script. It was prior to 11.1 so if your ifort is a shell script and you installed the 11.1.073 update as indicated into /usr/compiler/bin then something is corrupt with the installation. Maybe the 11.1.073 update was somehow installed over the top of an older 11.0 installation?

You should not invoke ifortbin directly. You should always use the ifort driver command.

I am beginning to believe perhaps what you have installed in an 11.0 compiler in /usr/compiler/bin and the 11.1.073 update in the default /opt/intel/Compiler/11.1/073 directory.

To use the compiler you should always setup your environment using the appropriate ifortvars.sh or ifortvars.csh setup script with either the ia32 or intel64argument depending on what compiler you want to use. On an Intel 64 based system, you must have the complete 32-bit gcc/glibc development environment installed to create a 32-bit executable. The error in your original post suggests there is a mixing of 32-bit and 64-bit components.

0 Kudos
mecej4
Honored Contributor III
1,135 Views
First of all, /usr/compiler is a non-standard installation directory. If your shell start-up scripts have been modified to set up or modify environmental variables so that /usr/compiler is accessed, that is something that you will have to remedy.

Secondly, I think that if you have a non-working installation of an older version of the Intel compiler, possibly with Itanium-specific files in it, those directories and files should be removed to save you trouble in the future.

If you have only the x64 version of the Intel Fortran compiler installed, i.e, there is no directory called /opt/intel/Compiler/11.1/073/bin/ia32 (thanks, Kevin), Even in the x64 environment (i.e., after issuing the source <...>/ifortvars.sh intel64 command) it is still possible to produce ELF 32-bit LSB executables. However, you must have the necessary libraries and start-off objects in /opt/intel/Compiler/11.1/073/lib/ia32 and the corresponding 32-bit GCC support libraries in the usual system directories. If you have satisfied these prerequisiites, you will have to give a couple of extra options to the compiler, e.g.,

[bash]ifort -m32 prog.f90 sub1.f90 sub3.f90 -L /opt/intel/Compiler/11.1/073/lib/ia32/[/bash]
The two extra options are (i) -m32 to have the compiler produce 32-bit objects, and (ii) the -L option above, which tells the compiler to use, for linking, the specified library directory instead of the default library directory /opt/intel/Compiler/11.1/073/lib/intel64 which contains x64 libraries and objects.
0 Kudos
Kevin_D_Intel
Employee
1,135 Views
Not completely correct. -m32 causes invocation of the IA-32 compiler (bin/ia32/fortcom for ifort) under the hood.In the absence of the "ia32" sub-directory (underbin, lib, include) the compilation fails as shown.Notice the Intel 64 ifort driver was used.

$ ifort -V -m32 sample.f90

Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20100806 Package ID: l_cprof_p_11.1.073
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.

catastrophic error: Compiler configuration problem encountered. The expected target architecture compiler is missing (11.1-ia32 != 11.1-intel64)
compilation aborted for sample.f90 (code 1)

0 Kudos
Reply