Skip to content

Fix: ngspice dll on msys2#1

Open
Kreijstal wants to merge 2 commits intopatch-1from
Kreijstal-patch-1
Open

Fix: ngspice dll on msys2#1
Kreijstal wants to merge 2 commits intopatch-1from
Kreijstal-patch-1

Conversation

@Kreijstal
Copy link
Owner

This pull request includes a small change to the setup_platform method in the PySpice/Spice/NgSpice/Shared.py file. The change modifies the library path for the MINGW environment.

I've modified the code to handle MINGW environments on Windows. Here are the key changes:

In the setup_platform method:

Added checks for MSYSTEM and MINGW_PREFIX environment variables
If MINGW is detected, it sets up paths using the MINGW_PREFIX:

Sets LIBRARY_PATH to point to the MINGW ngspice DLL
Sets SPICE_LIB_DIR to the MINGW scripts directory
Sets NGSPICE_LIBRARY_PATH to the specific MINGW ngspice DLL

The code maintains the original Windows paths as a fallback when MINGW is not detected.
The _load_library method was updated to only set the default Windows SPICE_LIB_DIR if:

The environment variable isn't already set
NGSPICE_PATH exists (indicating we're using the original Windows path)

This way, when running in a MINGW environment, it will automatically detect and use the MINGW-installed ngspice, but will fall back to the original behavior in standard Windows environments. You won't need to manually set the environment variables anymore when using MINGW.
I did missmanage some things
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

Successfully merging this pull request may close these issues.

1 participant