-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Build universal native libraries on macOS [2 XMR] #843
Comments
There is a bounty on this issue, the amount is in the title. The reward will be awarded to the first person or group of people who resolves this issue. If you are starting to work on this bounty, please write a comment, so that we can assign the issue to you. We expect contributors to provide a PR in a reasonable time frame or, in case of an extensive work, updates on their progresses. We will unassign the issue if we feel the assignee is not responsive or has abandoned the task. Read the full conditions and details of our bounty system. |
I’ll look into this |
Excellent, happy to have your help. Thanks. |
I'm curious; is the goal to avoid multiple builds or to have a universal native library on Mac? |
Universal native library for macOS x86_64 and ARM64. |
What if the universal native library is generated from already built x86_64 and ARM64 libraries? Then that involves multiple builds. That is why I ask. |
That could be one way to do it, but I was expecting to use cmake configuration and toolchains like monero-project, to avoid multiple builds and be able to do it from one machine: https://github.com/monero-project/monero/tree/master/cmake |
For clarity; is it allowed to use the platform libraries to generate this
universal library?
…On Tue, Apr 2, 2024, 3:45 AM woodser ***@***.***> wrote:
Universal native library for macOS x86_64 and ARM64.
—
Reply to this email directly, view it on GitHub
<#843 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2MWRYLTIRJRT54RPG3YNDY3ILWPAVCNFSM6AAAAABFJMPZMWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZQHE3TIOJUGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I think 2 builds to generate the 2 architecture libraries might still be
necessary. And then the final step will be to combine both into the
universal library.
…On Tue, Apr 2, 2024, 1:12 PM Oyeniyi Dada ***@***.***> wrote:
For clarity; is it allowed to use the platform libraries to generate this
universal library?
On Tue, Apr 2, 2024, 3:45 AM woodser ***@***.***> wrote:
> Universal native library for macOS x86_64 and ARM64.
>
> —
> Reply to this email directly, view it on GitHub
> <#843 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AE2MWRYLTIRJRT54RPG3YNDY3ILWPAVCNFSM6AAAAABFJMPZMWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZQHE3TIOJUGQ>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
|
I'm reading that multiple flags can be passed to the build command, e.g. But I haven't looked into it deeply. |
Are you already using set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")?
…On Tue, Apr 2, 2024, 1:49 PM woodser ***@***.***> wrote:
I'm reading that multiple flags can be passed to the build command, e.g. CXXFLAGS="-arch
x86_64 -arch arm64 -mmacosx-version-min=11.0 -std=c++11"
But I haven't looked into it deeply.
—
Reply to this email directly, view it on GitHub
<#843 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2MWR5TG55OBPQ6T7A46BLY3KSNXAVCNFSM6AAAAABFJMPZMWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZRHE2TOMZRGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Nope, but sounds worth trying. |
I believe set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64") should be used;
followed by lipo to combine the 2 arch libraries into a universal library.
…On Tue, Apr 2, 2024, 2:01 PM Oyeniyi Dada ***@***.***> wrote:
Are you already using set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")?
On Tue, Apr 2, 2024, 1:49 PM woodser ***@***.***> wrote:
> I'm reading that multiple flags can be passed to the build command, e.g. CXXFLAGS="-arch
> x86_64 -arch arm64 -mmacosx-version-min=11.0 -std=c++11"
>
> But I haven't looked into it deeply.
>
> —
> Reply to this email directly, view it on GitHub
> <#843 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AE2MWR5TG55OBPQ6T7A46BLY3KSNXAVCNFSM6AAAAABFJMPZMWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZRHE2TOMZRGU>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
|
Any progress on this? I will be taking a look.
…On Tue, Apr 2, 2024, 2:05 PM Oyeniyi Dada ***@***.***> wrote:
I believe set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64") should be used;
followed by lipo to combine the 2 arch libraries into a universal library.
On Tue, Apr 2, 2024, 2:01 PM Oyeniyi Dada ***@***.***> wrote:
> Are you already using set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")?
>
> On Tue, Apr 2, 2024, 1:49 PM woodser ***@***.***> wrote:
>
>> I'm reading that multiple flags can be passed to the build command, e.g. CXXFLAGS="-arch
>> x86_64 -arch arm64 -mmacosx-version-min=11.0 -std=c++11"
>>
>> But I haven't looked into it deeply.
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#843 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AE2MWR5TG55OBPQ6T7A46BLY3KSNXAVCNFSM6AAAAABFJMPZMWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZRHE2TOMZRGU>
>> .
>> You are receiving this because you commented.Message ID:
>> ***@***.***>
>>
>
|
|
...and you added the lipo command? I have not tested this yet (no Mac):
|
I can test this for you, I have an M2 mac and I can emulate an x86-64 one using UTM |
The main issue (sorry, I kinda dropped the ball on this issue, was working on other things) was/is getting monero to properly static compile for both x86_64 and arm64 on the same system. I was able to get that far in GitHub workflows, but I am still unable to properly test if lipo will create a proper universal binary (especially the cctools Linux port, which seems to hate GitHub workflows with a burning passion) the most recent workflow run I did is here; if you could run lipo on the artifacts and see if it works properly, that would be highly appreciated. It should, but honestly it wouldn’t shock me at this point if it found a way to mess things up |
Heyo! Good news!! after running The binaries themselves work in practice so you may be able to just run the above command in the final linker step? Proof it works too ^^: |
@ all, thank you all for your contribution and proving the idea works. |
If there's anyway I can help further I'm more than happy too ^^ I'll see if I can take a look at the GitHub workflows tomorrow if you'd like @preland unless it's not going to be used in the final build? |
That would be appreciated; once that is working properly, then the path to getting this issue resolved will be as “simple” as monero->monero-cpp->monero-java->haveno |
Haveno can use native libraries instead of monero-wallet-rpc for wallet functionality using the monero-java project.
Currently, the native libraries built for macOS are platform-dependent, so they must be built for x86_64 and ARM64.
This issue requests making the native libraries universal on macOS, so multiple builds are not necessary.
This issue shares a bounty with the related issue: woodser/monero-java#81
The text was updated successfully, but these errors were encountered: