Skip to content

mpdecimal: Enable build on Apple Silicon (M1) #8603

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

Merged
merged 5 commits into from
Jan 5, 2022

Conversation

dean0x7d
Copy link
Contributor

@dean0x7d dean0x7d commented Jan 1, 2022

Specify library name and version: mpdecimal/all

This PR enables building mpdecimal on Apple ARM. Previously, the recipe explicitly disabled non-x86 architectures, however mpdecimal itself supports pretty much everything. I suspect that non-x86 was originally disabled because of MSVC build complications, as I see that x86 and x64 are explicitly mentioned in the MSVC-specific bits of the recipe.

Simply dropping this check on macOS, produces a good build on Apple ARM64 CPUs. Tested on my M1 Mac.

I suspect that Linux ARM64 would also work fine but I can't verify this so I've only enabled it for macOS.


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

The recipe explicitly disabled non-x86 architectures, however `mpdecimal` itself
supports pretty much everything. I suspect that non-x86 was originally disabled
because of MSVC build complications, as I see that x86 and x64 are explicitly
mentioned in the MSVC-specific bits of the recipe.

Simply dropping this check on macOS, produces a good build on Apple ARM64 CPUs.
Tested on my M1 Mac.

I suspect that Linux ARM64 would also work fine but I can't verify this so I've
only enabled it for macOS.
@CLAassistant
Copy link

CLAassistant commented Jan 1, 2022

CLA assistant check
All committers have signed the CLA.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

All green in build 5 (becc8bf4602c446db387d9ddb00d888d55254acf):

  • mpdecimal/2.4.2@:
    All packages built successfully! (All logs)

  • mpdecimal/2.5.1@:
    All packages built successfully! (All logs)

  • mpdecimal/2.5.0@:
    All packages built successfully! (All logs)

Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -4,6 +4,11 @@ project(test_package)
include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
conan_basic_setup(TARGETS)

# Workaround for -rpath on arm64: https://cmake.org/cmake/help/latest/release/3.20.html#id2
if(CMAKE_VERSION VERSION_LESS "3.20.1" AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
Copy link
Contributor

Choose a reason for hiding this comment

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

usually we just require a hire CMake version but this is good to know

@conan-center-bot conan-center-bot merged commit b75973d into conan-io:master Jan 5, 2022
@dean0x7d dean0x7d deleted the mpdecimal-apple-arm branch January 11, 2022 14:54
miklelappo pushed a commit to miklelappo/conan-center-index that referenced this pull request Feb 9, 2022
* mpdecimal: Enable build on Apple Silicon (M1)

The recipe explicitly disabled non-x86 architectures, however `mpdecimal` itself
supports pretty much everything. I suspect that non-x86 was originally disabled
because of MSVC build complications, as I see that x86 and x64 are explicitly
mentioned in the MSVC-specific bits of the recipe.

Simply dropping this check on macOS, produces a good build on Apple ARM64 CPUs.
Tested on my M1 Mac.

I suspect that Linux ARM64 would also work fine but I can't verify this so I've
only enabled it for macOS.

* mpdecimal: Remove fPIC when building shared library

* fixup! mpdecimal: Enable build on Apple Silicon (M1)

* fixup! mpdecimal: Enable build on Apple Silicon (M1)

* fixup! mpdecimal: Enable build on Apple Silicon (M1)
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.

6 participants