Skip to content

irony-install-server failure #196

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

Open
codekingplusplus opened this issue May 19, 2015 · 10 comments
Open

irony-install-server failure #196

codekingplusplus opened this issue May 19, 2015 · 10 comments

Comments

@codekingplusplus
Copy link

I have been unsuccessful in properly executing the irony-install-server command. I have read through some prior issues and tried various options such as -DCMAKE_PREFIX_PATH, -DCMAKE_LIBCLANG_LIBRARY and -DLIBCLANG_INCLUDE_DIR. I first tried llvm/clang that comes with my Mac (running OSX 10.10.3), when that didn't work I tried brew install llvm --with-clang. The errors I get are of the form:

dyld: Library not loaded: @rpath/libclangAST.dylib Referenced from: /usr/local/opt/llvm/lib/libclang.3.6.dylib Reason: image not found

If I execute sudo install_name_tool -change @rpath/libclangAST.dylib /usr/local/opt/llvm/lib/libclangAST.dylib /usr/local/opt/llvm/lib/libclang.3.6.dylib and try running irony-install-server again, then I get the same error message with different .dylib files (I did this a lot more than once....). I can find all of these .dylib files in the /usr/local/opt/llvm/lib/.

The command that I have run (shown in irony-server build buffer) is:

/opt/local/bin/cmake -DLIBCLANG_LIBRARY=/usr/local/opt/llvm/lib/libclang.3.6.dylib -DLIBCLANG_INCLUDE_DIR=/usr/local/opt/llvm/include/ -DCMAKE_PREFIX_PATH=/usr/local/opt/llvm -DCMAKE_INSTALL_PREFIX\=/Users/thutmose/.emacs.d/irony/ /Users/thutmose/.emacs.d/elpa/irony-20150408.1501/server && /opt/local/bin/cmake --build . --use-stderr --config Release --target install

I think I have these "PATHS" configured correctly and I'm not sure what else to try. Please let me know if you need more information. Thanks.

@Sarcasm
Copy link
Owner

Sarcasm commented May 19, 2015

You can also try to set the -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON as shown here: https://github.com/Sarcasm/irony-mode#faq

Can you show the output of otool -L on irony-server or libclang.dylib? See this issue: Homebrew/legacy-homebrew#34169

Did you try this very command (replacing 3.5 by 3.6)? #135 (comment)

Can you go back to the simple cmake command:

mkdir /tmp/build-irony
cd /tmp/build-irony
/opt/local/bin/cmake /Users/thutmose/.emacs.d/elpa/irony-20150408.1501/server
make
./bin/irony-server --version

And copy/paste any error you get.

Debugging OS X issues is difficult for me as I cannot test, maybe @tsukimizake may help, I don't know.

@codekingplusplus
Copy link
Author

First Suggestion

cmake -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON -DCMAKE_INSTALL_PREFIX\=/Users/thutmose/.emacs.d/irony/ /Users/thutmose/.emacs.d/elpa/irony-20150614.1225/server && cmake --build . --use-stderr --config Release --target install

-*- mode: compilation; default-directory: "/var/folders/kf/9_ybd9l55sx4ktk77r831q600000gn/T/build-irony-server-0.2.0-cvs4/" -*-
Compilation started at Wed Jun 17 11:36:40

cmake -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON -DCMAKE_INSTALL_PREFIX\=/Users/thutmose/.emacs.d/irony/ /Users/thutmose/.emacs.d/elpa/irony-20150614.1225/server && cmake --build . --use-stderr --config Release --target install
-- Detecting libclang builtin headers directory
-- Detecting libclang builtin headers directory -- fail
CMake Warning at cmake/CheckLibClangBuiltinHeadersDir.cmake:87 (message):
  CheckLibClangBuiltinHeadersDir: unsupported configuration, please report.



    Check with args: -isystem;"/usr/local/Cellar/llvm/3.6.0/lib/clang/3.6.0/include";/var/folders/kf/9_ybd9l55sx4ktk77r831q600000gn/T/CMakeFiles/CMakeTmp/check-libclang-stddef.cpp
    Check output:
      dyld: Library not loaded: @rpath/libclangAST.dylib
    Referenced from: /usr/local/opt/llvm/lib/libclang.3.6.dylib
    Reason: image not found

  SIGTRAP

Call Stack (most recent call first):
  src/CMakeLists.txt:8 (check_libclang_builtin_headers_dir)


-- Irony package version is '0.2.0-cvs4'
-- Found emacs: /usr/bin/emacs
-- Configuring done
-- Generating done
-- Build files have been written to: /var/folders/kf/9_ybd9l55sx4ktk77r831q600000gn/T
[100%] Built target irony-server
Install the project...
-- Install configuration: "Release"
-- Installing: /Users/thutmose/.emacs.d/irony/bin/irony-server

Compilation finished at Wed Jun 17 11:36:41

Second Suggestion

/usr/local/Cellar/llvm/3.6.0/lib $ otool -L libclang.dylib 
libclang.dylib:
    /usr/local/opt/llvm/lib/libclang.3.6.dylib (compatibility version 1.0.0, current version 3.6.0)
    @rpath/libclangAST.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libclangBasic.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libclangFrontend.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libclangIndex.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libclangLex.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libclangSema.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libclangTooling.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libclangARCMigrate.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libLLVMCore.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libLLVMSupport.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)

Third Suggestion

/usr/local/opt/llvm/lib $ sudo install_name_tool -change @rpath/libLLVM-3.6.dylib /usr/local/opt/llvm/lib/libLLVM-3.6.dylib /usr/local/opt/llvm/lib/libclang.dylib

yields: the same output as above.

Fourth Suggestion

/tmp/build-irony $ cmake /Users/thutmose/.emacs.d/elpa/irony-20150614.1225/server/ 
-- The C compiler identification is AppleClang 6.1.0.6020049
-- The CXX compiler identification is AppleClang 6.1.0.6020049
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified
-- Performing Test HAS_STDCXX11
-- Performing Test HAS_STDCXX11 - Success
-- Performing Test HAS_CXX11_STDLIB
-- Performing Test HAS_CXX11_STDLIB - Success
-- C++11 compiler option(s): -std=c++11
-- Found LibClang: /usr/local/Cellar/llvm/3.6.0/lib/libclang.dylib  
-- Detecting libclang builtin headers directory
-- Detecting libclang builtin headers directory -- fail
CMake Warning at cmake/CheckLibClangBuiltinHeadersDir.cmake:87 (message):
  CheckLibClangBuiltinHeadersDir: unsupported configuration, please report.



    Check with args: -isystem;"/usr/local/Cellar/llvm/3.6.0/lib/clang/3.6.0/include";/tmp/build-irony/CMakeFiles/CMakeTmp/check-libclang-stddef.cpp
    Check output:
      dyld: Library not loaded: @rpath/libclangAST.dylib
    Referenced from: /usr/local/opt/llvm/lib/libclang.3.6.dylib
    Reason: image not found

  SIGTRAP

Call Stack (most recent call first):
  src/CMakeLists.txt:8 (check_libclang_builtin_headers_dir)


-- Irony package version is '0.2.0-cvs4'
-- Found emacs: /usr/bin/emacs
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/build-irony
/tmp/build-irony $ make
Scanning dependencies of target irony-server
[ 16%] Building CXX object src/CMakeFiles/irony-server.dir/support/CommandLineParser.cpp.o
[ 33%] Building CXX object src/CMakeFiles/irony-server.dir/support/TemporaryFile.cpp.o
[ 50%] Building CXX object src/CMakeFiles/irony-server.dir/Command.cpp.o
[ 66%] Building CXX object src/CMakeFiles/irony-server.dir/Irony.cpp.o
[ 83%] Building CXX object src/CMakeFiles/irony-server.dir/TUManager.cpp.o
[100%] Building CXX object src/CMakeFiles/irony-server.dir/main.cpp.o
Linking CXX executable ../bin/irony-server
[100%] Built target irony-server
/tmp/build-irony $ ./bin/irony-server --version
dyld: Library not loaded: @rpath/libclangAST.dylib
  Referenced from: /usr/local/opt/llvm/lib/libclang.3.6.dylib
  Reason: image not found
