Shicheng-Guo / bsmap

Automatically exported from code.google.com/p/bsmap
0 stars 0 forks source link

Compilation error on Debian: param.cpp: sysconf(_SC_NPROCESSORS_ONLN) #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use debian
2. make

What is the expected output? What do you see instead?
Expected to compile successfully.

Instead, I get:
param.cpp:9:20: error: '_SC_NPROCESSORS_ONLN' was not declared in this scope

What version of the product are you using? On what operating system?
bsmap 2.74, Debian (it says testing release O_o)

Please provide any additional information below.
Seems like _SC_NPROCESSORS_ONLN is not standard on this distribution. To solve 
it locally, I have changed the call to 'num_procs = 
std::thread::hardware_concurrency();' and compiled using std=c++11.
In main.cpp, I had to rename 'ref' to avoid name collisions.

I think it would be a good idea to replace the call to sysconf with a 
cross-platform call.

Thanks,
Amit

Original issue reported on code.google.com by amit.la...@mail.huji.ac.il on 4 Aug 2014 at 12:16