- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have updated my Intel OneAPI suite (ifx (IFX) 2024.1.2 20240508). After the update, my ifx/ifort is not linking the OpenMP programs properly and returns an error.
The details of the compiler output is given here
ifx -o run main.o constant.o declaration.o grid.o boundary.o misc.o -O3 -warn all -fiopenmp -fp-model=precise
ld: main.o: in function `MAIN__.DIR.OMP.PARALLEL.LOOP.21813.split1817':
main.f90:(.text+0x2724): undefined reference to `__kmpc_for_static_init_2'
make: *** [Makefile:33: run] Error 1
I have tried many ways to avoid it but still end up with the same error. I have included the code snippet used for the compilation.
do nb = 1, nBlocks
!$omp parallel do &
!$omp shared(q, nx, ny, nb)
do j = 1, ny(nb)
do i = 1, nx(nb)
q(1, i, j, nb) = zero
end do
end do
!$end parallel do
end do
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A small reproducer:
program x
implicit none
integer, parameter :: it = 2
integer(it) :: nb, i, j
integer(it), parameter :: nBlocks = 1, nx_ = 1, ny_ = 1
integer(it) :: nx(nBlocks), ny(nBlocks)
real :: q(1, nx_, ny_, nBlocks)
real, parameter :: zero = 0
nx = 1
ny = 1
do nb = 1, nBlocks
!$omp parallel do &
!$omp shared(q, nx, ny, nb)
do j = 1, ny(nb)
do i = 1, nx(nb)
q(1, i, j, nb) = zero
end do
end do
!$end parallel do
end do
end program
lewym@ADSKPW015RGM:~/intel/src$ ifx -o x x.f90 -O3 -warn all -fiopenmp -fp-model=precise
ld: /tmp/ifx003727979395vbMv/ifxFlW5gD.o: in function `MAIN__.DIR.OMP.PARALLEL.LOOP.265.split67':
x.f90:(.text+0xa7): undefined reference to `__kmpc_for_static_init_2'
Workaround: change the value of it to 4.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Without a full reproducer, I can only speculate here, but I think the problem is that you may be using integer(2) variables in your program and __kmpc_for_static_init_2 has been deleted from the OpenMP RTLs (regression?). There are symbols defined for __kmpc_for_static_init_4 and __kmpc_for_static_init_8 in the current library. Try declaring any integer(2) variables as default integers and see if that helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A small reproducer:
program x
implicit none
integer, parameter :: it = 2
integer(it) :: nb, i, j
integer(it), parameter :: nBlocks = 1, nx_ = 1, ny_ = 1
integer(it) :: nx(nBlocks), ny(nBlocks)
real :: q(1, nx_, ny_, nBlocks)
real, parameter :: zero = 0
nx = 1
ny = 1
do nb = 1, nBlocks
!$omp parallel do &
!$omp shared(q, nx, ny, nb)
do j = 1, ny(nb)
do i = 1, nx(nb)
q(1, i, j, nb) = zero
end do
end do
!$end parallel do
end do
end program
lewym@ADSKPW015RGM:~/intel/src$ ifx -o x x.f90 -O3 -warn all -fiopenmp -fp-model=precise
ld: /tmp/ifx003727979395vbMv/ifxFlW5gD.o: in function `MAIN__.DIR.OMP.PARALLEL.LOOP.265.split67':
x.f90:(.text+0xa7): undefined reference to `__kmpc_for_static_init_2'
Workaround: change the value of it to 4.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Mark_Lewy,
Thanks for your reply, Your solution worked, and I'm not getting errors once I update the integer variable. Thanks once again. I have spent a lot of time checking the code instead of looking into the data types.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks for reporting this, I send a reproducer to our developers. CMPLRLLVM-59394
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page