p-mathur / hadoop-snappy

Automatically exported from code.google.com/p/hadoop-snappy
Apache License 2.0
0 stars 0 forks source link

/usr/bin/ld: cannot find -ljvm #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm trying to build hadoop-snappy but it does not work with errors.

[exec] make  all-am
     [exec] make[1]: Entering directory `/home/ywkim/workspace/hadoop-snappy/target/native'
     [exec] /bin/bash ./libtool --tag=CXX   --mode=link g++  -g -O2 -version-info 0:1:0 -L/usr/local/lib -o libhadoopsnappy.la -rpath /usr/local/lib src/SnappyCompressor.lo src/SnappyDecompressor.lo  -ljvm 
     [exec] libtool: link: g++ -shared -nostdlib /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/../../../crti.o /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/crtbeginS.o  src/.libs/SnappyCompressor.o src/.libs/SnappyDecompressor.o   -L/usr/local/lib -ljvm -L/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2 -L/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/../../.. -L/usr/lib/x86_64-linux-gnu -lstdc++ -lm -lc -lgcc_s /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/crtendS.o /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/../../../crtn.o    -Wl,-soname -Wl,libhadoopsnappy.so.0 -o .libs/libhadoopsnappy.so.0.0.1
     [exec] make[1]: Leaving directory `/home/ywkim/workspace/hadoop-snappy/target/native'
     [exec] /usr/bin/ld: cannot find -ljvm
     [exec] collect2: ld returned 1 exit status
     [exec] make[1]: *** [libhadoopsnappy.la] 오류 1
     [exec] make: *** [all] 오류 2

Ubuntu 11.04(x86_64, on VirtualBox)

Original issue reported on code.google.com by warwit...@gmail.com on 24 May 2011 at 7:14

GoogleCodeExporter commented 8 years ago
I had the same problem on Ubuntu 11.04(i386 and x86_64). My solution:

Comment line 58 in src/main/native/configure.ac:
LDFLAGS=$ldflags_bak
replace:
#LDFLAGS=$ldflags_bak

Original comment by krzyszto...@gmail.com on 29 Jul 2011 at 1:59

GoogleCodeExporter commented 8 years ago
In fact for resolve it you should create symbolic link in /usr/local/lib for 
libjvm.so. like:
$ sudo ln -s /usr/java/jdk1.6.0_27/jre/lib/i386/server/libjvm.so /usr/local/lib/

because it try to compile it with flag:  -L/usr/local/lib

Probably also to /usr/lib. In my case error was:
[exec] libtool: link: gcc -shared  
src/org/apache/hadoop/io/compress/snappy/.libs/SnappyCompressor.o 
src/org/apache/hadoop/io/compress/snappy/.libs/SnappyDecompressor.o   
-L/usr/local/lib -ljvm -ldl  -m32   -Wl,-soname -Wl,libhadoopsnappy.so.0 -o 
.libs/libhadoopsnappy.so.0.0.1
     [exec] /usr/bin/ld: cannot find -ljvm

Original comment by rku...@satelliz.com on 17 Oct 2011 at 1:04

GoogleCodeExporter commented 8 years ago
I am facing the same issue. 

[exec] config.status: executing libtool commands
     [exec] /bin/bash ./libtool --tag=CC   --mode=link gcc -g -Wall -fPIC -O2 -m64 -g -O2 -version-info 0:1:0 -L/usr/local/lib -o libhadoopsnappy.la -rpath /usr/local/lib src/org/apache/hadoop/io/compress/snappy/SnappyCompressor.lo src/org/apache/hadoop/io/compress/sn/usr/bin/ld: cannot find -ljvm
     [exec] collect2: ld returned 1 exit status
     [exec] make: *** [libhadoopsnappy.la] Error 1
     [exec] appy/SnappyDecompressor.lo  -ljvm -ldl 
     [exec] libtool: link: gcc -shared  src/org/apache/hadoop/io/compress/snappy/.libs/SnappyCompressor.o src/org/apache/hadoop/io/compress/snappy/.libs/SnappyDecompressor.o   -L/usr/local/lib -ljvm -ldl  -m64   -Wl,-soname -Wl,libhadoopsnappy.so.0 -o .libs/libhadoopsnappy.so.0.0.1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.762s
[INFO] Finished at: Thu Nov 17 15:14:53 PST 2011
[INFO] Final Memory: 8M/227M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-antrun-plugin:1.6:run (compile) on project 
hadoop-snappy: An Ant BuildException has occured: The following error occurred 
while executing this line:
[ERROR] 
/home/pkommireddi/misc/hadoop-snappy-read-only/maven/build-compilenative.xml:75:
 exec returned: 2

