Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions PySpice/Spice/NgSpice/Shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,22 @@ def setup_platform(cls):
cls.LIBRARY_PATH = _
else:
if ConfigInstall.OS.on_windows:
ngspice_path = Path(__file__).parent.joinpath('Spice64_dll')
cls.NGSPICE_PATH = ngspice_path
# path = ngspice_path.joinpath('dll-vs', 'ngspice-{version}{id}.dll')
path = ngspice_path.joinpath('dll-vs', 'ngspice{}.dll')
# Check for MSYSTEM environment first
msystem = os.environ.get('MSYSTEM')
mingw_prefix = os.environ.get('MINGW_PREFIX')

if msystem and mingw_prefix:
# Use MINGW paths
path = str(Path(mingw_prefix) / 'bin' / 'libngspice-0{}.dll')
if 'SPICE_LIB_DIR' not in os.environ:
os.environ['SPICE_LIB_DIR'] = str(Path(mingw_prefix) / 'share' / 'ngspice' / 'scripts')
else:
# Fall back to original Windows paths
ngspice_path = Path(__file__).parent.joinpath('Spice64_dll')
cls.NGSPICE_PATH = ngspice_path
# path = ngspice_path.joinpath('dll-vs', 'ngspice-{version}{id}.dll')
path = str(ngspice_path.joinpath('dll-vs', 'ngspice{}.dll'))

elif ConfigInstall.OS.on_osx:
path = 'libngspice{}.dylib'
elif ConfigInstall.OS.on_linux:
Expand Down Expand Up @@ -619,7 +631,8 @@ def _send_char(message_c, ngspice_id, user_data):
func = self._logger.info
elif content.startswith('Warning:'):
func = self._logger.warning
# elif content.startswith('Warning:'):
elif content.startswith('Using'): # Ignore "Using ... as Direct Linear Solver" messages
func = self._logger.debug
else:
self._error_in_stderr = True
func = self._logger.error
Expand Down