When I run pip install jsonnet I run into this error:
```f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/kn/ck6tzd4n36l_6chhyvgxv8_80000gn/T/pip-wheel-wrojzpm7 --python-tag cp36:
running bdist_wheel
running build
running build_ext
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/desugarer.cpp -o core/desugarer.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/formatter.cpp -o core/formatter.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/libjsonnet.cpp -o core/libjsonnet.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/lexer.cpp -o core/lexer.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/parser.cpp -o core/parser.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/pass.cpp -o core/pass.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/static_analysis.cpp -o core/static_analysis.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/string_utils.cpp -o core/string_utils.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/vm.cpp -o core/vm.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 third_party/md5/md5.cpp -o third_party/md5/md5.o
building '_jsonnet' extension
creating build
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/python
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/gabrielgordon-hall/anaconda/include -arch x86_64 -I/Users/gabrielgordon-hall/anaconda/include -arch x86_64 -Iinclude -Ithird_party/md5 -I/Users/gabrielgordon-hall/anaconda/include/python3.6m -c python/_jsonnet.c -o build/temp.macosx-10.7-x86_64-3.6/python/_jsonnet.o
python/_jsonnet.c:147:19: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (i = 0; i < ctx->argc; ++i) {
~ ^ ~~~~~
1 warning generated.
creating build/lib.macosx-10.7-x86_64-3.6
g++ -bundle -undefined dynamic_lookup -L/Users/gabrielgordon-hall/anaconda/lib -arch x86_64 -L/Users/gabrielgordon-hall/anaconda/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/python/_jsonnet.o core/desugarer.o core/formatter.o core/libjsonnet.o core/lexer.o core/parser.o core/pass.o core/static_analysis.o core/string_utils.o core/vm.o third_party/md5/md5.o -o build/lib.macosx-10.7-x86_64-3.6/_jsonnet.cpython-36m-darwin.so
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
Failed building wheel for jsonnet
Running setup.py clean for jsonnet
Failed to build jsonnet
Installing collected packages: jsonnet
Running setup.py install for jsonnet ... error
Complete output from command /Users/gabrielgordon-hall/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/kn/ck6tzd4n36l_6chhyvgxv8_80000gn/T/pip-install-co6r6y5j/jsonnet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/kn/ck6tzd4n36l_6chhyvgxv8_80000gn/T/pip-record-neozg46d/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
make: core/desugarer.o' is up to date.
make:core/formatter.o' is up to date.
make: core/libjsonnet.o' is up to date.
make:core/lexer.o' is up to date.
make: core/parser.o' is up to date.
make:core/pass.o' is up to date.
make: core/static_analysis.o' is up to date.
make:core/string_utils.o' is up to date.
make: core/vm.o' is up to date.
make:third_party/md5/md5.o' is up to date.
building '_jsonnet' extension
creating build
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/python
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/gabrielgordon-hall/anaconda/include -arch x86_64 -I/Users/gabrielgordon-hall/anaconda/include -arch x86_64 -Iinclude -Ithird_party/md5 -I/Users/gabrielgordon-hall/anaconda/include/python3.6m -c python/_jsonnet.c -o build/temp.macosx-10.7-x86_64-3.6/python/_jsonnet.o
python/_jsonnet.c:147:19: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (i = 0; i < ctx->argc; ++i) {
~ ^ ~~~~~
1 warning generated.
creating build/lib.macosx-10.7-x86_64-3.6
g++ -bundle -undefined dynamic_lookup -L/Users/gabrielgordon-hall/anaconda/lib -arch x86_64 -L/Users/gabrielgordon-hall/anaconda/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/python/_jsonnet.o core/desugarer.o core/formatter.o core/libjsonnet.o core/lexer.o core/parser.o core/pass.o core/static_analysis.o core/string_utils.o core/vm.o third_party/md5/md5.o -o build/lib.macosx-10.7-x86_64-3.6/_jsonnet.cpython-36m-darwin.so
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
----------------------------------------
Command "/Users/gabrielgordon-hall/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/kn/ck6tzd4n36l_6chhyvgxv8_80000gn/T/pip-install-co6r6y5j/jsonnet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/kn/ck6tzd4n36l_6chhyvgxv8_80000gn/T/pip-record-neozg46d/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/kn/ck6tzd4n36l_6chhyvgxv8_80000gn/T/pip-install-co6r6y5j/jsonnet/
Is this a path problem? The output of `gcc --version` is:
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.10.44.2)
Target: x86_64-apple-darwin18.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
```
I wasn't able to reproduce it on my Mac. Also the error doesn't seem to be something specific for jsonnet. Can you see if other C++ programs compile without issue (even hello world, which uses standard library)?
You're right, seems to be a problem with clang. Received a similar error trying to compile hello world with clang. Could be related to this although haven't worked it out yet.
Looks like it was a Mojave issue. Following this StackOverflow answer solved the problem.
Most helpful comment
Looks like it was a Mojave issue. Following this StackOverflow answer solved the problem.