【发布时间】:2022-01-24 14:47:12
【问题描述】:
我正在与这个 CMAKE for Wazuh Agent 安装问题作斗争,我将感谢您的帮助。
服务器信息> AIX 7.1 - 技术级别 5 - Service Pack 8
问题> 服务器未连接到互联网。我正在关注这个 Wazuh 安装文档> https://documentation.wazuh.com/current/installation-guide/more-installation-alternatives/wazuh-from-sources/wazuh-agent/ 所以我自己下载的每个依赖项。
执行 wazuh ./install.sh 脚本后,我收到 此错误>
4- Installing the system
DIR="/var/ossec"
Running the Makefile
grep: can't open /etc/os-release
grep: can't open /etc/redhat-release
/opt/freeware/bin/gmake build_sysinfo build_shared_modules build_syscollector
gmake[1]: Entering directory '/home/myname/wazuh-wazuh-d9bdabd/src'
grep: can't open /etc/os-release
grep: can't open /etc/redhat-release
cd data_provider/ && mkdir -p build && cd build && cmake -DINSTALL_PREFIX=/var/ossec .. && /opt/freeware/bin/gmake
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
**CMake 3.12.4 or higher is required. You are running version 3.9.1**
– Configuring incomplete, errors occurred!
gmake[1]: *** [Makefile:1370: build_sysinfo] Error 1
gmake[1]: Leaving directory '/home/myname/wazuh-wazuh-d9bdabd/src'
gmake: *** [Makefile:722: agent] Error 2
Error 0x5.
Building error. Unable to finish the installation.
所以我需要将 CMAKE 至少升级到 3.12.4 版本
我下载了 3.12.4(也有更高版本,但有同样的问题),但我得到了这个错误:
./bootstrap
---------------------------------------------
CMake 3.12.4, Copyright 2000-2018 Kitware, Inc. and Contributors
Found XL toolchain
C compiler on this system is: xlc
---------------------------------------------
Error when bootstrapping CMake:
Cannot find a C++ compiler that supports both C+11 and the specified C+ flags.
Please specify one using environment variable CXX.
The C++ flags are "".
They can be changed using the environment variable CXXFLAGS.
See cmake_bootstrap.log for compilers attempted.
---------------------------------------------
Log of errors: /tmp/test/cmake-3.12.4/Bootstrap.cmk/cmake_bootstrap.log
这里是 cmake_bootstrap.log>
xlC: 1501-210 (W) command option t contains an incorrect subargument
"/usr/vacpp/include/unordered_map", line 70.5: 1540-0859 (S) #error directive: To use the unordered map library, macro _IBMCPP_TR1_ must be defined
by user to non zero integer value..
"cmake_bootstrap_11272306_test.cxx", line 7.2: 1540-0859 (S) #error directive: "Compiler is not in a mode aware of C++11.".
Test failed to compile
关于我的编译器的信息>
/usr/vacpp/bin/xlC -qversion
IBM XL C/C++ for AIX, V12.1 (5765-J02, 5725-C72)
Version: 12.01.0000.0000
/usr/vac/bin/xlc -qversion
IBM XL C/C++ for AIX, V12.1 (5765-J02, 5725-C72)
Version: 12.01.0000.0000
lslpp -l | grep "vac.C"; lslpp -l | grep "vacpp.cmp.core"; lslpp -l | grep "xlC.aix*"
vac.C 12.1.0.0 COMMITTED IBM XL C Compiler
vac.C 12.1.0.0 COMMITTED IBM XL C Compiler
vacpp.cmp.core 12.1.0.0 COMMITTED IBM XL C/C++ Compiler
vacpp.cmp.core 12.1.0.0 COMMITTED IBM XL C/C++ Compiler
xlC.aix61.rte 13.1.3.3 COMMITTED IBM XL C++ Runtime for AIX 6.1
您能帮帮我吗,我现在该怎么办,如何安装 CMAKE 才能使 wazuh 安装工作?
【问题讨论】:
-
specify one using environment variable CXX.所以试试CXX=/usr/vac/bin/xlc CXXFLAGS="someflags that you want to use -flag-to-enable-c++11-see -documentation" ./bootstrap。但是来自documentation.wazuh.com/current/installation-guide/… 的AIX 安装并没有提到CMake,是吗?它使用 gmake。 -
感谢您的回答。我做了> '''CXX=/usr/vac/bin/xlc''' 和 '''CXXFLAGS=-std=gnu++11''' 这两个命令都被接受但错误仍然相同。找不到同时支持 C++11 和指定 C++ 标志的 C++ 编译器。 C++ 标志是“”。可以使用环境变量 CXXFLAGS 更改它们。我对这个 cmake 标志不是很熟悉。我以前从来不需要使用这个,所以不知道我是否正确地这样做了。是的,在那个 Aix 安装 wazuh 中提到了 Gmake,但是在安装尝试中错误地提到了 Cmake 作为依赖项。
-
这是一个命令,而不是多个。如果有多个,你必须
export它。export CXX=stuff CXXFLAGS=stuff也是如此,然后是./bootstrap或在 one 行中执行CXX=stuff CXXFLAGS=stuff ./bootstrap。 -
你可以从IBMibm.com/support/pages/…下载编译好的二进制cmake@