personalrobotics / appl

Mirror of the Approximate POMDP Planning (APPL) C++ toolkit for POMDP planning.
http://bigbird.comp.nus.edu.sg/pmwiki/farm/appl/
21 stars 3 forks source link

Building on OSX #1

Open jeroen opened 8 years ago

jeroen commented 8 years ago

I can get it to build on Linux but OSX gives:

Jeroens-MacBook-Pro:src jeroen$ make
g++ -g -w -O3 -I./MathLib -I./Algorithms -I./Algorithms/HSVI -I./Algorithms/SARSOP -I./Models/MOMDP/ -I./Models/MOMDP/CoLoc/ -I./OfflineSolver/ -I./Bounds/ -I./Core/ -I./Parser/Cassandra/ -I./Parser/Cassandra/include -I./Parser/ -I./Parser/POMDPX/ -I./Utils/ -I./Simulator/ -I./Evaluator/ -I./Controller/  -msse2  -mfpmath=sse      -c -o PolicyGraph/PolicyGraph.o PolicyGraph/PolicyGraph.cpp
In file included from PolicyGraph/PolicyGraph.cpp:1:
In file included from ./Models/MOMDP/MOMDP.h:10:
In file included from ./Core/Observations.h:8:
In file included from ./Core/VariableContainer.h:10:
In file included from ./MathLib/MathLib.h:12:
./MathLib/SparseMatrix.h:24:33: error: field of type 'iterator' (aka
      '__wrap_iter<const momdp::SparseVector_Entry *>') has private constructor
            inline SparseCol(): _begin(NULL), _end(NULL) {}
                                ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:1239:31: note:
      declared private here
    _LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT ...
                              ^
In file included from PolicyGraph/PolicyGraph.cpp:1:
In file included from ./Models/MOMDP/MOMDP.h:10:
In file included from ./Core/Observations.h:8:
In file included from ./Core/VariableContainer.h:10:
In file included from ./MathLib/MathLib.h:12:
./MathLib/SparseMatrix.h:24:47: error: field of type 'iterator' (aka
      '__wrap_iter<const momdp::SparseVector_Entry *>') has private constructor
            inline SparseCol(): _begin(NULL), _end(NULL) {}
                                              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:1239:31: note:
      declared private here
    _LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT ...
                              ^
2 errors generated.
make: *** [PolicyGraph/PolicyGraph.o] Error 1
Jeroens-MacBook-Pro:src jeroen$
mkoval commented 8 years ago

I think the issue is that std::vector<T>::iterator is not guaranteed to have a constructor that accepts a pointer by the C++ standard. I changed this to use the default constructor in e433ee63e542551a7c6d35ec2d71192fd5a06d62 and it now works for me on El Capitan.

Also, note that this is an unofficial fork of the version of the APPL toolkit released by NUS.