Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.0-alpha
-
None
-
None
-
-
Incompatible change, Reviewed
Description
It would be good to use cmake rather than autotools to build the native (C/C++) code in Hadoop.
Rationale:
1. automake depends on shell scripts, which often have problems running on different operating systems. It would be extremely difficult, and perhaps impossible, to use autotools under Windows. Even if it were possible, it might require horrible workarounds like installing cygwin. Even on Linux variants like Ubuntu 12.04, there are major build issues because /bin/sh is the Dash shell, rather than the Bash shell as it is in other Linux versions. It is currently impossible to build the native code under Ubuntu 12.04 because of this problem.
CMake has robust cross-platform support, including Windows. It does not use shell scripts.
2. automake error messages are very confusing. For example, "autoreconf: cannot empty /tmp/ar0.4849: Is a directory" or "Can't locate object method "path" via package "Autom4te..." are common error messages. In order to even start debugging automake problems you need to learn shell, m4, sed, and the a bunch of other things. With CMake, all you have to learn is the syntax of CMakeLists.txt, which is simple.
CMake can do all the stuff autotools can, such as making sure that required libraries are installed. There is a Maven plugin for CMake as well.
3. Different versions of autotools can have very different behaviors. For example, the version installed under openSUSE defaults to putting libraries in /usr/local/lib64, whereas the version shipped with Ubuntu 11.04 defaults to installing the same libraries under /usr/local/lib. (This is why the FUSE build is currently broken when using OpenSUSE.) This is another source of build failures and complexity. If things go wrong, you will often get an error message which is incomprehensible to normal humans (see point #2).
CMake allows you to specify the minimum_required_version of CMake that a particular CMakeLists.txt will accept. In addition, CMake maintains strict backwards compatibility between different versions. This prevents build bugs due to version skew.
4. autoconf, automake, and libtool are large and rather slow. This adds to build time.
For all these reasons, I think we should switch to CMake for compiling native (C/C++) code in Hadoop.
Attachments
Attachments
Issue Links
- blocks
-
HDFS-3250 Get the fuse-dfs test running
- Resolved
- is depended upon by
-
MAPREDUCE-4267 mavenize pipes
- Closed
- is duplicated by
-
HDFS-3607 log a message when fuse_dfs is not built
- Closed
- is related to
-
HADOOP-8482 give a better error message if native build dependencies are missng
- Open
-
HADOOP-8488 test-patch.sh gives +1 even if the native build fails.
- Closed
-
HADOOP-8480 The native build should honor -DskipTests
- Closed
-
HADOOP-8481 update BUILDING.txt to talk about cmake rather than autotools
- Closed
- relates to
-
HADOOP-8538 CMake builds fail on ARM
- Closed
-
HADOOP-8620 Add -Drequire.fuse and -Drequire.snappy
- Closed