Neil Hopcroft

A digital misfit

Fixing of-fl-core build

The fl-core package is giving this error:

fl_compose.cc: In function ‘int get_available_cpus()’:
fl_compose.cc:757:19: error: ‘_SC_NPROCESSORS_ONLN’ was not declared in this scope
return sysconf( _SC_NPROCESSORS_ONLN);
^
fl_compose.cc:757:39: error: ‘sysconf’ was not declared in this scope
return sysconf( _SC_NPROCESSORS_ONLN);
^
make: *** [fl_compose.oct] Error 1

A quick search of the octave source code shows a potential alternative, _SC_NPROCESSORS_CONF, if _SC_NPROCESSORS_ONLN is not defined. But it also says “This works on glibc, Mac OS X 10.5, FreeBSD, AIX, OSF/1, Solaris, Cygwin, Haiku” for both CONF and ONLN.
For the moment I have replaced the call to sysconf with a hard-coded ‘1’, representing a single core. Not an ideal solution but it should work for my current purposes.
Fixed in build 23.


Leave a Reply

Your email address will not be published.