Or-tools: compilation error with fabs

Created on 18 Jul 2016  Â·  5Comments  Â·  Source: google/or-tools

There is compilation error on

src/sat/boolean_problem.cc: Dans la fonction ‘void operations_research::sat::UseObjectiveForSatAssignmentPreference(const operations_research::LinearBooleanProblem&, operations_research::sat::SatSolver*)’:
src/sat/boolean_problem.cc:234:78: erreur : ‘fabs’ was not declared in this scope
                           fabs(static_cast<double>(objective.coefficients(i))));
                                                                              ^
src/sat/boolean_problem.cc:238:60: erreur : ‘fabs’ was not declared in this scope
         fabs(static_cast<double>(objective.coefficients(i))) / max_weight;
                                                            ^
make: *** [makefiles/Makefile.cpp.mk:1580: objs/sat/boolean_problem.o] Error 1

Missing somewhere #include or #include

Most helpful comment

This exact bug is hitting me. It seems commit a493cb818e92f63bab97417e5ddcd93240117fd6 took the #include back out. I added it back in and it seems to be compiling fine (make cc is still running)

All 5 comments

Hi,

Can you tell me which platform you are using?

Thanks

Laurent Perron | Operations Research | [email protected] | (33) 1 42 68 53
00

2016-07-18 8:02 GMT-07:00 Frédéric Rodrigo [email protected]:

There is compilation error on

src/sat/boolean_problem.cc: Dans la fonction ‘void operations_research::sat::UseObjectiveForSatAssignmentPreference(const operations_research::LinearBooleanProblem&, operations_research::sat::SatSolver_)’:
src/sat/boolean_problem.cc:234:78: erreur : ‘fabs’ was not declared in this scope
fabs(static_cast(objective.coefficients(i))));
^
src/sat/boolean_problem.cc:238:60: erreur : ‘fabs’ was not declared in this scope
fabs(static_cast(objective.coefficients(i))) / max_weight;
^
make: *_* [makefiles/Makefile.cpp.mk:1580: objs/sat/boolean_problem.o] Error 1

Missing somewhere #include or #include

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/212, or mute the thread
https://github.com/notifications/unsubscribe-auth/AKj17XlhXLQ-VUlqHXiKh8FX0Rmcc82tks5qW5WhgaJpZM4JOzn6
.

archlinux with gcc:

$ LANG=C gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib --disable-werror --enable-checking=release
Thread model: posix
gcc version 6.1.1 20160707 (GCC) 

I have added #include
Can you update the sources and retry?

Compilation is now fine, Thank you.

This exact bug is hitting me. It seems commit a493cb818e92f63bab97417e5ddcd93240117fd6 took the #include back out. I added it back in and it seems to be compiling fine (make cc is still running)

Was this page helpful?
0 / 5 - 0 ratings