jeaye / color_coded

A vim plugin for libclang-based highlighting of C, C++, ObjC
MIT License
870 stars 53 forks source link

libtinfo.so.* missing in Arch Linux #169

Closed iosmanthus closed 6 years ago

iosmanthus commented 6 years ago

I try to compile color_coded in ArchLinux. After executing cmake .., Errors occur:

-- Clang/LLVM root path: /root/.vim/plugged/color_coded/build/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04
/root/.vim/plugged/color_coded/build/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/llvm-config: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
/root/.vim/plugged/color_coded/build/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/llvm-config: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
/root/.vim/plugged/color_coded/build/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/llvm-config: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
/root/.vim/plugged/color_coded/build/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/llvm-config: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
/root/.vim/plugged/color_coded/build/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/llvm-config: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
/root/.vim/plugged/color_coded/build/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/llvm-config: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
/root/.vim/plugged/color_coded/build/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/llvm-config: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
/root/.vim/plugged/color_coded/build/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/llvm-config: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
/root/.vim/plugged/color_coded/build/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/llvm-config: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
CMake Error at cmake/FindLLVM.cmake:137 (string):
  string sub-command REGEX, mode MATCHALL needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  cmake/FindLLVM.cmake:171 (llvm_set_libs)
  CMakeLists.txt:64 (find_package)

CMake Error at /usr/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find LLVM (missing: LLVM_ROOT_DIR LLVM_HOST_TARGET) (found
  version "")
Call Stack (most recent call first):
  /usr/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindLLVM.cmake:204 (find_package_handle_standard_args)
  CMakeLists.txt:64 (find_package)

And the content of CMakeError.log:

Determining if the pthread_create exist failed with the following output:
Change Dir: /root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_73d49/fast"
/usr/bin/make -f CMakeFiles/cmTC_73d49.dir/build.make CMakeFiles/cmTC_73d49.dir/build
make[1]: Entering directory '/root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_73d49.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTC_73d49.dir/CheckSymbolExists.c.o   -c /root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_73d49
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_73d49.dir/link.txt --verbose=1
/usr/bin/cc      -rdynamic CMakeFiles/cmTC_73d49.dir/CheckSymbolExists.c.o  -o cmTC_73d49 
CMakeFiles/cmTC_73d49.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x1b): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_73d49.dir/build.make:87: cmTC_73d49] Error 1
make[1]: Leaving directory '/root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_73d49/fast] Error 2

File /root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_19bd8/fast"
/usr/bin/make -f CMakeFiles/cmTC_19bd8.dir/build.make CMakeFiles/cmTC_19bd8.dir/build
make[1]: Entering directory '/root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_19bd8.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_19bd8.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.11/Modules/CheckFunctionExists.c
Linking C executable cmTC_19bd8
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_19bd8.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create    -rdynamic CMakeFiles/cmTC_19bd8.dir/CheckFunctionExists.c.o  -o cmTC_19bd8 -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_19bd8.dir/build.make:87: cmTC_19bd8] Error 1
make[1]: Leaving directory '/root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_19bd8/fast] Error 2

[root@Osmanthus-Laptop CMakeFiles]# 
[root@Osmanthus-Laptop CMakeFiles]# cat CMakeError.log 
Determining if the pthread_create exist failed with the following output:
Change Dir: /root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_73d49/fast"
/usr/bin/make -f CMakeFiles/cmTC_73d49.dir/build.make CMakeFiles/cmTC_73d49.dir/build
make[1]: Entering directory '/root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_73d49.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTC_73d49.dir/CheckSymbolExists.c.o   -c /root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_73d49
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_73d49.dir/link.txt --verbose=1
/usr/bin/cc      -rdynamic CMakeFiles/cmTC_73d49.dir/CheckSymbolExists.c.o  -o cmTC_73d49 
CMakeFiles/cmTC_73d49.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x1b): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_73d49.dir/build.make:87: cmTC_73d49] Error 1
make[1]: Leaving directory '/root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_73d49/fast] Error 2

File /root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_19bd8/fast"
/usr/bin/make -f CMakeFiles/cmTC_19bd8.dir/build.make CMakeFiles/cmTC_19bd8.dir/build
make[1]: Entering directory '/root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_19bd8.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_19bd8.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.11/Modules/CheckFunctionExists.c
Linking C executable cmTC_19bd8
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_19bd8.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create    -rdynamic CMakeFiles/cmTC_19bd8.dir/CheckFunctionExists.c.o  -o cmTC_19bd8 -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_19bd8.dir/build.make:87: cmTC_19bd8] Error 1
make[1]: Leaving directory '/root/.vim/plugged/color_coded/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_19bd8/fast] Error 2

I try to recompile the missing library, and it works. But the problem is the library that in ArchLinux is in version 6 now.

jeaye commented 6 years ago

Hey, thanks for your interest in color_coded and for making such a detailed issue! On Arch, you should just need to install ncurses5-compat-libs. Here's the shared object you need:

$ pacman -Ql ncurses5-compat-libs | grep libtinfo
ncurses5-compat-libs /usr/lib/libtinfo.so.5
iosmanthus commented 6 years ago

Thanks! It works perfectly! 👍

jeaye commented 6 years ago

Happy to hear!

kevr commented 4 years ago

This package is no longer available; there are only two packages on my system that have libtinfo.so.6, none with 5.