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

Presto is not supported in Mac OS (PrestoSystemRequirements requires x86_64 on Mac OS X (found aarch64)) #17146

Open
jl-sparkwithdots opened this issue Dec 30, 2021 · 7 comments

Comments

@jl-sparkwithdots
Copy link

jl-sparkwithdots commented Dec 30, 2021

Hi,

I was trying to install Presto under my M1 Macbook Pro, and got error message "Presto requires x86_64 on Mac OS X (found aarch64)" when service was launched.
I found the issue was from the method 'verifyOsArchitecture' under class PrestoSystemRequirements.java of package com.facebook.presto.server.

I currently fork the repo and build my version to avoid the issue by changing the method as below:

else if ("Mac OS X".equals(osName)) { if (!"x86_64".equals(osArch) && !"aarch64".equals(osArch)) { failRequirement("Presto requires x86_64 or aarch64 on Mac OS X (found %s)", osArch); } }
Also, presto-cli is not compatible with arm yet. I got error like this.

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi64-0.269-SNAPSHOT-ce338f0 in java.library.path, no jansi-0.269-SNAPSHOT-ce338f0 in java.library.path, no jansi in java.library.path, /private/var/folders/n2/gmyyclln46b7zb4q0t885wyr0000gn/T/libjansi-64-0-4225468188239448006.269-SNAPSHOT-ce338f0: dlopen(/private/var/folders/n2/gmyyclln46b7zb4q0t885wyr0000gn/T/libjansi-64-0-4225468188239448006.269-SNAPSHOT-ce338f0, 0x0001): tried: '/private/var/folders/n2/gmyyclln46b7zb4q0t885wyr0000gn/T/libjansi-64-0-4225468188239448006.269-SNAPSHOT-ce338f0' (fat file, but missing compatible architecture (have 'x86_64,i386', need 'arm64e')), '/usr/lib/libjansi-64-0-4225468188239448006.269-SNAPSHOT-ce338f0' (no such file)]

It would be great if it can be fixed and released in next version.

@jrwagz
Copy link

jrwagz commented Mar 9, 2022

I am having similar issues, and would love to see prestodb supported on M1 based macs!

I'm using the ahanaio/prestodb-sandbox:0.271 docker image, and I am getting this crash:

2022-03-09T17:44:21.939Z	INFO	main	com.facebook.presto.security.AccessControlManager	-- Loaded system access control allow-all --
2022-03-09T17:44:21.957Z	INFO	main	com.facebook.presto.storage.TempStorageManager	-- Loading temp storage local --
2022-03-09T17:44:22.018Z	INFO	main	com.facebook.presto.storage.TempStorageManager	-- Loaded temp storage local --
2022-03-09T17:44:22.397Z	INFO	main	com.facebook.presto.server.PrestoServer	======== SERVER STARTED ========
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x000000401f04d584, pid=9, tid=318
#
# JRE version: OpenJDK Runtime Environment Corretto-11.0.14.10.1 (11.0.14.1+10) (build 11.0.14.1+10-LTS)
# Java VM: OpenJDK 64-Bit Server VM Corretto-11.0.14.10.1 (11.0.14.1+10-LTS, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# J 5244 c1 java.util.regex.Pattern$$Lambda$5.is(I)Z java.base@11.0.14.1 (13 bytes) @ 0x000000401f04d584 [0x000000401f04d560+0x0000000000000024]
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /var/lib/presto/datanode.id=7a44a03130e0/hs_err_pid9.log
Compiled method (c2)   89272 5583       4       java.util.regex.Pattern$BmpCharProperty::match (55 bytes)
 total in heap  [0x0000004025d9c490,0x0000004025d9ca60] = 1488
 relocation     [0x0000004025d9c608,0x0000004025d9c638] = 48
 main code      [0x0000004025d9c640,0x0000004025d9c800] = 448
 stub code      [0x0000004025d9c800,0x0000004025d9c828] = 40
 metadata       [0x0000004025d9c828,0x0000004025d9c860] = 56
 scopes data    [0x0000004025d9c860,0x0000004025d9c938] = 216
 scopes pcs     [0x0000004025d9c938,0x0000004025d9c9e8] = 176
 dependencies   [0x0000004025d9c9e8,0x0000004025d9c9f0] = 8
 handler table  [0x0000004025d9c9f0,0x0000004025d9ca38] = 72
 nul chk table  [0x0000004025d9ca38,0x0000004025d9ca60] = 40
