ecr05 / MSM_HOCR

Multimodal Surface Matching with Higher order Clique Reduction: Mac OS and Linux binaries
35 stars 10 forks source link

Missing include <cmath> in ELC.h #9

Closed vanzod closed 5 years ago

vanzod commented 5 years ago

When attempting to compile MSM_OCR v1.0 with icpc v17.0.4, the following error prevents the correct compilation of Fusion.cpp:

icpc -O2 -xHost -ftz -fp-speculation=safe -fp-model source -Wall -ansi -pedantic -Wno-long-long -g  -std=c++11  -DHAS_HOCR  -DNDEBUG -m64  -O2 -xHost -m64 [...] -c -o Fusion.o Fusion.cpp
[...]
/opt/easybuild/software/MPI/intel/2017.4.196-GCC-6.4.0-2.28/impi/2017.3.196/MSM/1.0/extras/include/ELC/ELC.h(268): error: more than one instance of overloaded function "abs" matches the argument list:
            function "abs(int)"
            function "std::abs(long long)"
            function "std::abs(long)"
            argument types are: (REAL)
                REAL q = abs(c);
                         ^
          detected during:
            instantiation of "void ELCReduce::PBF<REAL>::reduceHigher(int) [with REAL=REAL={double}]" at line 36 of "Fusion.cpp"
            instantiation of "void MESHREG::Fusion::reduce_and_convert(ELCReduce::PBF<REAL={double}> &, OPTIMIZER &, MESHREG::Reduction) [with OPTIMIZER=DISCRETEOPT::DiscreteModelDummy]" at line 302 of "Fusion.cpp"

/opt/easybuild/software/MPI/intel/2017.4.196-GCC-6.4.0-2.28/impi/2017.3.196/MSM/1.0/extras/include/ELC/ELC.h(291): error: more than one instance of overloaded function "abs" matches the argument list:
            function "abs(int)"
            function "std::abs(long long)"
            function "std::abs(long)"
            argument types are: (REAL)
            addCancelTerm(it, elc_idx, abs(c));
                                       ^
          detected during:
            instantiation of "void ELCReduce::PBF<REAL>::reduceHigherApprox() [with REAL=REAL={double}]" at line 47 of "Fusion.cpp"
            instantiation of "void MESHREG::Fusion::reduce_and_convert(ELCReduce::PBF<REAL={double}> &, OPTIMIZER &, MESHREG::Reduction) [with OPTIMIZER=DISCRETEOPT::DiscreteModelDummy]" at line 302 of "Fusion.cpp"

This can be easily solved with the addition of the following include statement in ELC.h:

#include <cmath>
ecr05 commented 5 years ago

Sorry for the delay, this should be fixed now?

vanzod commented 5 years ago

@ecr05 Yes. Thank you for following up on this.