Hi! I am trying to compile from source but I keep getting an error from linker saying library not found for -lshm. What is this missing library and how do I fix it? Thanks!
Here is the complete dump:
sudo MACOSX_DEPLOYMENT_TARGET=10.13 CC=clang CXX=clang++ python3 setup.py install
Password:
Building wheel torch-1.1.0a0+cbefd03
-- Building version 1.1.0a0+cbefd03
[  0%] Built target onnxifi_dummy
[  0%] Built target pthreadpool
[  0%] Built target foxi_dummy
[  0%] Built target foxi_loader
[  0%] Built target onnxifi_loader
[  1%] Built target clog
[  3%] Built target libprotobuf-lite
[  3%] Built target mkrename
[  3%] Built target common
[  3%] Built target mkdisp
[  4%] Built target mkalias
[  4%] Built target ATEN_CPU_FILES_GEN_TARGET
[  6%] Built target c10
[ 10%] Built target libprotobuf
[ 10%] Built target mkrename_gnuabi
[ 10%] Built target mkmasked_gnuabi
[ 10%] Built target arraymap
[ 11%] Built target cpuinfo
[ 11%] Built target cpuinfo_internals
[ 12%] Built target nnpack_reference_layers
[ 46%] Built target onnxifi_wrapper
[ 46%] Built target python_copy_files
[ 46%] Built target __aten_op_header_gen
[ 46%] Built target foxi_wrapper
[ 47%] Built target headers
[ 47%] Built target renamedsp256.h_generated
[ 47%] Built target dispavx.c_generated
[ 47%] Built target renameSSE2.h_generated
[ 47%] Built target renameAVX.h_generated
[ 47%] Built target renameFMA4.h_generated
[ 47%] Built target renameSSE4.h_generated
[ 47%] Built target renameAVX2128.h_generated
[ 47%] Built target renameAVX2.h_generated
[ 47%] Built target dispsse.c_generated
[ 47%] Built target renamedsp128.h_generated
[ 47%] Built target renameAVX512F.h_generated
[ 47%] Built target alias_avx512f.h_generated
[ 48%] Built target nnpack
[ 49%] Built target dispavx_obj
[ 51%] Built target sleefsse2
[ 52%] Built target qnnpack
[ 52%] Built target sleefavx
[ 52%] Built target sleeffma4
[ 53%] Built target sleefsse4
[ 53%] Built target dispsse_obj
[ 53%] Built target sleefavx2128
[ 54%] Built target sleefavx2
[ 54%] Built target sleefavx512f
[ 58%] Built target libprotoc
[ 58%] Built target sleef
[ 58%] Built target protoc
[ 58%] Built target gen_onnx_proto
[ 58%] Built target Caffe2_PROTO
[ 59%] Built target onnx_proto
[ 59%] Built target caffe2_protos
[ 59%] Built target Caffe2_perfkernels_avx2
[ 59%] Built target Caffe2_perfkernels_avx512
[ 60%] Built target Caffe2_perfkernels_avx
[ 62%] Built target onnx
[ 99%] Built target caffe2
[ 99%] Built target caffe2_observers
[ 99%] Built target caffe2_pybind11_state
[100%] Built target caffe2_detectron_ops
Install the project...
-- Install configuration: "Release"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libprotobuf-lite.a(arenastring.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libprotobuf-lite.a(io_win32.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libprotobuf.a(arenastring.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libprotobuf.a(io_win32.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libprotobuf.a(gzip_stream.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libprotobuf.a(error_listener.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libonnx.a(defs.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libonnx.a(old.cc.o) has no symbols
copying third_party/pybind11/include/pybind11/attr.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/embed.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/numpy.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/pybind11.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/operators.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/iostream.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/chrono.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/stl_bind.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/buffer_info.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/options.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/functional.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/stl.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/detail/typeid.h -> torch/include/pybind11/detail
copying third_party/pybind11/include/pybind11/detail/descr.h -> torch/include/pybind11/detail
copying third_party/pybind11/include/pybind11/detail/internals.h -> torch/include/pybind11/detail
copying third_party/pybind11/include/pybind11/detail/common.h -> torch/include/pybind11/detail
copying third_party/pybind11/include/pybind11/detail/class.h -> torch/include/pybind11/detail
copying third_party/pybind11/include/pybind11/detail/init.h -> torch/include/pybind11/detail
copying third_party/pybind11/include/pybind11/common.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/eval.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/cast.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/eigen.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/pytypes.h -> torch/include/pybind11
copying third_party/pybind11/include/pybind11/complex.h -> torch/include/pybind11
running install
running build
running build_py
copying torch/version.py -> build/lib.macosx-10.13-x86_64-3.7/torch
copying caffe2/proto/prof_dag_pb2.py -> build/lib.macosx-10.13-x86_64-3.7/caffe2/proto
copying caffe2/proto/metanet_pb2.py -> build/lib.macosx-10.13-x86_64-3.7/caffe2/proto
copying caffe2/proto/torch_pb2.py -> build/lib.macosx-10.13-x86_64-3.7/caffe2/proto
copying caffe2/proto/caffe2_pb2.py -> build/lib.macosx-10.13-x86_64-3.7/caffe2/proto
copying caffe2/proto/predictor_consts_pb2.py -> build/lib.macosx-10.13-x86_64-3.7/caffe2/proto
copying caffe2/proto/caffe2_legacy_pb2.py -> build/lib.macosx-10.13-x86_64-3.7/caffe2/proto
copying caffe2/proto/hsm_pb2.py -> build/lib.macosx-10.13-x86_64-3.7/caffe2/proto
running build_ext
-- Building with NumPy bindings
-- Not using cuDNN
-- Not using MIOpen
-- Not using CUDA
-- Using MKLDNN
-- Not using NCCL
-- Building with THD distributed package 
-- Building without c10d distributed package

Copying extension caffe2.python.caffe2_pybind11_state
torch/lib/python3.7/site-packages/caffe2/python/caffe2_pybind11_state.cpython-37m-darwin.so does not exist
building 'torch._C' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c torch/csrc/stub.cpp -o build/temp.macosx-10.13-x86_64-3.7/torch/csrc/stub.o -std=c++11 -Wall -Wextra -Wno-strict-overflow -Wno-unused-parameter -Wno-missing-field-initializers -Wno-write-strings -Wno-unknown-pragmas -Wno-deprecated-declarations -fno-strict-aliasing -Wno-missing-braces
clang++ -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk build/temp.macosx-10.13-x86_64-3.7/torch/csrc/stub.o -L/Users/yesifan/pytorch/torch/lib -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lshm -ltorch_python -o build/lib.macosx-10.13-x86_64-3.7/torch/_C.cpython-37m-darwin.so -Wl,-rpath,@loader_path/lib
ld: library not found for -lshm
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang++' failed with exit status 1