Skip to content

Conversation

@jwlodek
Copy link
Contributor

@jwlodek jwlodek commented Apr 25, 2024

…th STATIC_BUILD=YES

At the moment, it seems if you perform a build with STATIC_BUILD=YES you get an error about how -lxspress3 and -limg_mod could not be found.

@MarkRivers
Copy link
Member

Just a note on this. In this case Quantum did provide static versions (.a) of their libraries. Often vendors don't do that, they only provide shareable versions (.so). However, even if they had only provided .so files you could still build the application statically by changing these lines:

$(PROD_NAME)_LIBS += xspress3
$(PROD_NAME)_LIBS += img_mod

to this:

$(PROD_NAME)_SYS_LIBS += xspress3
$(PROD_NAME)_SYS_LIBS += img_mod

@newville
Copy link
Contributor

@jwlodek why would you want to do that?
Should building a statically linked version with older versions of the libraries be encouraged?

@jwlodek
Copy link
Contributor Author

jwlodek commented Apr 25, 2024

I prefer to build statically whenever possible, so I can make the executable entirely portable. It was not clear to me that the static builds are an older version of the libraries given that they do not have version numbers.

Maybe what we can do is make the installation of the static libraries conditional on if STATIC_BUILD is true.

Edit: Or, if we want to always use the newer shared libraries during linking even in a static build we can apply Mark's suggestion and use SYS_LIBS instead of just LIBS?

@jwlodek
Copy link
Contributor Author

jwlodek commented Sep 17, 2025

I've ran into this again today - since the static libraries are out of date, should we just remove them and change the Makefile to use SYS_LIBS to always link the shared libraries, even with STATIC_BUILD=YES?

@newville
Copy link
Contributor

@jwlodek If the Makefile is changed to use SYS_LIBS, would we need to remove the vendor-supplied static libs?

@BenBradnick
Copy link

I think it makes sense to remove the static libs. They're not the most convenient to build and the lack of version number changes means it is hard to tell if they are synchronised.

@jwlodek
Copy link
Contributor Author

jwlodek commented Sep 18, 2025

We can leave the static libs if we use SYS_LIBS, but since we are recommending to not use them since they are seemingly out of date, I thought maybe it would be clearer which are used if they are removed?

@newville
Copy link
Contributor

It would be great if the shared libraries from the vendor were versioned and if updates to them were detailed in individual PRs.
I'm okay with removing static libraries from the vendor and trying to avoid merging them in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants