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

Linking errors Intel MPI Libraries

LPN2024
Beginner
790 Views

When I attempt to compile and link my Intel Fortran + Intel MPI + NAG library code, the process fails at the link step with several dozen error messages of the form:

 

ld: ${WORKDIR}/main.f90:143: undefined reference to `_PDBX_readMemory'

ld: ${WORKDIR}/main.f90:143: undefined reference to `__PDBX_isGuardedCall' 
ld: ${WORKDIR}/main.f90:143: undefined reference to `_PDBX_writeMemory'

 

Any idea how to fix this?

 

I am using the Intel HPC Toolkit with Ubuntu:

Ubuntu VERSION="20.04.6 LTS (Focal Fossa)"

ifort version: 2021.11.1 20231117 

 

Here is the command to compile:

mpiifort -o test.exe ${FLAGS} ${LIBS} tools.o main.o ${LINK}  

 

FLAGS = -fpp -cxxlib -align all -allow nofpp_comments -assume realloc_lhs \

                 -g -debug extended -gdwarf-2 -check bounds  -diag-disable=10448 \

                -debug parallel

LIBS =  -I/opt/intel/oneapi/mkl/2024.0/include \

               -I/NAG/nll6i293bl/lp64/include  \

              -I/NAG/nll6i293bl/lp64/nag_interface_blocks 

NAG_LINK = /NAG/nll6i293bl/lp64/lib/libnag_mkl.a -Wl, \

                     --start-group /NAG/nll6i293bl/mkl/lib/intel64/libmkl_intel_lp64.a \

                    /NAG/nll6i293bl/mkl/lib/intel64/libmkl_intel_thread.a \   

                    /NAG/nll6i293bl/mkl/lib/intel64/libmkl_core.a -Wl,--end-group \

                  -L/NAG/nll6i293bl/rtl/lib/intel64 \

                  -liomp5 -lpthread -lm -ldl -lstdc++ -shared-intel

 

 

0 Kudos
4 Replies
TobiasK
Moderator
737 Views

@LPN2024


you specify ${LINK} in your compilation command but only NAG_LINK is defined. What do you specify for $LINK?


0 Kudos
LPN2024
Beginner
732 Views

Sorry that was a typo:

LINK = ${NAG_LINK}

 

mpiifort -o test.exe ${FLAGS} ${LIBS} tools.o main.o ${LINK}  

 

FLAGS = -fpp -cxxlib -align all -allow nofpp_comments -assume realloc_lhs \

                 -g -debug extended -gdwarf-2 -check bounds  -diag-disable=10448 \

                -debug parallel

LIBS =  -I/opt/intel/oneapi/mkl/2024.0/include \

               -I/NAG/nll6i293bl/lp64/include  \

              -I/NAG/nll6i293bl/lp64/nag_interface_blocks 

LINK = /NAG/nll6i293bl/lp64/lib/libnag_mkl.a -Wl, \

                     --start-group /NAG/nll6i293bl/mkl/lib/intel64/libmkl_intel_lp64.a \

                    /NAG/nll6i293bl/mkl/lib/intel64/libmkl_intel_thread.a \   

                    /NAG/nll6i293bl/mkl/lib/intel64/libmkl_core.a -Wl,--end-group \

                  -L/NAG/nll6i293bl/rtl/lib/intel64 \

                  -liomp5 -lpthread -lm -ldl -lstdc++ -shared-intel

0 Kudos
TobiasK
Moderator
720 Views

@LPN2024

this seems to be a compiler problem. In the meantime, you can either remove -debug parallel or use ifx but without -gdwarf=2. Let me move to the Fortran forum and escalate to the developers.


0 Kudos
LPN2024
Beginner
662 Views

I removed the option: -debug parallel.

Without that option, the code compiles and links and I am able to run and debug my code.

 

I haven't tried the second suggestion yet but will do so.

 

Thank you.

0 Kudos
Reply