Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VPI on Windows #42

Open
gatk555 opened this issue Dec 8, 2024 · 2 comments
Open

VPI on Windows #42

gatk555 opened this issue Dec 8, 2024 · 2 comments

Comments

@gatk555
Copy link

gatk555 commented Dec 8, 2024

I am mainly here to thank developers for this nifty repository. Lacking a Windows machine, I am using Actions to check that my code can work there and expected to have to build my own GHDL. This Action has saved much time.

I have run into a problem, for which likely perhaps a documentary fix is possible. Background: I build with "ghdl -e -shared", adding my own code with "-Wl,ghdl_shim.o". No problem there, but I also have a VPI module built with:

"shell ghdl --vpi-link clang ghdl_vpi.o -o ghdlng.vpi -lm -L. -l$base"

That is also apparently fine, DUMPBIN.EXE says it is a good DLL, although MSYS's ldd chokes on it. (The last part is because this VPI code calls back into the main DLL.) But when trying to run:

loading VPI module './ghdlng.vpi'
The specified module could not be found.

555:error: cannot load VPI module './ghdlng.vpi

A fix is straightforward: "copy D:\a_temp\msys64\UCRT64\lib\libghdlvpi.dll ." So the problem is a combination of lousy error reporting by the OS (GHDL seems to do the right thing), and the library is not in the DLL search path. Being a baby at Windows admin, I have no idea how to add it, but if that is not easy it may be worth documenting this trap. Thanks!

@tgingold
Copy link
Member

tgingold commented Dec 9, 2024

On Windows, DLL are sheared in the PATH environment variable.
You can simply move libghdlvpi.dll in the same directory as ghdl.exe

Or you can modify PATH, but I don't know which shell are you using.

@gatk555
Copy link
Author

gatk555 commented Dec 20, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants