Arm-Examples / AVH-VSI

This repository contains a simple Hello World example for Arm Virtual Hardware.
Apache License 2.0
4 stars 7 forks source link

pyhon39.dll not found #13

Closed rebolloluis closed 3 months ago

rebolloluis commented 4 months ago

When trying to run any of the simulations (FVP_* commands) on a Windows 10 host (22H2, OS Build 19045.4529) from the CLI, the execution fails silently, with no feedback except a non-zero error code.

I went to the exe location on my PC, e.g. %USERPROFILE%\.vcpkg\downloads\artifacts\2139c4c6\models.arm.avh.fvp\11.26.11\bin\models and double-clicking the FVP executable showed the following error: image

To fix it, I had to manually copy python39.dll from %USERPROFILE%\.vcpkg\downloads\artifacts\2139c4c6\models.arm.avh.fvp\11.26.11\python\ to %USERPROFILE%\.vcpkg\downloads\artifacts\2139c4c6\models.arm.avh.fvp\11.26.11\bin\models\.

I'm using vcpkg-tool to work from the CLI. I ran \.vcpkg\vcpkg-init.ps1 and then vcpkg activate within hello_vsi path. I have a Keil MDK V6 Professional License, user-locked.

I was expecting that running vcpkg activate would somehow solve this dependency but it didn't. I am just posting this here as I don't know if it's an actual issue.

P.S. Thank you for updating and sharing this examples, it took me a bit to figure out where to look for them and how to navigate all AVH-related doc, but I'm finally able to see it running on my PC πŸ˜„

vovamarch commented 3 months ago

Hi @rebolloluis ,

Yes, the idea is that with vcpkg activate all required dependencies will be configured.

Unfortunately avh-fvp release 11.26.11 has an issue. The python39.dll is located in \11.26.11\python\ folder, that doesn't get added to the PATH. So it requires some additional manual actions, either moving the python library, or adding the \python\ folder to the PATH.

If you fix the avh-fvp version as 11.24.24 in the vcpkg_configuration.json then it should work automatically, because the python39.dll is in the \bin\models\ that is also added to the PATH by vcpkg. Note that you should not have the ^ symbol prior to the older version, as otherwise the latest version above the specified one will be installed (i.e. 11.26.11 again).

` "arm:models/arm/avh-fvp": "11.24.24", `

Python dependency will be simplified with the next avh-fvp release.

rebolloluis commented 3 months ago

Hello @vovamarch,

Thank you for the reply. Using arm:models/arm/avh-fvp": "11.24.24 avh" fixed the issue for me. This also explains why adding my local Python 3.9 to PATH also solved the issue. I'm finally able to execute the virtual platforms without any manual patches.

Thanks, again. I look forward to the official release πŸ˜„

vovamarch commented 3 months ago

Hi @rebolloluis , this now should have been fixed for 11.26.11 release as well. You can change the avh-fvp version to ^11.26.11 in your vcpkg_configuration.json file and test.

rebolloluis commented 3 months ago

Hi @vovamarch, I tried the fix in a couple of build nodes and my local machine too and it worked. Please feel free to close the issue. Thank you!

P.S. - I've noticed that most of the AVH + CI examples are using Github workflows and cloud-hosted runners. It would be nice to also have a reference Jenkins pipeline script, given how ubiquitous it is. It'll cover the use case for on-premise Jenkins server + local nodes (on Windows). I'm happy to share mine if it helps πŸ˜„

vovamarch commented 3 months ago

Hi @rebolloluis, thanks for confirmation.

Would be great if you can attach your Jenkins script for reference!

For CI outside of GitHub we're preparing a flow based on Docker images. But of course direct use of vcpkg and artifactory should work as well, as explained in https://arm-software.github.io/AVH/main/infrastructure/html/avh_fvp_artifactory.html .

rebolloluis commented 3 months ago

Hi @vovamarch, please find the Jenkinsfile here: https://github.com/rebolloluis/avh-ci-jenkins/blob/2b4f937d346d13d90ddb52209a5fe56675a699e8/Jenkinsfile. Not perfect, but worked for us.

Notes:

vovamarch commented 3 months ago

Thank you, @rebolloluis, this is useful! Closing this now issue as complete.