Issue Details (XML | Word | Printable)

Key: HADOOP-3344
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Giridharan Kesavan
Reporter: Craig Macdonald
Votes: 0
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

libhdfs: always builds 32bit, even when x86_64 Java used

Created: 03/May/08 10:37 PM   Updated: 08/Jul/09 05:05 PM
Return to search
Component/s: build
Affects Version/s: None
Fix Version/s: 0.20.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works HADOOP-3344-v2.patch 2008-10-31 03:46 AM Giridharan Kesavan 3.00 MB
Text File Licensed for inclusion in ASF works HADOOP-3344.patch 2008-12-16 07:47 AM Giridharan Kesavan 1.18 MB
Text File Licensed for inclusion in ASF works HADOOP-3344.patch 2008-12-15 05:57 AM Giridharan Kesavan 1.18 MB
Text File Licensed for inclusion in ASF works HADOOP-3344.patch 2008-12-12 03:37 PM Giridharan Kesavan 1.18 MB
Text File Licensed for inclusion in ASF works HADOOP-3344.v0.patch 2008-05-07 01:02 AM Craig Macdonald 15 kB
Text File Licensed for inclusion in ASF works HADOOP-3344.v1.patch 2008-05-14 03:35 PM Craig Macdonald 25 kB
Text File Licensed for inclusion in ASF works HADOOP-3344.v3.patch 2008-11-04 08:07 AM Giridharan Kesavan 1.18 MB
Environment: x86_64 linux, x86_64 Java installed
Issue Links:
Incorporates
 

Hadoop Flags: Reviewed, Incompatible change
Release Note: Changed build procedure for libhdfs to build correctly for different platforms. Build instructions are in the Jira item.
Resolution Date: 16/Dec/08 08:22 AM


 Description  « Hide
The makefile for libhdfs is hard-coded to compile 32bit libraries. It should perhaps compile dependent on which Java is set.

The relevant lines are:

LDFLAGS = -L$(JAVA_HOME)/jre/lib/$(OS_ARCH)/server -ljvm -shared -m32 -Wl,-x
CPPFLAGS = -m32 -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/$(PLATFORM)

$OS_ARCH can be (e.g.) amd64 if you're using a 64bit java on the x86_64 platform. So while gcc will try to link against the correct libjvm.so, it will fail because libhdfs is to be built 32bit (because of -m32)

     [exec] /usr/bin/ld: skipping incompatible /usr/java64/latest/jre/lib/amd64/server/libjvm.so when searching for -ljvm
     [exec] /usr/bin/ld: cannot find -ljvm
     [exec] collect2: ld returned 1 exit status
     [exec] make: *** [/root/def/hadoop-0.16.3/build/libhdfs/libhdfs.so.1] Error 1

The solution should be to specify -m32 or -m64 depending on the os.arch detected.

There are 3 cases to check:

  • 32bit OS, 32bit java => libhdfs should be built 32bit, specify -m32
  • 64bit OS, 32bit java => libhdfs should be built 32bit, specify -m32
  • 64bit OS, 64bit java => libhdfs should be built 64bit, specify -m64


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.