octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Warning from libgomp during make check


From: Rik
Subject: Warning from libgomp during make check
Date: Fri, 26 Sep 2014 10:22:41 -0700

All,

Is anyone else seeing this warning during the test for imfinfo.m during
'make check'?

libgomp: Invalid value for environment variable OMP_NUM_THREADS

I can manually reproduce it outside of 'make check' by doing

./run-octave -cli -f
test nproc.cc
test imfinfo

The issue seems to be the test code in nproc.cc which is

%!test
%! c = nproc ("current");
%! unwind_protect
%!   old_val = getenv ("OMP_NUM_THREADS");
%!   new_val = c + 1;
%!   setenv ("OMP_NUM_THREADS", num2str (new_val));
%!   assert (nproc ("overridable"), new_val);
%! unwind_protect_cleanup
%!   if (! isempty (old_val))
%!     setenv ("OMP_NUM_THREADS", old_val);
%!   else
%!     setenv ("OMP_NUM_THREADS", "");
%!   endif
%! end_unwind_protect

At the end of the test, because we don't have unsetenv(), the environment
variable is cleared to the empty string.  According to the Matlab
documentation, "setenv (name)" is equivalent to "setenv (name, "")" which
on a Windows system undefines the variable.  On a UNIX system, however, one
can have a defined environment variable with an empty value.

Perhaps we should deviate from Matlab here and if the two argument form is
used, then set the environment variable to whatever value is offered
including the null string.  But if the number of arguments to the function
is 1 then we call unsetenv with the name of the variable.

Thoughts,
Rik



reply via email to

[Prev in Thread] Current Thread [Next in Thread]