Sarcasm / irony-mode

A C/C++ minor mode for Emacs powered by libclang
GNU General Public License v3.0
901 stars 98 forks source link

M-x irony-install-server fails #573

Open gavinhughes opened 3 years ago

gavinhughes commented 3 years ago

Attempting to install the irony server through M-x irony-install-server returns the following:

-*- mode: compilation; default-directory: "/var/folders/zq/7w9sl6hd41q3zczmbsym_fx00000gp/T/build-irony-server-1.4.0/" -*-
Compilation started at Fri Nov 13 16:59:32

cmake -DCMAKE_INSTALL_PREFIX\=/Users/gavinhughes/.emacs.d/.local/etc/irony-server/  /Users/gavinhughes/.emacs.d/.local/straight/build-27.0.50/irony/server && cmake --build . --use-stderr --config Release --target install
CMake Warning at src/CMakeLists.txt:4 (find_package):
  By not providing "FindClang.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Clang", but
  CMake did not find one.

  Could not find a package configuration file provided by "Clang" with any of
  the following names:

    ClangConfig.cmake
    clang-config.cmake

  Add the installation prefix of "Clang" to CMAKE_PREFIX_PATH or set
  "Clang_DIR" to a directory containing one of the above files.  If "Clang"
  provides a separate development package or SDK, be sure it has been
  installed.

CMake Error at /usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find LibClang (missing: LIBCLANG_LIBRARY LIBCLANG_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindLibClang.cmake:94 (find_package_handle_standard_args)
  src/CMakeLists.txt:28 (find_package)

-- Configuring incomplete, errors occurred!
See also "/private/var/folders/zq/7w9sl6hd41q3zczmbsym_fx00000gp/T/build-irony-server-1.4.0/CMakeFiles/CMakeOutput.log".
See also "/private/var/folders/zq/7w9sl6hd41q3zczmbsym_fx00000gp/T/build-irony-server-1.4.0/CMakeFiles/CMakeError.log".

Compilation exited abnormally with code 1 at Fri Nov 13 16:59:33

Searched for the following files but none are present on my system:

FindClang.cmake
ClangConfig.cmake
clang-config.cmake
309631 commented 2 years ago

I have same problem, did you menage to solve it?

309631 commented 2 years ago

-- mode: compilation; default-directory: "/tmp/build-irony-server-1.5.0/" -- Compilation started at Mon Mar 7 15:28:36

cmake -DCMAKE_INSTALL_PREFIX\=/home/uuu/.emacs.d/irony/ /home/uuu/.emacs.d/elpa/irony-20220110.849/server && cmake --build . --use-stderr --config Release --target install CMake Warning at src/CMakeLists.txt:4 (find_package): By not providing "FindClang.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Clang", but CMake did not find one.

Could not find a package configuration file provided by "Clang" with any of the following names:

ClangConfig.cmake
clang-config.cmake

Add the installation prefix of "Clang" to CMAKE_PREFIX_PATH or set "Clang_DIR" to a directory containing one of the above files. If "Clang" provides a separate development package or SDK, be sure it has been installed.

CMake Error at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message): Could NOT find LibClang (missing: LIBCLANG_LIBRARY LIBCLANG_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE) cmake/modules/FindLibClang.cmake:94 (find_package_handle_standard_args) src/CMakeLists.txt:28 (find_package)

-- Configuring incomplete, errors occurred! See also "/tmp/build-irony-server-1.5.0/CMakeFiles/CMakeOutput.log".

Compilation exited abnormally with code 1 at Mon Mar 7 15:28:36

309631 commented 2 years ago

I have found a solution - I have install clangd

m-aXimilian commented 2 years ago

I had the same problem on Fedora 35. Installing

(additionally to cmake, clang, and llvm) solved it for me.

rnikander commented 1 year ago

Fails for me on macOS. I downloaded a binary release of clang 15. It would be nice to have some instruction on how to point this build at that directory.

sfc-gh-randerson commented 9 months ago

On MacOS, using homebrew, I ended up doing setting all of these environment variables:

export PATH=/opt/homebrew/opt/llvm/bin:$PATH
export LDFLAGS=-L/opt/homebrew/opt/llvm/lib
export CPPFLAGS=-I/opt/homebrew/opt/llvm/include
export LIBRARY_PATH=/opt/homebrew/opt/llvm/lib/

and then manually running the cmake commands outside of emacs.