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

ifx: missing clang_rt.msan to link Fortran program in debug build type

MehdiChinoune
New Contributor I
1,618 Views

Since approximately 4 months my project started failing with debug build type:

[38/40] Linking Fortran shared library src/libtdcs_e_2e.so
FAILED: src/libtdcs_e_2e.so 
: && /opt/intel/oneapi/compiler/2023.2.1/linux/bin/ifx -fPIC -warn all -stand f18 -standard-semantics -xHost -g -check all -fpe-all=0 -traceback -ipo  -ipo -shared -nofor-main -Wl,-soname,libtdcs_e_2e.so -o src/libtdcs_e_2e.so src/CMakeFiles/tdcs_e_2e.dir/conhyp.F90.o src/CMakeFiles/tdcs_e_2e.dir/conhyp_h.F90.o src/CMakeFiles/tdcs_e_2e.dir/constants.F90.o src/CMakeFiles/tdcs_e_2e.dir/fdcs_e2e.F90.o src/CMakeFiles/tdcs_e_2e.dir/fdcs_e2e_h.F90.o src/CMakeFiles/tdcs_e_2e.dir/input.F90.o src/CMakeFiles/tdcs_e_2e.dir/input_h.F90.o src/CMakeFiles/tdcs_e_2e.dir/integration.F90.o src/CMakeFiles/tdcs_e_2e.dir/integration_h.F90.o src/CMakeFiles/tdcs_e_2e.dir/special_functions.F90.o src/CMakeFiles/tdcs_e_2e.dir/special_functions_h.F90.o src/CMakeFiles/tdcs_e_2e.dir/trigo.F90.o src/CMakeFiles/tdcs_e_2e.dir/trigo_h.F90.o src/CMakeFiles/tdcs_e_2e.dir/utils.F90.o src/CMakeFiles/tdcs_e_2e.dir/utils_h.F90.o   && :
ifx: warning #10182: disabling optimization; runtime debug checks enabled
ld: cannot find -lclang_rt.msan: No such file or directory

 

 

0 Kudos
1 Solution
Ron_Green
Moderator
1,220 Views

-check all,nouninit

does fix the problem, correct?

 

Unfortunately the memory sanitizer files needed by ifx were packaged with our C++ compiler.  If you install the dpc++/c++ compiler this will also fix the issue.

 

A point to keep in mind - if your application uses external libraries, like MKL or NetCDF, HDF5, Lapack, etc those libraries will have to be built with -check uninit or -fsanitize=memory with icx.  

 

Probably easier to disable uninit for now.  Even the 2024.0 version to be released soon has memory sanitizer problems.  We have a redesign going into 2024.1, but that release is in the first quarter of 2024.

 

These new technologies are painful.  but eventually we'll get it right.

 

 

View solution in original post

0 Kudos
12 Replies
Barbara_P_Intel
Employee
1,567 Views

"-check all" includes "-check uninit". WIth ifx 2023.2.x "-check uninit" is enabled for the first time. "-check uninit" did nothing in earlier versions.

Do you have the HPC Toolkit installed? The toolkit includes the msan (LLVM memory sanitizer) libraries you need. If not, do that and try again.

If you have the HPC Toolkit installed, please run "echo $LIBRARY_PATH" and report it here.

If you are blocked from developing, "-check all,nouninit" is a workaround for you while we determine what the issue is in your environment.

 

 

 

0 Kudos
MehdiChinoune
New Contributor I
1,555 Views

Yes, I am using HPC Toolkit through APT by installing

$ wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
            | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
$ echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
$ sudo apt update
$ sudo apt install --no-install-recommends -y intel-oneapi-compiler-fortran
$ source /opt/intel/oneapi/setvars.sh

echo $LIBRARY_PATH:

/opt/intel/oneapi/mpi/2021.10.0//libfabric/lib:/opt/intel/oneapi/mpi/2021.10.0//lib/release:/opt/intel/oneapi/mpi/2021.10.0//lib:/opt/intel/oneapi/compiler/2023.2.1/linux/compiler/lib/intel64_lin:/opt/intel/oneapi/compiler/2023.2.1/linux/lib

 

0 Kudos
Barbara_P_Intel
Employee
1,516 Views

Thanks for the information!

I checked with the compiler developer who works on the uninitialized variable feature. He suggests removing /opt/intel/oneapi/compiler/2023.2.1/linux/compiler/lib/intel64_lin from LIBRARY_PATH. There is a known issue that might be related to what you are seeing.

Please let me know how that works for you.

 

0 Kudos
MehdiChinoune
New Contributor I
1,484 Views

Removing /opt/intel/oneapi/compiler/2023.2.1/linux/compiler/lib/intel64_lin from LIBRARY_PATH (andLD_LIBRARY_PATH) doesn't fix the issue.

0 Kudos
Barbara_P_Intel
Employee
1,414 Views

Okay...

Can you please post a reproducer?

 

0 Kudos
MehdiChinoune
New Contributor I
1,406 Views
0 Kudos
Barbara_P_Intel
Employee
1,400 Views

What OS are you using?

 

0 Kudos
MehdiChinoune
New Contributor I
1,387 Views

Ubuntu 22.04 through GitHub Actions.

0 Kudos
Barbara_P_Intel
Employee
1,381 Views

Thank you for the OS info.

I should have been more specific. Do you have a minimal reproducer? For example, do you have the same linker problem with a "Hello World" program?



0 Kudos
MehdiChinoune
New Contributor I
1,372 Views

I will try to minimize it and post it later.

MehdiChinoune
New Contributor I
1,276 Views

A minimal reproducer:

main.f90

program test
  print*, "Hello"
end program

 

$ echo "${LIBRARY_PATH}"
/opt/intel/oneapi/mpi/2021.10.0//libfabric/lib:/opt/intel/oneapi/mpi/2021.10.0//lib/release:/opt/intel/oneapi/mpi/2021.10.0//lib:/opt/intel/oneapi/compiler/2023.2.1/linux/compiler/lib/intel64_lin:/opt/intel/oneapi/compiler/2023.2.1/linux/lib
$ LIBRARY_PATH="${LIBRARY_PATH/"/opt/intel/oneapi/compiler/2023.2.1/linux/compiler/lib/intel64
_lin"/}"
$ echo "${LIBRARY_PATH}"
/opt/intel/oneapi/mpi/2021.10.0//libfabric/lib:/opt/intel/oneapi/mpi/2021.10.0//lib/release:/opt/intel/oneapi/mpi/2021.10.0//lib::/opt/intel/oneapi/compiler/2023.2.1/linux/lib
$ ifx -check all  main.f90
ld: cannot find /opt/intel/oneapi/compiler/2023.2.1/linux/compiler/lib/intel64_lin/msan/for_main.o: No such file or directory
ld: cannot find -lclang_rt.msan: No such file or directory

 

0 Kudos
Ron_Green
Moderator
1,221 Views

-check all,nouninit

does fix the problem, correct?

 

Unfortunately the memory sanitizer files needed by ifx were packaged with our C++ compiler.  If you install the dpc++/c++ compiler this will also fix the issue.

 

A point to keep in mind - if your application uses external libraries, like MKL or NetCDF, HDF5, Lapack, etc those libraries will have to be built with -check uninit or -fsanitize=memory with icx.  

 

Probably easier to disable uninit for now.  Even the 2024.0 version to be released soon has memory sanitizer problems.  We have a redesign going into 2024.1, but that release is in the first quarter of 2024.

 

These new technologies are painful.  but eventually we'll get it right.

 

 

0 Kudos
Reply