Cyrus SASL/GSASL 缺失解决
# 1. 报错现象与日志定位
在 Bigtop 体系下编译 Hadoop 3.3.4(尤其是 hadoop-hdfs-native-client
)过程中,CMake 阶段如未提前安装 Cyrus SASL
相关依赖,会遇到如下错误提示:
[INFO] Running cmake /opt/modules/bigtop/build/hadoop/rpm/BUILD/hadoop-3.3.4-src/hadoop-hdfs-project/hadoop-hdfs-native-client/src -DGENERATED_JAVAH=/opt/modules/bigtop/build/hadoop/rpm/BU
ILD/hadoop-3.3.4-src/hadoop-hdfs-project/hadoop-hdfs-native-client/target/native/javah -DHADOOP_BUILD=1 -DJVM_ARCH_DATA_MODEL=64 -DREQUIRE_FUSE=false -DREQUIRE_LIBWEBHDFS=false -DREQUIRE_V
ALGRIND=false -G Unix Makefiles
[INFO] with extra environment variables {}
[WARNING] CMake Warning (dev) in CMakeLists.txt:
[WARNING] No project() command is present. The top-level CMakeLists.txt file must
[WARNING] contain a literal, direct call to the project() command. Add a line of
[WARNING] code such as
[WARNING]
[WARNING] project(ProjectName)
[WARNING]
[WARNING] near the top of the file, but after cmake_minimum_required().
[WARNING]
[WARNING] CMake is pretending there is a "project(Project)" command on the first
[WARNING] line.
[WARNING] This warning is for project developers. Use -Wno-dev to suppress it.
[WARNING]
[WARNING] CMake Warning (dev) in CMakeLists.txt:
[WARNING] cmake_minimum_required() should be called prior to this top-level project()
[WARNING] call. Please see the cmake-commands(7) manual for usage documentation of
[WARNING] both commands.
[WARNING] This warning is for project developers. Use -Wno-dev to suppress it.
[WARNING]
[WARNING] -- The C compiler identification is GNU 8.5.0
[WARNING] -- The CXX compiler identification is GNU 8.5.0
[WARNING] -- Detecting C compiler ABI info
[WARNING] -- Detecting C compiler ABI info - done
[WARNING] -- Check for working C compiler: /usr/bin/cc - skipped
[WARNING] -- Detecting C compile features
[WARNING] -- Detecting C compile features - done
[WARNING] -- Detecting CXX compiler ABI info
[WARNING] -- Detecting CXX compiler ABI info - done
[WARNING] -- Check for working CXX compiler: /usr/bin/c++ - skipped
[WARNING] -- Detecting CXX compile features
[WARNING] -- Detecting CXX compile features - done
[WARNING] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
[WARNING] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
[WARNING] -- Looking for pthread_create in pthreads
[WARNING] -- Looking for pthread_create in pthreads - not found
[WARNING] -- Looking for pthread_create in pthread
[WARNING] -- Looking for pthread_create in pthread - found
[WARNING] -- Found Threads: TRUE
[WARNING] -- Performing Test HAVE_BETTER_TLS
[WARNING] -- Performing Test HAVE_BETTER_TLS - Success
[WARNING] -- Performing Test HAVE_INTEL_SSE_INTRINSICS
[WARNING] -- Performing Test HAVE_INTEL_SSE_INTRINSICS - Success
[WARNING] -- Looking for dlopen in dl
[WARNING] -- Looking for dlopen in dl - found
[WARNING] JAVA_HOME=, JAVA_JVM_LIBRARY=/opt/modules/jdk1.8.0_202/jre/lib/amd64/server/libjvm.so
[WARNING] JAVA_INCLUDE_PATH=/opt/modules/jdk1.8.0_202/include, JAVA_INCLUDE_PATH2=/opt/modules/jdk1.8.0_202/include/linux
[WARNING] Located all JNI components successfully.
[WARNING] -- Found JNI: /opt/modules/jdk1.8.0_202/include found components: AWT JVM
[WARNING] CUSTOM_OPENSSL_PREFIX =
[WARNING] -- Performing Test HAS_NEW_ENOUGH_OPENSSL
[WARNING] -- Performing Test HAS_NEW_ENOUGH_OPENSSL - Success
[WARNING] -- Check if compiler accepts -pthread
[WARNING] -- Check if compiler accepts -pthread - yes
[WARNING] -- Performing Test THREAD_LOCAL_SUPPORTED
[WARNING] -- Performing Test THREAD_LOCAL_SUPPORTED - Success
[WARNING] CMake Deprecation Warning at main/native/libhdfspp/CMakeLists.txt:29 (cmake_minimum_required):
[WARNING] Compatibility with CMake < 2.8.12 will be removed from a future version of
[WARNING] CMake.
[WARNING]
[WARNING] Update the VERSION argument <min> value or use a ...<max> suffix to tell
[WARNING] CMake that the project does not need compatibility with older versions.
[WARNING]
[WARNING]
[WARNING] -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
[WARNING] -- Found OpenSSL: /usr/lib64/libcrypto.so (found version "1.1.1k")
[WARNING] -- Found Protobuf: /usr/lib64/libprotobuf.so;-lpthread (found version "3.5.0")
[WARNING] CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
[WARNING] The package name passed to `find_package_handle_standard_args` (CYRUS_SASL)
[WARNING] does not match the name of the calling package (CyrusSASL). This can lead
[WARNING] to problems in calling code that expects `find_package` result variables
[WARNING] (e.g., `_FOUND`) to follow a certain pattern.
[WARNING] Call Stack (most recent call first):
[WARNING] main/native/libhdfspp/CMake/FindCyrusSASL.cmake:46 (find_package_handle_standard_args)
[WARNING] main/native/libhdfspp/CMakeLists.txt:46 (find_package)
[WARNING] This warning is for project developers. Use -Wno-dev to suppress it.
[WARNING]
[WARNING] -- Could NOT find CYRUS_SASL (missing: CYRUS_SASL_SHARED_LIB CYRUS_SASL_INCLUDE_DIR)
[WARNING] CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
[WARNING] The package name passed to `find_package_handle_standard_args` (GSASL) does
[WARNING] not match the name of the calling package (GSasl). This can lead to
[WARNING] problems in calling code that expects `find_package` result variables
[WARNING] (e.g., `_FOUND`) to follow a certain pattern.
[WARNING] Call Stack (most recent call first):
[WARNING] main/native/libhdfspp/CMake/FindGSasl.cmake:42 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
[WARNING] main/native/libhdfspp/CMakeLists.txt:47 (find_package)
[WARNING] This warning is for project developers. Use -Wno-dev to suppress it.
[WARNING]
[WARNING] -- Could NOT find GSASL (missing: GSASL_LIBRARIES GSASL_INCLUDE_DIR)
[WARNING] -- Performing Test THREAD_LOCAL_SUPPORTED
[WARNING] -- Performing Test THREAD_LOCAL_SUPPORTED - Success
[WARNING] -- Performing Test PROTOC_IS_COMPATIBLE
[WARNING] -- Performing Test PROTOC_IS_COMPATIBLE - Success
[WARNING] -- valgrind location: MEMORYCHECK_COMMAND-NOTFOUND
[WARNING] CMake Error at main/native/libhdfspp/CMakeLists.txt:136 (message):
[WARNING] Cound not find a SASL library (GSASL (gsasl) or Cyrus SASL (libsasl2).
[WARNING] Install/configure one of them or define NO_SASL=1 in your cmake call
[WARNING]
[WARNING]
[WARNING] -- Configuring incomplete, errors occurred!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
日志高频关键词
Could NOT find CYRUS_SASL
、Could NOT find GSASL
、Cound not find a SASL library
是判断此类依赖缺失问题的直接依据。
其中最关键一行:
Cound not find a SASL library (GSASL (gsasl) or Cyrus SASL (libsasl2). Install/configure one of them or define NO_SASL=1 in your cmake call
1
说明 CMake 配置未能检测到任何可用的 SASL 实现(Cyrus SASL 或 GSASL),导致 native 模块无法继续编译。
# 2. 根因分析与依赖说明
Hadoop Native 组件(如 libhdfspp
)需要依赖 Cyrus SASL/GSASL 库进行安全认证扩展,若编译主机环境未安装相关开发包,就会出现上述
CMake 错误。
仅装运行库不够,需开发包!(cyrus-sasl-devel
、gsasl-devel
等)
笔记
多数情况下只需安装 cyrus-sasl-devel
即可满足 native 编译需求。极个别环境要求 GSASL,可参考实际报错按需补齐依赖。
# 3. 解决办法
直接执行如下命令即可一键修复依赖:
dnf install -y cyrus-sasl-devel
1
- RHEL/CentOS 8 及以上推荐用 dnf,CentOS 7 用
yum install -y cyrus-sasl-devel
亦可。 - 若本地有内网镜像源,优先配置内网源提升安装速度。
警告
注意: 如果你的编译主机没有公网,建议提前准备好相关 RPM 包进行离线安装,避免因网络阻断反复踩坑。