0

I am currently trying to install doxygen on my computer, but upon running doxygen through the command line it fails with this error:

doxygen: error while loading shared libraries: libclang.so.6: cannot open shared object file: No such file or directory

I have tried multiple ways of installing it. I tried using apt-get, I tried building it from source, and I tried the unique solution suggested in this StackExchange answer. When I try to build it from source, cmake fails with this error:

 ~/Documents/Repos/doxygen/build/CMakeFiles$ cmake -G "Unix Makefiles" ..
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find FLEX (missing: FLEX_EXECUTABLE)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindFLEX.cmake:230 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:84 (find_package)


-- Configuring incomplete, errors occurred!

I have even tried installing clang manually, but all to no avail.

Ian MathWiz
  • 133
  • 1
  • 7
  • When running doxygen you get the message about libclang.so.6 and you also say that you used the suggestion in https://stackoverflow.com/questions/49220422/doxygen-cannot-find-the-shared-librarys-libclang-so-6/49220534#49220534 installin clang-6.0. What happens if you give the command `ldd /doxygen` in respect to clang? Is the directory where clang 6.0 is installed in your LD_LIBRARY_PATH? – albert May 08 '18 at 13:54
  • 1
    Regarding the building from sources, it looks like `flex` is not installed or it is installed in a place cmake cannot find it. – albert May 08 '18 at 14:03
  • `doxygen` should install using `apt` and run fine on 16.04, pulling in `libclang1-3.6` and `libllvm3.6v5` as dependencies if necessary. If you followed the linked instructions *literally* (which are for 17.10) then possibly you have messed up the versions of clang/llvm on your system? – steeldriver May 08 '18 at 14:12
  • Libclang is version 3.6 and libllvm is 3.6v5. I tried installing flex using apt-get and the build still fails with the same error. – Ian MathWiz May 09 '18 at 03:21
  • Upon running `ldd` it says `libclang.so.6 => not found` even after I tried reinstalling libclang 6 and doxygen using apt-get. – Ian MathWiz May 09 '18 at 07:04
  • How about the `LD_LIBRARY_PATH` settings. Where is the libclang installed (`find / -iname libclang.so\*`)? – albert May 09 '18 at 10:28
  • `find: ‘/run/user/1000/gvfs’: Permission denied /usr/share/segger_embedded_studio_for_arm_3.34a/llvm/bin/libclang.so /usr/lib/llvm-3.8/lib/libclang.so.1 /usr/lib/llvm-3.6/lib/libclang.so.1 /usr/lib/llvm-6.0/lib/libclang.so.1` – Ian MathWiz May 09 '18 at 11:14
  • So I see here only libclang.so.1 and no liblang.so.6. Small google gave me: https://superuser.com/questions/1298131/doxygen-cannot-find-the-shared-librarys-libclang-so-6-version-llvm-6-0-wh maybe the answer here might give some pointers. – albert May 09 '18 at 11:29
  • Please also use @albert so I will see a notification. – albert May 09 '18 at 11:31
  • @albert After running `sudo apt-get install -f` it just gave me `Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: ... Use 'sudo apt autoremove' to remove them. 0 to upgrade, 0 to newly install, 0 to remove and 16 not to upgrade.` – Ian MathWiz May 09 '18 at 12:15
  • @albert Upon trying to reinstall doxygen using `make install` `/usr/bin/install -d /usr/local/bin /usr/bin/install -d /usr/local/doc/doxygen /usr/bin/install -m 755 bin/doxygen /usr/local/bin /usr/bin/install -m 755 bin/doxytag /usr/local/bin #/usr/bin/install -m 755 bin/doxywizard /usr/local/bin cp -r html /usr/local/doc/doxygen cp -r html/examples /usr/local/doc/doxygen` And running the doxygen executable still gives the same error message. – Ian MathWiz May 09 '18 at 12:17
  • In the mentioned question it also stated: "After doing that, I was able to install doxygen through apt-get, which also automatically installed its incoming dependences." as far as I see you install your own version without apt-get or is the output from apt-get? – albert May 09 '18 at 12:23
  • @albert Using apt-get just gives the same "The following packages were automatically installed..." output that the apt-get install -f command gave. – Ian MathWiz May 09 '18 at 12:25
  • Is the libclang.s0.6 now present? and if so is the directory in the LD_LIBRARY_PATH? – albert May 09 '18 at 12:39
  • @albert OK, this time I tried installing libclang.so.6 with apt-get and it output that it has unmet dependencies but cannot install (the correct version of) them. The list is too long to fit into a comment, but is there a way to automatically track and install all those dependencies? – Ian MathWiz May 10 '18 at 02:08
  • I'm sorry but on that I cannot really help. Probably catch the output and install the missing packages. Maybe apt-get has an option (the command build-dep, see on your system man apt-get or see https://linux.die.net/man/8/apt-get). Please check further on askubuntu or post a question for it. – albert May 10 '18 at 07:20

1 Answers1

0

After upgrading to Ubuntu 18.04, installing flex and bison with apt, and rebuilding from source using these instructions, I was finally able to get doxygen to work.

Ian MathWiz
  • 133
  • 1
  • 7
  • Good to see that you succeeded although you needed to install a new version of the OS and did the build yourself instead of using a provided Ubuntu package (but this would probably not be the newest version, but the 1.8.13 version). – albert May 10 '18 at 14:08