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

After upgrading, ifort no longer finds include dir for OpenMP

frx
Novice
975 Views

Hello,

after upgrading to:

$ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.12.0 Build 20240211_000000
Copyright (C) 1985-2024 Intel Corporation.  All rights reserved.

ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '-diag-disable=10448' to disable this message.

I found out that ifort is no longer able to find the include directory for OpenMP.

 

Let's see a minimal example.

 

Consider the following source file ('test.f90'):

module test

contains

subroutine do_something

use omp_lib

write(*,*) 'Now: ', omp_get_wtime()

end subroutine do_something

end module test

If I attempt to compile it, I get the following error:

$ ifort -qopenmp -c test.f90
ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '-diag-disable=10448' to disable this message.
test.f90(7): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [OMP_LIB]
use omp_lib
----^
compilation aborted for test.f90 (code 1)
$ ls
test.f90

 On the other hand, if I explicitly add a directory to the include path, ifort compiles the module successfully:

$ ifort -qopenmp -I/opt/intel/oneapi/compiler/2024.1/opt/compiler/include/intel64/ -c test.f90
ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '-diag-disable=10448' to disable this message.
$ ls
test.f90  test.mod  test.o

 

 

Until this last upgrade, there has never been any need to explicitly add this -I option. to tell the compiler where it can find 'omp_lib.mod'.

This looks like a regression.

0 Kudos
1 Solution
Mark_Lewy
Valued Contributor I
689 Views

@Ron_Green It was the OP, @frx,  who was using a custom config file, I just have source /opt/intel/oneapi/setvars.sh in my ~/.bashrc.

 

From my POV, this isn't a major issue, as we have switched to using IFX for development & production.  I encountered the compilation error with IFORT on a local build of an old branch - easily resolved by building it with our ADO pipeline instead which is using IFORT 2021.11.

 

View solution in original post

18 Replies
Ron_Green
Moderator
957 Views

How do you set your environment? 

source /opt/intel/oneapi/setvars.sh 

or

source /opt/itnel/oneapi/compiler/2024.1/env/vars.sh

or 

do you use Environment Modules or similar env utility?

 

For the case you show, dump all the defines and paths in your compilation with option -#

ifort -qopenmp -c -# test.f90

 

 

 

0 Kudos
frx
Novice
792 Views

Hello Ron, thanks for following up.

I set my environment with:

. /opt/intel/oneapi/setvars.sh --config=~/.config/oneapi.conf

where:

$ cat ~/.config/oneapi.conf
default=exclude
compiler=2024.1
debugger=2024.1

I tried to dump the defines and paths, as you requested:

$ ifort -qopenmp -c -# test.f90 2> define_dump.out

The result is:

ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '-diag-disable=10448' to disable this message.
/opt/intel/oneapi/compiler/2024.1/bin/../bin/fortcom  \
    -D__INTEL_COMPILER=2021 \
    -D__INTEL_COMPILER_UPDATE=0 \
    -D__unix__ \
    -D__unix \
    -D__linux__ \
    -D__linux \
    -D__gnu_linux__ \
    -Dunix \
    -Dlinux \
    -D__ELF__ \
    -D__x86_64 \
    -D__x86_64__ \
    -D__amd64 \
    -D__amd64__ \
    -D__INTEL_COMPILER_BUILD_DATE=20240211 \
    -D_OPENMP=201611 \
    -D__INTEL_OFFLOAD \
    -D__MMX__ \
    -D__SSE__ \
    -D__SSE_MATH__ \
    -D__SSE2__ \
    -D__SSE2_MATH__ \
    -D__pentium4 \
    -D__pentium4__ \
    -D__tune_pentium4__ \
    -I. \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../opt/compiler/include \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../opt/compiler/include/icc \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../opt/compiler/include \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../include \
    -I/usr/local/include \
    -I/usr/lib/gcc/x86_64-linux-gnu/6/include \
    -I/usr/lib/gcc/x86_64-linux-gnu/6/include-fixed \
    -I/usr/include/ \
    -I/usr/include \
    -I/usr/include/x86_64-linux-gnu \
    -automatic \
    -omp \
    -omp_simd \
    -O2 \
    "-reentrancy threaded" \
    -simd \
    -offload_host \
    -mGLOB_em64t=TRUE \
    -mP1OPT_version=2021.12.0-intel64 \
    -mGLOB_diag_file=test.diag \
    -mGLOB_long_size_64 \
    -mGLOB_routine_pointer_size_64 \
    -mGLOB_source_language=GLOB_SOURCE_LANGUAGE_F90 \
    -mP2OPT_static_promotion \
    -mGLOB_pack_sort_init_list \
    -mP1OPT_print_version=FALSE \
    -mCG_use_gas_got_workaround=F \
    -mP2OPT_align_option_used=TRUE \
    -mGLOB_gcc_version=630 \
    "-mGLOB_options_string=-qopenmp -c -# " \
    -mGLOB_cxx_limited_range=FALSE \
    -mCG_extend_parms=FALSE \
    -mGLOB_compiler_bin_directory=/opt/intel/oneapi/compiler/2024.1/bin/../bin \
    -mGLOB_as_output_backup_file_name=/tmp/ifortxdWZojas_.s \
    -mIPOPT_activate \
    -mIPOPT_lite \
    -mGLOB_uarch_tuning=0x0 \
    -mGLOB_product_id_code=0x22006d91 \
    -mCG_bnl_movbe=T \
    -mP3OPT_use_mspp_call_convention \
    -mP2OPT_subs_out_of_bound=FALSE \
    -mP2OPT_disam_type_based_disam=2 \
    -mGLOB_ansi_alias \
    -mPGOPTI_value_profile_use=T \
    -mPAROPT_openmp=TRUE \
    -mP2OPT_hpo_omp_simd_only=FALSE \
    -mGLOB_offload_mode=1 \
    -mGLOB_offload_no_openmp=TRUE \
    -mP2OPT_offload_unique_var_string=ifort14721215553pBDSy \
    -mP2OPT_hlo_level=2 \
    -mP2OPT_hlo \
    -mP2OPT_hpo_rtt_control=0 \
    -mIPOPT_args_in_regs=0 \
    -mP2OPT_disam_assume_nonstd_intent_in=FALSE \
    -mGLOB_imf_mapping_library=/opt/intel/oneapi/compiler/2024.1/bin/../bin/libiml_attr.so \
    -mPGOPTI_gen_threadsafe_level=0 \
    -mIPOPT_lto_object_enabled \
    -mIPOPT_lto_object_value=1 \
    -mIPOPT_obj_output_file_name=test.o \
    -mIPOPT_whole_archive_fixup_file_name=/tmp/ifortwarch9qX6Lt \
    -mGLOB_linker_version=2.28 \
    -mGLOB_linker=ld \
    -mGLOB_driver_tempfile_name=/tmp/iforttempfilehkaZX3 \
    -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS \
    -mGLOB_async_unwind_tables=TRUE \
    -mGLOB_obj_output_file=test.o \
    -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_FORTRAN \
    -mP1OPT_source_file_name=test.f90 \
    -mP1OPT_full_source_file_name=/home/${USER}/INTEL_TEST/test.f90 \
    -mP2OPT_symtab_type_copy=true \
    test.f90

rm /tmp/ifortdashvKyxazo
rm /tmp/ifortdummycrF8HY.c
rm /tmp/ifortsearchdirslt5b38
rm /tmp/ifortxdWZojas_.s
rm /tmp/ifortldashvFsHfAT
rm /tmp/iforttempfilehkaZX3
rm /tmp/ifortargTOAW9D

 If I dump the same output with a previous version of the oneAPI compiler (version 2024.0), the result is very similar, but the important difference seems to be the location where file 'omp_lib.mod' lives:

$ ls -altrF /opt/intel/oneapi/compiler/2024.0/opt/compiler/include/omp_lib.mod 
-rw-r--r-- 1 root root 100618 Oct 10  2023 /opt/intel/oneapi/compiler/2024.0/opt/compiler/include/omp_lib.mod
$ ls -altrF /opt/intel/oneapi/compiler/2024.1/opt/compiler/include/intel64/omp_lib.mod
-rw-r--r-- 1 root root 108378 May  8 21:49 /opt/intel/oneapi/compiler/2024.1/opt/compiler/include/intel64/omp_lib.mod
$ ls -altrF /opt/intel/oneapi/compiler/2024.1/opt/compiler/include/omp_lib.mod
ls: cannot access '/opt/intel/oneapi/compiler/2024.1/opt/compiler/include/omp_lib.mod': No such file or directory

 

It seems to me that the location of file 'omp_lib.mod' has been moved, without changing the implicit include paths...

Or am I completely off-track?

 

0 Kudos
frx
Novice
790 Views

Hi Ron, thanks for following up.

I set my environment with:

. /opt/intel/oneapi/setvars.sh --config=~/.config/oneapi.conf

where:

