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

Bugfix: The METv12.0.0 release fails to build on a non-HPC system #3045

Open
HathewayWill opened this issue Dec 20, 2024 · 2 comments
Open
Labels
alert: NEED ACCOUNT KEY Need to assign an account key to this issue alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle alert: NEED MORE DEFINITION Not yet actionable, additional definition required type: bug Fix something that is not working

Comments

@HathewayWill
Copy link

HathewayWill commented Dec 20, 2024

Describe the Problem

The METv12.0.0 release fails to build on a non-HPC system during the proj library compilation phase. This issue occurs on Ubuntu 24 using modern GNU compilers and Python 3.12. The installation process does not progress past the library compilation stage, which deviates from the behavior observed in the stable version v11.1.0, where the installation completes successfully.

Environment

Describe your runtime environment:
Machine: Linux Workstation
Operating System: Ubuntu 24.4.1
Python Version: 3.12.3
Compiler: GNU 13.3.0

To Reproduce

The issue can be observed by following the steps outlined in the provided log files. Unfortunately, I cannot attach files directly here, but I am happy to provide them upon request or share through an alternative method.

compile_MET_all.log

@HathewayWill HathewayWill added alert: NEED ACCOUNT KEY Need to assign an account key to this issue alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle alert: NEED MORE DEFINITION Not yet actionable, additional definition required type: bug Fix something that is not working labels Dec 20, 2024
@HathewayWill
Copy link
Author

logs.zip

@HathewayWill
Copy link
Author

To ensure compatibility with the current version of C++ and avoid issues with fixed-width integer types, I recommend modifying the CMake command as follows:

Original Command:

cmd="cmake -DCMAKE_INSTALL_PREFIX=${LIB_DIR} -DSQLITE3_INCLUDE_DIR=${SQLITE_INCLUDE_DIR} -DSQLITE3_LIBRARY=${SQLITE_LIB_DIR}/libsqlite3.${dynamic_lib_ext} ${tiff_arg} .. > $(pwd)/proj.cmake.log 2>&1"
Updated Command:

cmd="cmake -DCMAKE_INSTALL_PREFIX=${LIB_DIR} -DCMAKE_CXX_FLAGS='-include cstdint' -DSQLITE3_INCLUDE_DIR=${SQLITE_INCLUDE_DIR} -DSQLITE3_LIBRARY=${SQLITE_LIB_DIR}/libsqlite3.${dynamic_lib_ext} ${tiff_arg} .. > $(pwd)/proj.cmake.log 2>&1"

Reason for the Change:
The -include cstdint flag ensures the header file is implicitly included in every translation unit during compilation. This change addresses issues related to the usage of fixed-width integer types (int64_t, uint64_t) provided by the C++ standard library. If the source files rely on these types but fail to explicitly include , compilation errors such as the following may occur:
'std::int64_t' does not name a type

Benefits of Using -include cstdint:

Ensures Availability of Fixed-Width Integer Types:
Types like int64_t and uint64_t are universally available, regardless of whether is explicitly included in individual source files.

Avoids Modifying Source Code:
By using this flag, you can avoid altering legacy or third-party source files to include manually.

Consistency Across Compilation Units:
This approach standardizes the inclusion of across all files, reducing the risk of inconsistencies due to conditional includes or missing headers.

Recommendation:
This modification is particularly useful when working with legacy codebases or third-party libraries where direct source changes are not feasible. Adding the -include cstdint flag as shown in the updated command ensures compatibility with modern C++ standards and prevents build failures related to missing integer type definitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alert: NEED ACCOUNT KEY Need to assign an account key to this issue alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle alert: NEED MORE DEFINITION Not yet actionable, additional definition required type: bug Fix something that is not working
Projects
None yet
Development

No branches or pull requests

1 participant