trace/BPT trap: 5

Further Suggestions

@Sarcasm Thanks for all the help so far, I hope this output that I gave you is helpful. I hope we can come up with a solution.

@Sarcasm
Copy link
Owner

Sarcasm commented Jun 17, 2015

Can you add -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON to your cmake command line and repeat the tests?

@codekingplusplus
Copy link
Author

Here is the output:

-- mode: compilation; default-directory: "/var/folders/kf/9_ybd9l55sx4ktk77r831q600000gn/T/build-irony-server-0.2.0-cvs4/" --
Compilation started at Wed Jun 17 13:01:04

cmake -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_INSTALL_PREFIX=/Users/thutmose/.emacs.d/irony/ /Users/thutmose/.emacs.d/elpa/irony-20150614.1225/server && cmake --build . --use-stderr --config Release --target install
-- Detecting libclang builtin headers directory
-- Detecting libclang builtin headers directory -- fail
CMake Warning at cmake/CheckLibClangBuiltinHeadersDir.cmake:87 (message):
CheckLibClangBuiltinHeadersDir: unsupported configuration, please report.

Check with args: -isystem;"/usr/local/Cellar/llvm/3.6.0/lib/clang/3.6.0/include";/var/folders/kf/9_ybd9l55sx4ktk77r831q600000gn/T/CMakeFiles/CMakeTmp/check-libclang-stddef.cpp
Check output:
  dyld: Library not loaded: @rpath/libclangAST.dylib
Referenced from: /usr/local/opt/llvm/lib/libclang.3.6.dylib
Reason: image not found

SIGTRAP

Call Stack (most recent call first):
src/CMakeLists.txt:8 (check_libclang_builtin_headers_dir)

-- Irony package version is '0.2.0-cvs4'
-- Found emacs: /usr/bin/emacs
-- Configuring done
-- Generating done
-- Build files have been written to: /var/folders/kf/9_ybd9l55sx4ktk77r831q600000gn/T
[100%] Built target irony-server
Install the project...
-- Install configuration: "Release"
-- Installing: /Users/thutmose/.emacs.d/irony/bin/irony-server

Compilation finished at Wed Jun 17 13:01:04

@Sarcasm
Copy link
Owner

Sarcasm commented Jun 17, 2015

Can you run ./bin/irony-server --version. Not 100% sure the test binaries have the rpath set.

I'm sorry, apart from that I don't know much what to do. Maybe @tsukimizake can help?

Maybe you will have a better luck on stackexchange asking question about rpath and stuff. I don't know the tools to inspect the rpath, to list the libraries that aren't found, ...

@codekingplusplus
Copy link
Author

It tells me the same thing as last time:

~/.emacs.d/irony $ ./bin/irony-server --version
dyld: Library not loaded: @rpath/libclangAST.dylib
Referenced from: /usr/local/opt/llvm/lib/libclang.3.6.dylib
Reason: image not found
trace/BPT trap: 5

Yeah, thanks for all the help again. I'll have to read more about the rpath.

@Sarcasm
Copy link
Owner

Sarcasm commented Jun 17, 2015

I'm interested by any solution you can find, so let the ticket open until you find one.

If you just want irony to works, I think you can download a working archive here: http://llvm.org/releases/

@codekingplusplus
Copy link
Author

All I really want is Cocoa UI object/method completion (e.g. completion on the methods for the NSTextField class) what's the easiest way to get this capability?

@Sarcasm
Copy link
Owner

Sarcasm commented Jun 18, 2015

Probably to download the archive from http://llvm.org/releases/

You can an example here: #138 (comment)

@codekingplusplus
Copy link
Author

Sweet! That works well!

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

2 participants