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

Building VerneMQ in macOS Catalina #1391

Closed
thales-gaddini opened this issue Dec 4, 2019 · 7 comments · Fixed by #1423
Closed

Building VerneMQ in macOS Catalina #1391

thales-gaddini opened this issue Dec 4, 2019 · 7 comments · Fixed by #1423

Comments

@thales-gaddini
Copy link

thales-gaddini commented Dec 4, 2019

Hi there, mac user here.

Environment

  • VerneMQ Version: from master
  • OS: macOS Catalina version 10.15.1
  • Erlang/OTP version (if building from source): 22.1.8

Expected behavior

Being able to follow the tutorial on how to build on OS-X and build VerneMQ.

Actual behaviour

It is not possible to install the Xcode CLT (Command Line Tools) 9.4.1 on Catalina so I don't know how to get around the issues compiling the leveldb package.

.
.
.
1 warning and 1 error generated.
cc  -I /Users/thales.biancalana/Desktop/vernemq/_build/default/lib/eleveldb/c_src/system/include -I. -I./include -mmacosx-version-min=10.8 -DOS_MACOSX -DLEVELDB_PLATFORM_POSIX -DSNAPPY  -O2 -g -DNDEBUG     -fPIC -MM -E -MT db/c.d -MT db/c.o -MF db/c.d db/c.cc
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from db/c.cc:9:
In file included from ./include/leveldb/cache.h:22:
./include/leveldb/slice.h:21:10: fatal error: 'string' file not found
#include <string>
         ^~~~~~~~
1 warning and 1 error generated.
cc  -I /Users/thales.biancalana/Desktop/vernemq/_build/default/lib/eleveldb/c_src/system/include -I. -I./include -mmacosx-version-min=10.8 -DOS_MACOSX -DLEVELDB_PLATFORM_POSIX -DSNAPPY  -O2 -g -DNDEBUG     -fPIC -MM -E -MT db/builder.d -MT db/builder.o -MF db/builder.d db/builder.cc
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from db/builder.cc:8:
In file included from ./db/builder.h:8:
./include/leveldb/status.h:16:10: fatal error: 'string' file not found
#include <string>
         ^~~~~~~~
1 warning and 1 error generated.
g++  -I /Users/thales.biancalana/Desktop/vernemq/_build/default/lib/eleveldb/c_src/system/include -I. -I./include -mmacosx-version-min=10.8 -DOS_MACOSX -DLEVELDB_PLATFORM_POSIX -DSNAPPY  -O2 -g -DNDEBUG     -fPIC -c db/builder.cc -o db/builder.o
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from db/builder.cc:8:
In file included from ./db/builder.h:8:
./include/leveldb/status.h:16:10: fatal error: 'string' file not found
#include <string>
         ^~~~~~~~
1 warning and 1 error generated.
make[1]: *** [db/builder.o] Error 1
@namjitharavind
Copy link

Same issue for me. Not possible to install Xcode CLT older version(9.4.1) without Software Manufacturer Help.

@ioolkos
Copy link
Contributor

ioolkos commented Dec 5, 2019

@thales-gaddini @namjitharavind thanks for opening the issue.

We can't do much more than wait for Mac hackers to kindly look into this. In any case, it seems strange as this is just about the path to stdlibc++, so potentially an easy fix?

@thales-gaddini
Copy link
Author

I've been looking at some proposed solutions for compiling in Catalina but I wasn't able to make it work yet (I'm not a C++ guy):

For now I'll use the docker version, but I'll keep trying to compile it. Can I leave the issue open?

@codeadict
Copy link
Contributor

I'm planning to upgrade to Catalina next week, so may be able to find a fix if nobody has by them.

@codeadict
Copy link
Contributor

Some good stuff towards a fix on vernemq/eleveldb#5

@ghost
Copy link

ghost commented Apr 9, 2021

I'm not an expert but after launching the build command:

make rel

I get the following error:

...
... (omitted for brevity)
...
===> Compiling c_src/eleveldb.cc
===> Compiling c_src/refobjects.cc
===> Compiling c_src/threading.cc
===> Compiling c_src/workitems.cc
===> Linking /Users/ameneghini/vernemq/_build/default/lib/eleveldb/priv/eleveldb.so
make: *** [rel] Error 1

After that I download eleveldb from repository unzipped it and replaced it with the contents in the vernemq/_build/default/lib/eleveldb folder.

launched the make rel command again and the vernemq binary was successfully created 👍

Just as a side note. I installed the latest version of openssl using homebrew:

brew update
brew install openssl

Make sure you add the right PATH to the .zshrc file (For example):

export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"

Good luck 😉

@bopbi
Copy link
Contributor

bopbi commented Sep 28, 2022

for latest guide on how to install mac on m1

https://gist.github.com/bopbi/aded8534762e728ec9d0e7b25ddd583c

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

Successfully merging a pull request may close this issue.

5 participants