Undeclared identifier '_SC_NPROCESSORS_ONLN'

asked 2020-03-19 14:28:12 -0600

jonmoore gravatar image

Hello,

I'm trying to build opencv with the additional modules but I'm getting an error when I run 'make'. I'm in a freenas jail.

the error I'm getting is; /usr/local/lib/opencv/opencv/modules/core/src/parallel.cpp:948:60 error: use of undeclared identifier '_SC_NPROCESSORS_ONLN' static unsigned cpu_count_sysconf = (unsigned)sysconf( _SC_NPROCESSO...

Anyone seen this before when building from source and found a way around?

Thanks so much for the help!

edit retag flag offensive close merge delete

Comments

berak gravatar imageberak ( 2020-03-19 14:59:58 -0600 )edit

Ah, maybe something like adding if not freebsd to that if statement? Or maybe just get rid of it completely? Would that just set it to 1? Any issues with that you think?

Thanks!

jonmoore gravatar imagejonmoore ( 2020-03-19 17:15:19 -0600 )edit

my 2 ct.: experiment. you're some unlucky dude on unchartered territory ;(

nothing's sacred. careful with the axe, though ;)

berak gravatar imageberak ( 2020-03-19 17:41:25 -0600 )edit