New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ngspice: update to 35 and fix issue with binary not built/installed #32403
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if unnecessary, I wonder if we should make ngspice
depend on libngspice
... This way people's systems won't be broken.
Also, this PR needs to revbump kicad to pick up the new dependency.
Another possible solution is creating a ngspice-progs
subpackage, but that feels kind of ugly.
I included the revbump to kicad. What exactly would happen if we don't have ngspice depend on libngspice? |
Basically that someone who installed ngspice locally to use the libraries in their own projects would no longer be able to run them. That doesn't matter for most cases, since those people will usually have |
I see what you're saying. As far as the checks go, apparently since v34 you have to add a .spiceinit file to the home directory containing |
You can create a |
Well, while playing with this I noticed that version 35 has been released. Removing the erroneously included files is no longer needed. Thanks for the tip for including pre_check! The only thing I haven't included is a libngspice dependency in ngspice, since it doesn't really seem necessary and doubles the install size for those just looking to use ngspice (admittedly install size probably isn't a big deal either), but I can add it too if we want to go that way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the shape this is taking, nice job :)
:) |
srcpkgs/ngspice/template
Outdated
# Configure can handle building ngspice as a library or as a binary, but not both at once. | ||
# --with-ngshared builds the library, but not binary, and readline should not be configured for the library, | ||
# see: https://github.com/imr/ngspice/commit/b86c85f85bbba6e45dc030af3e853edf8b9cfa3d | ||
pre_configure() { | ||
install -d .build_lib | ||
cd .build_lib | ||
../configure --with-ngshared ${configure_args/--with-readline=yes/} | ||
} | ||
|
||
# library built during first do_build, now build the binary | ||
post_build() { | ||
make_build_args= do_build | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to remove --with-readline=yes
from configure_args
then
# Configure can handle building ngspice as a library or as a binary, but not both at once. | |
# --with-ngshared builds the library, but not binary, and readline should not be configured for the library, | |
# see: https://github.com/imr/ngspice/commit/b86c85f85bbba6e45dc030af3e853edf8b9cfa3d | |
pre_configure() { | |
install -d .build_lib | |
cd .build_lib | |
../configure --with-ngshared ${configure_args/--with-readline=yes/} | |
} | |
# library built during first do_build, now build the binary | |
post_build() { | |
make_build_args= do_build | |
} | |
do_configure() { | |
mkdir build-lib | |
cd build-lib | |
../configure --with-ngshared ${configure_args} | |
mkdir build | |
../configure --with-readline=yes ${configure_args} | |
} | |
do_build() { | |
make -C build-lib ${makejobs} | |
make -C build ${makejobs} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied suggestion, with just minor tweaks
srcpkgs/ngspice/template
Outdated
post_install() { | ||
vlicense COPYING | ||
cd .build_lib | ||
do_install | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And:
post_install() { | |
vlicense COPYING | |
cd .build_lib | |
do_install | |
} | |
do_install() { | |
make -C build-lib install | |
make -C build install | |
vlicense COPYING | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does seem clearer this way. I kind of liked not touching do_install, etc., to keep defaults and things, but maybe it just makes it a bit confusing at this point.
I am pretty happy with this version of the template. Functionally these last set of changes seem to do the same as the last, but make it clearer what it's doing. Thanks for all the helpful feedback so far! |
I went ahead and did a rebase since my branch was old. |
@ericonr I am not a KiCad user ( or even really an ngspice user), but I was curious about the |
I'm honestly ok with the last option. |
Sounds good! I went ahead and pushed changes to no longer split a libngspice package. Builds okay on my system. |
Ok, I think this still requires a kicad rebuild for some godforsaken reason :/ I can test and confirm tomorrow. |
Oh, there might be a issue if the version in the repo was linked against readline, which I'm pretty sure it is. We may want to rebuild kicad anyway just to be safe. |
It's worse ;) it tries to dlopen |
Also fixes issue with ngspice binary not being packaged and include warning for kicad.
It hardcodes the underlying file for libngspice.so.0, which it dlopens despite being linked against libngspice.so.0.
Thanks! I pushed the kicad change and merged. |
:) Thanks ericonr! |
General
Have the results of the proposed changes been tested?
close #32251
(edited PR title to be more clear)