-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Unable to build on M1 Mac #8797
Comments
@JasonInOttawa: #8767 (comment) My suggestion would be:
Once you get the emulator running the rest of changes (mostly brew deps and the tiny c launcher) should be way easier to attempt. |
Thank you. I'll try getting the emulator built. Right now, the error I am seeing is as follows:
EDIT: It appears that M1 supports "-mcpu=apple-m1" rather than "-march=native" |
I'm fairly sure you'll find a lot of issues building the emulator. The cheapest way of workaround issues is by hacking the code locally, even if that destroys compatibility with the rest of targets. Then with all required changes documented it's a matter of spending time tweaking makefiles. The specific issue you mention is caused by https://github.com/koreader/koreader-base/blob/master/Makefile.defs#L457. You can try to use https://github.com/koreader/koreader-base/blob/master/Makefile.defs#L468 instead (or the one in your edit :p) |
I hope you don't mind a quick question: I'm getting the following error message
I think that implies that an x86_64 library for openssl is being downloaded rather than built, because if it were built it would be arm64 instead. Does that sound right? |
OpenSSL's build system is a nightmare, it's entirely plausible it's happily been building an x64 binary behind your back... |
Yup.
It is expected if your CHOST doesn't match https://github.com/koreader/koreader-base/blob/master/thirdparty/openssl/CMakeLists.txt#L48-L54 According to https://github.com/stuartcarnie/openssl/blob/0a76703445ff6f8aafdb9ace1bc8fd484fc6e85f/Configurations/10-main.conf you'll need to add a new branch with There're probably other 3rd party deps relying on CHOST. What's yours? |
Running into the same problem. My CHOST is empty (didn't check why). But my guess is the x86_64 target is hardcoded at https://github.com/koreader/koreader-base/blob/64bdeda85efe127357c9b969a8cc72b46521ad87/Makefile.third#L575. You can remove that and openssl will compile |
Thank you. I'll try that. I've been playing with it but haven't figured it out yet 🙂
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Maarten den Braber ***@***.***>
Sent: Thursday, February 17, 2022 7:54:29 AM
To: koreader/koreader ***@***.***>
Cc: Jason Benwell ***@***.***>; Mention ***@***.***>
Subject: Re: [koreader/koreader] Unable to build release macos on M1 Mac (Issue #8797)
Running into the same problem. My CHOST is empty (didn't check why). But my guess is the x86_64 target is hardcoded at https://github.com/koreader/koreader-base/blob/64bdeda85efe127357c9b969a8cc72b46521ad87/Makefile.third#L575. You can remove that and openssl will compile
—
Reply to this email directly, view it on GitHub<#8797 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALCMSRXKDY75ZSKAUGIBLV3U3TVYLANCNFSM5OB4CZHQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Also: the path for Lua include files is hardcoded for compilation on Darwin, which seems wrong with the new |
And another one: also the include paths for glib are not pointing to |
The last one I needed to fix was libSDL being in the wrong place. The easiest / quick way to fix this is to link libSDL* from |
@mdbraber Thank you very much! Did you happen to run into this error while trying to build libzmq:
|
No haven't seen that. Seems to be some header files for libsodium? |
I don't have sodium.h in either ~/koreader or /opt/homebrew. I installed the dependencies mentioned in the build guide. Do you happen to know where sodium.h comes from? Thanks! |
Some progress -- I ran
and made this revision to line 21 of base/thirdparty/libzmq/CMakeLists.txt
and the emulator builds! It also doesn't crash when I open an epub, per issue #8686 I'm not able to build the mac application with koreader release macos though - still working on that |
Following as I vastly prefer koreader to Apple books. I've got Koreader running on 4 devices and really would love to see it running on my macbook too |
Shouldn't the Intel build work on M1? |
@Frenzie I recall trying to run one of the intel builds on my mac and it errored out somehow. It was a different ticket. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I was hoping someone could help out with this error, from trying to "kodev build", from base/thirdparty/leptonica"
|
Try again after installing webp from brew ;) |
I did (and do) have webp installed
I can confirm that encode.h etc are in this folder
but I'm not sure how to get it into the build environment. I'm guessing a need to put a magic symlink in someplace but I'm not sure where. |
I'm not entirely convinced it's actually coming from leptonica itself. Can't really say without a full verbose build log. (And/or try to just disable webp in leptonica by passing |
I built emulator version 2022-05.1-8 with the following notes. Most of the errors are related to homebrew putting things in /opt/homebrew rather than /usr/local it seems, with a couple of issues related to arm64 v x86_64 It also doesn't crash when I open an epub, per issue #8686 Running ./kodev build FIRST ERROR
Revise base/Makefile.defs
Do a “./kodev clean” SECOND ERROR
Revise base/thirdparty/libk2pdfopt/CMakeLists.txt
THIRD ERROR
Revise line 575 from base/Makefile.third
FOURTH ERROR
Revise base/Makefile.defs
FIFTH ERROR
Revise base/thirdparty/libzmq/CMakeLists.txt
SIXTH ERROR
Revise base/thirdparty/glib/CMakeLists.txt
SEVENTH ERROR
Run ./kodev build again and this error doesn’t happen |
For the second error, I will look into @NiLuJe 's suggestions re
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I tried building and running after the SDL2 and base bumps and am getting the same error. The stack trace suggested by NiLuJe looks like this
|
What about the print? |
It didn't actually cause a stack overflow. I added these lines to logger.lua near line 75
and it prints
|
Weeeeell, that's interesting :D. |
Sure is. It looks like the logger is crashing when trying to print a simple string, but only in the application bundle. |
@JasonInOttawa: lets refocus on the emulator for a moment. Could you check that all the libraries (both in /common, /libs and some under rocks/.../...) were built for arm?. Both |
@pazos They seem to be built for arm64. I also checked the application bundle and they are as well.
|
Further notes
|
I just did a debug M1 build after applying a couple of the fixes from above and the resulting application seems to work. Still poking. |
I thought setting
|
I noticed a recent base bump that I believe fixes M1 building. When I try to build, I get the following error. If things should work now, I'd appreciate a pointer toward fixing this error.
|
Oh dang. I am running 13.3. |
I hear they've been breaking things to fix other things, in 13.3 SMB being the fixed thing. To get it to build you can probably just change this line to |
Yeah, Apple keeps us entertained ;) This was either recent XCode Tools upgrade or OS X upgrade from 13.2 to .3. I installed them together, so it's hard to say. |
XCode forced me to upgrade btw, when I tried to use it.
…On Apr 6 2023, at 11:17 pm, Piotrek Marciniak ***@***.***> wrote:
Yeah, Apple keeps us entertained ;) This was either recent XCode Tools upgrade or OS X upgrade from 13.2 to .3. I installed them together, so it's hard to say.
—
Reply to this email directly, view it on GitHub (#8797 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AABRQBPJGNJ2XOP4IL67CS3W74XE7ANCNFSM5OB4CZHQ).
You are receiving this because you were mentioned.
|
This does the job. Haven't tried any mq-related feature yet, but at least the emulator builds and launches ;) |
I was able to build on my M1 Mac (not sure if it built to M1 or Intel, I didn't change any defaults from the build instructions) but it seems the touch interface might be messed up on 2023.04 and later version. E.g., I use the mouse cursor to tap somewhere and it seems to register a click as if my mouse was a few hundred pixels higher up. The reason I wonder if it's a recent bug is because mouse clicking works as expected using the prebuilt artiface from within 2023-03 here: https://github.com/koreader/koreader/actions/runs/4584196480. But then this prebuilt artifact produced earlier today has the same cursor issue above: https://github.com/koreader/koreader/actions/runs/4843953756. (I'm also curious if these prebuilt artifacts I'm linking to are built for M1 architecture or Intel and my computer is just doing Rosetta translation). (Another issue: resizing the window on any of these builds seems to eventually lead to KOReader crashing. It works for awhile but when I try to open the file browser, it crashes. I haven't tested this enough yet, so it might not be specifically related to opening the file browser). |
@ryanwwest I didn't notice anything off on the M1 Air but try with this reverted: koreader/koreader-base@8724254 |
I'm trying to build on an M1 Mac but am getting the following error. I was hoping someone could point me at a possible fix.
The text was updated successfully, but these errors were encountered: