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

undefined reference to `for_ifcore_version'

Mohammed_A_5
Beginner
4,882 Views

Hi
I wanted to compile a code with MPICH 3.1 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.

and the .bashrc has the environment variables:

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

LD_LIBRARY_PATH="/home/mohammed/mpich3/bin:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH

and when I test the ifort and MPI I got :

:~$ which ifort
/opt/intel/compilers_and_libraries_2016.0.109/linux/bin/intel64/ifort
:~$ ifort -v
ifort version 16.0.0
:~$ which mpicc
/home/mohammed/mpich3/bin/mpicc
:~$ which mpiexec
/opt/intel/compilers_and_libraries_2016.0.109/linux/mpi/intel64/bin/mpiexec
any suggestions

 

 

thanks

 

 

0 Kudos
28 Replies
Kevin_D_Intel
Employee
3,813 Views

The error suggests libifcore was not found. This is very similar to this post, https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/590325 so it seems like an environment setting just not entirely correct.

As suggested in the other thread, did you verify mpif90 -V agrees with the version of ifort you noted?

Would you expect the mpiexec to resolve to the MPICH 3.1 version and not Intel MPI?

0 Kudos
Mohammed_A_5
Beginner
3,813 Views

What do you mean ( verify mpif90 -V agrees with the version of ifort you noted) ? is it a command? sorry I'm not professional

 

0 Kudos
Kevin_D_Intel
Employee
3,813 Views

If you are building an MPI Fortran application using mpich 3.1 then you would compile using mpif90 and not ifort. ifort itself does perform an MPI specific compilation/link; however, the mpif90 wrapper from mpich 3.1 is specifically geared to do that.

What is meant by verify the version is, these two commands should report the same version of ifort:

mpif90 –V
ifort -V

I do not have MPICH 3.1 installed so I have to use the -fc option to point to the expected compiler. It is my understanding that if your MPICH 3.1 was built specifically to use ifort (e.g. during configure one specifies F77=ifort FC=ifort) then it is not necessary to use the -fc option and the simple commands shown above should report the same ifort 16.0 version as are shown below.

$ mpif90 -fc=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.

$ 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.

 

0 Kudos
Mohammed_A_5
Beginner
3,813 Views

Hi Kevin

 

This is what I got from the commands that you suggest :

:~$ mpif90 -fc=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.

GNU ld (GNU Binutils for Ubuntu) 2.24
/opt/intel/compilers_and_libraries_2016.0.109/linux/compiler/lib/intel64_lin/for_main.o: In function `main':
for_main.c:(.text+0x2a): undefined reference to `MAIN__'
/opt/intel/compilers_and_libraries_2016.0.109/linux/compiler/lib/intel64/libifport.so.5: undefined reference to `for_ifcore_version'


:~$ 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.

any suggestions

 

Regards

0 Kudos
TimP
Honored Contributor III
3,813 Views

Apparently, mpif90 -fc=ifort -V is finding the right compiler, but is trying to link an application.  As no application is present (no Fortran PROGRAM unit), it's hard to guess whether the missing reference to libifcore indicates a problem with the library path settings.  If your mpif90 was not built against ifort, I don't know whether the -fc option is expected to yield correct library paths.

0 Kudos
Mohammed_A_5
Beginner
3,813 Views

Tim Prince wrote:

Apparently, mpif90 -fc=ifort -V is finding the right compiler, but is trying to link an application.  As no application is present (no Fortran PROGRAM unit), it's hard to guess whether the missing reference to libifcore indicates a problem with the library path settings.  If your mpif90 was not built against ifort, I don't know whether the -fc option is expected to yield correct library paths.

Hi Tim

I'm compiling this program:

