-
Notifications
You must be signed in to change notification settings - Fork 324
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
Compiling the core library on Linux(ubuntu) #45
Comments
Hi @idykman, how are you trying to build? Could you outline what your steps are here? |
I'm building using provided CMakeList.txt using default gcc, cmake and make installation on Ubuntu 18.04. My only changes to CMakeList.txt so far are related to flags I've mentioned in OP. |
Just in case, below is the diff:
|
We build for Android using Android Studio and for iOS via XCode (in the breadwallet-ios project). So we don't officially build for Linux (per say) but I will take a look next week at seeing if I can get a build going. |
@michael-brd Just FYI:
boil down to the fact that linux gcc is not happy about following initialization:
From the recent C11 draft (it did not change from C99):
|
Thanks @idykman. It sounds like you are able to build now, correct? I'll log a ticket to get this addressed. |
No, I'm not. I mentioned the root cause of the problem, but not a fix
unfortunately. Your help is still needed and appreciated.
…On Tue, May 21, 2019, 04:57 michael-brd ***@***.***> wrote:
Thanks @idykman <https://github.com/idykman>. It sounds like you are able
to build now, correct? I'll log a ticket to get this addressed.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#45?email_source=notifications&email_token=AHZMCJGHWUK3UHXMRD2P4ZTPWPPRNA5CNFSM4HNXVD6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV3VMBY#issuecomment-494360071>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHZMCJDL5DPW3YOVQVLYIULPWPPRNANCNFSM4HNXVD6A>
.
|
I built on Ubuntu x64 18.04 by doing the following:
This builds using clang (instead of GCC), which is what is used by the Android and iOS builds. In addition, it removes the JNI files (which aren't relevant if you are just trying to use the C functionality). Finally, it fixes some portability issues (i.e. preprocessor guards, includes, etc.). Let me know if you have any issues.
|
This works, thanks a lot for the solution! Are you planning to make .c and .h changes in this repo? It will help us with future integraions |
Yes, this repository undergoes regular feature development. That said, we've create a ticket in our system to look at creating a supported Linux build. The idea being we keep that working as changes are made. |
Where was this build originally from |
Jennifer Warren's |
trying to compile the core lib under ubuntu using https://github.com/breadwallet/breadwallet-core/blob/master/Java/Core/CMakeLists.txt and facing several problems:
core/support/BRAssert.c:196:42: error: ‘PTHREAD_MUTEX_RECURSIVE’ undeclared
Solved by CFLAG _XOPEN_SOURCE=600
core/support/BRFileService.c:286:33: error: ‘DT_REG’ undeclared (first use in this function)
Solved by CFLAG _GNU_SOURCE
Required code change:
core/support/BRAssert.c:138:5: error: too few arguments to function ‘pthread_setname_np’
core/src/main/cpp/core/support/BRInt.h:138:31: error: initializer element is not constant
#define uint256(s) ((UInt256) { .u8 = {
^
Can you help me with those issues? Thanks!
The text was updated successfully, but these errors were encountered: