Open pranavjainjs opened 11 months ago
I can help with 2 and 3.
Other readme issues:
build
dir before calling cmake in the readme. So you can address that too.python visualize.py
after running a backtest to visualize strategy specific data as shown in the screenshot.Finally, thank you for the help :)
make
(in Linux), the compiler gives error 'undefined reference to 'pthread_create''. This error occurs because the library pthread needs to be added during linking (which is done using -pthread flag in gcc instruction). Adding a line target_link_libraries(mercury pthread)
in CMakeLists.txt
does exactly that.I will include the other readme issues as well. Will you include this issue in hacktoberfest under no-code contributions?
Provide some information on the issues you have with compiling (what compiler you use, OS and other relevant info).
As for the rest of the readme, you can proceed. I'm not sure how to add it to hacktoberfest contributions, I need some info on that.
To participate in Hacktoberfest, you need to do the following things before accepting any PR. For more details, refer the website.
hacktoberfest
topic in your repository.hacktoberfest
label in the issue.hacktoberfest-accepted
label to the PRs.I will proceed with the README as discussed. Check #4.
As for the OS, I am using Windows 11. My compilers are MinGW gcc and g++. I was getting the following error -
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:16 (project):
Running
'nmake' '-?'
failed with:
The system cannot find the file specified
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
I saw a similar answer on StackOverflow which requires a change in CMakeLists.txt. On a second note. Currently, I am not using Visual Studio. Are there some files missing from my system? Will the issue be resolved if I install Visual Studio?
You're not generating mingw makefiles, use this command: cmake .. -G "MinGW Makefiles"
. The error has nothing to do with visual studio if you're using mingw.
Okay. I followed your instructions (which should be added in README too). I am glad it worked and I was able to create the Makefile.
Now, I am getting the following error when I run make
command.
...\mercury\src\backtest.cc:22:8: error: 'thread' is not a member of 'std'
22 | std::thread(&MarketSimulation::run, MarketSimulation(m_config)).detach();
| ^~~~~~
...\mercury\src\backtest.cc:8:1: note: 'std::thread' is defined in header '<thread>'; did you forget to '#include <thread>'?
7 | #include <mean_reversion.h>
+++ |+#include <thread>
8 |
make[2]: *** [CMakeFiles\mercury.dir\build.make:76: CMakeFiles/mercury.dir/src/backtest.cc.obj] Error 1
make[1]: *** [CMakeFiles\Makefile2:82: CMakeFiles/mercury.dir/all] Error 2
make: *** [Makefile:90: all] Error 2
But, library thread is included in both files.
I think you may have a weird MinGW configuration. Take a look at this: https://stackoverflow.com/questions/21460817/why-do-i-get-this-error-thread-is-not-a-member-of-std
I noticed the following issues in your source code which many people will encounter while installation.
cmake ..
gives many errors for Windows.CMakeLists.txt
has to be modified to mitigate those errors.pthread
library to use pthread_create and pthread_join functions. This could be fixed just by adding a linetarget_link_libraries(mercury pthread)
inCMakeLists.txt
config.json