Original comment by prash1...@gmail.com on 17 Nov 2011 at 11:18

GoogleCodeExporter commented 8 years ago
/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: 
cannot find -ljvm. 
I worked it around creating a symbolic link:
cd /usr/lib
ln -s /usr/lib64/jvm/java-1_6_0-ibm-1.6.0/jre/lib/amd64/default/libjvm.so 
libjvm.so

Use the path to libjvm.so that fits your installation

Original comment by south.mi...@gmail.com on 18 Feb 2014 at 1:42

GoogleCodeExporter commented 8 years ago
while installing apache 2.2.21 on SUSE Linux 1, i m facing following issue:

make[1]: Entering directory `/home/aigwas/apache2.2.21/httpd-2.2.21/support'
make[2]: Entering directory `/home/aigwas/apache2.2.21/httpd-2.2.21/support'
make[2]: Nothing to be done for `local-all'.
make[2]: Leaving directory `/home/aigwas/apache2.2.21/httpd-2.2.21/support'
make[1]: Leaving directory `/home/aigwas/apache2.2.21/httpd-2.2.21/support'
make[1]: Entering directory `/home/aigwas/apache2.2.21/httpd-2.2.21'
gcc -pthread    -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE    
-I/home/aigwas/apache2.2.21/httpd-2.2.21/srclib/pcre -I. 
-I/home/aigwas/apache2.2.21/httpd-2.2.21/os/unix 
-I/home/aigwas/apache2.2.21/httpd-2.2.21/server/mpm/prefork 
-I/home/aigwas/apache2.2.21/httpd-2.2.21/modules/http 
-I/home/aigwas/apache2.2.21/httpd-2.2.21/modules/filters 
-I/home/aigwas/apache2.2.21/httpd-2.2.21/modules/proxy 
-I/home/aigwas/apache2.2.21/httpd-2.2.21/include 
-I/home/aigwas/apache2.2.21/httpd-2.2.21/modules/generators 
-I/home/aigwas/apache2.2.21/httpd-2.2.21/modules/mappers 
-I/home/aigwas/apache2.2.21/httpd-2.2.21/modules/database -I/usr/include 
-I/usr/include/apr-1 
-I/home/aigwas/apache2.2.21/httpd-2.2.21/modules/proxy/../generators 
-I/home/aigwas/apache2.2.21/httpd-2.2.21/modules/ssl 
-I/home/aigwas/apache2.2.21/httpd-2.2.21/modules/dav/main  -c 
/home/aigwas/apache2.2.21/httpd-2.2.21/server/buildmark.c
/usr/lib64/apr-1/build/libtool --silent --mode=link gcc -pthread        -o 
httpd  modules.lo buildmark.o -export-dynamic server/libmain.la 
modules/aaa/libmod_authn_file.la modules/aaa/libmod_authn_default.la 
modules/aaa/libmod_authz_host.la modules/aaa/libmod_authz_groupfile.la 
modules/aaa/libmod_authz_user.la modules/aaa/libmod_authz_default.la 
modules/aaa/libmod_auth_basic.la modules/filters/libmod_include.la 
modules/filters/libmod_filter.la modules/loggers/libmod_log_config.la 
modules/metadata/libmod_env.la modules/metadata/libmod_setenvif.la 
modules/metadata/libmod_version.la modules/ssl/libmod_ssl.la 
modules/http/libmod_http.la modules/http/libmod_mime.la 
modules/generators/libmod_status.la modules/generators/libmod_autoindex.la 
modules/generators/libmod_asis.la modules/generators/libmod_cgi.la 
modules/mappers/libmod_negotiation.la modules/mappers/libmod_dir.la 
modules/mappers/libmod_actions.la modules/mappers/libmod_userdir.la 
modules/mappers/libmod_alias.la modules/mappers/libmod_so.la 
server/mpm/prefork/libprefork.la os/unix/libos.la -lm 
/home/aigwas/apache2.2.21/httpd-2.2.21/srclib/pcre/libpcre.la 
/usr/lib64/libaprutil-1.la -lldap -llber -ldb-4.3 -lexpat 
/usr/lib64/libapr-1.la -lrt -lcrypt -lpthread -ldl
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: 
cannot find -lldap
collect2: ld returned 1 exit status
make[1]: *** [httpd] Error 1
make[1]: Leaving directory `/home/aigwas/apache2.2.21/httpd-2.2.21'
make: *** [all-recursive] Error 1

Please help!
what is the issue here!

Original comment by yogitwr...@gmail.com on 20 Jul 2015 at 12:03