question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build Fails on MacOS

See original GitHub issue

Building python-rocksdb fails on recent version of MacOS. The final error you get is when linking with libstdc++:

clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1

Summary of how to work around right now:

brew install rocksdb
export MACOSX_DEPLOYMENT_TARGET=10.9
pip install python-rocksdb

The pandas folks ran into this too; here is a discussion on how to resolve the issue by passing additional args to Clang: https://github.com/pandas-dev/pandas/issues/23424

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:24

github_iconTop GitHub Comments

8reactions
zzzhccommented, Jun 22, 2019
export CFLAGS=-stdlib=libc++
pip install python-rocksdb

this works for me on macOS 10.14.3

6reactions
faberchricommented, Feb 25, 2022

The following procedure worked for me on:

  • MacBook Pro M1
  • macOS 12.2.1 Monterey
  • rocksdb 6.29.3

Install rocksdb with brew:

brew install rocksdb

Use brew to look up the path on your system of the libs required for the install of python-rocksdb:

brew info rocksdb lz4 snappy

I had all libs already installed, maybe due to the install of rocksdb. If libs are missing, I guess you need to install them.

Export (for gcc?) the paths of the libs with CPPFLAGS and LDFLAGS and install python-rocksdb with pip. For me that was (adapt paths according to your setup):

export CPPFLAGS=-I/opt/homebrew/Cellar/rocksdb/6.29.3/include
export LDFLAGS="-L/opt/homebrew/Cellar/rocksdb/6.29.3/lib -L/opt/homebrew/Cellar/snappy/1.1.9/lib -L/opt/homebrew/Cellar/lz4/1.9.3/lib"
pip install python-rocksdb

The exports fixed also the poetry install of a poetry project with faust-streaming-rocksdb (faust-streaming = {extras = ["rocksdb"], version = "^0.8.2"}) as dependency.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PyEnv BUILD FAILED installing Python on MacOS
While trying to install Python 3.6.6 (for Airflow ) using PyEnv on MacOS , I am encountering build failure with following stack-trace
Read more >
Not Able to Build Some Versions of Python on M1 at 12.3.1
I trying to build older version of python such as 3.6, 3.7, 3.8 using pyenv and having build failures. I am on apple...
Read more >
Build failed on MacOs Big Sur · Issue #1746 · pyenv ... - GitHub
This works for me with MacOS 11.0.1, xcode-select version 2384 and latest homebrew & homebrew-cask. Update: This doesn't work for old version ...
Read more >
Build fails under macOS Monterey - GameMaker Community
Hello everyone! I have recently reset my MacBook and since then, GameMaker Studio 2 fails to build my projects.
Read more >
Build Fails for MacOs app on Unreal Engine 5 in a Mac M1 Pro
Total execution time: 2.96 seconds Took 3.084248s to run UnrealBuildTool, ExitCode=0 BUILD FAILED: AddBuildProductsFromManifest: /Users/Shared/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found