Bug 128311 - textproc/py-lucene: Shared object "libjava.so" not found
Summary: textproc/py-lucene: Shared object "libjava.so" not found
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Cheng-Lung Sung
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-23 11:30 UTC by Julien Cigar
Modified: 2009-01-08 15:09 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Cigar 2008-10-23 11:30:01 UTC
Hello,

It seems that java/jdk1(5|6) forget to add some paths to the shared library search paths (?), so when you build the port and try to import lucene it says that a shared object is not found :

jcigar@bccm-it ~ % python
Python 2.5.2 (r252:60911, Sep  9 2008, 09:50:48) 
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
Type "help", "copyright", "credits" or "license" for more information.

Fix: 

To fix the problem I created a file /usr/local/libdata/ldconfig/jdk1.5.0 with the following:

jcigar@bccm-it ~ % cat /usr/local/libdata/ldconfig/jdk1.5.0 
/usr/local/jdk1.5.0/jre/lib/i386
/usr/local/jdk1.5.0/jre/lib/i386/server
/usr/local/jdk1.5.0/jre/lib/i386/client

then sudo /etc/rc.d/ldconfig restart
How-To-Repeat: Build the port and >>> import lucene
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2008-10-23 11:30:12 UTC
Responsible Changed
From-To: freebsd-ports-bugs->clsung

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Geoffrey Mainland 2008-10-30 17:34:04 UTC
I'm having the exact same problem with this port. Did the maintainer not
have this issue?

Anyway, fix follows. diablo-jdk1.5.0 didn't work for me, by the way,
resulting is a strange segfault when I tried to use it to build
PyLucene.

--- jcc/setup.py.orig	2008-10-30 12:59:16.000000000 -0400
+++ jcc/setup.py	2008-10-30 13:27:06.000000000 -0400
@@ -95,6 +95,8 @@
                '/usr/jdk/instances/jdk1.6.0/include/solaris'],
     'win32': ['o:/Java/jdk1.6.0_02/include',
               'o:/Java/jdk1.6.0_02/include/win32'],
+    'freebsd7': ['/usr/local/diablo-jdk1.6.0/include',
+                 '/usr/local/diablo-jdk1.6.0/include/freebsd'],
 }
 
 CFLAGS = {
@@ -103,6 +105,7 @@
     'sunos5': ['-features=iddollar',
                '-erroff=badargtypel2w,wbadinitl,wvarhidemem'],
     'win32': [],
+    'freebsd7': ['-fno-strict-aliasing'],
 }
 
 # added to CFLAGS when JCC invoked with --debug
@@ -111,6 +114,7 @@
     'linux2': ['-O0', '-g', '-DDEBUG'],
     'sunos5': ['-DDEBUG'],
     'win32': ['/Od', '/DDEBUG'],
+    'freebsd7': ['-O0', '-g', '-DDEBUG'],
 }
 
 LFLAGS = {
@@ -127,7 +131,10 @@
     'sunos5': ['-L/usr/jdk/instances/jdk1.6.0/jre/lib/i386', '-ljava',
                '-L/usr/jdk/instances/jdk1.6.0/jre/lib/i386/client', '-ljvm',
                '-R/usr/jdk/instances/jdk1.6.0/jre/lib/i386:/usr/jdk/instances/jre/lib/i386/client'],
-    'win32': ['/LIBPATH:o:/Java/jdk1.6.0_02/lib', 'jvm.lib']
+    'win32': ['/LIBPATH:o:/Java/jdk1.6.0_02/lib', 'jvm.lib'],
+    'freebsd7': ['-L/usr/local/diablo-jdk1.6.0/jre/lib/i386', '-ljava', '-lverify',
+                 '-L/usr/local/diablo-jdk1.6.0/jre/lib/i386/client', '-ljvm',
+                 '-Wl,-rpath=/usr/local/diablo-jdk1.6.0/jre/lib/i386:/usr/local/diablo-jdk1.6.0/jre/lib/i386/client'],
 }
 
 if sys.platform == 'linux2':
@@ -138,6 +145,7 @@
     'linux2': ['javac'],
     'sunos5': ['javac'],
     'win32': ['javac.exe'],
+    'freebsd7': ['javac']
 }
Comment 3 Julien Cigar 2008-10-30 18:05:11 UTC
On Thu, 2008-10-30 at 13:34 -0400, Geoffrey Mainland wrote:
> I'm having the exact same problem with this port. Did the maintainer not
> have this issue?
> 
> Anyway, fix follows. diablo-jdk1.5.0 didn't work for me, by the way,
> resulting is a strange segfault when I tried to use it to build
> PyLucene.
> 

