Don't know, but for me it works with a msys2/ucrt64 created exe from latest dev branch pre-master-45 tested in cmd environment (not bash). Same for ngspice_con.exe - w/o graphics.
We are not told the ngspice version number, nor shown the complete output. A more adequate error report would be a big help.
But this looks like a failure to splice the directory path of an included file to a relative .include file name that it contains. If so, the version must be 43 or 44, as that function did not exist before commit b660e75S. My guess is that inp_pathresolve_at() is failing to splice paths containing a mix of directory separators. It may be necessary to reproduce with a build with extra debugging.
But for now, what is the file containing the failed path name? What is the ngspice version, the origin of the program (built locally, packaged), the Windows version, the default directory? All this background information should be in any bug report.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are using a relative path to find the models. Relative to what?
On windows such calls are relative to the "current directory". This directory is typically the directory of the calling program, here ngspice_con.exe.
If you want to use a different "current directory" when using ngspice, you may add a command
cd new_current_dir
into .spiceinit.
I gave a script, the script is meant to be executed on that directory, which works in linux, windows 11 but not winsows 10, ngspice_con runs exactly on that directory, the same process works on windows11 while the exact same process doesn't run on windows 10, I don't see how are paths relevant now. (provided it does work on windows 11 (and the msys2 version is the same))
Not sure if it is related but I'll try to compile ngspice-44 to see if the bug dissapears: there are some bugs:
kreijstal@windowsUCRT64~/git/MINGW-packages/mingw-w64-ngspice/src/build-shared-UCRT64/src/xspice/verilog#echo" CC "ivlng_la-icarus_shim.lo;/bin/sh../../../libtool--silent--tag=CC--mode=compilegcc-DHAVE_CONFIG_H-I.-I../../../../ngspice-44/src/xspice/verilog-I../../../src/include-I../../../../src/include-march=nocona-msahf-mtune=generic-O2-pipe-Wp,-D_FORTIFY_SOURCE=2-fstack-protector-strong-Wp,-D__USE_MINGW_ANSI_STDIO=1-std=gnu11-fopenmp-MTivlng_la-icarus_shim.lo-MD-MP-MF.deps/ivlng_la-icarus_shim.Tpo-c-oivlng_la-icarus_shim.lo`test-f'icarus_shim.c'||echo'../../../../ngspice-44/src/xspice/verilog/'`icarus_shim.cCCivlng_la-icarus_shim.lo../../../../ngspice-44/src/xspice/verilog/icarus_shim.c:21:10:fatalerror:ngspice/cmtypes.h:Nosuchfileordirectory21|#include"ngspice/cmtypes.h"// For Digital_t|^~~~~~~~~~~~~~~~~~~compilationterminated.
I simply took the PKGBUILD and replaced 42 with 44. However this might just be a packaging issue unrelated to the ngspice project. I'll try to get 44 version working on windows 10, but again as I said the bug does not occur with windows 11, only with windows 10.
Last edit: kreijstal 2025-02-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I prefer a strict separation between MINGW and Cygwin.
Therefore I have installed MSYS2 seperately in addition to Cygwin, and I do not see any cross contamination. Compiling is done by a modified script in a MSYS2 bash window using compile_min.sh, by changing --with-wingui to --with-wingui=no
with a resulting configure ../configure --with-wingui=no --enable-cider prefix="C:/Spice64d" CFLAGS="-g -m64 -O0 -Wall -Wno-unused-but-set-variable" LDFLAGS="-g -m64"
Readline, OpenMP, XSPICE are included automatically.
The ncurses problems remains however, caused by some update in MINGW.
I'd propose to (temporarly) exclude the terminal code in terminal.c for a MINGW build by adding
/* temporarily exclude code from compiling with MINGW */#ifdef __MINGW32__#undef HAVE_TERMCAP#endif
to terminal.c.
Compiling of pre-master-45 is successful then, however there remains a problem with installing ivlng.vpi as
This error occurs because libtool fails to build the Icarus support DLLs, but treats it as a warning, so the error appears at the install stage. The failure is connected to configure's liking for ncurses, which is actually not used. I am testing fixes.
Giles
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think the slowdown of mingw compilation comes from autotools, not from mingw, does visual studio compilation doesn't use autotools, maybe cmake would be comparable. I wouldn't know.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Compiling and linking a console ngspice with ncurses on MINGW is possible by some code changes to terminal.c and configure.ac, as shown in ngspice git branch hv_curses.
I don't think however that this is wothwhile persuing, as tests have to be done on all relevant operating systems, and distribution would require additional dlls.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anyway, I finally compiled ngspice 44.2 and now I get the following error message: under windows 10
Error: Could not find include file ../../../libs.tech/ngspice/parasitics/sky130_fd_pr__model__parasitic__diode_pw2dn__extended_drain.model.spice
While reading .\sky130/sky130A/libs.tech/ngspice/corners\../../../libs.ref/sky130_fd_pr/spice\sky130_fd_pr__nfet_20v0__subcircuit.pm3.spice
ERROR: fatal error in ngspice, exit(1)
when sourcing test.spice
Edit:
now I tried with windows11, and it works without problems:
# ngspice_con.exe
******
** ngspice-44.2 : Circuit level simulation program
** Compiled with KLU Direct Linear Solver
** The U. C. Berkeley CAD Group
** Copyright 1985-1994, Regents of the University of California. ** Copyright 2001-2024, The ngspice team.
** Please get your ngspice manual from https://ngspice.sourceforge.io/docs.html
** Please file your bug-reports at http://ngspice.sourceforge.net/bugrep.html
** Creation Date: Tue Feb 4 16:11:16 UTC 2025
******
Warning: no graphics interface!
You may use command 'gnuplot'
if GnuPlot is installed.
ngspice 1 -> source test.spice
Note: No compatibility mode selected!
Circuit: Voltage Multiplier
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000
Using SPARSE 1.3 as Direct Linear Solver
Initial Transient Solution
--------------------------
Node Voltage
---- ------- vdd 1.8
in 0
out 1.8
v1#branch 0
vdd#branch -1.90256e-12
Reference value : 0.00000e+00 No. of Data Rows : 1068
Can't open viewport for graphics.
ngspice 2 ->
I can test the latest git version if you want, but I don't believe it will give me a different result
Last edit: kreijstal 2025-02-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have been using ngspice-44+, console as well as GUI, both MINGW and VS, Windows 10, sourcing your input file, using an absolute path to the Skywater library: no problem at all to run the simulation.
You might use an absolute path as well. And check your Skywater library install.
Last edit: Holger Vogt 2025-02-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't have a problem either on windows 11, however on windows 10, I do. Does it work for you as well on windows 10? My problem only happens on windows 10.
I'll try an absolute path, I think I did, and it didn't work either. I'll try outside the msys2 enviroment, to see if it is related to that.
Edit: Wow, ok, I'll see what's going on, thank you for the feedback.
Last edit: kreijstal 2025-02-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
code to reproduce:
then type
Don't know, but for me it works with a msys2/ucrt64 created exe from latest dev branch pre-master-45 tested in cmd environment (not bash). Same for ngspice_con.exe - w/o graphics.
Sorry - Screenshot upload seems not functional.
hmm alright yes thank you, it seems ucrt64 works but mingw64 doesn't
nevermind, I spoke too fast, it happens with ucrt64 on windows 10 as well, but not with windows 11 on the distro default, I'm using ngspice_con
Oh, forgot to say: my check was under win 11.
You are using a relative path to find the models. Relative to what?
On windows such calls are relative to the "current directory". This directory is typically the directory of the calling program, here ngspice_con.exe.
If you want to use a different "current directory" when using ngspice, you may add a command
cd new_current_dirinto .spiceinit.
We are not told the ngspice version number, nor shown the complete output. A more adequate error report would be a big help.
But this looks like a failure to splice the directory path of an included file to a relative .include file name that it contains. If so, the version must be 43 or 44, as that function did not exist before commit b660e75S. My guess is that inp_pathresolve_at() is failing to splice paths containing a mix of directory separators. It may be necessary to reproduce with a build with extra debugging.
But for now, what is the file containing the failed path name? What is the ngspice version, the origin of the program (built locally, packaged), the Windows version, the default directory? All this background information should be in any bug report.
I gave a script, the script is meant to be executed on that directory, which works in linux, windows 11 but not winsows 10, ngspice_con runs exactly on that directory, the same process works on windows11 while the exact same process doesn't run on windows 10, I don't see how are paths relevant now. (provided it does work on windows 11 (and the msys2 version is the same))
The one compiled on msys2. https://packages.msys2.org/packages/mingw-w64-x86_64-ngspice PKGBUILD : https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-ngspice/PKGBUILD You can see the compilation flags here.
For the one on linux I simply used the one that comes with archlinux: https://archlinux.org/packages/extra/x86_64/ngspice/
Not sure if it is related but I'll try to compile ngspice-44 to see if the bug dissapears: there are some bugs:
I simply took the PKGBUILD and replaced 42 with 44. However this might just be a packaging issue unrelated to the ngspice project. I'll try to get 44 version working on windows 10, but again as I said the bug does not occur with windows 11, only with windows 10.
Last edit: kreijstal 2025-02-03
Use the current version of ngspice tagged ngspice-44.2 to get rid of the above error and some other bugs.
Last edit: Holger Vogt 2025-02-03
@h_vogt Hmm interesting it seems it is failing here building ngspice_con
despite ncurses being installed.
I wonder if this is a configure.ac bug?
Here is a bit of the configure output attached.
Your configure log is the same as mine.
configure.ac does not check for the curses.h header.
What path does your curses.h have, where is it located?
Last edit: Holger Vogt 2025-02-03
it is /ucrt64/include/ncurses/curses.h
I patched it in configure.ac
I tried the git master version, it seems it worked, not done with the compilation yet. I'll keep you updated.
Hmm something went terribly wrong
It seems /usr/ was prioritized and it took cygwin libraries instead... huh
Last edit: kreijstal 2025-02-03
there is a rogue
-L/usr/libthat uses cygwin-lreadline -L/usr/lib -lpsapi -lshlwapi -fopenmpthis breaks msys2I prefer a strict separation between MINGW and Cygwin.
Therefore I have installed MSYS2 seperately in addition to Cygwin, and I do not see any cross contamination. Compiling is done by a modified script in a MSYS2 bash window using
compile_min.sh, by changing--with-winguito--with-wingui=nowith a resulting configure
../configure --with-wingui=no --enable-cider prefix="C:/Spice64d" CFLAGS="-g -m64 -O0 -Wall -Wno-unused-but-set-variable" LDFLAGS="-g -m64"Readline, OpenMP, XSPICE are included automatically.
The ncurses problems remains however, caused by some update in MINGW.
I'd propose to (temporarly) exclude the terminal code in terminal.c for a MINGW build by adding
to terminal.c.
Compiling of pre-master-45 is successful then, however there remains a problem with installing ivlng.vpi as
Giles might have a look at this, as now MINGW is compiling.
Generally I prefer Visual Studio 22, as compiling ngspice with VS needs 1min, compiling with MINGW 15min on my machine.
Last edit: Holger Vogt 2025-02-04
I solved the problem by just adding --without-x It compiles and runs.
No need to patch the code. (I just had some X libraries in my msys) (Not standard)
Last edit: Holger Vogt 2025-02-04
I managed to make a pkgbuild of the new version, however I use curses.patch
https://github.com/msys2/MINGW-packages/pull/23283
https://raw.githubusercontent.com/msys2/MINGW-packages/21d778022213758f8fa76ce9254db9b582d2d6ba/mingw-w64-ngspice/curses.patch
Last edit: kreijstal 2025-02-04
Holger,
This error occurs because libtool fails to build the Icarus support DLLs, but treats it as a warning, so the error appears at the install stage. The failure is connected to configure's liking for ncurses, which is actually not used. I am testing fixes.
Giles
looking for ncursesw instead of ncurses seems to help (MINGW mingw64). See git branch hv_curses.
Last edit: Holger Vogt 2025-02-04
I think the slowdown of mingw compilation comes from autotools, not from mingw, does visual studio compilation doesn't use autotools, maybe cmake would be comparable. I wouldn't know.
On Linux the compilation with the ngspice Autotools takes between 1 and 1.5min.
Compiling and linking a console ngspice with ncurses on MINGW is possible by some code changes to terminal.c and configure.ac, as shown in ngspice git branch hv_curses.
I don't think however that this is wothwhile persuing, as tests have to be done on all relevant operating systems, and distribution would require additional dlls.
Anyway, I finally compiled ngspice 44.2 and now I get the following error message: under windows 10
when sourcing
test.spiceEdit:
now I tried with windows11, and it works without problems:
I can test the latest git version if you want, but I don't believe it will give me a different result
Last edit: kreijstal 2025-02-04
I have been using ngspice-44+, console as well as GUI, both MINGW and VS, Windows 10, sourcing your input file, using an absolute path to the Skywater library: no problem at all to run the simulation.
You might use an absolute path as well. And check your Skywater library install.
Last edit: Holger Vogt 2025-02-04
I don't have a problem either on windows 11, however on windows 10, I do. Does it work for you as well on windows 10? My problem only happens on windows 10.
I'll try an absolute path, I think I did, and it didn't work either. I'll try outside the msys2 enviroment, to see if it is related to that.
Edit: Wow, ok, I'll see what's going on, thank you for the feedback.
Last edit: kreijstal 2025-02-04