erwincoumans / tiny-differentiable-simulator

Tiny Differentiable Simulator is a header-only C++ and CUDA physics library for reinforcement learning and robotics with zero dependencies.
Apache License 2.0
1.24k stars 130 forks source link

Make Error #197

Closed OnesoulKang closed 2 years ago

OnesoulKang commented 2 years ago

Thank you for always doing great research and making it public.

I tried to follow 'getting started'. But I faced some errors.

When I did the following procedures

mkdir build && cd build
cmake .. 
make -j

this error has occured

In file included from /home/onsoulkang/tiny-differentiable-simulator/examples/ars/ars_train_policy_cuda.cpp:171:
/home/onsoulkang/tiny-differentiable-simulator/examples/ars/ars_learner.h: In constructor ‘ARSLearner<ARSVecEnvironment>::ARSLearner(ARSVecEnvironment&, const ARSConfig&)’:
/home/onsoulkang/tiny-differentiable-simulator/examples/ars/ars_learner.h:42:83: error: class template argument deduction failed:
         worker_ = new Worker (tmpenv,  params_dim, policy_params, deltas_, config_);
                                                                                   ^
/home/onsoulkang/tiny-differentiable-simulator/examples/ars/ars_learner.h:42:83: error: no matching function for call to ‘Worker()’
In file included from /home/onsoulkang/tiny-differentiable-simulator/examples/ars/ars_train_policy_cuda.cpp:169:
/home/onsoulkang/tiny-differentiable-simulator/examples/ars/ars_vectorized_worker.h:23:5: note: candidate: ‘template<class ARSVecEnvironment> Worker(ARSVecEnvironment&, int, const PolicyParams&, const std::vector<double>&, const ARSConfig&)-> Worker<ARSVecEnvironment>’
     Worker(ARSVecEnvironment& env, int params_dim, const PolicyParams& policy_params, const std::vector<double>& deltas, const ARSConfig& config)
     ^~~~~~
/home/onsoulkang/tiny-differentiable-simulator/examples/ars/ars_vectorized_worker.h:23:5: note:   template argument deduction/substitution failed:
In file included from /home/onsoulkang/tiny-differentiable-simulator/examples/ars/ars_train_policy_cuda.cpp:171:
/home/onsoulkang/tiny-differentiable-simulator/examples/ars/ars_learner.h:42:83: note:   candidate expects 5 arguments, 0 provided
         worker_ = new Worker (tmpenv,  params_dim, policy_params, deltas_, config_);
                                                                                   ^
examples/ars/CMakeFiles/ars_train_policy_cuda.dir/build.make:75: recipe for target 'examples/ars/CMakeFiles/ars_train_policy_cuda.dir/ars_train_policy_cuda.cpp.o' failed
make[2]: *** [examples/ars/CMakeFiles/ars_train_policy_cuda.dir/ars_train_policy_cuda.cpp.o] Error 1
CMakeFiles/Makefile2:1390: recipe for target 'examples/ars/CMakeFiles/ars_train_policy_cuda.dir/all' failed
make[1]: *** [examples/ars/CMakeFiles/ars_train_policy_cuda.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2

I'm using Ubuntu 18.04, gcc 8.4.0, cmake 3.22.2. Any help on how to fix this error would be appreciated.

OnesoulKang commented 2 years ago

Upgrading gcc to version 9 solved the problem.