Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Intel compiled undefined reference errors (i.e. mpi_reduce_)
From: Elken, Tom (tom.elken_at_[hidden])
Date: 2013-06-24 14:21:53


I saw a couple of issues noted below ...

Now I am still getting some undefined reference errors. Namely:
[root_at_odie 060911_rmc_eam_gr_vk_t4]# make
ifort -g -debug all -check all -implicitnone -warn all -o rmc_test ran2.o globals.o read_inputs.o model.o rmc_functions.o scattering_factors.o fem1.o gr.o eam.o rmc_v_1_0.o -L /export/apps/openmpi_intel_20130618/lib -lmpi
[Tom]
>From your makefile below, this compile command is generated by your DEBUG target. Fixes to the FC_DEBUG command noted below in your makefile...

ifort: warning #10182: disabling optimization; runtime debug checks enabled
fem1.o: In function `fem':
/state/partition1/home/jjmaldonis/Jinwoo/2011/060911_rmc_eam_gr_vk_t4/fem1.f90:583: undefined reference to `mpi_reduce_'
/state/partition1/home/jjmaldonis/Jinwoo/2011/060911_rmc_eam_gr_vk_t4/fem1.f90:584: undefined reference to `mpi_reduce_'
fem1.o: In function `fem_update':
[Tom] <snip>

The above undefined reference errors are my problem.

Below are my PATH and LD_LIBRARY_PATH variables, if they are of help.
echo $PATH
/usr/lib64/qt-3.3/bin:/state/partition1/apps/intel_20130618/composer_xe_2013.3.163/bin/intel64:/state/partition1/apps/intel_20130618/composer_xe_2013.3.163/mpirt/bin/intel64:/state/partition1/apps/intel_20130618/composer_xe_2013.3.163/bin/intel64:/state/partition1/apps/intel_20130618/composer_xe_2013.3.163/bin/intel64_mic:/state/partition1/apps/intel_20130618/composer_xe_2013.3.163/debugger/gui/intel64:/export/apps/intel_20130618/advisor_xe_2013/bin64:/export/apps/intel_20130618/inspector_xe_2013/bin64:/export/apps/intel_20130618/vtune_amplifier_xe_2013/bin64:/usr/local/bin:/bin:/usr/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/eclipse:/opt/ganglia/bin:/opt/ganglia/sbin:/usr/java/latest/bin:/opt/maven/bin:/export/apps/openmpi_intel_20130618/:/opt/pdsh/bin:/opt/rocks/bin:/opt/rocks/sbin:/opt/condor/bin:/opt/condor/sbin:/usr/local/samba/sbin:/opt/gridengine/bin/linux-x64:/export/apps/openmpi_intel_20130618/bin/:/usr/local/samba/sbin:/export/apps/openmpi_intel_20130618/bin/
[Tom]
You should try to get
/export/apps/openmpi_intel_20130618/bin
earlier in your path, ahead of this part:
/state/partition1/apps/intel_20130618/composer_xe_2013.3.163/mpirt/bin/intel64
which comes from the intel compilers 'compilervars.[c]sh' script and points to the Intel MPI run-time libraries (which you don't want, since you are using Open MPI).
Either that, or use a full path to your OpenMPI/Intel mpirun when you are ready to run the app., such as:
/export/apps/openmpi_intel_20130618/bin/mpirun .... ./rmc_test

[Tom] <snip>

Below I will paste my makefile, and attached are the compressed "./configure ..." and "make all install" command logs. Please let me know anything else that you need.

#
# default makefile for ifort compiler with more or less
# appropriate options for debugging and high performance
#

# application name
APP = rmc_test

# list of source files
SRC = ran2.f90 globals.f90 read_inputs.f90 model.f90 rmc_functions.f90 scattering_factors.f90 fem1.f90 gr.f90 eam.f90 rmc_v_1_0.f90

# list of object files
OBJ = ran2.o globals.o read_inputs.o model.o rmc_functions.o scattering_factors.o fem1.o gr.o eam.o rmc_v_1_0.o

# define libraries needed by the linker
LIBS = -L /export/apps/openmpi_intel_20130618/lib -lmpi
[Tom]
Make this blank, so you will depend on 'mpif90' to provide the linking information:
LIBS =

# -rpath /state/partition1/apps/intel_20130618/composer_xe_2013.3.163/compiler/lib/

# compiler options for debugging
FC_DEBUG = ifort -g -debug all -check all -implicitnone -warn all
[Tom] You should make this more like your FC_OPT definition, using mpif90 rather than ifort, such as:
FC_DEBUG = mpif90 -g -debug all -check all -implicitnone -warn all

[Tom] Cheers, Tom

# compiler options for optmized running
#FC_OPT = ifort -O3 -xO -ipo -no-prec-div -static
#FC_OPT = mpif90 -O3 -ipo -static
FC_OPT = mpif90 -O3

# build rules

.SUFFIXES: .f90 .o
.f90.o:
        ${FC_DEBUG} -c $<

debug: ${OBJ}
        ${FC_DEBUG} -o ${APP} ${OBJ} ${LIBS}

opt: ${SRC}
        ${FC_OPT} -o ${APP} ${SRC} ${LIBS}

clean:
        rm -f *.mod *.o ${APP}
        ln -s /export/apps/openmpi_intel_20130618/lib/mpi.mod ./mpi.mod