mohammed@mohammed-Z9PA-U8-Series:~/bruno/3$ make
mpif90 -c -real-size 64 -O3 -openmp   module_vars.for
mpif90 -c -real-size 64 -O3 -openmp   module_multidata.for
mpif90 -c -real-size 64 -O3 -openmp   module_mpi.for
mpif90 -c -real-size 64 -O3 -openmp   module_vars_pt.for
mpif90 -c -real-size 64 -O3 -openmp   imb.for
mpif90 -c -real-size 64 -O3 -openmp   shapes.for
mpif90 -c -real-size 64 -O3 -openmp   fdstag.for
mpif90 -c -real-size 64 -O3 -openmp   initial.for
mpif90 -c -real-size 64 -O3 -openmp   init_particle.for
mpif90 -c -real-size 64 -O3 -openmp   localparameters.for
mpif90 -c -real-size 64 -O3 -openmp   alloc_dom.for
mpif90 -c -real-size 64 -O3 -openmp   post.for
mpif90 -c -real-size 64 -O3 -openmp   flosol.for
mpif90 -c -real-size 64 -O3 -openmp   checkdt.for
mpif90 -c -real-size 64 -O3 -openmp   bounds.for
mpif90 -c -real-size 64 -O3 -openmp   sipsol.for
mpif90 -c -real-size 64 -O3 -openmp   convection.for
mpif90 -c -real-size 64 -O3 -openmp   diffusion.for
mpif90 -c -real-size 64 -O3 -openmp   newsolv_mg.for
mpif90 -c -real-size 64 -O3 -openmp   mgsolver.for
mpif90 -c -real-size 64 -O3 -openmp   wall_function.for
mpif90 -c -real-size 64 -O3 -openmp   alloc_pt.for
mpif90 -c -real-size 64 -O3 -openmp   MPI_pt.for
mpif90 -c -real-size 64 -O3 -openmp   delta_func.for
mpif90 -c -real-size 64 -O3 -openmp   LPT.for
mpif90 -c -real-size 64 -O3 -openmp   timesig.for
mpif90 -c -real-size 64 -O3 -openmp   weno.for
mpif90 -c -real-size 64 -O3 -openmp   energy.for
mpif90 -c -real-size 64 -O3 -openmp   press.for
mpif90 -c -real-size 64 -O3 -openmp   roughness_function.for
mpif90 -c -real-size 64 -O3 -openmp   rungek.for
mpif90 -c -real-size 64 -O3 -openmp   averaging.for
mpif90 -c -real-size 64 -O3 -openmp   eddyvis_smag.for
mpif90 -c -real-size 64 -O3 -openmp   eddyvis_wale.for
mpif90 -c -real-size 64 -O3 -openmp   eddyvis_1eqn.for
mpif90 -c -real-size 64 -O3 -openmp   exchange_bc.for
mpif90 -c -real-size 64 -O3 -openmp   exchangep.for
mpif90 -c -real-size 64 -O3 -openmp   exchangepp.for
mpif90 -c -real-size 64 -O3 -openmp   exchangesca.for
mpif90 -c -real-size 64 -O3 -openmp   exchange.for
mpif90 -c -real-size 64 -O3 -openmp   exchangeu.for
mpif90 -c -real-size 64 -O3 -openmp   exchangev.for
mpif90 -c -real-size 64 -O3 -openmp   exchangew.for
mpif90 module_vars.o module_multidata.o module_mpi.o module_vars_pt.o imb.o shapes.o fdstag.o initial.o init_particle.o localparameters.o alloc_dom.o post.o flosol.o checkdt.o bounds.o sipsol.o convection.o diffusion.o newsolv_mg.o mgsolver.o wall_function.o alloc_pt.o MPI_pt.o delta_func.o LPT.o timesig.o weno.o energy.o press.o roughness_function.o rungek.o averaging.o eddyvis_smag.o eddyvis_wale.o eddyvis_1eqn.o exchange_bc.o exchangep.o exchangepp.o exchangesca.o exchange.o exchangeu.o exchangev.o exchangew.o -O3 -openmp -o 3dFDM.exe \
    