$ cat ~/.config/oneapi.conf
default=exclude
compiler=2024.1
debugger=2024.1

I tried to dump the defines and paths, as you suggested:

$ ifort -qopenmp -c -# test.f90 2> define_dump.out

The resulting file is:

ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '-diag-disable=10448' to disable this message.
/opt/intel/oneapi/compiler/2024.1/bin/../bin/fortcom  \
    -D__INTEL_COMPILER=2021 \
    -D__INTEL_COMPILER_UPDATE=0 \
    -D__unix__ \
    -D__unix \
    -D__linux__ \
    -D__linux \
    -D__gnu_linux__ \
    -Dunix \
    -Dlinux \
    -D__ELF__ \
    -D__x86_64 \
    -D__x86_64__ \
    -D__amd64 \
    -D__amd64__ \
    -D__INTEL_COMPILER_BUILD_DATE=20240211 \
    -D_OPENMP=201611 \
    -D__INTEL_OFFLOAD \
    -D__MMX__ \
    -D__SSE__ \
    -D__SSE_MATH__ \
    -D__SSE2__ \
    -D__SSE2_MATH__ \
    -D__pentium4 \
    -D__pentium4__ \
    -D__tune_pentium4__ \
    -I. \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../opt/compiler/include \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../opt/compiler/include/icc \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../opt/compiler/include \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../include \
    -I/usr/local/include \
    -I/usr/lib/gcc/x86_64-linux-gnu/6/include \
    -I/usr/lib/gcc/x86_64-linux-gnu/6/include-fixed \
    -I/usr/include/ \
    -I/usr/include \
    -I/usr/include/x86_64-linux-gnu \
    -automatic \
    -omp \
    -omp_simd \
    -O2 \
    "-reentrancy threaded" \
    -simd \
    -offload_host \
    -mGLOB_em64t=TRUE \
    -mP1OPT_version=2021.12.0-intel64 \
    -mGLOB_diag_file=test.diag \
    -mGLOB_long_size_64 \
    -mGLOB_routine_pointer_size_64 \
    -mGLOB_source_language=GLOB_SOURCE_LANGUAGE_F90 \
    -mP2OPT_static_promotion \
    -mGLOB_pack_sort_init_list \
    -mP1OPT_print_version=FALSE \
    -mCG_use_gas_got_workaround=F \
    -mP2OPT_align_option_used=TRUE \
    -mGLOB_gcc_version=630 \
    "-mGLOB_options_string=-qopenmp -c -# " \
    -mGLOB_cxx_limited_range=FALSE \
    -mCG_extend_parms=FALSE \
    -mGLOB_compiler_bin_directory=/opt/intel/oneapi/compiler/2024.1/bin/../bin \
    -mGLOB_as_output_backup_file_name=/tmp/ifortxdWZojas_.s \
    -mIPOPT_activate \
    -mIPOPT_lite \
    -mGLOB_uarch_tuning=0x0 \
    -mGLOB_product_id_code=0x22006d91 \
    -mCG_bnl_movbe=T \
    -mP3OPT_use_mspp_call_convention \
    -mP2OPT_subs_out_of_bound=FALSE \
    -mP2OPT_disam_type_based_disam=2 \
    -mGLOB_ansi_alias \
    -mPGOPTI_value_profile_use=T \
    -mPAROPT_openmp=TRUE \
    -mP2OPT_hpo_omp_simd_only=FALSE \
    -mGLOB_offload_mode=1 \
    -mGLOB_offload_no_openmp=TRUE \
    -mP2OPT_offload_unique_var_string=ifort14721215553pBDSy \
    -mP2OPT_hlo_level=2 \
    -mP2OPT_hlo \
    -mP2OPT_hpo_rtt_control=0 \
    -mIPOPT_args_in_regs=0 \
    -mP2OPT_disam_assume_nonstd_intent_in=FALSE \
    -mGLOB_imf_mapping_library=/opt/intel/oneapi/compiler/2024.1/bin/../bin/libiml_attr.so \
    -mPGOPTI_gen_threadsafe_level=0 \
    -mIPOPT_lto_object_enabled \
    -mIPOPT_lto_object_value=1 \
    -mIPOPT_obj_output_file_name=test.o \
    -mIPOPT_whole_archive_fixup_file_name=/tmp/ifortwarch9qX6Lt \
    -mGLOB_linker_version=2.28 \
    -mGLOB_linker=ld \
    -mGLOB_driver_tempfile_name=/tmp/iforttempfilehkaZX3 \
    -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS \
    -mGLOB_async_unwind_tables=TRUE \
    -mGLOB_obj_output_file=test.o \
    -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_FORTRAN \
    -mP1OPT_source_file_name=test.f90 \
    -mP1OPT_full_source_file_name=/home/${USER}/INTEL_TEST/test.f90 \
    -mP2OPT_symtab_type_copy=true \
    test.f90

rm /tmp/ifortdashvKyxazo
rm /tmp/ifortdummycrF8HY.c
rm /tmp/ifortsearchdirslt5b38
rm /tmp/ifortxdWZojas_.s
rm /tmp/ifortldashvFsHfAT
rm /tmp/iforttempfilehkaZX3
rm /tmp/ifortargTOAW9D

With an older version of the oneAPI ifort compiler (2024.0) the result is similar, but the difference seems to be the location where file 'omp_lib.mod' lives:

$ ls -altrF /opt/intel/oneapi/compiler/2024.0/opt/compiler/include/omp_lib.mod 
-rw-r--r-- 1 root root 100618 Oct 10  2023 /opt/intel/oneapi/compiler/2024.0/opt/compiler/include/omp_lib.mod
$ ls -altrF /opt/intel/oneapi/compiler/2024.1/opt/compiler/include/omp_lib.mod
ls: cannot access '/opt/intel/oneapi/compiler/2024.1/opt/compiler/include/omp_lib.mod': No such file or directory
$ ls -altrF /opt/intel/oneapi/compiler/2024.1/opt/compiler/include/intel64/omp_lib.mod
-rw-r--r-- 1 root root 108378 May  8 21:49 /opt/intel/oneapi/compiler/2024.1/opt/compiler/include/intel64/omp_lib.mod

It seems to me that the location of that .mod file was changes, without updating the implicit include paths.

Or am I completely off-track?

 

0 Kudos
frx
Novice
840 Views

Hi Ron, thanks for following up.

I set my environment with:

. /opt/intel/oneapi/setvars.sh --config=~/.config/oneapi.conf

where:

$ cat ~/.config/oneapi.conf
default=exclude
compiler=2024.1
debugger=2024.1
0 Kudos
frx
Novice
788 Views

I tried to dump the defines and paths, as you suggested:

$ ifort -qopenmp -c -# test.f90 2> define_dump.out

