fortran-lang/stdlib

Conflict between the pure function `stdlib_iparam2stage` and `openmp`

LaplaceSoda opened this issue · 1 comments

Description

Environment

gfortran 13.2.0 (Built by MSYS2 project)
fpm 0.10.1, alpha

Detail

When OpenMP is enabled, an error will occur when calling functions in stdlib_linalg module.

If we create a new project via fpm and then add the following code in fpm.toml to enable OpenMP and stdlib

[dependencies]
openmp = "*"
stdlib = "*"

And then call the eye function in main program

program main
  use stdlib_linalg, only: eye
  real :: A(3,3)
  A = eye(3)
end program main

Then building with fpm will result in the following error :

build\dependencies\stdlib\src\stdlib_linalg_lapack_aux.F90:1436:25:
 1436 |            !$ nthreads = omp_get_num_threads()
      |                         1
Error: Reference to impure function 'omp_get_num_threads' at (1) within a PURE procedure

Expected Behaviour

No errors when building.

Version of stdlib

5f8b2d5

Platform and Architecture

Windows, MSYS

Additional Information

No response

Thank you for reporting the bug. @perazz Could you have a look, please?