Bug#1108620: ngspice: Prospective upgrade of blt to 3.0 affects ngspice

2025-07-03 Thread Sergei Golovan
Hi, Holger, Carsten,

I'm sorry, when I prepared the patch, I minimized my own effort and didn't
bother to maintain compatibility with BLT 2. The problem with BLT 3 is that it
isn't released yet and I don't know when it'll be released. So,
currently keeping
ngspice compatible with BLT 2 is a must.

Also, my patch to ngspice relies on a bugfix to
https://sourceforge.net/p/blt/patches/46/
so it might be useless upstream before the patch there goes to the repository.

Anyway, I'm attaching a more complete version of the patch which doesn't break
compatibility with BLT 2. It might need a better way of finding blt.h
in the configure
script though.

On Tue, Jul 1, 2025 at 10:11 PM Holger Vogt  wrote:
>
> Carsten,
>
> the next ngspice release (45) is planned for end of July.
>
> Up to now I did not consider any changes to the tclspice port.
>
> I will have a look at the BLT 3 sources.
>
> What about putting these changes into ngspice-46 (end of 2025)?
>
> Best regards
>
> Holger
>
>
> Am 01.07.2025 um 18:49 schrieb Carsten Schoenert:
> > Hello Sergei,
> >
> > I haven't heard from upstream about a new planned version for NGspice
> > yet but let's forward your news to Holger Vogt from the NGspice team.
> > You changes will also affect Ubuntu at one day.
> >
> > Am 01.07.25 um 18:22 schrieb Sergei Golovan:
> >
> >> I'm planning to upgrade blt to 3.0 shortly after the release of trixie,
> >> and this upgrade will affect ngspice. Specifically, the configure script
> >> will not be able to find new libBlt30.so (now it searches for
> >> libBLT.so), also blt.h will move to /usr/include/blt, and new blt
> >> will require to be initiated by calling Blt_TclInit(). The attached
> >> patch fixes these problems, and also modifies two scripts under
> >> examples/tclspice/:
> >>   1) namespace import blt::* won't work without -force now,
> >>   2) vector create will return error if the vector already exists
> >>   3) blt graphs will not have 'grid' subcommand anymore, grid
> >>  configuration will move to the 'axis' subcommand.
> >>
> >> You can do additional testing by using the blt packages from
> >> experimental.
> >
> > @Holger
> > The patch Sergei is talking about can be found in the Debian BTS
> >
> > https://bugs.debian.org/1108620
> >
> > In detail in this URL
> >
> > https://bugs.debian.org/cgi-bin/bugreport.cgi?
> > att=1;bug=1108620;filename=blt3.patch;msg=5
> >
> > Maybe you already prepared in this direction in the upstream work of
> > ngspice?
> >
>


-- 
Sergei Golovan


blt3.patch
Description: Binary data


Bug#1108620: ngspice: Prospective upgrade of blt to 3.0 affects ngspice

2025-07-01 Thread Holger Vogt

Carsten,

the next ngspice release (45) is planned for end of July.

Up to now I did not consider any changes to the tclspice port.

I will have a look at the BLT 3 sources.

What about putting these changes into ngspice-46 (end of 2025)?

Best regards

Holger


Am 01.07.2025 um 18:49 schrieb Carsten Schoenert:

Hello Sergei,

I haven't heard from upstream about a new planned version for NGspice 
yet but let's forward your news to Holger Vogt from the NGspice team.

You changes will also affect Ubuntu at one day.

Am 01.07.25 um 18:22 schrieb Sergei Golovan:


I'm planning to upgrade blt to 3.0 shortly after the release of trixie,
and this upgrade will affect ngspice. Specifically, the configure script
will not be able to find new libBlt30.so (now it searches for
libBLT.so), also blt.h will move to /usr/include/blt, and new blt
will require to be initiated by calling Blt_TclInit(). The attached
patch fixes these problems, and also modifies two scripts under
examples/tclspice/:
  1) namespace import blt::* won't work without -force now,
  2) vector create will return error if the vector already exists
  3) blt graphs will not have 'grid' subcommand anymore, grid
 configuration will move to the 'axis' subcommand.

You can do additional testing by using the blt packages from
experimental.


@Holger
The patch Sergei is talking about can be found in the Debian BTS

https://bugs.debian.org/1108620

In detail in this URL

https://bugs.debian.org/cgi-bin/bugreport.cgi? 
att=1;bug=1108620;filename=blt3.patch;msg=5


Maybe you already prepared in this direction in the upstream work of 
ngspice?






Bug#1108620: ngspice: Prospective upgrade of blt to 3.0 affects ngspice

2025-07-01 Thread Carsten Schoenert

Hello Sergei,

I haven't heard from upstream about a new planned version for NGspice 
yet but let's forward your news to Holger Vogt from the NGspice team.

You changes will also affect Ubuntu at one day.

Am 01.07.25 um 18:22 schrieb Sergei Golovan:


I'm planning to upgrade blt to 3.0 shortly after the release of trixie,
and this upgrade will affect ngspice. Specifically, the configure script
will not be able to find new libBlt30.so (now it searches for
libBLT.so), also blt.h will move to /usr/include/blt, and new blt
will require to be initiated by calling Blt_TclInit(). The attached
patch fixes these problems, and also modifies two scripts under
examples/tclspice/:
  1) namespace import blt::* won't work without -force now,
  2) vector create will return error if the vector already exists
  3) blt graphs will not have 'grid' subcommand anymore, grid
 configuration will move to the 'axis' subcommand.

You can do additional testing by using the blt packages from
experimental.


@Holger
The patch Sergei is talking about can be found in the Debian BTS

https://bugs.debian.org/1108620

In detail in this URL

https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=1108620;filename=blt3.patch;msg=5

Maybe you already prepared in this direction in the upstream work of 
ngspice?


--
Regards
Carsten



Bug#1108620: ngspice: Prospective upgrade of blt to 3.0 affects ngspice

2025-07-01 Thread Sergei Golovan
Package: ngspice
Version: 44.2+ds-1+exp1
Severity: normal
Tags: patch

Dear Maintainer,

I'm planning to upgrade blt to 3.0 shortly after the release of trixie,
and this upgrade will affect ngspice. Specifically, the configure script
will not be able to find new libBlt30.so (now it searches for
libBLT.so), also blt.h will move to /usr/include/blt, and new blt
will require to be initiated by calling Blt_TclInit(). The attached
patch fixes these problems, and also modifies two scripts under
examples/tclspice/:
 1) namespace import blt::* won't work without -force now,
 2) vector create will return error if the vector already exists
 3) blt graphs will not have 'grid' subcommand anymore, grid
configuration will move to the 'axis' subcommand.

You can do additional testing by using the blt packages from
experimental.

Cheers!
-- 
Sergei Golovan
--- a/configure.ac
+++ b/configure.ac
@@ -587,8 +587,8 @@
 
  .  $tcl_config_sh
 
-CFLAGS="$CFLAGS $TCL_INCLUDE_SPEC"
-CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC"
+CFLAGS="$CFLAGS $TCL_INCLUDE_SPEC -I/usr/include/blt"
+CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC -I/usr/include/blt"
 
 AC_CHECK_HEADERS([tcl.h blt.h], [], [AC_MSG_ERROR([Couldn't find Tcl/BLT 
headers])])
 
@@ -612,7 +612,7 @@
 fi
 rm -f conftest.tcl
 
-AC_SEARCH_LIBS([Blt_GetVector], [BLT BLT24 BLT25],,
+AC_SEARCH_LIBS([Blt_GetVector], [BLT BLT24 BLT25 Blt30],,
 [AC_MSG_ERROR([Couldnt find BLT library.])])
 
 AC_CHECK_LIB([pthread], [pthread_create])
--- a/src/tclspice.c
+++ b/src/tclspice.c
@@ -117,6 +117,7 @@
 #undef WIN32
 #endif
 #include 
+#include 
 #include  "ngspice/sim.h"
 
 /* defines for Tcl support
@@ -2465,6 +2466,10 @@
 return TCL_ERROR;
 #endif
 
+if (Blt_TclInit(interp) == TCL_ERROR) {
+return TCL_ERROR;
+}
+
 Tcl_PkgProvide(interp, (char*) TCLSPICE_name, (char*) TCLSPICE_version);
 
 Tcl_Eval(interp, "namespace eval " TCLSPICE_namespace " { }");
--- a/examples/tclspice/tcl-testbench2/tcl-testbench2.sh
+++ b/examples/tclspice/tcl-testbench2/tcl-testbench2.sh
@@ -4,7 +4,7 @@
 
 package require BLT
 load ../../../src/.libs/libspice.so
-namespace import blt::*
+namespace import -force blt::*
 
 wm title . "Vector Test script"
 wm geometry . 800x600+40+40
--- a/examples/tclspice/tcl-testbench4/vspicechart.tcl
+++ b/examples/tclspice/tcl-testbench4/vspicechart.tcl
@@ -12,7 +12,7 @@
 source selectfromlist.tcl
 source bltGraph.tcl
 
-namespace import blt::*
+namespace import -force blt::*
 
 wm title . "vspicechart 0.01"
 wm geometry . 800x450+40+40
@@ -147,7 +147,7 @@
   set i 0
   foreach sig $globals(signals) {
 set nsig [replacechar $sig "\#" "_"]
-vector create $nsig
+catch { vector create $nsig }
 spice::spicetoblt $sig $nsig
   
 $globals(chart0) element create $sig -color  [lindex $globals(colors) $i]  
-xdata stime -ydata $nsig -symbol none
@@ -214,7 +214,8 @@
 .f2.chart axis configure x -title "Time in s"
 
 
-.f2.chart grid configure -hide no 
+.f2.chart axis configure x -grid yes 
+.f2.chart axis configure y -grid yes 
 Blt_ZoomStack .f2.chart
 Blt_Crosshairs .f2.chart
 Blt_ClosestPoint .f2.chart