您的位置:首页 > 运维架构

Hadoop 3.0 在Mac上面编译失败

2015-04-12 14:38 309 查看
时间:2015年4月

Hadoop版本:当前日期trunk最新版

OS版本:OS X 10.10.2

编译错误:

当编译hadoop-mapreduce-client-nativetask 3.0.0-SNAPSHOT工程的时候会出错,错误如下:

[exec] /Library/Developer/CommandLineTools/usr/bin/c++ -DSIMPLE_MEMCPY -fno-strict-aliasing -Wall -Wno-sign-compare -g -O2 -DNDEBUG -fPIC -I/Users/CaiYicong/Documents/SourceCode/ForkHadoop/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/target/native/javah -I/Users/CaiYicong/Documents/SourceCode/ForkHadoop/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src -I/Users/CaiYicong/Documents/SourceCode/ForkHadoop/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/util -I/Users/CaiYicong/Documents/SourceCode/ForkHadoop/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/lib -I/Users/CaiYicong/Documents/SourceCode/ForkHadoop/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/test -I/Users/CaiYicong/Documents/SourceCode/ForkHadoop/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src -I/Users/CaiYicong/Documents/SourceCode/ForkHadoop/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/target/native -I/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/include/darwin -isystem /Users/CaiYicong/Documents/SourceCode/ForkHadoop/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/gtest/include -w -o CMakeFiles/gtest.dir/main/native/gtest/gtest-all.cc.o -c /Users/CaiYicong/Documents/SourceCode/ForkHadoop/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/gtest/gtest-all.cc
[exec] In file included from /Users/CaiYicong/Documents/SourceCode/ForkHadoop/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/gtest/gtest-all.cc:39:
[exec] In file included from /Users/CaiYicong/Documents/SourceCode/ForkHadoop/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/gtest/include/gtest/gtest.h:55:
[exec] In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/ostream:131:
[exec] In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/ios:216:
[exec] In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__locale:15:
[exec] In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/string:439:
[exec] In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:628:
[exec] In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:604:
[exec] /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:341:10: fatal error: '__debug' file not found
[exec] #include <__debug>
[exec] ^
[exec] 1 error generated.
[exec] make[2]: *** [CMakeFiles/gtest.dir/main/native/gtest/gtest-all.cc.o] Error 1
[exec] make[1]: *** [CMakeFiles/gtest.dir/all] Error 2
[exec] make: *** [all] Error 2


该错误显示找不到__debug文件,在该路径下确实没有该文件/Library/Developer/CommandLineTools/usr/include/c++/v1/__debug
搜索了一下发现是由于最近更新了Command Line Tools 6.3所致,最近OS推送了这个更新,我也更新了,但是该版本貌似不那么友好,所以出现了该编译错误。

规避解决方法:

回退该工具到6.2版本,下载地址:https://developer.apple.com/downloads/index.action

选择Command Line Tools(OS X 10.10) for Xcode - Xcode 6.2版本

参考:http://stackoverflow.com/questions/29529455/missing-c-header-debug-after-updating-osx-command-line-tools-6-3
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  hadoop 3.0 mac 编译