The resulting file is:

ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '-diag-disable=10448' to disable this message.
/opt/intel/oneapi/compiler/2024.1/bin/../bin/fortcom  \
    -D__INTEL_COMPILER=2021 \
    -D__INTEL_COMPILER_UPDATE=0 \
    -D__unix__ \
    -D__unix \
    -D__linux__ \
    -D__linux \
    -D__gnu_linux__ \
    -Dunix \
    -Dlinux \
    -D__ELF__ \
    -D__x86_64 \
    -D__x86_64__ \
    -D__amd64 \
    -D__amd64__ \
    -D__INTEL_COMPILER_BUILD_DATE=20240211 \
    -D_OPENMP=201611 \
    -D__INTEL_OFFLOAD \
    -D__MMX__ \
    -D__SSE__ \
    -D__SSE_MATH__ \
    -D__SSE2__ \
    -D__SSE2_MATH__ \
    -D__pentium4 \
    -D__pentium4__ \
    -D__tune_pentium4__ \
    -I. \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../opt/compiler/include \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../opt/compiler/include/icc \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../opt/compiler/include \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../include \
    -I/usr/local/include \
    -I/usr/lib/gcc/x86_64-linux-gnu/6/include \
    -I/usr/lib/gcc/x86_64-linux-gnu/6/include-fixed \
    -I/usr/include/ \
    -I/usr/include \
    -I/usr/include/x86_64-linux-gnu \
    -automatic \
    -omp \
    -omp_simd \
    -O2 \
    "-reentrancy threaded" \
    -simd \
    -offload_host \
    -mGLOB_em64t=TRUE \
    -mP1OPT_version=2021.12.0-intel64 \
    -mGLOB_diag_file=test.diag \
    -mGLOB_long_size_64 \
    -mGLOB_routine_pointer_size_64 \
    -mGLOB_source_language=GLOB_SOURCE_LANGUAGE_F90 \
    -mP2OPT_static_promotion \
    -mGLOB_pack_sort_init_list \
    -mP1OPT_print_version=FALSE \
    -mCG_use_gas_got_workaround=F \
    -mP2OPT_align_option_used=TRUE \
    -mGLOB_gcc_version=630 \
    "-mGLOB_options_string=-qopenmp -c -# " \
    -mGLOB_cxx_limited_range=FALSE \
    -mCG_extend_parms=FALSE \
    -mGLOB_compiler_bin_directory=/opt/intel/oneapi/compiler/2024.1/bin/../bin \
    -mGLOB_as_output_backup_file_name=/tmp/ifortxdWZojas_.s \
    -mIPOPT_activate \
    -mIPOPT_lite \
    -mGLOB_uarch_tuning=0x0 \
    -mGLOB_product_id_code=0x22006d91 \
    -mCG_bnl_movbe=T \
    -mP3OPT_use_mspp_call_convention \
    -mP2OPT_subs_out_of_bound=FALSE \
    -mP2OPT_disam_type_based_disam=2 \
    -mGLOB_ansi_alias \
    -mPGOPTI_value_profile_use=T \
    -mPAROPT_openmp=TRUE \
    -mP2OPT_hpo_omp_simd_only=FALSE \
    -mGLOB_offload_mode=1 \
    -mGLOB_offload_no_openmp=TRUE \
    -mP2OPT_offload_unique_var_string=ifort14721215553pBDSy \
    -mP2OPT_hlo_level=2 \
    -mP2OPT_hlo \
    -mP2OPT_hpo_rtt_control=0 \
    -mIPOPT_args_in_regs=0 \
    -mP2OPT_disam_assume_nonstd_intent_in=FALSE \
    -mGLOB_imf_mapping_library=/opt/intel/oneapi/compiler/2024.1/bin/../bin/libiml_attr.so \
    -mPGOPTI_gen_threadsafe_level=0 \
    -mIPOPT_lto_object_enabled \
    -mIPOPT_lto_object_value=1 \
    -mIPOPT_obj_output_file_name=test.o \
    -mIPOPT_whole_archive_fixup_file_name=/tmp/ifortwarch9qX6Lt \
    -mGLOB_linker_version=2.28 \
    -mGLOB_linker=ld \
    -mGLOB_driver_tempfile_name=/tmp/iforttempfilehkaZX3 \
    -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS \
    -mGLOB_async_unwind_tables=TRUE \
    -mGLOB_obj_output_file=test.o \
    -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_FORTRAN \
    -mP1OPT_source_file_name=test.f90 \
    -mP1OPT_full_source_file_name=/home/${USER}/INTEL_TEST/test.f90 \
    -mP2OPT_symtab_type_copy=true \
    test.f90

rm /tmp/ifortdashvKyxazo
rm /tmp/ifortdummycrF8HY.c
rm /tmp/ifortsearchdirslt5b38
rm /tmp/ifortxdWZojas_.s
rm /tmp/ifortldashvFsHfAT
rm /tmp/iforttempfilehkaZX3
rm /tmp/ifortargTOAW9D

With an older version of the oneAPI ifort compiler (2024.0) the result is similar, but the difference seems to be the location where file 'omp_lib.mod' lives:

$ ls -altrF /opt/intel/oneapi/compiler/2024.0/opt/compiler/include/omp_lib.mod
-rw-r--r-- 1 root root 100618 Oct 10  2023 /opt/intel/oneapi/compiler/2024.0/opt/compiler/include/omp_lib.mod
$ ls -altrF /opt/intel/oneapi/compiler/2024.1/opt/compiler/include/omp_lib.mod
ls: cannot access '/opt/intel/oneapi/compiler/2024.1/opt/compiler/include/omp_lib.mod': No such file or directory
$ ls -altrF /opt/intel/oneapi/compiler/2024.1/opt/compiler/include/intel64/omp_lib.mod
-rw-r--r-- 1 root root 108378 May  8 21:49 /opt/intel/oneapi/compiler/2024.1/opt/compiler/include/intel64/omp_lib.mod

It seems to me that the location of that .mod file was changes, without updating the implicit include paths.

Or am I completely off-track?

0 Kudos
frx
Novice
832 Views

This forum does not allow me to reply as I wish: three previous
attempts to follow up were silently dropped...

Let's try with a shorter answer.

I tried to dump the defines and paths, as you suggested:

$ ifort -qopenmp -c -# test.f90 2> define_dump.out
$ grep include define_dump.out
    -I/opt/intel/oneapi/compiler/2024.1/bin/../opt/compiler/include \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../opt/compiler/include/icc \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../opt/compiler/include \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../include \
    -I/usr/local/include \
    -I/usr/lib/gcc/x86_64-linux-gnu/6/include \
    -I/usr/lib/gcc/x86_64-linux-gnu/6/include-fixed \
    -I/usr/include/ \
    -I/usr/include \
    -I/usr/include/x86_64-linux-gnu \