Could not load hsdis-amd64.so; library not loadable; PrintAssembly is disabled
#
# If you would like to submit a bug report, please visit:
#   https://github.com/corretto/corretto-11/issues/
#
qemu: uncaught target signal 6 (Aborted) - core dumped
/opt/entrypoint.sh: line 6:     9 Aborted                 $PRESTO_HOME/bin/launcher run

@humorless
Copy link

I encountered similar issue, but I installed a jdk version with x86 supported to bypass this issue.

I used sdkman to install jdk. After setting rosetta compatible as true/false, sdk list java will show some jdk version with both x86 & arm or only arm supported. Running presto using a jdk with x86 support can bypass it.

@jianwu
Copy link

jianwu commented Dec 20, 2022

I encountered similar issue, but I installed a jdk version with x86 supported to bypass this issue.

I used sdkman to install jdk. After setting rosetta compatible as true/false, sdk list java will show some jdk version with both x86 & arm or only arm supported. Running presto using a jdk with x86 support can bypass it.

Thanks for the advise. But how to setting rosetta compatible as true/false, I installed it using softwareupdate --install-rosetta. but when I use sdk list java, still didn't show any version with x86 support. @humorless

@ashishkumarazuga
Copy link

Any permanent fixes for this?

@yingsu00 yingsu00 changed the title Presto is not supported in Mac OS with Apple Silicon Presto is not supported in Mac OS (Presto requires x86_64 on Mac OS X (found aarch64)) May 11, 2023
@yingsu00 yingsu00 changed the title Presto is not supported in Mac OS (Presto requires x86_64 on Mac OS X (found aarch64)) Presto is not supported in Mac OS (PrestoSystemRequirements requires x86_64 on Mac OS X (found aarch64)) May 11, 2023
@humorless
Copy link

I encountered similar issue, but I installed a jdk version with x86 supported to bypass this issue.
I used sdkman to install jdk. After setting rosetta compatible as true/false, sdk list java will show some jdk version with both x86 & arm or only arm supported. Running presto using a jdk with x86 support can bypass it.

Thanks for the advise. But how to setting rosetta compatible as true/false, I installed it using softwareupdate --install-rosetta. but when I use sdk list java, still didn't show any version with x86 support. @humorless

Hi,

Sorry for replying late.

I think this link can provide most of the information you need.

The gist is:

  1. change the rosetta env in ~/.sdkman/etc/config and then restart the sdkman
  2. sdk list java
  3. install the right version

Experiments

laurencechen $ sdk use java  11.0.14-zulu 
laurencechen $ cat `which java` | file -
/dev/stdin: Mach-O 64-bit executable arm64
laurencechen $ sdk use java  11.0.14.fx-zulu    
laurencechen $ cat `which java` | file -        
/dev/stdin: Mach-O 64-bit executable x86_64

@TSTTang
Copy link

TSTTang commented Nov 30, 2023

So, this solution is to switch over to use x86_64 jdk to 'run' presto built with x86 jdk? Would it be possible to run the presto that has been built with x86 jdk with an aarch64 jdk?

@liewkaitsan
Copy link

liewkaitsan commented Dec 19, 2023

After my attempts, I am the latest macos sonnoma 14.2 found that sdkman is no longer able to download the x86 sdk

I encountered similar issue, but I installed a jdk version with x86 supported to bypass this issue.
I used sdkman to install jdk. After setting rosetta compatible as true/false, sdk list java will show some jdk version with both x86 & arm or only arm supported. Running presto using a jdk with x86 support can bypass it.

Thanks for the advise. But how to setting rosetta compatible as true/false, I installed it using softwareupdate --install-rosetta. but when I use sdk list java, still didn't show any version with x86 support. @humorless

Hi,

Sorry for replying late.

I think this link can provide most of the information you need.

The gist is:

  1. change the rosetta env in ~/.sdkman/etc/config and then restart the sdkman
  2. sdk list java
  3. install the right version

Experiments

laurencechen $ sdk use java  11.0.14-zulu 
laurencechen $ cat `which java` | file -
/dev/stdin: Mach-O 64-bit executable arm64
laurencechen $ sdk use java  11.0.14.fx-zulu    
laurencechen $ cat `which java` | file -        
/dev/stdin: Mach-O 64-bit executable x86_64

After my attempts, I am the latest macos sonnoma 14.2 found that sdkman is no longer able to download the x86 sdk

image

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

No branches or pull requests

7 participants