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
Fix questa/modelsim on Windows #882
Conversation
Tested on latest Questa (32 and 64) and Modelsim 12.1 (32) using conda + msys2
@@ -131,7 +140,9 @@ EXTRA_LIBDIRS := -L$(MODELSIM_BIN_DIR) | |||
OLD_PATH := $(shell echo "$(PATH)" | sed 's/(/\\(/g' | sed 's/)/\\)/g' | sed 's/ /\\ /g') | |||
|
|||
LIB_LOAD := PATH=$(MINGW_BIN_DIR):$(OLD_PATH):$(LIB_DIR) | |||
NEW_PYTHONPATH := $(shell echo "$(PYTHONPATH)" | sed -e 's/\\/\//g' -e 's/\([a-zA-Z]\):\//\/\1\//g' -e 's/;/:/g') | |||
NEW_PYTHONPATH:=$(shell python -c "import sys, os; print(':'.join(['/'+dir.replace(os.sep,'/').replace(':','') for dir in sys.path]))") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could really do with a comment. I assume it's the same as all the other makefiles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would print(os.pathsep.join(subprocess.check_output(['cygpath', '-m', d]) for d in sys.path))
work here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can do but in practice it will be something like this:
python -c "import sys, os, subprocess; print(os.pathsep.join(str(subprocess.check_output(['cygpath', '-m', d]))[2:-3] for d in sys.path if d != '' ))"
Is that better?
Thanks @themperek for working on our Windows builds. However, I'm not a fan of those changes, it's effectively piling workarounds on top of each other, one simulator at a time. What we need to have is a function that knows how to format a PATH-like list of directories and a file path according to the environment rules. Since especially msys has rules that differ depending on how you call it (cygwin paths or native windows paths) it doesn't make sense to spread this ugly and error-prone environment logic spread all Makefiles. |
I would rather work on getting ride of Makefiles .... |
@imphil Where those functions should be located? In makefile? In cocotb? Can try to write them with sed (like it was before). Not sure if this can be done in a "nice" way. Ex. Modelsim/Questa seems to accept only path in a form The same situation is already here: https://github.com/potentialventures/cocotb/blob/master/cocotb/share/makefiles/simulators/Makefile.icarus |
It seems very unlikely to me that these care about the |
For |
Hi, I tried with miniconda, then anaconda, removed/updated numpy etc...no luck. Since the change here was about the path, I wonder if you see the same issue on your end and maybe it's not a local issue on my side? Just importing numpy causes the crash. Thanks!
|
It looks like missing LD_LIBRARY_PATH to extra dll (in this case numpy). Will try to have a look. |
Hi, |
@imphil I know this is not very nice but I have no better idea with makefiles and without this on Windows is hard to make this working. |
I'd like to see this PR merged in some way or another. |
@elgorwi You can try this: https://github.com/themperek/cocotb-test/ (still experimental but should make windows much nicer experience long run) |
@themperek that looks really cool! I'll have to try it out when I get some spare time. Thanks |
Close in favor of #1099 |
Tested on latest Questa (32 and 64) and Modelsim 12.1 (32) using conda + msys2
Will update documentation as next step.
Usage:
PATH
to the *.exe folderAnaconda Prompt
conda install -c msys2 m2-base m2-make m2w64-toolchain libpython
see also: Dockerfile.windows