← Back to team overview

kicad-developers team mailing list archive

Re: libngspice versioning by libtool


The current HEAD in branch 5.1. is getting configured successful but is
failing while compiling with this error message with then updated
packages of libngspice0 and libngspice0-dev:

[ 87%] Building CXX object pcbnew/CMakeFiles/pcbnew_kiface_objects.dir/dialogs/dialog_pns_length_tuning_settings.cpp.o
[ 87%] Building CXX object eeschema/CMakeFiles/eeschema_kiface.dir/sim/netlist_exporter_pspice_sim.cpp.o
[ 87%] Building CXX object eeschema/CMakeFiles/eeschema_kiface.dir/sim/ngspice.cpp.o
[ 87%] Building CXX object pcbnew/CMakeFiles/pcbnew_kiface_objects.dir/dialogs/dialog_pns_length_tuning_settings_base.cpp.o
/home/carsten/gitprojects/kicad-upstream/kicad/eeschema/sim/ngspice.cpp:341:47: error: cannot initialize a parameter of type 'ControlledExit *' (aka 'int (*)(int, int, int, int, void *)') with an rvalue of type 'int (*)(int, bool, bool, int, void *)': type mismatch at 2nd parameter ('NG_BOOL' (aka 'int') vs 'bool')
     m_ngSpice_Init( &cbSendChar, &cbSendStat, &cbControlledExit, NULL, NULL, &cbBGThreadRunning, this );
1 error generated.
make[2]: *** [eeschema/CMakeFiles/eeschema_kiface.dir/build.make:2588: eeschema/CMakeFiles/eeschema_kiface.dir/sim/ngspice.cpp.o] Fehler 1
make[2]: *** Es wird auf noch nicht beendete Prozesse gewartet....

Looks currently to me if something needs to get cherry picked from
master into 5.1. At least I can remembering that some fixing around this
was already happen in the past.

Boolean data have always been of type 'int' in spice3f5 and ngspice. Unfortunately their type internally was coined 'bool' and then typedefed to int.

When I started shared ngspice, I inadvertently have named the boolean values as 'bool' in sharedspice.h as well, even if they were of type 'int'. In a C++ environment this may be of evil because bool is a (fixed) type in C++, taking one byte, whereas 'int' takes four bytes.

So I have made a correction in sharedspice.h, calling the boolean type NG_BOOL instead of 'bool' and typedefed it to 'int'.

This has to be reflected in the calling program as well.

Ah, and what is the versioning now? The API has not changed, it was however not described correctly in sharedspice.h, which now (ngspice-35) will be fixed.

Follow ups