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

compiler error: undefined reference to `for_ifcore_version'

Christoph_I_
Beginner
2,427 Views

Hello!
I wanted to compile a code with mpif90 (which i got from openmpi compiled with the intel compiler) but I get the error:

/opt/intel/compilers_and_libraries_2016.0.109/linux/compiler/lib/intel64/libifport.so.5: undefined reference to `for_ifcore_version'

I have the Intel Parallel Studio XE Composer Edition for Fortran and C++ (Linux) (parallel_studio_xe_2016.0.047) installed.

I started with loading the environment variables:

source /opt/intel/compilers_and_libraries/linux/bin/compilervars.sh -arch intel64 -platform linux

source /opt/intel/compilers_and_libraries/linux/mpi/bin64/mpivars.sh

export PATH=/opt/OpenMPI-intel/bin:$PATH

export LD_LIBRARY_PATH=/opt/OpenMPI-intel/lib:$LD_LIBRARY_PATH

and then I compile with:

mpif90 dns.f

mpif90 -O3  dns.o -lmpi

What did I do wrong?

0 Kudos
7 Replies
Steven_L_Intel1
Employee
2,427 Views

It's actually linking, not compiling. You're not linking against the 16.0 Fortran run-time libraries. It could be that the mpivars.sh set the wrong value for the environment variable. Try sourcing mpivars.sh before compilervars.sh

0 Kudos
TimP
Honored Contributor III
2,427 Views

If you're using OpenMPI, you should not be sourceing the Intel MPI mpivars.sh.  Instead, you should be setting PATH and LD_LIBRARY_PATH to your OpenMPI, and verifying that mpif90 -V agrees with the version of ifort you wished to set up by compilervars.

The OpenMPI paths have to be set after sourceing compilervars, to avoid having ifort coarray MPI come before OpenMP on path.

I haven't got to the linux installation of xe2016 release, but I would note that the default Windows installation directories were changed again in the release, so you have the possibility of inadvertently mixing beta and release path setting.

0 Kudos
Steven_L_Intel1
Employee
2,427 Views

I'll just note that for_ifcore_version is a new routine in 16.0 - see the release notes. It should be satisfied by libifcore and I see that the reference is from libifport in the correct directory, so I am not sure why you're getting the error. Make sure that libifcore is getting linked in.

0 Kudos
Christoph_I_
Beginner
2,427 Views

@Tim Prince thanks that fixed it for me!

0 Kudos
Mickael_Z_
Beginner
2,427 Views
Dear TimPrince, I have a similar problem on a cluster. Before compiling, I load two different modules for the Intel compiler and for OpenMPI : module load intel/parallel_studio_xe/2016.0.047 module load openmpi/intel-ofed/intel/64/1.8.4-qlc Such as : ifort -V Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.0.109 Build 20150815 Copyright (C) 1985-2015 Intel Corporation. All rights reserved. mpifort -show ifort -I/usr/mpi/intel/openmpi-1.8.4-qlc/include -I/usr/mpi/intel/openmpi-1.8.4-qlc/lib64 -Wl,-rpath -Wl,/usr/mpi/intel/openmpi-1.8.4-qlc/lib64 -Wl,--enable-new-dtags -L/usr/mpi/intel/openmpi-1.8.4-qlc/lib64 -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi And I have the following problem : mpifort -c muse.f mpifort -o pipo.x muse.o /cm/shared/apps/intel/compilers_and_libraries_2016.0.109/linux/daal/../compiler/lib/intel64_lin/libifport.so.5: undefined reference to `for_ifcore_version' It works with ifort but not with mpifort. Have you any idea ? Thanks a lot
0 Kudos
TimP
Honored Contributor III
2,427 Views

According to what Steve said, it looks like an older shared library is creeping in. You'd likely need help from your sysadmin to check that the ifort library installation under module is correct.

Maybe your openmpi was built with an earlier ifort version.  If you would load the ifort module after the openmpi it could be corrected.

0 Kudos
Mickael_Z_
Beginner
2,427 Views
Thank you Tim. I tried to change the order of loaded modules without results. I will ask to the system admin to install again both the ifort compiler and openmpi built with our current version.
0 Kudos
Reply