我正在尝试在运行 Fedora 14 的机器上编译来自 Hadoop 0.20.2 的 hdfs-fuse 扩展。以下是我已安装的软件包:
fuse-2.8.5-2.fc14.x86_64
fuse-libs-2.8.5-2.fc14.x86_64
fuse-devel-2.8.5-2.fc14.x86_64
然后,我按照 Hadoop wiki 上提供的教程进行操作:
http://wiki.apache.org/hadoop/MountableHDFS
总而言之,以下是我使用的步骤:
进入 $HADOOP_HOME 并使用以下命令启动 libhdfs 的编译:
ant compile-c++-libhdfs -Dislibhdfs=1
第二步,我将 libhdfs 库复制到 libhdfs 文件夹:
mkdir 构建/libhdfs
cp 构建/c++/Linux-amd64-64/lib/* 构建/libhdfs我编译了 fuse_hdfs 可执行文件:
ant 编译贡献-Dislibhdfs=1 -Dfusedfs=1 -Dlibhdfs-fuse=1
我的问题是在最后阶段出现以下错误:
[exec] Making all in .
[exec] make[1]: Entering directory `/local/opt/hadoop-0.20.2/src/contrib/fuse-dfs'
[exec] make[1]: Nothing to be done for `all-am'.
[exec] make[1]: Leaving directory `/local/opt/hadoop-0.20.2/src/contrib/fuse-dfs'
[exec] Making all in src
[exec] make[1]: Entering directory `/local/opt/hadoop-0.20.2/src/contrib/fuse-dfs/src'
[exec] gcc -Wall -O3 -L/local/opt/hadoop-0.20.2/build/libhdfs -lhdfs -L/lib -lfuse -L/user/lpellegr/home/local/opt/jdk//jre/lib/amd64/server -ljvm -o fuse_dfs fuse_dfs.o fuse_options.o fuse_trash.o fuse_stat_struct.o fuse_users.o fuse_init.o fuse_connect.o fuse_impls_access.o fuse_impls_chmod.o fuse_impls_chown.o fuse_impls_create.o fuse_impls_flush.o fuse_impls_getattr.o fuse_impls_mkdir.o fuse_impls_mknod.o fuse_impls_open.o fuse_impls_read.o fuse_impls_release.o fuse_impls_readdir.o fuse_impls_rename.o fuse_impls_rmdir.o fuse_impls_statfs.o fuse_impls_symlink.o fuse_impls_truncate.o fuse_impls_utimens.o fuse_impls_unlink.o fuse_impls_write.o
[exec] /usr/bin/ld: fuse_stat_struct.o: undefined reference to symbol 'ceil@@GLIBC_2.2.5'
[exec] /usr/bin/ld: note: 'ceil@@GLIBC_2.2.5' is defined in DSO /lib64/libm.so.6 so try adding it to the linker command line
[exec] /lib64/libm.so.6: could not read symbols: Invalid operation
[exec] collect2: ld returned 1 exit status
[exec] make[1]: *** [fuse_dfs] Error 1
[exec] make[1]: Leaving directory `/local/opt/hadoop-0.20.2/src/contrib/fuse-dfs/src'
[exec] make: *** [all-recursive] Error 1
BUILD FAILED
/local/opt/hadoop-0.20.2/build.xml:497: The following error occurred while executing this line:
/local/opt/hadoop-0.20.2/src/contrib/build.xml:30: The following error occurred while executing this line:
/local/opt/hadoop-0.20.2/src/contrib/fuse-dfs/build.xml:57: exec returned: 2
这里需要注意的是,我还没有定义 FUSE_HOME。您认为定义 FUSE_HOME 有帮助吗?或者您对这个问题有什么想法吗?
答案1
我认为定义 FUSE_HOME 不会有帮助。重要的行是
[exec] /usr/bin/ld: fuse_stat_struct.o: undefined reference to symbol 'ceil@@GLIBC_2.2.5'
[exec] /usr/bin/ld: note: 'ceil@@GLIBC_2.2.5' is defined in DSO /lib64/libm.so.6 so try adding it to the linker command line
[exec] /lib64/libm.so.6: could not read symbols: Invalid operation
[exec] collect2: ld returned 1 exit status
链接器告诉您无法找到 fuse_stat_struct.c 中的符号“ceil”。但它知道它在哪里。它在 libm.so 中 - 可能是由 glibc-devel 提供的。也许您需要 32 位版本的 libm.so。我以前没见过这种情况。
经过一番搜索,我们发现:http://lists.fedoraproject.org/pipermail/devel/2010-March/133601.html
为了尝试一下,请尝试设置 LDFLAGS 环境变量并重新编译。
ant compile-contrib -Dislibhdfs=1 -Dfusedfs=1 -Dlibhdfs-fuse=1 LDFLAGS=-lm