Code Monkey home page Code Monkey logo

Comments (9)

kkonevets avatar kkonevets commented on July 22, 2024 1

Ok, personally I did't compile it with gcc11, only with gcc10, so there could be a difference and in order to compile with gcc11 guess you should #include <optional>, that means you have to modify a code base, not a good idea. So you have to install gcc10 on your machine and compile like this cmake -DCMAKE_CXX_COMPILER=g++-10 .. && make -j4

To install gcc10 in ubuntu try apt install g++-10

from ai-toolbox.

kkonevets avatar kkonevets commented on July 22, 2024

Try this cmake -DCMAKE_CXX_COMPILER=g++-10 .. && make -j4

from ai-toolbox.

Princeofthebow avatar Princeofthebow commented on July 22, 2024

I had to alter you command a bit setting it to cmake -DCMAKE_CXX_COMPILER=g++ .. && make -j4 as g++ 11 is installed and it did not like g++-10

When I though execute this I get a similar error again, this time further down in the make progress:

[ 71%] Building CXX object test/CMakeFiles/MDP_TreeBackupLTests.dir/MDP/TreeBackupLTests.cpp.o
In file included from /home/jpk/Desktop/AI-Toolbox-master/src/Factored/MDP/Algorithms/Utils/FactoredLP.cpp:1:
/home/jpk/Desktop/AI-Toolbox-master/include/AIToolbox/Factored/MDP/Algorithms/Utils/FactoredLP.hpp:76:18: error: ‘optional’ in namespace ‘std’ does not name a template type
   76 |             std::optional<Vector> operator()(const FactoredVector & C, const FactoredVector & b, bool addConstantBasis = false);
      |                  ^~~~~~~~
/home/jpk/Desktop/AI-Toolbox-master/include/AIToolbox/Factored/MDP/Algorithms/Utils/FactoredLP.hpp:7:1: note: ‘std::optional’ is defined in header ‘<optional>’; did you forget to ‘#include <optional>’?
    6 | #include <AIToolbox/Factored/MDP/Types.hpp>
  +++ |+#include <optional>
    7 | 
/home/jpk/Desktop/AI-Toolbox-master/src/Factored/MDP/Algorithms/Utils/FactoredLP.cpp:32:27: error: no declaration matches ‘std::optional<Eigen::Matrix<double, -1, 1> > AIToolbox::Factored::MDP::FactoredLP::operator()(const AIToolbox::Factored::FactoredVector&, const AIToolbox::Factored::FactoredVector&, bool)’
   32 |     std::optional<Vector> FactoredLP::operator()(const FactoredVector & C, const FactoredVector & b, bool addConstantBasis) {
      |                           ^~~~~~~~~~
/home/jpk/Desktop/AI-Toolbox-master/src/Factored/MDP/Algorithms/Utils/FactoredLP.cpp:32:27: note: no functions named ‘std::optional<Eigen::Matrix<double, -1, 1> > AIToolbox::Factored::MDP::FactoredLP::operator()(const AIToolbox::Factored::FactoredVector&, const AIToolbox::Factored::FactoredVector&, bool)’
In file included from /home/jpk/Desktop/AI-Toolbox-master/src/Factored/MDP/Algorithms/Utils/FactoredLP.cpp:1:
/home/jpk/Desktop/AI-Toolbox-master/include/AIToolbox/Factored/MDP/Algorithms/Utils/FactoredLP.hpp:35:11: note: ‘class AIToolbox::Factored::MDP::FactoredLP’ defined here
   35 |     class FactoredLP {
      |           ^~~~~~~~~~
/home/jpk/Desktop/AI-Toolbox-master/src/Factored/MDP/Algorithms/Utils/FactoredLP.cpp:198:10: warning: ‘void AIToolbox::Factored::MDP::{anonymous}::Global::makeResult(AIToolbox::Factored::GenericVariableElimination<long unsigned int>::FinalFactors&&)’ defined but not used [-Wunused-function]
  198 |     void Global::makeResult(VE::FinalFactors && finalFactors) {
      |          ^~~~~~
/home/jpk/Desktop/AI-Toolbox-master/src/Factored/MDP/Algorithms/Utils/FactoredLP.cpp:183:10: warning: ‘void AIToolbox::Factored::MDP::{anonymous}::Global::endCrossSum()’ defined but not used [-Wunused-function]
  183 |     void Global::endCrossSum() {
      |          ^~~~~~
/home/jpk/Desktop/AI-Toolbox-master/src/Factored/MDP/Algorithms/Utils/FactoredLP.cpp:178:10: warning: ‘void AIToolbox::Factored::MDP::{anonymous}::Global::crossSum(const Factor&)’ defined but not used [-Wunused-function]
  178 |     void Global::crossSum(const Factor & f) {
      |          ^~~~~~
/home/jpk/Desktop/AI-Toolbox-master/src/Factored/MDP/Algorithms/Utils/FactoredLP.cpp:168:10: warning: ‘void AIToolbox::Factored::MDP::{anonymous}::Global::beginCrossSum()’ defined but not used [-Wunused-function]
  168 |     void Global::beginCrossSum() {
      |          ^~~~~~
/home/jpk/Desktop/AI-Toolbox-master/src/Factored/MDP/Algorithms/Utils/FactoredLP.cpp:159:10: warning: ‘void AIToolbox::Factored::MDP::{anonymous}::Global::initNewFactor()’ defined but not used [-Wunused-function]
  159 |     void Global::initNewFactor() {
      |          ^~~~~~
make[2]: *** [src/CMakeFiles/AIToolboxFMDP.dir/build.make:459: src/CMakeFiles/AIToolboxFMDP.dir/Factored/MDP/Algorithms/Utils/FactoredLP.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1109: src/CMakeFiles/AIToolboxFMDP.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 71%] Built target MDP_SARSATests
[ 71%] Linking CXX executable POMDP_BlindStrategiesTests
[ 71%] Linking CXX executable MDP_TreeBackupLTests
[ 71%] Built target POMDP_BlindStrategiesTests
[ 71%] Built target MDP_TreeBackupLTests
make: *** [Makefile:114: all] Error 2

from ai-toolbox.

kkonevets avatar kkonevets commented on July 22, 2024

what does this print gcc --version?

from ai-toolbox.

Princeofthebow avatar Princeofthebow commented on July 22, 2024
gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

do you mean gcc or g++?

Here for g++

g++ (Ubuntu 11.2.0-7ubuntu2) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

--------- EDIT

explicitly installing g++10,i.e. not 11, appears to have it go working! Perhaps writing it in the docs could be helpful as with v11 it did not work for me(which should be C20?).

from ai-toolbox.

kkonevets avatar kkonevets commented on July 22, 2024

--------- EDIT
explicitly installing g++10,i.e. not 11, appears to have it go working! Perhaps writing it in the docs could be helpful as with v11 it did not work for me(which should be C20?).

here you go!

from ai-toolbox.

Princeofthebow avatar Princeofthebow commented on July 22, 2024

OK indeed, v10 works!

Cheers!

from ai-toolbox.

Svalorzen avatar Svalorzen commented on July 22, 2024

Hey, thanks for the report! I had indeed forgotten to include a couple of header files, so g++-11 was rightfully complaining about it.

I've fixed and pushed the changes, so if you want to recompile with g++-11 everything should work correctly now.

from ai-toolbox.

Princeofthebow avatar Princeofthebow commented on July 22, 2024

Cheers for this and congratulations on this great work!
I'm actually a Debian user and stumbled upon g++-11 as I had to pull up an Ubuntu vm :-)

from ai-toolbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.