Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict between the pure function stdlib_iparam2stage and openmp #825

Closed
LaplaceSoda opened this issue May 21, 2024 · 1 comment · Fixed by #826
Closed

Conflict between the pure function stdlib_iparam2stage and openmp #825

LaplaceSoda opened this issue May 21, 2024 · 1 comment · Fixed by #826
Labels
bug Something isn't working

Comments

@LaplaceSoda
Copy link

LaplaceSoda commented May 21, 2024

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

@LaplaceSoda LaplaceSoda added the bug Something isn't working label May 21, 2024
@jvdp1
Copy link
Member

jvdp1 commented May 21, 2024

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

@LaplaceSoda LaplaceSoda changed the title Conflict between the pure function stdlib_iparam2stage with openmp Conflict between the pure function stdlib_iparam2stage and openmp May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants