epics-modules / xspress3

EPICS areaDetector xspress3 module
GNU Lesser General Public License v3.0
4 stars 18 forks source link

Install static versions of xspress3 and img_mod libraries to build wi… #52

Open jwlodek opened 5 months ago

jwlodek commented 5 months ago

…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 commented 5 months ago

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 commented 5 months ago

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

jwlodek commented 5 months ago

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?