[MacPorts] #51303: netcdf: Request: Add static library libnetcdf.a to build
#51303: netcdf: Request: Add static library libnetcdf.a to build ----------------------------+-------------------------------- Reporter: andy.nowacki@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Keywords: | Port: netcdf ----------------------------+-------------------------------- The majority of library ports that I have installed, but admittedly not all, seem to build and install both a static and dynamic version of the library. This is based on: {{{ $ ls /opt/local/lib/lib*.{a,dylib} | awk -F. '!/lib.*\..*\.dylib/ {lib[$1]++} END {for (l in lib) if (lib[l] > 1) { print l, "yes"; n++ } else { print l, "no"; m++ } print "\n"n, "of", n+m, "have static libraries"}' }}} Quite a few codes that I use, one example being SEATREE (http://geosys.usc.edu/projects/seatree/wiki/), seem to want to enforce static linking (presumably for executable portability or 'performance'), and so will not use a dynamic library. Would it be possible for the NetCDF port to create a static library? I apologise for not offering a patch for this, but my brain is not big enough to deal with CMake. I understand this is probably low priority, but I for one would find building a static library very useful, and it hopefully would be fairly trivial. I note that the `netcdf-fortran` port ''does'' build the static library, as does `hdf5`, which prompted me to believe the suggestion might be feasible. Please let me know if I can help in any way. -- Ticket URL: <https://trac.macports.org/ticket/51303> MacPorts <https://www.macports.org/> Ports system for OS X
#51303: netcdf: Request: Add static library libnetcdf.a to build -----------------------------+-------------------------------- Reporter: andy.nowacki@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: netcdf | -----------------------------+-------------------------------- Comment (by takeshi@…): {{{hdf5}}} and {{{netcdf-fortran}}} are configured with traditional {{{autotools}}} and have {{{enable-shared}}} and {{{enable-static}}} options. {{{netcdf}}} uses CMake and the upstream developers offer a switch {{{BUILD_SHARED_LIBS}}} to build either shared ({{{ON}}}) or static ({{{OFF}}}). It is possible to build both by conducting {{{configure}}} and {{{build}}} phases twice, but it will complicate {{{Portfile}}}, which I don't like to do. You can ask the upstream developers to add an option to build both. However, I could easily add a static variant, which does not install shared libraries with the current {{{CMakeLists.txt}}}. -- Ticket URL: <https://trac.macports.org/ticket/51303#comment:1> MacPorts <https://www.macports.org/> Ports system for OS X
#51303: netcdf: Request: Add static library libnetcdf.a to build -----------------------------+-------------------------------- Reporter: andy.nowacki@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: netcdf | -----------------------------+-------------------------------- Comment (by andy.nowacki@…): I understand the desire to keep the portfile simple, and I've submitted a request to UCAR for dual-building of shared and static libraries, so we'll see what happens there. It seems {{{BUILD_SHARED_LIBS}}} doesn't preclude building both at once, but the machinery isn't in place and I agree it's better for this to come from upstream.
However, I could easily add a static variant, which does not install shared libraries with the current CMakeLists.txt.
Presumably this '{{{+static}}}'(?) variant would conflict with the default, and so it would be a binary choice between having the static or dynamic libraries? In that case, I think it's probably not worth maintaining that for the sake of some recalcitrant software that won't do dynamic linking, as I wouldn't choose the static variant over the dynamic one. Thanks for explaining all that, though. -- Ticket URL: <https://trac.macports.org/ticket/51303#comment:2> MacPorts <https://www.macports.org/> Ports system for OS X
#51303: netcdf: Request: Add static library libnetcdf.a to build -----------------------------+----------------------- Reporter: andy.nowacki@… | Owner: takeshi@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: netcdf | -----------------------------+----------------------- Changes (by mf2k@…): * owner: macports-tickets@… => takeshi@… * cc: takeshi@… (removed) * version: 2.3.4 => -- Ticket URL: <https://trac.macports.org/ticket/51303#comment:3> MacPorts <https://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts