bhuman / BHumanCodeRelease

The official B-Human code releases
Other
194 stars 129 forks source link

Creating Project Files / Compiling the Code WINDOWS #60

Closed antbono closed 1 year ago

antbono commented 2 years ago

Hello everyone!

I am trying to compile the code in Windows 11 (21H2 version) but it seems the the 'generate.cmd' script does not work properly. If I simply double clik on it, it generates a visual studio solution named 'B-Human' but VisualStudio can't open it (not a valid solution file it reports). Then I tried using the windows terminal and I got the errors you can find in the attachment. Am I missing something, or there is a bug actually? Thank you all for your attention

Antonio

P.S. I don't know if it is related but I could not install the 'mold' package as you require in one step of the tutorial.

err

roefer commented 2 years ago

Can you please delete your checkout and pull again? Some hidden files were missing.

ahasselbring commented 2 years ago

P.S. I don't know if it is related but I could not install the 'mold' package as you require in one step of the tutorial.

This is likely related to the Ubuntu version in the WSL. The new code release requires Ubuntu 22.04 in the WSL (it seems that this still can be installed only from the Microsoft Store, but will become the default WSL distribution soon: https://github.com/microsoft/WSL/commit/4025b656b6d93e4ce51abf375b06c7547ac2a0ac)

antbono commented 2 years ago

Thank you @roefer for the new commit (new files added files in Make/Linux/... subfolders ). I pulled it but nothing changed unfortunately...


@ahasselbring I have the 22.04 version in my WSL

err

ahasselbring commented 2 years ago

You actually have to delete and clone the repository again. Pulling does not help, git will not change the line endings of existing files otherwise.

Did you run apt update in WSL?

antbono commented 2 years ago

I forgot to run 'update' after choosin Ubuntu 22.04 as default distro in wsl, now the package is found correctly. Sorry for the mistake...

I cloned the repository again and now Visual Studio can read the generated solution file. It compiles the project too with simRobot as target.

I don't know if it is important but I had these warnings/errors when calling the generate command.

Thank you again for your collaboration!

err

ahasselbring commented 2 years ago

I can't tell exactly because I don't know how you created that Ubuntu 22.04 instance, but something about the WSL setup isn't right. Normally, cmake (it's required in the WSL too in order to be able to compile for the real robot) is installed by the command

wsl apt -y install astyle ccache clang cmake llvm mold net-tools ninja-build pigz rsync xxd

that is given in here. Maybe you ran that command before setting the default to 22.04, such that the packages are installed in the other instance? Anyway, rerunning that apt install line in the correct WSL instance should fix the problem with the next run of generate, so you would be able to compile for the NAO.

(During the installation, you might get error messages that are due to this WSL bug)