lucasb-eyer / pydensecrf

Python wrapper to Philipp Krähenbühl's dense (fully connected) CRFs with gaussian edge potentials.
MIT License
1.94k stars 413 forks source link

Fail to build library in virtualenv due to redeclaration of round() function #44

Closed trangnambeo closed 6 years ago

trangnambeo commented 6 years ago

Hi Luca, I tried to build/install library inside a virtual environment created by Anaconda3 but it failed, the error is:

pydensecrf/densecrf/src/permutohedral.cpp:31:26: error: ambiguating new declaration of 'int round(double)' inline int round(double X) { ^ Looks like there is another round() function inside , I commented the following lines in permutohedral.cpp so It could build just fine.

//#ifdef WIN32 //inline int round(double X) { // return int(X+.5); //} //#endif

Is it correct to do so? Thanks,

lucasb-eyer commented 6 years ago

Hmm, so this is on windows, right? I have not built this on windows in a long long time. Actually, it seems like the round function is not used at all in the file, the only reference to it is commented-out.

If this works for you, could you please make a pull-request with that change?