Building `stdlib` with openmp

I’m testing whether it is possible to build stdlib in a package that also requires OpenMP (e.g. via -fopenmp if gfortran).

I get some nontrivial errors with some of the tests in the test-drive:

<ERROR> Execution for object " test_string_intrinsic " returned exit code  1
<ERROR> Execution for object " test_sorting " returned exit code  6
<ERROR> Execution for object " test_open " returned exit code  2
<ERROR>*cmd_run*:stopping due to failed executions
STOP 1

Since stdlib does not have any openmp pragmas, shouldn’t we expect the results to be identical? I’ve tested using -frecursive to require all recursive subroutines, but that did not help.

Unless some routines are not thread-safe and called from parallel regions.

I believe some may be using internal I/O, that may be the reason?
But, if there are no parallel regions at all in the program, shouldn’t it just ignore the openmp settings?

Do you mean that the calling program does not contain any OpenMP directive either? In that case yes, you should get the same results by compiling with or without -fopenmp

1 Like