Closed geohuz closed 8 years ago
Is msgpack installed?
ls -l /usr/local/lib/libmsgpack.a
If it is, please post your output from ld -v /dev/null
@rogual same issue here. msgpack is installed at:
lrwxr-xr-x 1 martin admin 40 1 Okt 12:13 /usr/local/lib/libmsgpack.a -> ../Cellar/msgpack/1.2.0/lib/libmsgpack.a
and the ld
output is:
@(#)PROGRAM:ld PROJECT:ld64-253.6
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
Library search paths:
/usr/lib
/usr/local/lib
Framework search paths:
/Library/Frameworks/
/System/Library/Frameworks/
ld: warning: -arch not specified
ld: warning: -macosx_version_min not specified, assuming 10.9
ld: file too small (length=0) file '/dev/null' for inferred architecture x86_64
OK, now that makes no sense because ld
is looking in /usr/local/lib
and libmsgpack.a
is right there.
I suppose you could make sure it isn't a broken link but I don't know why it would be:
ls -lh /usr/local/Cellar/msgpack/1.2.0/lib/libmsgpack.a
Output of that last command:
-r--r--r-- 1 martin admin 22K 4 Sep 23:59 /usr/local/Cellar/msgpack/1.2.0/lib/libmsgpack.a
@rogual same OS X version here, BTW: 10.11.1. Xcode 7.1.1. with CLI tools installed and ready (I just upgraded almost all my installed Homebrew tools, without a hitch but for Neovim.app).
OK, let's get some more info about what the linker thinks it's doing. If you go into the SConstruct file and add LINKFLAGS=['-v'],
to that first env.Append
block, so it says this:
env.Append(
CCFLAGS=['-std=c++11', '-stdlib=libc++', '-g', '-Wno-deprecated-register'],
LINKFLAGS=['-v'],
CPPPATH=['build'],
LIBS=['c++', 'msgpack'],
FRAMEWORKS=['Cocoa', 'Carbon']
)
Then recompile and you should get more detailed output at the link step. Paste it here and let's see what we can figure out.
Done. Looks like it fails to find the msgpack headers:
VIM=/usr/local/Cellar/neovim/HEAD/share/nvim NVIM=/usr/local/bin/nvim scons -Q
Install file: "res/Info.plist" as "build/Neovim.app/Contents/Info.plist"
clang++ -o build/client.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/client.cc
src/client.cc:5:10: fatal error: 'msgpack.hpp' file not found
#include <msgpack.hpp>
^
1 error generated.
scons: *** [build/client.o] Error 1
make: *** [all] Error 2
Wait, what? Changing link flags causes compile step to fail? OK, that's simply not possible, but carrying on:
-v
to CCFLAGS
as well just like you did for LINKFLAGS
. This should cause the compiler to print its header search path./usr/local/include
should be on that pathmsgpack.hpp
should be in that directory — ensure /usr/local/include/msgpack.hpp
exists and is readable.Done. msgpack.hpp
is present and accounted for. Compiling with the verbose flag gives:
VIM=/usr/local/Cellar/neovim/HEAD/share/nvim NVIM=/usr/local/bin/nvim scons -Q
clang++ -o build/client.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -v -Ibuild -Isrc src/client.cc
Apple LLVM version 7.0.0 (clang-700.1.76)
Target: x86_64-apple-darwin15.0.0
Thread model: posix
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name client.cc -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 253.6 -v -gdwarf-2 -dwarf-column-info -coverage-file /Users/martin/Downloads/neovim-dot-app-master/build/client.o -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -I build -I src -stdlib=libc++ -Wno-deprecated-register -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /Users/martin/Downloads/neovim-dot-app-master -ferror-limit 19 -fmessage-length 120 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o build/client.o -x c++ src/client.cc
clang -cc1 version 7.0.0 based upon LLVM 3.7.0svn default target x86_64-apple-darwin15.0.0
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/v1"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
build
src
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks (framework directory)
End of search list.
src/client.cc:5:10: fatal error: 'msgpack.hpp' file not found
#include <msgpack.hpp>
^
1 error generated.
scons: *** [build/client.o] Error 1
make: *** [all] Error 2
Looks like /usr/local/include/
is MIA (EDIT: from the search path, I mean. It’s present and that is where the headers are located on my machine, i.e. lrwxr-xr-x 1 martin admin 43B 1 Okt 12:13 /usr/local/include/msgpack.hpp -> ../Cellar/msgpack/1.2.0/include/msgpack.hpp
).
Have you run xcode-select --install
? Just noticed the original poster said he had but you didn't mention it.
Oh f… – I missed that step after the last Xcode dot update (probably because Homebrew didn’t complain, but still). My bad, and terribly sorry for the noise, on a Sunday of all things.
No worries, Apple's fault really with their confusing-ass tools :P
I'm having the same issue, but xcode-select --install
didn't help.
Also, my homebrew is located at ~/.homebrew
.
The msgpack.hpp
and msgpack.h
files exist in ~/.homebrew/include
Can you post your include & linker search paths? Is libmsgpack.a in ~/.homebrew/lib?
Also which error are you getting, the -lmsgpack one or the header file one?
I'm getting the -lmsgpack one
This is my verbose build output
❯ brew install --HEAD neovim-dot-app -v
==> Installing neovim-dot-app from rogual/homebrew-neovim-dot-app
==> Cloning https://github.com/rogual/neovim-dot-app.git
Updating /Library/Caches/Homebrew/neovim-dot-app--git
git config remote.origin.url https://github.com/rogual/neovim-dot-app.git
git config remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
git fetch origin
==> Checking out branch master
git checkout -f master --
Already on 'master'
Your branch is up-to-date with 'origin/master'.
git reset --hard origin/master
HEAD is now at 1983e13 Add neovim_dot_app variable
==> make NVIM=/Users/elentok/.homebrew/opt/neovim/bin/nvim
VIM=/Users/elentok/.homebrew/Cellar/neovim/HEAD/share/nvim NVIM=/Users/elentok/.homebrew/opt/neovim/bin/nvim scons -Q
Install file: "res/Info.plist" as "build/Neovim.app/Contents/Info.plist"
clang++ -o build/client.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/client.cc
clang++ -o build/process.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/process.cc
clang++ -o build/rpc.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/rpc.cc
clang++ -o build/vim.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/vim.cc
clang++ -o build/vimutils.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/vimutils.cc
clang++ -o build/app.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/app.mm
clang++ -o build/font.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/font.mm
clang++ -o build/graphics.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/graphics.mm
clang++ -o build/input.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/input.mm
clang++ -o build/keys.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/keys.mm
clang++ -o build/main.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/main.mm
clang++ -o build/menu.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/menu.mm
gperf -cCD -L C++ -Z RedrawHash -t src/redraw.gperf > build/redraw-hash.gen.h
clang++ -o build/view.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/view.mm
clang++ -o build/window.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/window.mm
clang++ -o build/Neovim.app/Contents/MacOS/Neovim build/client.o build/process.o build/rpc.o build/vim.o build/vimutils.o build/app.o build/font.o build/graphics.o build/input.o
build/keys.o build/main.o build/menu.o build/redraw.o build/view.o build/window.o -lc++ -lmsgpack -framework Cocoa -framework Carbon
ld: library not found for -lmsgpack
clang: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [build/Neovim.app/Contents/MacOS/Neovim] Error 1
make: *** [all] Error 2
==> Formula
Tap: rogual/homebrew-neovim-dot-app
Path: /Users/elentok/.homebrew/Library/Taps/rogual/homebrew-neovim-dot-app/neovim-dot-app.rb
==> Configuration
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: 477906438563455a80eaf7df687b4fb6235ab977
Last commit: 53 minutes ago
HOMEBREW_PREFIX: /Users/elentok/.homebrew
HOMEBREW_REPOSITORY: /Users/elentok/.homebrew
HOMEBREW_CELLAR: /Users/elentok/.homebrew/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit haswell
OS X: 10.11.1-x86_64
Xcode: 7.0.1
CLT: 7.1.0.0.1.1444952191
Clang: 7.0 build 700
X11: 2.7.8 => /opt/X11
System Ruby: 2.0.0-p645
Perl: /usr/bin/perl
Python: /Users/elentok/.homebrew/bin/python => /Users/elentok/.homebrew/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /Users/elentok/.rbenv/shims/ruby => /Users/elentok/.rbenv/versions/2.2.2/bin/ruby
Java: 1.8.0_60, 1.8.0_45, 1.7.0_79, 1.7.0_76, 1.7.0_71, 1.7.0_67
==> ENV
CC: /usr/bin/clang
CXX: /usr/bin/clang++
OBJC: /usr/bin/clang
OBJCXX: /usr/bin/clang++
CFLAGS: -Os -w -pipe -march=native -mmacosx-version-min=10.11
CXXFLAGS: -Os -w -pipe -march=native -mmacosx-version-min=10.11
CPPFLAGS: -I/Users/elentok/.homebrew/opt/openssl/include -I/Users/elentok/.homebrew/opt/sqlite/include -I/Users/elentok/.homebrew/opt/readline/include -isystem/Users/elentok/.homebrew/include -F/Users/elentok/.homebrew/Frameworks
LDFLAGS: -L/Users/elentok/.homebrew/opt/openssl/lib -L/Users/elentok/.homebrew/opt/sqlite/lib -L/Users/elentok/.homebrew/opt/readline/lib -L/Users/elentok/.homebrew/lib -F/Users/elentok/.homebrew/Frameworks -Wl,-headerpad_max_install_names
MAKEFLAGS: -j4
CMAKE_PREFIX_PATH: /Users/elentok/.homebrew/opt/openssl:/Users/elentok/.homebrew/opt/sqlite:/Users/elentok/.homebrew/opt/readline:/Users/elentok/.homebrew
CMAKE_FRAMEWORK_PATH: /Users/elentok/.homebrew/Frameworks
MACOSX_DEPLOYMENT_TARGET: 10.11
PKG_CONFIG_PATH: /Users/elentok/.homebrew/opt/openssl/lib/pkgconfig:/Users/elentok/.homebrew/opt/sqlite/lib/pkgconfig
PKG_CONFIG_LIBDIR: /Users/elentok/.homebrew/lib/pkgconfig:/Users/elentok/.homebrew/Library/ENV/pkgconfig/10.11:/usr/lib/pkgconfig
PATH: /Users/elentok/.homebrew/opt/python/bin:/Users/elentok/.homebrew/opt/openssl/bin:/Users/elentok/.homebrew/opt/sqlite/bin:/usr/local/git/current/bin:/Users/elentok/.rbenv/shims:/Users/elentok/.dotfiles/scripts:/Users/elentok/.dotlocal/scripts:/Users/elentok/.homebrew/bin:/Users/elentok/bin:/Users/elentok/scripts:/Users/elentok/.local/bin:/Users/elentok/.homebrew/opt/coreutils/libexec/gnubin:/Users/elentok/.homebrew/opt/gnu-sed/libexec/gnubin:/Users/elentok/.rbenv/shims:/usr/local/share/npm/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/elentok/Library/Android/sdk/tools:/Users/elentok/Library/Android/sdk/build-tools/23.0.0:/Users/elentok/.homebrew/opt/go/libexec/bin:/Users/elentok/go/bin:/Users/elentok/.homebrew/Library/Taps/homebrew/homebrew-boneyard/cmd:/Users/elentok/.homebrew/Library/ENV/scm
CPATH: /Users/elentok/.homebrew/include
Error: rogual/neovim-dot-app/neovim-dot-app HEAD did not build
Logs:
/Users/elentok/Library/Logs/Homebrew/neovim-dot-app/01.make
Is libmsgpack.a in ~/.homebrew/lib?
Also, what does this give: ld -v /dev/null
Yep:
❯ ls ~/.homebrew/lib/libmsgpack.a -l
4.0K lrwxr-xr-x 1 elentok admin 40 Nov 29 22:21 /Users/elentok/.homebrew/lib/libmsgpack.a -> ../Cellar/msgpack/1.2.0/lib/libmsgpack.a
> ld -v /dev/null
@(#)PROGRAM:ld PROJECT:ld64-253.3.3
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
Library search paths:
/usr/lib
/usr/local/lib
Framework search paths:
/Library/Frameworks/
/System/Library/Frameworks/
ld: warning: -arch not specified
ld: warning: -macosx_version_min not specified, assuming 10.10
ld: file too small (length=0) file '/dev/null' for inferred architecture x86_64
OK, there's your problem! Your library search paths don't seem to include ~/.homebrew/lib
so the linker isn't finding libmsgpack.
I don't know anything about installing Homebrew anywhere other than /usr/local but if you wanted a quick fix for this situation you might try symlinking libmsgpack.a into /usr/local/lib.
I'll try, thanks!
I believe PR #201 resolves this issue; I have Homebrew deployed via Boxen, and I could reproduce this issue when building from source on master, and could successfully complete a build on my branch.
I encountered the -lmsgpack issue as well, even though my Homebrew install is in the standard location. I looked for libmsgpack.a in /usr/local/lib, but it wasn't there. I uninstalled and reinstalled msgpack (using brew) and it still wasn't there. However, I did see libmsgpackc.a. I symlinked it to libmsgpack.a, and now Neovim installs and runs. I'm not sure if it functions 100% normally though...will report back if not.
Note: libmsgpack is deprecated and no longer built, see https://github.com/msgpack/msgpack-c/issues/395#issuecomment-174019730
It looks like this is fixed in HEAD: https://github.com/rogual/neovim-dot-app/commit/7ca70378c32a57575310c405bb5100290c716692
geohu~:brew install --HEAD neovim-dot-app ==> Installing neovim-dot-app from rogual/homebrew-neovim-dot-app ==> Cloning https://github.com/rogual/neovim-dot-app.git Updating /Library/Caches/Homebrew/neovim-dot-app--git ==> Checking out branch master ==> make NVIM=/usr/local/opt/neovim/bin/nvim Last 15 lines from /Users/geohu/Library/Logs/Homebrew/neovim-dot-app/01.make: clang++ -o build/font.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/font.mm clang++ -o build/graphics.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/graphics.mm clang++ -o build/input.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/input.mm clang++ -o build/keys.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/keys.mm clang++ -o build/main.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/main.mm clang++ -o build/menu.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/menu.mm gperf -cCD -L C++ -Z RedrawHash -t src/redraw.gperf > build/redraw-hash.gen.h clang++ -o build/redraw.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/redraw.mm clang++ -o build/view.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/view.mm clang++ -o build/window.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -Ibuild -Isrc src/window.mm clang++ -o build/Neovim.app/Contents/MacOS/Neovim build/client.o build/process.o build/rpc.o build/vim.o build/vimutils.o build/app.o build/font.o build/graphics.o build/input.o build/keys.o build/main.o build/menu.o build/redraw.o build/view.o build/window.o -lc++ -lmsgpack -framework Cocoa -framework Carbon ld: library not found for -lmsgpack clang: error: linker command failed with exit code 1 (use -v to see invocation) scons: * [build/Neovim.app/Contents/MacOS/Neovim] Error 1 make: * [all] Error 2
READ THIS: https://git.io/brew-troubleshooting If reporting this issue please do so at (not Homebrew/homebrew): https://github.com/rogual/homebrew-neovim-dot-app/issues
And I'm sure to run: xcode-select --install
OSX: 10.11.1