Interesting, on my computer I'm able to built it with jdk1.5, but it's
totally unusable, a simple: 
import lucene
foo = lucene.StandardAnalyzer()
results in a segfault.

I tried on a Debian box and it segfaults too, so it's not impossible
that PyLucene is totally incompatible with jdk < 1.6 .. 

> --- jcc/setup.py.orig	2008-10-30 12:59:16.000000000 -0400
> +++ jcc/setup.py	2008-10-30 13:27:06.000000000 -0400
> @@ -95,6 +95,8 @@
>                 '/usr/jdk/instances/jdk1.6.0/include/solaris'],
>      'win32': ['o:/Java/jdk1.6.0_02/include',
>                'o:/Java/jdk1.6.0_02/include/win32'],
> +    'freebsd7': ['/usr/local/diablo-jdk1.6.0/include',
> +                 '/usr/local/diablo-jdk1.6.0/include/freebsd'],
>  }
>  
>  CFLAGS = {
> @@ -103,6 +105,7 @@
>      'sunos5': ['-features=iddollar',
>                 '-erroff=badargtypel2w,wbadinitl,wvarhidemem'],
>      'win32': [],
> +    'freebsd7': ['-fno-strict-aliasing'],
>  }
>  
>  # added to CFLAGS when JCC invoked with --debug
> @@ -111,6 +114,7 @@
>      'linux2': ['-O0', '-g', '-DDEBUG'],
>      'sunos5': ['-DDEBUG'],
>      'win32': ['/Od', '/DDEBUG'],
> +    'freebsd7': ['-O0', '-g', '-DDEBUG'],
>  }
>  
>  LFLAGS = {
> @@ -127,7 +131,10 @@
>      'sunos5': ['-L/usr/jdk/instances/jdk1.6.0/jre/lib/i386', '-ljava',
>                 '-L/usr/jdk/instances/jdk1.6.0/jre/lib/i386/client', '-ljvm',
>                 '-R/usr/jdk/instances/jdk1.6.0/jre/lib/i386:/usr/jdk/instances/jre/lib/i386/client'],
> -    'win32': ['/LIBPATH:o:/Java/jdk1.6.0_02/lib', 'jvm.lib']
> +    'win32': ['/LIBPATH:o:/Java/jdk1.6.0_02/lib', 'jvm.lib'],
> +    'freebsd7': ['-L/usr/local/diablo-jdk1.6.0/jre/lib/i386', '-ljava', '-lverify',
> +                 '-L/usr/local/diablo-jdk1.6.0/jre/lib/i386/client', '-ljvm',
> +                 '-Wl,-rpath=/usr/local/diablo-jdk1.6.0/jre/lib/i386:/usr/local/diablo-jdk1.6.0/jre/lib/i386/client'],
>  }
>  
>  if sys.platform == 'linux2':
> @@ -138,6 +145,7 @@
>      'linux2': ['javac'],
>      'sunos5': ['javac'],
>      'win32': ['javac.exe'],
> +    'freebsd7': ['javac']
>  }
>          
>
Comment 4 dfilter service freebsd_committer freebsd_triage 2008-11-03 09:01:38 UTC
clsung      2008-11-03 09:01:29 UTC

  FreeBSD ports repository

  Modified files:
    devel/py-jcc         Makefile 
  Log:
  - solve the problem by updating the py-jcc's Makefile
  - bump PORTREVISION (devel/py-jcc)
  
  PR:             ports/128311
  Reviewed by:    clsung
  
  Revision  Changes    Path
  1.5       +3 -2      ports/devel/py-jcc/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Stefan Walter freebsd_committer freebsd_triage 2009-01-08 10:59:31 UTC
Hi Julien, hi Geoffrey,

there hasn't been an update on this issue for a while. I'm trying to find
out what the state of this is. Can you still reproduce the problem on an
up-to-date system?

Regards,
Stefan
Comment 6 Julien Cigar 2009-01-08 11:22:46 UTC
Hi Stefan,

I made a "fresh" build right now (7.0-RELEASE), the following are
installed :
- py25-PyLucene-2.4.0
- py25-jcc-2.1
- jdk-1.5.0.14p8_5,1
- python25-2.5.2_3

The "Shared object "libjava.so" not found" is fixed, but I've still a
segmentation fault on my system :

