Skip to content
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

Consolidate XDR into the mfhdf library #483

Merged
merged 56 commits into from
Feb 6, 2024

Conversation

derobins
Copy link
Member

@derobins derobins commented Feb 4, 2024

XDR is now consolidated into the mfhdf library:

  • The build system always uses the library XDR implementation
  • Unused XDR functionality has been removed
  • There is no separate XDR library
  • The xdr.h header is no longer deployed
  • The POSIX XDR implementation is hard-coded as the only XDR implementation
  • The XDR "long" functions have been replaced with functions that take 32-bit data

XDR will eventually be removed from HDF4, but in the meantime, this will make it easier to deal with that layer and will fix the linking issues seen on some platforms.

Fixes #15
Fixes #25
Fixes #423
Fixes #151

Dana Robinson added 30 commits February 2, 2024 00:48
We are removing XDR from the library, so the configuration options
are being removed and the library's version of XDR will always
be used.

Removes:

    Autotools:  --enable-hdf4-xdr
    CMake:      HDF4_BUILD_XDR_LIB
This provided implementations of htons, etc. if a platform didn't
have them. It's never compiled.
This appears to be an old VMS file and is not referenced in
the test code
We no longer build a separate XDR library as all the XDR functionality
has been moved to mfhdf/libsrc and is built with the mfhdf library.
Because of this, we no longer distribute a separate XDR library with
either build system.

We also no longer distribute the XDR types.h and xdr.h headers.
Also, other misc cleanup
Also minor cleanup
* Included mfhdf.h to get Boolean values
* Removed redundant TRUE/FALSE
* Move xdrposix.c netCDF fxns to file.c
* XDR handle ops macro --> function
* Comment out Sun get/put_int calls
* Misc reorg and commenting
No longer needed since we make everyone use our XDR
xdrtest.c relies on xdrstdio and I want to unify xdr.c and xdrposix.c,
so out they go...
Also hard-codes xdrposix calls for op-specific calls
Everything is hard-coded to POSIX now
Replaced with xdr_int, which is 32-bits on all supported platforms
These were commented out some time ago
@bmribler bmribler self-requested a review February 4, 2024 04:50
@@ -64,7 +64,7 @@ if (WIN32 AND NOT MINGW)
endif ()

if (WINDOWS)
set (HDF4_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib")
set (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to get MinGW to work and this seemed like the more correct thing to do. Is it not?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not really because HDF4_REQUIRED_LIBRARIES is temporary for checking, I believe CMAKE_REQUIRED_LIBRARIES is more global.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that the point, though? We want to require links to ws2_32, etc.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it looks like the opposite is true - CMAKE_REQUIRED_LIBRARIES is temporary for checking, we use HDF4_REQUIRED_LIBRARIES after the configure_checks.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then again CMAKE_REQUIRED_LIBRARIES shows up afterwards - ARRGH.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HDF5 uses CMAKE_REQUIRED_LIBRARIES is temporary for checking.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For HDF4 CMakeLists.txt line 485 incorrectly set CMAKE_REQUIRED_LIBRARIES and should have been setting HDF4_REQUIRED_LIBRARIES.
Then everything would be correct ;
CMAKE_REQUIRED_LIBRARIES is temporary for checking, we use HDF4_REQUIRED_LIBRARIES after the configure_checks.

@derobins derobins merged commit b9fb3af into HDFGroup:master Feb 6, 2024
31 checks passed
@derobins derobins deleted the remove_xdr_entirely2 branch March 3, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Build CMake, Autotools Component - C Library Core C library issues Component - netCDF netCDF interface and nc* command-line tools Component - Testing Test code, GitHub workflows Priority - 0. Blocker ⛔ This MUST be merged for the release to happen Type - Improvement Improvements that don't add a new feature or functionality
Projects
None yet
3 participants