rtags构建失败(由于错误/无体系结构?)

时间:2020-06-17 16:19:15

标签: linux cmake compilation include rtags

我正在尝试在VirtualBox Ubuntu上构建rtags-2.38。 cmake设置过程似乎运行正常:

VirtualBox-Ubuntu:~/Downloads/rtags-2.38$ ./configure --cmake-argument -DZLIB_LIBRARY=$ZLIB_LIBRARY --cmake-argument -DZLIB_INCLUDE_DIR=$ZLIB_INCLUDE_DIR 
Running cmake:
"cmake" "." -DCMAKE_EXPORT_COMPILE_COMMANDS=1 "-DZLIB_LIBRARY=/lib/x86_64-linux-gnu/rsyslog/lmzlibw.so" "-DZLIB_INCLUDE_DIR=/usr/src/linux-headers-5.4.0-37/include/"

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /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: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- llvm-config executable found: /usr/bin/llvm-config
-- Using Clang version 10.0.0 from /usr/lib/llvm-10/lib with CXXFLAGS -I/usr/lib/llvm-10/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-- Found LibClang: /usr/lib/llvm-10/lib/libclang.so  
-- Performing Test LIBCLANG_COMPILES
-- Performing Test LIBCLANG_COMPILES - Success
-- Performing Test CXX_11_EXTENDED_REGEX_SUPPORT
-- Performing Test CXX_11_EXTENDED_REGEX_SUPPORT - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Looking for backtrace
-- Looking for backtrace - found
-- Looking for CLOCK_MONOTONIC_RAW
-- Looking for CLOCK_MONOTONIC_RAW - found
-- Looking for CLOCK_MONOTONIC
-- Looking for CLOCK_MONOTONIC - found
-- Looking for mach_absolute_time
-- Looking for mach_absolute_time - not found
-- Looking for inotify_init
-- Looking for inotify_init - found
-- Looking for kqueue
-- Looking for kqueue - not found
-- Looking for epoll_wait
-- Looking for epoll_wait - found
-- Looking for select
-- Looking for select - found
-- Looking for FD_CLOEXEC
-- Looking for FD_CLOEXEC - found
-- Looking for SO_NOSIGPIPE
-- Looking for SO_NOSIGPIPE - not found
-- Looking for MSG_NOSIGNAL
-- Looking for MSG_NOSIGNAL - found
-- Looking for GetLogicalProcessorInformation
-- Looking for GetLogicalProcessorInformation - not found
-- Looking for SCHED_IDLE
-- Looking for SCHED_IDLE - found
-- Looking for SHM_DEST
-- Looking for SHM_DEST - found
-- Performing Test HAVE_STATMTIM
-- Performing Test HAVE_STATMTIM - Success
-- Found ZLIB: /lib/x86_64-linux-gnu/rsyslog/lmzlibw.so  
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1f")  
-- Performing Test HAVE_CXX11
-- Performing Test HAVE_CXX11 - Success
-- Performing Test HAVE_STRING_ITERATOR_ERASE
-- Performing Test HAVE_STRING_ITERATOR_ERASE - Success
-- Found emacs version 26.3
-- The following OPTIONAL packages have been found:

 * ZLIB
 * OpenSSL
 * PkgConfig, helper tool, <https://www.freedesktop.org/wiki/Software/pkg-config/>
   We use it to get the bash completion installation path, and replace the prefix with the value of CMAKE_INSTALL_PREFIX.

-- The following REQUIRED packages have been found:

 * LibClang

-- Configuring done
-- Generating done
-- Build files have been written to: /home/mark/Downloads/rtags-2.38
VirtualBox-Ubuntu:~/Downloads/rtags-2.38$ 

然后,事情似乎在一个非常基本的层面上出了问题:

VirtualBox-Ubuntu:~/Downloads/rtags-2.38$ make all
[  1%] Building CXX object src/CMakeFiles/rct.dir/rct/rct/AES256CBC.cpp.o
In file included from /usr/include/x86_64-linux-gnu/bits/local_lim.h:38,
                 from /usr/include/x86_64-linux-gnu/bits/posix1_lim.h:161,
                 from /usr/include/limits.h:183,
                 from /usr/lib/gcc/x86_64-linux-gnu/9/include/limits.h:194,
                 from /usr/lib/gcc/x86_64-linux-gnu/9/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-linux-gnu/9/include/limits.h:34,
                 from /usr/include/openssl/ossl_typ.h:13,
                 from /usr/include/openssl/evp.h:14,
                 from /home/mark/Downloads/rtags-2.38/src/rct/rct/AES256CBC.cpp:6:
/usr/include/x86_64-linux-gnu/bits/xopen_lim.h:99:6: error: missing binary operator before token "("
   99 | # if INT_MAX == 32767
      |      ^~~~~~~
/usr/include/x86_64-linux-gnu/bits/xopen_lim.h:102:7: error: missing binary operator before token "("
  102 | #  if INT_MAX == 2147483647
      |       ^~~~~~~
/usr/include/x86_64-linux-gnu/bits/xopen_lim.h:126:6: error: missing binary operator before token "("
  126 | # if LONG_MAX == 2147483647
      |      ^~~~~~~~
In file included from /usr/src/linux-headers-5.4.0-37/include/linux/time.h:5,
                 from /usr/src/linux-headers-5.4.0-37/include/linux/stat.h:19,
                 from /usr/include/x86_64-linux-gnu/bits/statx.h:31,
                 from /usr/include/x86_64-linux-gnu/sys/stat.h:446,
                 from /home/mark/Downloads/rtags-2.38/src/rct/rct/Path.h:12,
                 from /home/mark/Downloads/rtags-2.38/src/rct/rct/Log.h:17,
                 from /home/mark/Downloads/rtags-2.38/src/rct/rct/AES256CBC.cpp:10:
/usr/src/linux-headers-5.4.0-37/include/linux/cache.h:6:10: fatal error: asm/cache.h: No such file or directory
    6 | #include <asm/cache.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/CMakeFiles/rct.dir/build.make:63: src/CMakeFiles/rct.dir/rct/rct/AES256CBC.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1013: src/CMakeFiles/rct.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

据我解释,cmake设置与CPU体系结构之间似乎缺少联系,因为存在:

/usr/src/linux-headers-5.4.0-37/arch/arm64/include/asm/cache.h

我找不到告诉cmake我要为amd64构建版本的方法-还是我需要告诉这个方法?

已安装的内核标头为:

Package: linux-aws-headers-5.4.0-1009
Package: linux-azure-headers-5.4.0-1010
Package: linux-gcp-headers-5.4.0-1009
Package: linux-kvm-headers-5.4.0-1009
Package: linux-oracle-headers-5.4.0-1009
Package: linux-oem-5.6-headers-5.6.0-1007
Package: linux-riscv-headers-5.4.0-24
Package: linux-aws-headers-5.4.0-1011
Package: linux-aws-headers-5.4.0-1015
Package: linux-azure-headers-5.4.0-1012
Package: linux-azure-headers-5.4.0-1016
Package: linux-gcp-headers-5.4.0-1011
Package: linux-gcp-headers-5.4.0-1015
Package: linux-kvm-headers-5.4.0-1011
Package: linux-oracle-headers-5.4.0-1011
Package: linux-kvm-headers-5.4.0-1015
Package: linux-oracle-headers-5.4.0-1015
Package: linux-oem-5.6-headers-5.6.0-1008
Package: linux-oem-5.6-headers-5.6.0-1010
Package: linux-oem-5.6-headers-5.6.0-1011
Package: linux-riscv-headers-5.4.0-26
Package: linux-riscv-headers-5.4.0-27

0 个答案:

没有答案