微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Doxygen Build在带有Clang的ubuntu上失败1.8.20

如何解决Doxygen Build在带有Clang的ubuntu上失败1.8.20

这些是我安装doxygen 1.8.20的步骤:

apt-get install graphviz
apt-get install bison
apt-get install flex
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
tar -xvzf libiconv-1.16.tar.gz
cd libiconv-1.16
./configure --prefix=/usr/local/libiconv
make
make install
wget http://doxygen.nl/files/doxygen-1.8.20.src.tar.gz
gunzip doxygen-1.8.20.src.tar.gz
tar -xf doxygen-1.8.20.src.tar
cd doxygen-1.8.20
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -Duse_libclang=ON ..

这时我得到以下输出

CMake Error at CMakeLists.txt:51 (find_package):
  Could not find a package configuration file provided by "LLVM" with any of
  the following names:

    LLVMConfig.cmake
    llvm-config.cmake

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


-- Configuring incomplete,errors occurred!
See also "/home/doxygen-1.8.20/build/CMakeFiles/CMakeOutput.log".

现在我得到了LLVM软件包:

apt-get install llvm
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -Duse_libclang=ON ..

这时我得到以下输出

CMake Error at CMakeLists.txt:52 (find_package):
  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,errors occurred!

获取clang程序包:

apt-get install clang

得到相同的错误

CMake Error at CMakeLists.txt:52 (find_package):
  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,errors occurred!
See also "/home/doxygen-1.8.20/build/CMakeFiles/CMakeOutput.log".

现在呢?

解决方法

发现这是与apt-get install llvmapt-get install clang一起安装的llvm和clang的问题。这将同时安装两者的版本6。

代替这些命令,请执行以下操作:

apt install llvm-10 clang-10 libclang-10-dev

然后跑步

cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -Duse_libclang=ON ..

将产生成功的输出:

-- Found PythonInterp: /usr/bin/python (found version "2.7.17")
-- Found FLEX: /usr/bin/flex (found version "2.6.4")
-- Found BISON: /usr/bin/bison (found version "3.0.4")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for iconv_open
-- Looking for iconv_open - found
-- Performing Test ICONV_COMPILES
-- Performing Test ICONV_COMPILES - Success
-- Found Iconv: In glibc
-- One (and only one) of the ICONV_ACCEPTS_... tests must pass
-- Performing Test ICONV_ACCEPTS_NONCONST_INPUT
-- Performing Test ICONV_ACCEPTS_NONCONST_INPUT - Success
-- Performing Test ICONV_ACCEPTS_CONST_INPUT
-- Performing Test ICONV_ACCEPTS_CONST_INPUT - Failed
-- The javacc executable not found,using existing files
-- Configuring done
-- Generating done
-- Build files have been written to: /home/libiconv-1.16/doxygen-1.8.20/build

并继续进行makemake install

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。