jcigar@bccm-it ~ % python
Python 2.5.2 (r252:60911, Sep  9 2008, 09:50:48)
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> import lucene
>>> foo = lucene.StandardAnalyzer()
zsh: segmentation fault (core dumped)  python
jcigar@bccm-it ~ %

Best regards and thanks for support,
Julien

On Thu, 2009-01-08 at 11:59 +0100, Stefan Walter wrote:
> Hi Julien, hi Geoffrey,
> 
> there hasn't been an update on this issue for a while. I'm trying to find
> out what the state of this is. Can you still reproduce the problem on an
> up-to-date system?
> 
> Regards,
> Stefan
-- 
Julien Cigar
Belgian Biodiversity Platform
http://www.biodiversity.be
Université Libre de Bruxelles (ULB)
Campus de la Plaine CP 257
Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
Boulevard du Triomphe, entrée ULB 2
B-1050 Bruxelles
Mail: jcigar@ulb.ac.be
@biobel: http://biobel.biodiversity.be/person/show/471
Tel : 02 650 57 52
Comment 7 Stefan Walter freebsd_committer freebsd_triage 2009-01-08 12:34:11 UTC
Hi Julien,

Julien Cigar, 08.01.09, 12:22h CET:

> Hi Stefan,
> 
> I made a "fresh" build right now (7.0-RELEASE), the following are
> installed :
> - py25-PyLucene-2.4.0
> - py25-jcc-2.1
> - jdk-1.5.0.14p8_5,1
> - python25-2.5.2_3
> 
> The "Shared object "libjava.so" not found" is fixed, but I've still a
> segmentation fault on my system :

Thanks for your feedback! Since you reported that it also segfaults on a
Linux system, I would suspect it's not a problem with the FreeBSD port and
would suggest to set JAVA_VERSION to 1.6+ in the port's Makefile. (Can you
verify that that works for you? I would commit it, then.)

Regards,
Stefan
Comment 8 Julien Cigar 2009-01-08 13:18:44 UTC
Hi Stefan,

Unfortunately it segfaults on 1.6 too .. :

jcigar@scar:/home/jcigar % java -version
java version "1.6.0_07"
Diablo Java(TM) SE Runtime Environment (build 1.6.0_07-b02)
Diablo Java HotSpot(TM) Server VM (build 10.0-b23, mixed mode)

jcigar@scar:/home/jcigar % python
Python 2.5.2 (r252:60911, Jan  8 2009, 13:55:19) 
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> import lucene
>>> foo=lucene.StandardAnalyzer()
zsh: segmentation fault (core dumped)  python
jcigar@scar:/home/jcigar % 

(it's on another machine so there are few chances that it's an hardware
issue ...)

I wonder if I'm the only one to have this "segmentation fault"
problem .. ?

Best regards,
Julien


On Thu, 2009-01-08 at 13:34 +0100, Stefan Walter wrote:
> Hi Julien,
> 
> Julien Cigar, 08.01.09, 12:22h CET:
> 
> > Hi Stefan,
> > 
> > I made a "fresh" build right now (7.0-RELEASE), the following are
> > installed :
> > - py25-PyLucene-2.4.0
> > - py25-jcc-2.1
> > - jdk-1.5.0.14p8_5,1
> > - python25-2.5.2_3
> > 
> > The "Shared object "libjava.so" not found" is fixed, but I've still a
> > segmentation fault on my system :
> 
> Thanks for your feedback! Since you reported that it also segfaults on a
> Linux system, I would suspect it's not a problem with the FreeBSD port and
> would suggest to set JAVA_VERSION to 1.6+ in the port's Makefile. (Can you
> verify that that works for you? I would commit it, then.)
> 
> Regards,
> Stefan
-- 
Julien Cigar
Belgian Biodiversity Platform
http://www.biodiversity.be
Université Libre de Bruxelles (ULB)
Campus de la Plaine CP 257
Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
Boulevard du Triomphe, entrée ULB 2
B-1050 Bruxelles
Mail: jcigar@ulb.ac.be
@biobel: http://biobel.biodiversity.be/person/show/471
Tel : 02 650 57 52
Comment 9 Julien Cigar 2009-01-08 13:24:28 UTC
I made a backtrace at http://pastebin.com/f1dcfa6f8

