tspooner / rl_markets

Market Making via Reinforcement Learning
https://arxiv.org/abs/1804.04216v1
BSD 3-Clause "New" or "Revised" License
311 stars 105 forks source link

error in make #5

Open mujtabahasan opened 5 years ago

mujtabahasan commented 5 years ago

Hi, I cannot make the code after successfully configuring it. Below is the error log.

Thanks, Mujtaba

[ 14%] Built target catch [ 29%] Built target yaml-cpp [ 44%] Built target spdlog [ 46%] Building CXX object src/CMakeFiles/rl_engine.dir/market/book.cpp.o /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp: In instantiation of ‘bool market::Book<C, DEPTH>::PlaceOrder(double, long int) [with C = FloatComparator<>; long unsigned int DEPTH = 1ul]’: /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:368:24: required from here /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:257:54: error: call of overloaded ‘make_unique(double&, long int&, long int)’ is ambiguous open_orders.emplace(price, make_unique(price, size, volume(price ^ In file included from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:4:0: /home/mujtaba.hasan/Documents/RL/rl_markets/include/utilities/memory.h:5:20: note: candidate: std::unique_ptr<_Tp> make_unique(Args&& ...) [with T = market::Order; Args = {double&, long int&, long int}] std::unique_ptr make_unique( Args&& ...args ) ^ In file included from /usr/include/c++/5/memory:81:0, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/order.h:4, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/book.h:10, from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:1: /usr/include/c++/5/bits/unique_ptr.h:764:5: note: candidate: typename std::_MakeUniq<_Tp>::single_object std::make_unique(_Args&& ...) [with _Tp = market::Order; _Args = {double&, long int&, long int}; typename std::_MakeUniq<_Tp>::single_object = std::unique_ptr] make_unique(_Args&&... args) ^ /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp: In instantiation of ‘bool market::Book<C, DEPTH>::PlaceOrder(double, long int) [with C = FloatComparator<>; long unsigned int DEPTH = 2ul]’: /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:369:24: required from here /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:257:54: error: call of overloaded ‘make_unique(double&, long int&, long int)’ is ambiguous open_orders.emplace(price, make_unique(price, size, volume(price ^ In file included from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:4:0: /home/mujtaba.hasan/Documents/RL/rl_markets/include/utilities/memory.h:5:20: note: candidate: std::unique_ptr<_Tp> make_unique(Args&& ...) [with T = market::Order; Args = {double&, long int&, long int}] std::unique_ptr make_unique( Args&& ...args ) ^ In file included from /usr/include/c++/5/memory:81:0, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/order.h:4, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/book.h:10, from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:1: /usr/include/c++/5/bits/unique_ptr.h:764:5: note: candidate: typename std::_MakeUniq<_Tp>::single_object std::make_unique(_Args&& ...) [with _Tp = market::Order; _Args = {double&, long int&, long int}; typename std::_MakeUniq<_Tp>::single_object = std::unique_ptr] make_unique(_Args&&... args) ^ /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp: In instantiation of ‘bool market::Book<C, DEPTH>::PlaceOrder(double, long int) [with C = FloatComparator<>; long unsigned int DEPTH = 3ul]’: /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:370:24: required from here /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:257:54: error: call of overloaded ‘make_unique(double&, long int&, long int)’ is ambiguous open_orders.emplace(price, make_unique(price, size, volume(price ^ In file included from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:4:0: /home/mujtaba.hasan/Documents/RL/rl_markets/include/utilities/memory.h:5:20: note: candidate: std::unique_ptr<_Tp> make_unique(Args&& ...) [with T = market::Order; Args = {double&, long int&, long int}] std::unique_ptr make_unique( Args&& ...args ) ^ In file included from /usr/include/c++/5/memory:81:0, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/order.h:4, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/book.h:10, from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:1: /usr/include/c++/5/bits/unique_ptr.h:764:5: note: candidate: typename std::_MakeUniq<_Tp>::single_object std::make_unique(_Args&& ...) [with _Tp = market::Order; _Args = {double&, long int&, long int}; typename std::_MakeUniq<_Tp>::single_object = std::unique_ptr] make_unique(_Args&&... args) ^ /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp: In instantiation of ‘bool market::Book<C, DEPTH>::PlaceOrder(double, long int) [with C = FloatComparator<>; long unsigned int DEPTH = 4ul]’: /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:371:24: required from here /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:257:54: error: call of overloaded ‘make_unique(double&, long int&, long int)’ is ambiguous open_orders.emplace(price, make_unique(price, size, volume(price ^ In file included from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:4:0: /home/mujtaba.hasan/Documents/RL/rl_markets/include/utilities/memory.h:5:20: note: candidate: std::unique_ptr<_Tp> make_unique(Args&& ...) [with T = market::Order; Args = {double&, long int&, long int}] std::unique_ptr make_unique( Args&& ...args ) ^ In file included from /usr/include/c++/5/memory:81:0, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/order.h:4, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/book.h:10, from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:1: /usr/include/c++/5/bits/unique_ptr.h:764:5: note: candidate: typename std::_MakeUniq<_Tp>::single_object std::make_unique(_Args&& ...) [with _Tp = market::Order; _Args = {double&, long int&, long int}; typename std::_MakeUniq<_Tp>::single_object = std::unique_ptr] make_unique(_Args&&... args) ^ /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp: In instantiation of ‘bool market::Book<C, DEPTH>::PlaceOrder(double, long int) [with C = FloatComparator<>; long unsigned int DEPTH = 5ul]’: /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:372:24: required from here /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:257:54: error: call of overloaded ‘make_unique(double&, long int&, long int)’ is ambiguous open_orders.emplace(price, make_unique(price, size, volume(price ^ In file included from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:4:0: /home/mujtaba.hasan/Documents/RL/rl_markets/include/utilities/memory.h:5:20: note: candidate: std::unique_ptr<_Tp> make_unique(Args&& ...) [with T = market::Order; Args = {double&, long int&, long int}] std::unique_ptr make_unique( Args&& ...args ) ^ In file included from /usr/include/c++/5/memory:81:0, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/order.h:4, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/book.h:10, from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:1: /usr/include/c++/5/bits/unique_ptr.h:764:5: note: candidate: typename std::_MakeUniq<_Tp>::single_object std::make_unique(_Args&& ...) [with _Tp = market::Order; _Args = {double&, long int&, long int}; typename std::_MakeUniq<_Tp>::single_object = std::unique_ptr] make_unique(_Args&&... args) ^ /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp: In instantiation of ‘bool market::Book<C, DEPTH>::PlaceOrder(double, long int) [with C = ReverseFloatComparator<>; long unsigned int DEPTH = 1ul]’: /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:374:24: required from here /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:257:54: error: call of overloaded ‘make_unique(double&, long int&, long int)’ is ambiguous open_orders.emplace(price, make_unique(price, size, volume(price ^ In file included from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:4:0: /home/mujtaba.hasan/Documents/RL/rl_markets/include/utilities/memory.h:5:20: note: candidate: std::unique_ptr<_Tp> make_unique(Args&& ...) [with T = market::Order; Args = {double&, long int&, long int}] std::unique_ptr make_unique( Args&& ...args ) ^ In file included from /usr/include/c++/5/memory:81:0, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/order.h:4, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/book.h:10, from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:1: /usr/include/c++/5/bits/unique_ptr.h:764:5: note: candidate: typename std::_MakeUniq<_Tp>::single_object std::make_unique(_Args&& ...) [with _Tp = market::Order; _Args = {double&, long int&, long int}; typename std::_MakeUniq<_Tp>::single_object = std::unique_ptr] make_unique(_Args&&... args) ^ /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp: In instantiation of ‘bool market::Book<C, DEPTH>::PlaceOrder(double, long int) [with C = ReverseFloatComparator<>; long unsigned int DEPTH = 2ul]’: /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:375:24: required from here /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:257:54: error: call of overloaded ‘make_unique(double&, long int&, long int)’ is ambiguous open_orders.emplace(price, make_unique(price, size, volume(price ^ In file included from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:4:0: /home/mujtaba.hasan/Documents/RL/rl_markets/include/utilities/memory.h:5:20: note: candidate: std::unique_ptr<_Tp> make_unique(Args&& ...) [with T = market::Order; Args = {double&, long int&, long int}] std::unique_ptr make_unique( Args&& ...args ) ^ In file included from /usr/include/c++/5/memory:81:0, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/order.h:4, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/book.h:10, from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:1: /usr/include/c++/5/bits/unique_ptr.h:764:5: note: candidate: typename std::_MakeUniq<_Tp>::single_object std::make_unique(_Args&& ...) [with _Tp = market::Order; _Args = {double&, long int&, long int}; typename std::_MakeUniq<_Tp>::single_object = std::unique_ptr] make_unique(_Args&&... args) ^ /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp: In instantiation of ‘bool market::Book<C, DEPTH>::PlaceOrder(double, long int) [with C = ReverseFloatComparator<>; long unsigned int DEPTH = 3ul]’: /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:376:24: required from here /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:257:54: error: call of overloaded ‘make_unique(double&, long int&, long int)’ is ambiguous open_orders.emplace(price, make_unique(price, size, volume(price ^ In file included from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:4:0: /home/mujtaba.hasan/Documents/RL/rl_markets/include/utilities/memory.h:5:20: note: candidate: std::unique_ptr<_Tp> make_unique(Args&& ...) [with T = market::Order; Args = {double&, long int&, long int}] std::unique_ptr make_unique( Args&& ...args ) ^ In file included from /usr/include/c++/5/memory:81:0, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/order.h:4, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/book.h:10, from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:1: /usr/include/c++/5/bits/unique_ptr.h:764:5: note: candidate: typename std::_MakeUniq<_Tp>::single_object std::make_unique(_Args&& ...) [with _Tp = market::Order; _Args = {double&, long int&, long int}; typename std::_MakeUniq<_Tp>::single_object = std::unique_ptr] make_unique(_Args&&... args) ^ /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp: In instantiation of ‘bool market::Book<C, DEPTH>::PlaceOrder(double, long int) [with C = ReverseFloatComparator<>; long unsigned int DEPTH = 4ul]’: /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:377:24: required from here /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:257:54: error: call of overloaded ‘make_unique(double&, long int&, long int)’ is ambiguous open_orders.emplace(price, make_unique(price, size, volume(price ^ In file included from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:4:0: /home/mujtaba.hasan/Documents/RL/rl_markets/include/utilities/memory.h:5:20: note: candidate: std::unique_ptr<_Tp> make_unique(Args&& ...) [with T = market::Order; Args = {double&, long int&, long int}] std::unique_ptr make_unique( Args&& ...args ) ^ In file included from /usr/include/c++/5/memory:81:0, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/order.h:4, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/book.h:10, from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:1: /usr/include/c++/5/bits/unique_ptr.h:764:5: note: candidate: typename std::_MakeUniq<_Tp>::single_object std::make_unique(_Args&& ...) [with _Tp = market::Order; _Args = {double&, long int&, long int}; typename std::_MakeUniq<_Tp>::single_object = std::unique_ptr] make_unique(_Args&&... args) ^ /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp: In instantiation of ‘bool market::Book<C, DEPTH>::PlaceOrder(double, long int) [with C = ReverseFloatComparator<>; long unsigned int DEPTH = 5ul]’: /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:378:24: required from here /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:257:54: error: call of overloaded ‘make_unique(double&, long int&, long int)’ is ambiguous open_orders.emplace(price, make_unique(price, size, volume(price ^ In file included from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:4:0: /home/mujtaba.hasan/Documents/RL/rl_markets/include/utilities/memory.h:5:20: note: candidate: std::unique_ptr<_Tp> make_unique(Args&& ...) [with T = market::Order; Args = {double&, long int&, long int}] std::unique_ptr make_unique( Args&& ...args ) ^ In file included from /usr/include/c++/5/memory:81:0, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/order.h:4, from /home/mujtaba.hasan/Documents/RL/rl_markets/include/market/book.h:10, from /home/mujtaba.hasan/Documents/RL/rl_markets/src/market/book.cpp:1: /usr/include/c++/5/bits/unique_ptr.h:764:5: note: candidate: typename std::_MakeUniq<_Tp>::single_object std::make_unique(_Args&& ...) [with _Tp = market::Order; _Args = {double&, long int&, long int}; typename std::_MakeUniq<_Tp>::single_object = std::unique_ptr] make_unique(_Args&&... args) ^ src/CMakeFiles/rl_engine.dir/build.make:158: recipe for target 'src/CMakeFiles/rl_engine.dir/market/book.cpp.o' failed make[2]: [src/CMakeFiles/rl_engine.dir/market/book.cpp.o] Error 1 CMakeFiles/Makefile2:220: recipe for target 'src/CMakeFiles/rl_engine.dir/all' failed make[1]: [src/CMakeFiles/rl_engine.dir/all] Error 2 Makefile:94: recipe for target 'all' failed make: *** [all] Error 2

tspooner commented 5 years ago

Hi mujtabahasan,

First, sorry for taking so long to respond - I received no notification of the issue.

So this issue is something I experience also. If I remember correctly, the problem is that the unique_ptr and shared_ptr types are defined in different headers on Mac OS X and Linux systems. Really I should code it such that it works on either system without any changes but I just manually edited the files each time I switched; the laziness of programmers never ceases to amaze!

It's been a while since I've done this myself so take a look on stack overflow as it's a common issue. Hope that helps.

Regards, Tom

tspooner commented 5 years ago

(I'll keep the issue open while you debug 👍)

dichen9412 commented 5 years ago

Hi, I'm also facing this problem with Mac OS. Can you tell me what should I do to fix it? (w.r.t. what you said about unique_ptr and shared_ptr.) Best, Di

niurencheng commented 2 years ago

Hi, I'm also facing this problem with ubuntu, Can you tell me what should I do to fix it? (w.r.t. what you said about unique_ptr and shared_ptr.) Best, Thank you Di

dichen9412 commented 2 years ago

Sorry, I had the same problem before but I was not the one who solved it. Very Best, Di

On Tue, Dec 21, 2021 at 10:44 PM niurencheng @.***> wrote:

Hi, I'm also facing this problem with ubuntu, Can you tell me what should I do to fix it? (w.r.t. what you said about unique_ptr and shared_ptr.) Best, Thank you Di

— Reply to this email directly, view it on GitHub https://github.com/tspooner/rl_markets/issues/5#issuecomment-999326663, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALNN52K4YMBI7BYWQSZ6HHDUSFXTNANCNFSM4F3D3ARQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

niurencheng commented 2 years ago

Sorry, I had the same problem before but I was not the one who solved it. Very Best, Di On Tue, Dec 21, 2021 at 10:44 PM niurencheng @.> wrote: Hi, I'm also facing this problem with ubuntu, Can you tell me what should I do to fix it? (w.r.t. what you said about unique_ptr and shared_ptr.) Best, Thank you Di — Reply to this email directly, view it on GitHub <#5 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALNN52K4YMBI7BYWQSZ6HHDUSFXTNANCNFSM4F3D3ARQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you commented.Message ID: @.>

你是中国人吗?可以加个微信15111027704,一起讨论下嘛?谢谢啦

readerwei commented 1 month ago

change the book.cpp line 257 (https://github.com/tspooner/rl_markets/blob/master/src/market/book.cpp#L257): To: open_orders.emplace(price, ::make_unique(price, size, volume(price))); which uses the make_unique function defined the program instead of the one in std.