/opt/intel/compilers_and_libraries_2016.0.109/linux/compiler/lib/intel64/libifport.so.5: undefined reference to `for_ifcore_version'
make: *** [3dFDM.exe] Error 1


as you can see that the error in create the exe file.

Regards

0 Kudos
Kevin_D_Intel
Employee
3,813 Views

What is the output for this command: mpif90 -V

0 Kudos
Mohammed_A_5
Beginner
3,813 Views

Kevin Davis (Intel) wrote:

What is the output for this command: mpif90 -V

Hi Kevin

this is the output

:~$ mpif90 -v
mpifort for MPICH version 3.1.3
ifort version 16.0.0

 

 

Regards

 

0 Kudos
Kevin_D_Intel
Employee
3,813 Views

Thank you for the output. That’s what we hoped to see.

Next, in your makefile for the rule that is creating executable 3dFDM.exe, I would like you to add the option: -watch

After adding that, I’d like you to run make using this command:  make &> output.txt

That should capture output for just the final link. Please attached the output.txt file to your reply so we can see what library paths are used.

If you need/want help modifying the makefile then just attach that I will be happy to look at it.

0 Kudos
Mohammed_A_5
Beginner
3,813 Views

Kevin Davis (Intel) wrote:

Thank you for the output. That’s what we hoped to see.

Next, in your makefile for the rule that is creating executable 3dFDM.exe, I would like you to add the option: -watch

After adding that, I’d like you to run make using this command:  make &> output.txt

That should capture output for just the final link. Please attached the output.txt file to your reply so we can see what library paths are used.

If you need/want help modifying the makefile then just attach that I will be happy to look at it.

Hi

 

I attach what I get.

Regards

477943

0 Kudos
Kevin_D_Intel
Employee
3,813 Views

Did you add the -watch option?  I don't see evidence of that in the output.

0 Kudos
Mohammed_A_5
Beginner
3,813 Views

Kevin Davis (Intel) wrote:

Did you add the -watch option?  I don't see evidence of that in the output.

 

 

yes I did and here is the line of code

clean:
    rm -rfv *.o *.mod -watch 3dFDM_LPT.exe

 

regards

0 Kudos
Kevin_D_Intel
Employee
3,813 Views

That is the clean target and not what I was referring to. You can remove -watch from there. Perhaps it will be easier to illustrate the change I'd like if you will attach your makefile.

0 Kudos
Mohammed_A_5
Beginner
3,813 Views

Kevin Davis (Intel) wrote:

That is the clean target and not what I was referring to. You can remove -watch from there. Perhaps it will be easier to illustrate the change I'd like if you will attach your makefile.

Thank you very much for your time  Kevin

this is a copy of my make file and  I put it like txt file so I can upload it

Regards

477994

0 Kudos
Mohammed_A_5
Beginner
3,813 Views

Kevin Davis (Intel) wrote:

That is the clean target and not what I was referring to. You can remove -watch from there. Perhaps it will be easier to illustrate the change I'd like if you will attach your makefile.

That is a new make command

478045

0 Kudos
Kevin_D_Intel
Employee
3,813 Views

Ok, you have it on the correct make target rule but there is a space between the "-" (hyphen) and watch. Remove that space and redo the make.

0 Kudos
Mohammed_A_5
Beginner
3,813 Views

Kevin Davis (Intel) wrote:

Ok, you have it on the correct make target rule but there is a space between the "-" (hyphen) and watch. Remove that space and redo the make.

Hi

Here is the output file it has lots of things!!!!!!

478057

Regards

0 Kudos
Kevin_D_Intel
Employee
3,813 Views

This snippet shows the culprit. The link pulls in 2015.1.133 (i.e. 15.0) libraries ahead of the 2016.0.109 (i.e. 16.0) libraries.

    -L/opt/intel/composer_xe_2015.1.133/compiler/lib/intel64 \
    -L/opt/intel/composer_xe_2015.1.133/ipp/../compiler/lib/intel64 \
    -L/opt/intel/composer_xe_2015.1.133/ipp/lib/intel64 \
    -L/opt/intel/composer_xe_2015.1.133/compiler/lib/intel64 \
    -L/opt/intel/composer_xe_2015.1.133/mkl/lib/intel64 \
    -L/opt/intel/composer_xe_2015.1.133/tbb/lib/intel64/gcc4.4 \
    -L/opt/intel/compilers_and_libraries_2016.0.109/linux/compiler/lib/intel64_lin \

This finding takes us back to looking at your environment and the steps taken to set it up before building this app.

Let's start with having you please execute the following command and attach the output.txt file to your reply:    env &> output.txt

0 Kudos
Mohammed_A_5
Beginner
3,813 Views

Kevin Davis (Intel) wrote:

This snippet shows the culprit. The link pulls in 2015.1.133 (i.e. 15.0) libraries ahead of the 2016.0.109 (i.e. 16.0) libraries.

    -L/opt/intel/composer_xe_2015.1.133/compiler/lib/intel64 \
    -L/opt/intel/composer_xe_2015.1.133/ipp/../compiler/lib/intel64 \
    -L/opt/intel/composer_xe_2015.1.133/ipp/lib/intel64 \
    -L/opt/intel/composer_xe_2015.1.133/compiler/lib/intel64 \
    -L/opt/intel/composer_xe_2015.1.133/mkl/lib/intel64 \
    -L/opt/intel/composer_xe_2015.1.133/tbb/lib/intel64/gcc4.4 \
    -L/opt/intel/compilers_and_libraries_2016.0.109/linux/compiler/lib/intel64_lin \

This finding takes us back to looking at your environment and the steps taken to set it up before building this app.

Let's start with having you please execute the following command and attach the output.txt file to your reply:    env &> output.txt

 

Hi

 

this is the output file

478073

478073

0 Kudos
Kevin_D_Intel
Employee
3,592 Views

Ok, thank you. The key environment variable settings include paths to both the 2015 and 2016 products on your system. As a first step, we need to setup your environment to use the 2016 product exclusively. Going back to your original post, you indicate having the compilervars.sh in your .bashrc.

Given that, please start a new login session and check the PATH variable using the command: echo $PATH

You do not want to see any reference to 2015.1.133 in the output of that command.

If you do then you have to track down where on your system something is sourcing the 2015 setup script. I could be compilervars.sh or ifortvars.sh and referenced from /opt/intel/composer_xe_2015/bin. If it happens after you login then its happening as part of the login process so you might look at your .bashrc and .bash_profile perhaps.

If there is no evidence of 2015.1.133, then follow your other steps to setup your environment you indicated were needed to use your MPICH 3.1. After that setup is complete, remove the -watch option we added to the makefile, do a clean (‘make clean’ - or whatever this app requires), then run the make. Hopefully the build will succeed.

0 Kudos
Reply