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

request help: How to install Apache APISIX 2.9 on Mac M1 #4945

Open
juzhiyuan opened this issue Aug 31, 2021 · 9 comments
Open

request help: How to install Apache APISIX 2.9 on Mac M1 #4945

juzhiyuan opened this issue Aug 31, 2021 · 9 comments

Comments

@juzhiyuan
Copy link
Member

@juzhiyuan juzhiyuan commented Aug 31, 2021

Issue description

Hi, when I try to install Apache APISIX 2.9 on Mac (M1) accoding to those links[1][2], it failed due to reasons below:

lualogging 1.5.2-1 depends on luasocket (3.0rc1-2 installed)
lualogging 1.5.2-1 is now installed in /Users/juzhiyuan/workspace/apisix-2.9/apache-apisix-2.9-src/deps (license: MIT/X11)

casbin 1.26.0-1 depends on lrexlib-pcre >= 2.9.1 (not installed)
Installing https://luarocks.org/lrexlib-pcre-2.9.1-1.src.rock

Error: Failed installing dependency: https://luarocks.org/casbin-1.26.0-1.rockspec - Failed installing dependency: https://luarocks.org/lrexlib-pcre-2.9.1-1.src.rock - Could not find header file for PCRE
  No file pcre.h in /usr/local/include
  No file pcre.h in /usr/include
  No file pcre.h in /include
You may have to install PCRE in your system and/or pass PCRE_DIR or PCRE_INCDIR to the luarocks command.
Example: luarocks install lrexlib-pcre PCRE_DIR=/usr/local
make: *** [deps] Error 1

When I try to install pcre-devrel, it shows

brew install pcre-devel

Warning: No available formula or cask with the name "pcre-devel".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.

[1] https://apisix.apache.org/docs/apisix/how-to-build/#installation-via-source-release-package
[2] #4772

Environment

  • apisix version (cmd: apisix version): 2.9
  • OS (cmd: uname -a): Darwin bogon 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:27 PDT 2021; root:xnu-7195.141.2~5/RELEASE_ARM64_T8101 arm64
  • OpenResty / Nginx version (cmd: nginx -V or openresty -V): nginx version: openresty/1.19.3.2
  • etcd version, if have (cmd: run curl http://127.0.0.1:9090/v1/server_info to get the info from server-info API): None
  • apisix-dashboard version, if have: None
  • luarocks version, if the issue is about installation (cmd: luarocks --version): /opt/homebrew/bin/luarocks 3.7.0
@spacewander
Copy link
Member

@spacewander spacewander commented Aug 31, 2021

@hsluoyz
Copy link

@hsluoyz hsluoyz commented Aug 31, 2021

@rushitote
Copy link
Contributor

@rushitote rushitote commented Aug 31, 2021

Have you tried brew install pcre?
See https://github.com/apache/apisix/blob/master/docs/en/latest/install-dependencies.md#mac-osx

Yes, please try this.

@juzhiyuan
Copy link
Member Author

@juzhiyuan juzhiyuan commented Sep 1, 2021

@iSuperCoder
Copy link

@iSuperCoder iSuperCoder commented Sep 1, 2021

Why don't you use Docker? Try it, very simple!

@juzhiyuan
Copy link
Member Author

@juzhiyuan juzhiyuan commented Sep 1, 2021

I'd like to build it from Source, and make some changes. 😄

@tzssangglass
Copy link
Member

@tzssangglass tzssangglass commented Sep 1, 2021

after brew install pcre, I do something ad below

  1. find the pcre install dir, on Mac M1, usually in /opt/homebrew/Cellar/pcre/8.45/
  2. modify the ~/.luarocks/config-5.1.lua as
lua_interpreter = "luajit"
variables = {
   OPENSSL_INCDIR = "/opt/homebrew/opt/openresty-openssl111/include",
   OPENSSL_LIBDIR = "/opt/homebrew/opt/openresty-openssl111/lib",
   PCRE_DIR = "/opt/homebrew/Cellar/pcre/8.45",
   PCRE_INCDIR = "/opt/homebrew/Cellar/pcre/8.45/include"
}

@spacewander
Copy link
Member

@spacewander spacewander commented Sep 1, 2021

Could we add this to:

ifeq ($(UNAME_MACHINE), arm64)

Note: need a way to check pcre version instead of hardcoded 8.45

@tzssangglass
Copy link
Member

@tzssangglass tzssangglass commented Sep 1, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants