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

Added -DPNG_ARM_NEON=off to cmake arguments for the darwin arm64 case. #265

Merged

Conversation

srherbener
Copy link
Collaborator

The PNG_ARM_NEON feature on the Mac arm64 architecture does not compile successfully so this PR shuts that feature off but only when on the Mac arm64 architecture. Note that the PNG_ARM_NEON feature is not relevant to the Mac x86_64 (intel) architecture.

This fixes an issue (JCSDA/spack-stack/issues/572) that surfaced when the NOAA-EMC/spack repo was recently sync'd up with the authoritative spack repo. This is because the libpng package.py script was changed from using Autotools to CMake, and the Autotools configuration had PNG_ARM_NEON off by default whereas the CMake configuration has PNG_ARM_NEON on by default.

Fixes JCSDA/spack-stack/issues/572

self.define("CMAKE_CXX_FLAGS", self.spec["zlib"].headers.include_flags),
self.define("ZLIB_ROOT", self.spec["zlib"].prefix),
self.define("PNG_SHARED", "shared" in self.spec.variants["libs"].value),
self.define("PNG_STATIC", "static" in self.spec.variants["libs"].value),
]
]
if platform.system() == "Darwin" and platform.machine() == "arm64":
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you try

Suggested change
if platform.system() == "Darwin" and platform.machine() == "arm64":
if self.spec.satisfies("platform=darwin target=aarch64:"):

and then revert the import platform changes in lines 6-7 please?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Your suggestion worked. Thanks! I think it's an improvement since it doesn't rely on the python platform module.

@climbfuji climbfuji merged commit e0801ac into JCSDA:jcsda_emc_spack_stack May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MacOS build fails on libpng package
2 participants