abcorrea / powerlifted

Powerlifted Planner
GNU General Public License v3.0
28 stars 12 forks source link

error: call to 'feed' is ambiguous #36

Closed harshakokel closed 1 year ago

harshakokel commented 2 years ago

Hello,

I am trying to setup the powerlifted planner on a MacOS. I am getting two call to 'feed' is ambiguous errors shown below on running build.py. Can you share what gcc and cmake version are you using? Mine is 13.1.6 and 3.23.2 respectively.

GCC version

$ gcc --version 
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: arm64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Cmake version

$cmake --version
cmake version 3.23.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Error

In file included from ~/lifted-planner/powerlifted/src/search/states/extensional_states.h:5:
~/lifted-planner/powerlifted/src/search/states/../algorithms/dynamic_bitset.h:190:9: error: call to 'feed' is ambiguous
        feed(hash_state, a.num_bits);
        ^~~~
~/lifted-planner/powerlifted/src/search/states/extensional_states.cc:25:12: note: in instantiation of function template specialization 'utils::feed<unsigned long>' requested here
    utils::feed(hash_state, s.atoms);
           ^
~/lifted-planner/powerlifted/src/search/states/../utils/hash.h:224:13: note: candidate function
inline void feed(HashState &hash_state, int value) {
            ^
~/lifted-planner/powerlifted/src/search/states/../utils/hash.h:231:13: note: candidate function
inline void feed(HashState &hash_state, unsigned int value) {
            ^
~/lifted-planner/powerlifted/src/search/states/../utils/hash.h:235:13: note: candidate function
inline void feed(HashState &hash_state, std::uint64_t value) {
            ^
~/lifted-planner/powerlifted/src/search/states/../utils/hash.h:241:13: note: candidate function
inline void feed(HashState &hash_state, long value) {
~/lifted-planner/powerlifted/src/search/states/../utils/hash.h:272:9: error: call to 'feed' is ambiguous
        feed(hash_state, vec[i]);
        ^~~~
~/lifted-planner/powerlifted/src/search/states/../algorithms/dynamic_bitset.h:191:9: note: in instantiation of function template specialization 'utils::feed<unsigned long>' requested here
        feed(hash_state, a.blocks);
        ^
~/lifted-planner/powerlifted/src/search/states/extensional_states.cc:25:12: note: in instantiation of function template specialization 'utils::feed<unsigned long>' requested here
    utils::feed(hash_state, s.atoms);
           ^
~/lifted-planner/powerlifted/src/search/states/../utils/hash.h:224:13: note: candidate function
inline void feed(HashState &hash_state, int value) {
            ^
~/lifted-planner/powerlifted/src/search/states/../utils/hash.h:231:13: note: candidate function
inline void feed(HashState &hash_state, unsigned int value) {
            ^
~/lifted-planner/powerlifted/src/search/states/../utils/hash.h:235:13: note: candidate function
inline void feed(HashState &hash_state, std::uint64_t value) {
            ^
~/lifted-planner/powerlifted/src/search/states/../utils/hash.h:241:13: note: candidate function
inline void feed(HashState &hash_state, long value) {
            ^
2 errors generated.
make[2]: *** [CMakeFiles/search.dir/states/extensional_states.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 90%] Linking CXX static library libabsl_flags_parse.a
1 warning generated.
[ 90%] Built target absl_flags_parse
make[1]: *** [CMakeFiles/search.dir/all] Error 2
make: *** [all] Error 2
Traceback (most recent call last):
  File "build.py", line 50, in <module>
    build(args.debug)
  File "build.py", line 45, in build
    subprocess.check_call(['make', '-j5' ], cwd=BUILD_SEARCH_DIR)
  File "~/miniconda3/envs/lplan/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', '-j5']' returned non-zero exit status 2.
abcorrea commented 2 years ago

Hi Harsha,

I tried to compile the planner using the same CMake and clang versions as you, and it worked without problems. Are you using the master branch or some previous version?

abcorrea commented 2 years ago

Sorry, I think that I actually might have some changes that could help -- I did not realize they were not pushed. I made some changes due to some warnings in the more recent version of GCC and pushed them to a branch called test-compilers. Could you please check out the branch and try to compile it?

> git pull
> git checkout test-compilers
> ./build.py

I also added a flag to build.py and powerlifted.py to switch the C++ compilers more easily. You basically just need to pass --cxx-compiler /path/to/compiler.

harshakokel commented 2 years ago

Hello,

I tried a couple of things on master branch: changed cmake version, added -Wno-error flag, etc. Finally I was able to compile the code with the following changes:

image

I tested with cmake 3.12 as well as 3.23.2. Above changes works with both the versions.

I tested the test-compilers branch on both versions and I still get the same error: call to 'feed' is ambiguous

Do you approve of the above changes?

abcorrea commented 2 years ago

Dear @harshakokel

Apologies for the (very) long delay. We merged a pull request from @PLauerRocks (Pascal) that addresses your changes. Could you please check the commit ca8530e and see if it solves your problem? It seems like Pascal applied all the changes you requested and a few more too. -ABC