-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix typo, exploring solution to #1324
- Loading branch information
Showing
2 changed files
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f940969
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 cloned and tested v4.6.3-dev-branch-gh1324.wif with Cmake on Mac. Looks good, these values as expected in my result file
netcdf.pc
:However, what is going on with the package version number in the same
netcdf.pc
file? I will assume this is normal and will be corrected to 4.6.3 for the release:f940969
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.
f940969
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.
Shouldn't
@NC_LIBS@
in line 11 of file netcdf.pc.in be simply-lnetcdf
?f940969
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.
@wkliao yes, are you seeing something different?
f940969
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 am seeing below in master branch (I was referring to the .in file).
netcdf-c/netcdf.pc.in
Line 11 in c0d24c8
f940969
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 that
@NC_LIBS@
was changed somewhere else at about the same time, to make it consistent between autotools and Cmake builds. It seems that@NC_LIBS@
is now always emitted as-lnetcdf
only, and the extra library flags are now in@LIBS@
only. These both come from somewhere in configure scripts. It is all working well in my tests on release 4..6.3, both build systems. @WardF?f940969
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.
My understanding is because NetCDF C library only produces one library (libnetcdf.a and libnetcdf.so), it is safe to just use
Libs: -L${libdir} -lnetcdf
in netcdf.pc.in.FYI. NC_LIBS is set in configure.ac and CMakeLists.txt.
When --disable-shared is set, it includes user's LIBS environment variable.
f940969
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.
Since HDF5 is a dependent package of NetCDF, should the following be added to netcdf.pc.in?
Requires: hdf5
Similar for hdf4. if hdf5.pc and hdf4.pc are available.
f940969
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.
Requires
vs.Libs
does not have a simple answer. This would involve a deeper study of pkg-config rules. Meanwhile, this commit appears to solve the original overlinking problem, though that has not been verified yet by the original issue #1324 author.I suspect there is room for further improvement to
netcdf.pc.in
along these lines. I don't plan to work on it any more, unless a new problem is reported.f940969
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 agree there is more work to be done, and I will revisit it when I get the chance. I am inclined to leave the system as it is for now because, as @Dave-Allured notes, it does appear to be working consistently between the build systems. Hardcoding
-lnetcdf
into the template file at this point doesn't solve any problem that I've seen, so if it does change it will likely be concurrent with other changes that ultimately need to be made.f940969
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.
FYI. When I configured NetCDF with --disable-shared, I got the followings in netcdf.pc.
I assume this is OK for static-library build only. My configure command line is:
f940969
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 this is okay for now, for static builds. In
@NC_LIBS@
, it looks likeconfigure
is performing some flag grouping that should be reserved for later handling inpkg-config
. But the current result is functional for all cases that I can see without digging.