profitviews / heisenberg

Algo trading code, documentation and webinars.
https://profitview.net
MIT License
64 stars 30 forks source link

Help with Heisenberg installation #9

Open IntuitionQuant opened 1 year ago

IntuitionQuant commented 1 year ago

Hi profitviews,

I appreciate that you share the algo-trading platform written in C++. I have been trying to install it on my PC with Windows 11, but cannot do it.

  1. Your steps involved with conan is written for conan version 1.x. I am not sure how to revise it in the current conan version 2.x. I installed the older version. It seems to have solved the problem.
  2. Step 15. conan install ../ --build missing --profile windows-msvc does not work. Several components are not building. I attached the picture shown in my PowerShell.
Screenshot 2023-04-25 181028 Screenshot 2023-04-25 181126

Any clue or help is deeply appreciated.

Twon commented 1 year ago

You should be using Conan 1.59 for now. The Conan 2 migration is ongoing but not yet complete as far as I know. This means many packages have not yet been migrated across to Conan 2, and until the migration is complete support is experimental.

As for the build errors, b2 is the boost build system, so Conan is failing while trying to build Boost 1.78 but the image you've attached does not contain the actual error, but is just a downstream exception caused by an earlier error in the build process. Can you attach the whole build log (i.e pipe the output of Conan to a text file, for example on my system I execute "conan install ../ --profile=C:\Users\antpe.conan\profiles\vs17-x64-debug --build=missing 2>&1 > build.log" to capture the log) and add it to this issue to I can see the actual cause of the error.

However, I've advice trying to update the version of boost to 1.81 by bumping the version in the conan.txt file at the root of the repository.

IntuitionQuant commented 1 year ago

Thanks for your reply. Here is the log file. I have Boost_1.81.0 but the build is still using boost/1.78.0.

Please let me know how I can proceed. Thanks again. build.log

Twon commented 1 year ago

Thanks, I see the problem now. Your Conan profile file is missing the C++ language version setting. You can see this at the top of the log file:

Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=Visual Studio
compiler.runtime=MDd
compiler.version=17
os=Windows
os_build=Windows
[options]
[build_requires]
[env]

Without it then it will default to C++03 which is not recent enough to build the Boost libraries which required C++11 support. You can see this in the Boost output when it's trying to detect C++ features. Without the required features then it fails to build targets that require them. Note this project uses C++20, so this would always have failed eventually. You need to add this setting file (usually in ~/.conan/profiles/default unless you've created a profile of a different name)

compiler.cppstd=20

With this, your profile should look as:

Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=Visual Studio
compiler.runtime=MDd
compiler.version=17
compiler.cppstd=20
os=Windows
os_build=Windows
[options]
[build_requires]
[env]

Try this and let me know how you get on.

IntuitionQuant commented 1 year ago

Thanks for your reply. I added the C++ version to both the default and the windows-msvc profiles (as in the build instructions). It still does not work. I attached the build log file here (build2.log).
build2.log

Twon commented 1 year ago

Ok, so I've compared this to my machine where this works: build.log

There is a number of suspicious things in your log, but without knowing your exact set up its hard to debug the cause:

At this point perhaps you could share some information about your system setup as it appears to deviate from anything we have seen from users before. What tools do you have installed? Do you have the latest MSVC for C++20 support? Any info here is going to increase the chances we can solve this.

Cheers!

IntuitionQuant commented 1 year ago

Thanks. I am using VS 2022 community. VS code is my Python IDE.

I am very interested in applying C++ to back-testing and portfolio optimization. I found that the resources for quant investment with C++ is really scarce compared with Python. I appreciate if you could share a crash course/self-learning recourse.