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

Cannot compile on Mac OS #252

Closed
roynalnaruto opened this issue Aug 6, 2019 · 6 comments
Closed

Cannot compile on Mac OS #252

roynalnaruto opened this issue Aug 6, 2019 · 6 comments

Comments

@roynalnaruto
Copy link

I am facing compilation errors in the eleveldb dependency. A complete report of the log, I have posted here: https://gist.github.com/roynalnaruto/0dab850266367d7e99e4787a98ef355f

  • Mac OS version
macOS Mojave v10.14.6
  • xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
  • I have also completed the setup for the command line tools
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
  • gcc version
$ gcc version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  • clang version
$ clang --version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  • xcode-select version
$ xcode-select --version
xcode-select version 2354.
  • LDFLAGS and CFLAGS were unset before I tried to compile

Any help regarding this would be appreciated

@ergl
Copy link

ergl commented Aug 8, 2019

Getting the same issue, was fixed with PR #245. It would be good to get a new version on hex that contains this fix.

EDIT: In the meantime, you might try adding that flag manually yourself during compilation. If you're using make, simply do:

make CFLAGS+="-stdlib=libc++" \
    CXXFLAGS+="-stdlib=libc++" \
    DRV_CFLAGS+="-stdlib=libc++" \
    DRV_LDFLAGS+="-stdlib=libc++"

@roynalnaruto
Copy link
Author

@ergl thanks! It worked, yes it would be helpful to get a bumped version on hex

@binarytemple
Copy link

@Erlg thanks for taking the time to post your fix - wasted half of yesterday on this (missed the DRV_ vars

@ghost
Copy link

ghost commented Aug 14, 2019

Worth mentioning this fix doesn't work unless you build from the 'develop' branch as it has this #245 PR applied

@ergl
Copy link

ergl commented Aug 14, 2019

@bryanhuntesl if you're already depending on develop, I don't think you should have any problems compiling, since the fix is already there. The solution I posted above is doing the same as #245, but at the Makefile level.

The upside of #245 is that it adds the flags only at the eleveldb dependency level, whereas what I posted will apply to the same project.

@jvf
Copy link

jvf commented Dec 11, 2019

Building on macOS did not work for me with the only the changes from #245, it failed as follows:

$ mix deps.compile eleveldb
===> Compiling eleveldb
...
/Library/Developer/CommandLineTools/usr/bin/make  all-am
/bin/sh ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.     -g -O2 -MT snappy.lo -MD -MP -MF .deps/snappy.Tpo -c -o snappy.lo snappy.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -g -O2 -MT snappy.lo -MD -MP -MF .deps/snappy.Tpo -c snappy.cc  -fno-common -DPIC -o snappy.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 snappy.cc:29:
./snappy.h:43:10: fatal error: 'string' file not found
#include <string>
         ^~~~~~~~
1 warning and 1 error generated.
make[1]: *** [snappy.lo] Error 1
make: *** [all] Error 2
===> Hook for compile failed!

** (Mix) Could not compile dependency :eleveldb, "/Users/jvf/.mix/rebar3 bare compile --paths "/Users/jvf/repos/sonnen/vpp/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile eleveldb", update it with "mix deps.update eleveldb" or clean it with "mix deps.clean eleveldb"

As you can see the problem is with building Snappy, I created #258 to fix this.

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

4 participants