Svalorzen / AI-Toolbox

A C++ framework for MDPs and POMDPs with Python bindings
GNU General Public License v3.0
647 stars 98 forks source link

Make cannot find .hpp file in Boost #54

Closed stamourb closed 2 years ago

stamourb commented 2 years ago

When I follow the build instructions, I can run the first three commands but then get an error after entering 'make'. I'm using an Ubuntu virtual machine and have all of the requirements listed in the dependencies section (including g++-10).

The error message that comes up is the following:

Scanning dependencies of target AIToolboxMDP
[  1%] Building CXX object src/CMakeFiles/AIToolboxMDP.dir/Impl/Seeder.cpp.o
[  1%] Building CXX object src/CMakeFiles/AIToolboxMDP.dir/Impl/CassandraParser.cpp.o
In file included from /home/ben/AI/AI-Toolbox-master/include/AIToolbox/Impl/CassandraParser.hpp:4,
                 from /home/ben/AI/AI-Toolbox-master/src/Impl/CassandraParser.cpp:1:
/home/ben/AI/AI-Toolbox-master/include/AIToolbox/Types.hpp:7:10: fatal error: boost/multi_array.hpp: No such file or directory
    7 | #include <boost/multi_array.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/CMakeFiles/AIToolboxMDP.dir/build.make:76: src/CMakeFiles/AIToolboxMDP.dir/Impl/CassandraParser.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1140: src/CMakeFiles/AIToolboxMDP.dir/all] Error 2
make: *** [Makefile:95: all] Error 2

cmake was able to find Boost and I can see that the multi_array.hpp file is in the folder /home/ben/AI/boost_1_77_0/boost, so I'm not sure why make can't find the file.

I also have to add several options to the cmake command I run right before make in order to get rid of any errors with that; here's what I enter in case that would do anything or if I need to add something else in there:

cmake .. -DBOOST_ROOT=/home/ben/AI/boost_1_77_0 -DLPSOLVE_INCLUDE_PATH=/home/ben/AI/lpsolve -DVCPKG_TARGET_TRIPLET=x64-linux -DCMAKE_TOOLCHAIN_FILE=/home/ben/AI/vcpkg/scripts/buildsystems/vcpkg.cmake

Would anyone have any ideas as to how I can get past the make error?

Svalorzen commented 2 years ago

Can you post the output of CMake?

One thing that might make it easier for yourself is to just install Boost using apt, if possible.

Otherwise, I believe there are additional options you can pass CMake for Boost if some things are not found. One I have on top of my head is BOOST_LIBRARYDIR. There may be more, looking at the Boost documentation/StackOverflow/Google might be more helpful as I rarely manually install Boost.

stamourb commented 2 years ago

I deleted my Boost folder and reinstalled it using apt and it worked! I just reran cmake and took out all the options I had been using except for the lpsolve one, and then when I ran make afterward I encountered no issues.

Thank you so much for your help! I hadn't realized there would be such a difference between the different methods of installing Boost.