On Thu, 2009-01-08 at 13:34 +0100, Stefan Walter wrote:
> Hi Julien,
> 
> Julien Cigar, 08.01.09, 12:22h CET:
> 
> > Hi Stefan,
> > 
> > I made a "fresh" build right now (7.0-RELEASE), the following are
> > installed :
> > - py25-PyLucene-2.4.0
> > - py25-jcc-2.1
> > - jdk-1.5.0.14p8_5,1
> > - python25-2.5.2_3
> > 
> > The "Shared object "libjava.so" not found" is fixed, but I've still a
> > segmentation fault on my system :
> 
> Thanks for your feedback! Since you reported that it also segfaults on a
> Linux system, I would suspect it's not a problem with the FreeBSD port and
> would suggest to set JAVA_VERSION to 1.6+ in the port's Makefile. (Can you
> verify that that works for you? I would commit it, then.)
> 
> Regards,
> Stefan
-- 
Julien Cigar
Belgian Biodiversity Platform
http://www.biodiversity.be
Université Libre de Bruxelles (ULB)
Campus de la Plaine CP 257
Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
Boulevard du Triomphe, entrée ULB 2
B-1050 Bruxelles
Mail: jcigar@ulb.ac.be
@biobel: http://biobel.biodiversity.be/person/show/471
Tel : 02 650 57 52
Comment 10 Julien Cigar 2009-01-08 13:36:56 UTC
mmh forgot it, it's totally useless.

On Thu, 2009-01-08 at 14:24 +0100, Julien Cigar wrote:
> I made a backtrace at http://pastebin.com/f1dcfa6f8
> 
> On Thu, 2009-01-08 at 13:34 +0100, Stefan Walter wrote:
> > Hi Julien,
> > 
> > Julien Cigar, 08.01.09, 12:22h CET:
> > 
> > > Hi Stefan,
> > > 
> > > I made a "fresh" build right now (7.0-RELEASE), the following are
> > > installed :
> > > - py25-PyLucene-2.4.0
> > > - py25-jcc-2.1
> > > - jdk-1.5.0.14p8_5,1
> > > - python25-2.5.2_3
> > > 
> > > The "Shared object "libjava.so" not found" is fixed, but I've still a
> > > segmentation fault on my system :
> > 
> > Thanks for your feedback! Since you reported that it also segfaults on a
> > Linux system, I would suspect it's not a problem with the FreeBSD port and
> > would suggest to set JAVA_VERSION to 1.6+ in the port's Makefile. (Can you
> > verify that that works for you? I would commit it, then.)
> > 
> > Regards,
> > Stefan
-- 
Julien Cigar
Belgian Biodiversity Platform
http://www.biodiversity.be
Université Libre de Bruxelles (ULB)
Campus de la Plaine CP 257
Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
Boulevard du Triomphe, entrée ULB 2
B-1050 Bruxelles
Mail: jcigar@ulb.ac.be
@biobel: http://biobel.biodiversity.be/person/show/471
Tel : 02 650 57 52
Comment 11 Stefan Walter freebsd_committer freebsd_triage 2009-01-08 14:38:24 UTC
I do not use py-lucene myself, but searching a bit for "pylucene" and
"segmentation fault" turned up, for instance, the thread at [1]. Does the
procedure for initialization described there fix the problem for you?

Regards,
Stefan

[1]: http://www.mail-archive.com/pylucene-dev@osafoundation.org/msg01507.html
Comment 12 Julien Cigar 2009-01-08 14:50:49 UTC
Hi Stefan,

OK, it works with the lucene.initVM(lucene.CLASSPATH) trick .. thanks !

Best regards,
Julien

On Thu, 2009-01-08 at 15:38 +0100, Stefan Walter wrote:
> I do not use py-lucene myself, but searching a bit for "pylucene" and
> "segmentation fault" turned up, for instance, the thread at [1]. Does the
> procedure for initialization described there fix the problem for you?
> 
> Regards,
> Stefan
> 
> [1]: http://www.mail-archive.com/pylucene-dev@osafoundation.org/msg01507.html
-- 
Julien Cigar
Belgian Biodiversity Platform
http://www.biodiversity.be
Université Libre de Bruxelles (ULB)
Campus de la Plaine CP 257
Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
Boulevard du Triomphe, entrée ULB 2
B-1050 Bruxelles
Mail: jcigar@ulb.ac.be
@biobel: http://biobel.biodiversity.be/person/show/471
Tel : 02 650 57 52
Comment 13 Stefan Walter freebsd_committer freebsd_triage 2009-01-08 15:09:22 UTC
State Changed
From-To: open->closed

Problem resolved.