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

Build monero-java and monero-cpp to static libraries with shared library wrapper [3 XMR] #795

Open
woodser opened this issue Feb 25, 2024 · 17 comments
Labels
💰bounty There is a bounty on this issue

Comments

@woodser
Copy link
Contributor

woodser commented Feb 25, 2024

This issue requests building monero-java and monero-cpp to static libraries so all dependencies are self-contained, with a shared library wrapper to access libmonero-java in JNI.

For example: libmonero-cpp.a, libmonero-java.a, and libmonero-java.so.

This will help us switch from using monero-wallet-rpc to native wallet bindings for better performance, and without depending on MSYS2 in Windows.

This issue shares the same bounty as the related issue in monero-java: woodser/monero-java#74

@woodser woodser added the 💰bounty There is a bounty on this issue label Feb 25, 2024
Copy link

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.

@woodser woodser closed this as completed Mar 2, 2024
@woodser woodser changed the title Build monero-java and monero-cpp to static libraries with dynamic library wrappers [1 XMR] Build monero-java and monero-cpp to static libraries with shared library wrapper [2 XMR] Apr 2, 2024
@woodser woodser reopened this Apr 2, 2024
@niyid
Copy link
Contributor

niyid commented Apr 5, 2024 via email

@woodser
Copy link
Contributor Author

woodser commented Apr 5, 2024

I think the only issue is that the dynamic libraries require MSYS2 to be installed and on the Path variable in Windows, whereas static libraries would be self-contained and shouldn't require external dependencies.

@niyid
Copy link
Contributor

niyid commented Apr 5, 2024 via email

@woodser
Copy link
Contributor Author

woodser commented Apr 5, 2024

No, creating static libraries with a shared library wrapper is the request of this issue.

@niyid
Copy link
Contributor

niyid commented Apr 5, 2024

I think the only issue is that the dynamic libraries require MSYS2 to be installed and on the Path variable in Windows, whereas static libraries would be self-contained and shouldn't require external dependencies.

I am not clear what the issue is from here. I summize it is an issue with MSYS2 on Windows; and that this is a Windows only issue.

@woodser
Copy link
Contributor Author

woodser commented Apr 5, 2024

The libraries should not have external dependencies which need to be installed, but should be standalone, which switching to static libraries ought to support?

Otherwise, someone installing Haveno and using the native libraries would additionally need to install MSYS2.

@mcneb10
Copy link

mcneb10 commented Apr 26, 2024

I would like to look into this

@woodser
Copy link
Contributor Author

woodser commented Apr 27, 2024

@mcneb10 Great!

@woodser
Copy link
Contributor Author

woodser commented Jun 23, 2024

@mcneb10 Any progress?

Currently, the dynamic libraries built for Linux only work on Ubuntu 20.0.4 as far as I know (what they're built from). But there's a linker error on later versions.

This would be resolved by building to static libraries.

@woodser woodser changed the title Build monero-java and monero-cpp to static libraries with shared library wrapper [2 XMR] Build monero-java and monero-cpp to static libraries with shared library wrapper [3 XMR] Jun 23, 2024
@woodser
Copy link
Contributor Author

woodser commented Jun 23, 2024

Bounty bumped to 3 XMR.

@mcneb10
Copy link

mcneb10 commented Jun 23, 2024

I'm sorry I have been distracted and unmotivated recently. I was not able to compile to source due to some linking errors with the unbound package. I will have another look today.

@woodser
Copy link
Contributor Author

woodser commented Jun 23, 2024

No worries, we can leave this unassigned if it doesn't work out.

@woodser
Copy link
Contributor Author

woodser commented Jun 23, 2024

@mcneb10 Please ping me if I can help with the linker error. I've built it a few times :)

@preland
Copy link
Contributor

preland commented Jun 23, 2024

Is this issue related to the mac universal issue on Haveno?

@woodser
Copy link
Contributor Author

woodser commented Jun 23, 2024

Not quite. That issue is to create universal binaries which run natively on mac x86_64 and arm64 without emulation, whereas this issue is to build the monero-java libs to static libraries with a dynamic wrapper on all platforms, for portability. Othewise, the libs built on Ubuntu 20.04 can't run on 22.04.

@mcneb10
Copy link

mcneb10 commented Jun 23, 2024

Note to anyone compiling this: if you try to compile on anything except a distro based on stable debian you will run into errors very quickly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💰bounty There is a bounty on this issue
Projects
None yet
Development

No branches or pull requests

4 participants