With an older version of the oneAPI ifort compiler (2024.0) the result is similar, but the difference seems to be the location where file 'omp_lib.mod' lives:

$ ls -altrF /opt/intel/oneapi/compiler/2024.0/opt/compiler/include/omp_lib.mod 
-rw-r--r-- 1 root root 100618 Oct 10  2023 /opt/intel/oneapi/compiler/2024.0/opt/compiler/include/omp_lib.mod
$ ls -altrF /opt/intel/oneapi/compiler/2024.1/opt/compiler/include/omp_lib.mod
ls: cannot access '/opt/intel/oneapi/compiler/2024.1/opt/compiler/include/omp_lib.mod': No such file or directory
$ ls -altrF /opt/intel/oneapi/compiler/2024.1/opt/compiler/include/intel64/omp_lib.mod
-rw-r--r-- 1 root root 108378 May  8 21:49 /opt/intel/oneapi/compiler/2024.1/opt/compiler/include/intel64/omp_lib.mod

It seems to me that the location of that .mod file was changed, without updating the implicit include paths.

Or am I completely off-track?

0 Kudos
Mark_Lewy
Valued Contributor I
787 Views

I also noticed that ifort 2021.12 couldn't open omp_lib on Ubuntu 22.04 LTS (wsl) after upgrading OneAPI HPC with apt.

My .bashrc has "source /opt/intel/oneapi/setvars.sh" in it and the instance has been restarted since the install.

Output from "ifort -qopenmp -c -# omp.f90", where omp.f90 is the same module as test.f90 from the OP:

 

ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '-diag-disable=10448' to disable this message.
/opt/intel/oneapi/compiler/2024.1/bin/../bin/fortcom  \
    -D__INTEL_COMPILER=2021 \
    -D__INTEL_COMPILER_UPDATE=0 \
    -D__unix__ \
    -D__unix \
    -D__linux__ \
    -D__linux \
    -D__gnu_linux__ \
    -Dunix \
    -Dlinux \
    -D__ELF__ \
    -D__x86_64 \
    -D__x86_64__ \
    -D__amd64 \
    -D__amd64__ \
    -D__INTEL_COMPILER_BUILD_DATE=20240211 \
    -D_OPENMP=201611 \
    -D__INTEL_OFFLOAD \
    -D__MMX__ \
    -D__SSE__ \
    -D__SSE_MATH__ \
    -D__SSE2__ \
    -D__SSE2_MATH__ \
    -D__pentium4 \
    -D__pentium4__ \
    -D__tune_pentium4__ \
    -I. \
    -I/opt/intel/oneapi/tbb/2021.12/env/../include \
    -I/opt/intel/oneapi/mpi/2021.12/include \
    -I/opt/intel/oneapi/mkl/2024.1/include \
    -I/opt/intel/oneapi/ippcp/2021.11/include \
    -I/opt/intel/oneapi/ipp/2021.11/include \
    -I/opt/intel/oneapi/dpl/2022.5/include \
    -I/opt/intel/oneapi/dpcpp-ct/2024.1/include \
    -I/opt/intel/oneapi/dnnl/2024.1/include \
    -I/opt/intel/oneapi/dev-utilities/2024.1/include \
    -I/opt/intel/oneapi/dal/2024.2/include/dal \
    -I/opt/intel/oneapi/compiler/2024.1/opt/oclfpga/include \
    -I/opt/intel/oneapi/ccl/2021.12/include \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../opt/compiler/include \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../opt/compiler/include/icc \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../opt/compiler/include \
    -I/opt/intel/oneapi/compiler/2024.1/bin/../include \
    -I/usr/local/include \
    -I/usr/lib/gcc/x86_64-linux-gnu/11/include \
    -I/usr/include/ \
    -I/usr/include \
    -I/usr/include/x86_64-linux-gnu \
    -automatic \
    -omp \
    -omp_simd \
    -O2 \
    "-reentrancy threaded" \
    -simd \
    -offload_host \
    -mGLOB_em64t=TRUE \
    -mP1OPT_version=2021.12.0-intel64 \
    -mGLOB_diag_file=omp.diag \
    -mGLOB_long_size_64 \
    -mGLOB_routine_pointer_size_64 \
    -mGLOB_source_language=GLOB_SOURCE_LANGUAGE_F90 \
    -mP2OPT_static_promotion \
    -mGLOB_pack_sort_init_list \
    -mP1OPT_print_version=FALSE \
    -mCG_use_gas_got_workaround=F \
    -mP2OPT_align_option_used=TRUE \
    -mGLOB_gcc_version=1140 \
    "-mGLOB_options_string=-qopenmp -c -# " \
    -mGLOB_cxx_limited_range=FALSE \
    -mCG_extend_parms=FALSE \
    -mGLOB_compiler_bin_directory=/opt/intel/oneapi/compiler/2024.1/bin/../bin \
    -mGLOB_as_output_backup_file_name=/tmp/ifortKoMrMbas_.s \
    -mIPOPT_activate \
    -mIPOPT_lite \
    -mGLOB_uarch_tuning=0x0 \
    -mGLOB_product_id_code=0x22006d91 \
    -mCG_bnl_movbe=T \
    -mP3OPT_use_mspp_call_convention \
    -mP2OPT_subs_out_of_bound=FALSE \
    -mP2OPT_disam_type_based_disam=2 \
    -mGLOB_ansi_alias \
    -mPGOPTI_value_profile_use=T \
    -mPAROPT_openmp=TRUE \
    -mP2OPT_hpo_omp_simd_only=FALSE \
    -mGLOB_offload_mode=1 \
    -mGLOB_offload_no_openmp=TRUE \
    -mP2OPT_offload_unique_var_string=ifort0286250303y2Gwbl \
    -mP2OPT_hlo_level=2 \
    -mP2OPT_hlo \
    -mP2OPT_hpo_rtt_control=0 \
    -mIPOPT_args_in_regs=0 \
    -mP2OPT_disam_assume_nonstd_intent_in=FALSE \
    -mGLOB_imf_mapping_library=/opt/intel/oneapi/compiler/2024.1/bin/../bin/libiml_attr.so \
    -mPGOPTI_gen_threadsafe_level=0 \
    -mIPOPT_lto_object_enabled \
    -mIPOPT_lto_object_value=1 \
    -mIPOPT_obj_output_file_name=omp.o \
    -mIPOPT_whole_archive_fixup_file_name=/tmp/ifortwarchja0ese \
    -mGLOB_linker_version=2.38 \
    -mGLOB_linker=ld \
    -mGLOB_driver_tempfile_name=/tmp/iforttempfile8Rf2s5 \
    -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS \
    -mGLOB_async_unwind_tables=TRUE \
    -mGLOB_obj_output_file=omp.o \
    -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_FORTRAN \
    -mP1OPT_source_file_name=omp.f90 \
    -mP1OPT_full_source_file_name=/home/lewym/intel/src/omp.f90 \
    -mP2OPT_symtab_type_copy=true \
    omp.f90

rm /tmp/ifortdashvZOvmCE
rm /tmp/ifortdummyU6Vx28.c
rm /tmp/ifortsearchdirs5M2S91
rm /tmp/ifortKoMrMbas_.s
rm /tmp/ifortldashvA1shdW
rm /tmp/iforttempfile8Rf2s5
rm /tmp/ifortarglSyL5t

 

I note that ifx compiles this with no issue:

ifort (IFORT) 2021.12.0 20240211

ifx (IFX) 2024.1.2 20240508

 

IFORT 2021.11 seems to be working fine.

0 Kudos
Mark_Lewy
Valued Contributor I
718 Views

@Ron_Green I note that in 2024.1 that omp_lib.mod is now in compiler/include/intel64/omp_lib.mod c.f. compiler/include/omp_lib.mod in 2024.0:

lewym@ADSKPW015RGM:~/intel/src$ find /opt/intel/ -name omp_lib.mod
/opt/intel/oneapi/2024.0/opt/compiler/include/omp_lib.mod
/opt/intel/oneapi/2024.1/opt/compiler/include/intel64/omp_lib.mod
/opt/intel/oneapi/compiler/2024.0/opt/compiler/include/omp_lib.mod
/opt/intel/oneapi/compiler/2024.1/opt/compiler/include/intel64/omp_lib.mod

 

And also that for ifx -#, we have this in the output (hence its ability to compile without errors):

<elided>
-I/opt/intel/oneapi/compiler/2024.1/opt/compiler/include/intel64 \
-I/opt/intel/oneapi/compiler/2024.1/opt/compiler/include \

<elided>

 

As a quick and dirty workaround,  "ifort -I/opt/intel/oneapi/compiler/2024.1/opt/compiler/include/intel64 -qopenmp -c omp.f90", would work.

 

 

0 Kudos
Ron_Green
Moderator
709 Views

@Mark_Lewy   one difference I see in your env is that you use your own oneapi.conf file.  Have you tried to source setvars.sh without the config file?  

I am thinking that the exclude everything but the compiler and debugger may be missing the omp and runtime setup.  The OMP RT could be considered a shared resource instead of a compiler resource.  That is probably a bug in setvars.  Setvars is created outside of the compiler teams and I really don't know the logic they use.

 

As an alternative, if you want only the compilers, try sourcing just the compiler 'vars.sh' file which is in

<oneapi path>/compilers/<version>/env/vars.sh

 

Each component has it's one "env/" dir with their own component-level vars script.  I suspect a bug in setvars.sh wrt the 'exclude' default

0 Kudos
Mark_Lewy
Valued Contributor I
690 Views

@Ron_Green It was the OP, @frx,  who was using a custom config file, I just have source /opt/intel/oneapi/setvars.sh in my ~/.bashrc.

 

From my POV, this isn't a major issue, as we have switched to using IFX for development & production.  I encountered the compilation error with IFORT on a local build of an old branch - easily resolved by building it with our ADO pipeline instead which is using IFORT 2021.11.

 

frx
Novice
622 Views

Yes, I am the one who is using a custom config file, but I have also just tried without any config file:

. /opt/intel/oneapi/setvars.sh

and it does not make any difference. Same error, unless I manually add the include directory with the -I option.

 

And switching to ifx is not an option for the time being: I am seeing some 30 % performance hit on the generated executable (I mean the same source code, compiled with ifx, runs about 1.30 slower than with ifort). This is really worrying, especially taking into account that Intel is planning to completely drop ifort by the end of 2024...

0 Kudos
CoryG
Novice
572 Views

I have had exactly the same issue. I updated the intel compilers yesterday on Ubuntu via apt-get, and my build all of a sudden started failing. The compiler was not able to find omp_lib. I have always just used ```source /opt/intl/oneapi/setvars.sh```. No custom config. Explicitly adding the path to omp_lib fixed the compile issue, but this does seem like a bug.

0 Kudos
Ron_Green
Moderator
564 Views

@frx what compiler options are you using with ifx?  The optimizer in ifx is completely different than in ifort, so the options should be reexamined.  I would recommend

-O2 -xhost -flto -align array64byte

along with anything else you use.  Are you using fp-model or -fpe0?  Show me your list of options maybe we can get ifx closer to ifort.  We have several performance bugs being fixed in 2024.2 which should be here in about a month.

0 Kudos
frx
Novice
331 Views

The application is a numerical solver. The compiler options used with ifort are:

OMPI_FC=ifort mpifort -m64 -ip -fp-model precise -ftz -shared-intel -fpp  -qopenmp -mcmodel=medium -O3 -xAVX -fno-alias -fno-fnalias -assume buffered_io

I have just tried the following options with ifx:

OMPI_FC=ifx mpifort -m64 -fp-model precise -ftz -shared-intel -fpp  -qopenmp -mcmodel=medium -flto -align array64byte -O3 -xAVX -fno-alias -assume buffered_io

This leads to incorrect execution of the solver application (which almost immediately produces NaNs).

Dropping the -flto option:

OMPI_FC=ifx mpifort -m64 -fp-model precise -ftz -shared-intel -fpp  -qopenmp -mcmodel=medium -align array64byte -O3 -xAVX -fno-alias -assume buffered_io

leads to an execution which is about 28 % slower than with ifort. Almost the same computing time as with ifx without the -align array64byte option...

 

BTW, I use the APT repositories on a Debian system.

0 Kudos
Ron_Green
Moderator
708 Views

@Mark_Lewy forgot you wanted the debugger also.  source it's env/vars.sh also

0 Kudos
Ron_Green
Moderator
562 Views

@CoryG @frx @Mark_Lewy  

Perhaps it's the packages from the repositories?  On my hosts I use the IRC offline installer packages, not package managers.  Could you share if you

use a package manager

if so which one?  APT, YUM/DNF, or Zypper? 

 

I'm wondering if this is a bug in the package delivered by our repos.  I don't see the issue with the packages I use from the IRC downloads.

0 Kudos
Mark_Lewy
Valued Contributor I
407 Views

Hi @Ron_Green ,

 

If you didn't pick this up from my original reply in this thread, I'm using APT on Ubuntu 22.04 LTS (in WSL FWIW).

0 Kudos
CoryG
Novice
561 Views

That would make sense. I used APT on Ubuntu 22.

0 Kudos
Reply