create-native-configure: [exec] configure.ac:47: error: possibly undefined macro: AC_PROG_LIBTOOL [exec] If this token and others are legitimate, please use m4_pattern_allow. [exec] See the Autoconf documentation. [exec] autoreconf: /usr/local/Cellar/autoconf/2.69/bin/autoconf failed with exit status: 1 BUILD FAILED /Users/lili/快盘/hadoop-1.0.3/build.xml:618: exec returned: 1
用ant编译至此出现报错,然后安装个libtool问题就解决了,brew install libtool,这个问题应该只在Mac下出现,可能是系统的原因。接下来解决了这个问题,还出现了个奇葩的问题。
compile: [echo] contrib: gridmix [javac] /Users/lili/快盘/hadoop-1.0.3/src/contrib/build-contrib.xml:185: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds [javac] Compiling 31 source files to /Users/lili/快盘/hadoop-1.0.3/build/contrib/gridmix/classes [javac] /Users/lili/快盘/hadoop-1.0.3/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/Gridmix.java:396: 错误: 类型参数? extends T不在类型变量E的范围内 [javac] private <T> String getEnumValues(Enum<? extends T>[] e) { [javac] ^ [javac] 其中, T,E是类型变量: [javac] T扩展已在方法 <T>getEnumValues(Enum<? extends T>[])中声明的Object [javac] E扩展已在类 Enum中声明的Enum<E> [javac] /Users/lili/快盘/hadoop-1.0.3/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/Gridmix.java:399: 错误: 类型参数? extends T不在类型变量E的范围内 [javac] for (Enum<? extends T> v : e) { [javac] ^ [javac] 其中, T,E是类型变量: [javac] T扩展已在方法 <T>getEnumValues(Enum<? extends T>[])中声明的Object [javac] E扩展已在类 Enum中声明的Enum<E> [javac] 注: 某些输入文件使用了未经检查或不安全的操作。 [javac] 注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。 [javac] 2 个错误
这个问题是这个版本的个BUG,解决方法如下:
Index: src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/Gridmix.java =================================================================== --- src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/Gridmix.java (revision 1340233) +++ src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/Gridmix.java (working copy) @@ -613,10 +613,10 @@ } } - private <T> String getEnumValues(Enum<? extends T>[] e) { + private String getEnumValues(Enum<?>[] e) { StringBuilder sb = new StringBuilder(); String sep = ""; - for (Enum<? extends T> v : e) { + for (Enum<?> v : e) { sb.append(sep); sb.append(v.name()); sep = "|";