LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 11-06-2009, 07:55 AM   #1
Martinezio
Member
 
Registered: May 2009
Location: Warsaw, Poland
Distribution: Slackware64-current
Posts: 191

Rep: Reputation: 32
Question pdftk for Slackware64-current.


Hi,

recently I've tried to compile pdftk package for my Slack64-current box.
But the compile process has failed with such info:
Code:
Exception in thread "main" java.io.IOException: can't find class file java_local/security/Provider.class in java.net.URLClassLoader{urls=[file:/tmp/pdftk-1.41/java_libs/gnu_local/java/security/provider/./,file:/usr/share/java/libgcj-4.3.3.jar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}                                                                                                                   
   at gnu.classpath.tools.javah.Main.getClass(libgcj-tools.so.9)                                                         
   at gnu.classpath.tools.javah.ClassWrapper.linkSupers(libgcj-tools.so.9)                                               
   at gnu.classpath.tools.javah.ClassWrapper.printFully(libgcj-tools.so.9)                                               
   at gnu.classpath.tools.javah.CniIncludePrinter.printClass(libgcj-tools.so.9)                                          
   at gnu.classpath.tools.javah.Main.writeHeaders(libgcj-tools.so.9)                                                     
   at gnu.classpath.tools.javah.Main.run(libgcj-tools.so.9)                                                              
   at gnu.classpath.tools.javah.GcjhMain.main(libgcj-tools.so.9)                                                         
make[2]: *** [Gnu.h] Error 1                                                                                              
rm Gnu.class                                                                                                             
make[2]: Leaving directory `/tmp/pdftk-1.41/java_libs/gnu_local/java/security/provider'                               
make[1]: *** [libgcj_local] Error 2                                                                                       
make[1]: Leaving directory `/tmp/pdftk-1.41/java_libs'                                                                
make: *** [java_libs] Error 2
I found some info, checked the Debian packages, and made some edits in Makefiles. Problem was solver partialy. Still cannot make the package, but the error messages are different:
Code:
Exception in thread "main" java.io.IOException: can't find class file com/lowagie/text/Phrase.class in java.net.URLClassLoader{urls=[file:/tmp/pdftk-1.41/java_libs/com/lowagie/text/./,file:/usr/share/java/libgcj-4.3.3.jar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}
   at gnu.classpath.tools.javah.Main.getClass(libgcj-tools.so.9)
   at gnu.classpath.tools.javah.ClassWrapper.linkSupers(libgcj-tools.so.9)
   at gnu.classpath.tools.javah.ClassWrapper.printFully(libgcj-tools.so.9)
   at gnu.classpath.tools.javah.CniIncludePrinter.printClass(libgcj-tools.so.9)
   at gnu.classpath.tools.javah.Main.writeHeaders(libgcj-tools.so.9)
   at gnu.classpath.tools.javah.Main.run(libgcj-tools.so.9)
   at gnu.classpath.tools.javah.GcjhMain.main(libgcj-tools.so.9)
make[2]: *** [Anchor.h] Error 1
rm Anchor.class
make[2]: Leaving directory `/tmp/pdftk-1.41/java_libs/com/lowagie/text'
make[1]: *** [itext] Error 2
make[1]: Leaving directory `/tmp/pdftk-1.41/java_libs'
make: *** [java_libs] Error 2
Any helps or hints?
Or maybe some one of You knows there is somewhere a ready to use package for Slack64-13 (or -current)?

TIA.
 
Old 11-06-2009, 09:51 PM   #2
escaflown
Member
 
Registered: Apr 2009
Location: Canada
Distribution: Slackware
Posts: 237

Rep: Reputation: 30
I recently got into the same trouble while compiling pdftk in my x86 slackware 13. I used to run it in my slack 12.2 but no way to get it to run in slackware 13. I would be interessed if someone got it to work.
 
Old 11-09-2009, 07:15 AM   #3
Martinezio
Member
 
Registered: May 2009
Location: Warsaw, Poland
Distribution: Slackware64-current
Posts: 191

Original Poster
Rep: Reputation: 32
Hi

Almost done. I found on slacky.eu repository a SlackBuild script for this tool, and a patch to enable compilation on gcc 4.3.
Here is the patch:
http://repository.slacky.eu/slackwar...-gcc-4.3.patch

But the source files are not clean, and this patch is not applied for every file they should. You probably get some rejection on 3 Makefiles:

$SRC-DIR/java_libs/com/lowagie/text/pdf/codec/Makefile
$SRC-DIR/java_libs/com/lowagie/text/pdf/codec/postscript/Makefile
$SRC-DIR/java_libs/com/lowagie/text/pdf/codec/wmf/Makefile

You need to change the files by hand. It's easy. You should replace gcjh command for generating headers from classes, and provide FQDN classpath as this:
Code:
# gcjh doesn't want the ".class" extension, so use
# the "$*" automatic variable, here
#
%.h : %.class
        $(GCJH) --classpath="$(java_libs_root):." $*;
#                            ^^^^^^^^^^^^^^^^^^ this is what You need to add ;)
Edit: I forgot to mention, that You shoud also remove the command just after gcjh command ($(RM) ... ). It's important.

Currently trying to make the package for x86_64...
(tfu tfu )

Last edited by Martinezio; 11-09-2009 at 07:35 AM.
 
Old 11-09-2009, 07:45 AM   #4
Martinezio
Member
 
Registered: May 2009
Location: Warsaw, Poland
Distribution: Slackware64-current
Posts: 191

Original Poster
Rep: Reputation: 32
Hmm... Still something wrong, but this time I was able to compile java-things of pdftk.

Currently I get this errors:
Code:
../java_libs/com/lowagie/text/pdf/pdf.a(PdfEncryption.o): In function `com::lowagie::text::pdf::PdfEncryption::PdfEncryption()':
ccWMwkN3.jar:(.text+0x343): undefined reference to `java_local::security::MessageDigest* java_local::security::MessageDigest::getInstance(java::lang::String*)'
../java_libs/com/lowagie/text/pdf/pdf.a(PdfEncryption.o): In function `JArray<char>* com::lowagie::text::pdf::PdfEncryption::createDocumentId()':
ccWMwkN3.jar:(.text+0x9fc): undefined reference to `java_local::security::MessageDigest* java_local::security::MessageDigest::getInstance(java::lang::String*)'
../java_libs/com/lowagie/text/pdf/pdf.a(PdfEncryption.o):(.data+0x1e8): undefined reference to `java_local::security::MessageDigest::class$'
collect2: ld returned 1 exit status
make: *** [pdftk] Error 1
Ehh... Still lookin' for reason and solution...
 
Old 11-09-2009, 08:28 AM   #5
Martinezio
Member
 
Registered: May 2009
Location: Warsaw, Poland
Distribution: Slackware64-current
Posts: 191

Original Poster
Rep: Reputation: 32
Looks, like the itext part of pdftk is staticaly linked for internal version of gcj part available in source tree... This patch available in slacky repository doesn't repair the makefiles in gcj-tree, but removes build commands from main makefile of java's tree.
Restoring those command and repairing the makefiles as mentioned above is the solution, I think

How to produce a patch file for entire tree?
 
Old 11-09-2009, 09:01 AM   #6
Martinezio
Member
 
Registered: May 2009
Location: Warsaw, Poland
Distribution: Slackware64-current
Posts: 191

Original Poster
Rep: Reputation: 32
Damn... Compilation still unsuccesfull :/ The same result, as above... Still, undefinied reference.
 
Old 11-09-2009, 09:13 AM   #7
Martinezio
Member
 
Registered: May 2009
Location: Warsaw, Poland
Distribution: Slackware64-current
Posts: 191

Original Poster
Rep: Reputation: 32
I am stupid!
I said previously, that the patch from Slacky.eu removes some commands from javas-part makefile, but I forgot to check the main makefile of whole source tree!.

Well, the patch removes definition of gcj libraries, so the ld tool cannot collect all information

Restoring these lines solute all!

I was able to make pdftk tool

I try to make the patch file, so I pase it into this thread soon...
 
Old 11-09-2009, 07:45 PM   #8
escaflown
Member
 
Registered: Apr 2009
Location: Canada
Distribution: Slackware
Posts: 237

Rep: Reputation: 30
If you succeed, you should try to contact the maintainer of the slackbuild for an update for slackware 13.
 
Old 11-09-2009, 11:22 PM   #9
hemp4fuel
Member
 
Registered: Jun 2003
Location: Topeka, KS
Distribution: Slackware
Posts: 192

Rep: Reputation: 45
I have been fighting this one for awhile, thanks for getting on the right track.
 
Old 11-09-2009, 11:34 PM   #10
escaflown
Member
 
Registered: Apr 2009
Location: Canada
Distribution: Slackware
Posts: 237

Rep: Reputation: 30
Quote:
Originally Posted by hemp4fuel View Post
I have been fighting this one for awhile, thanks for getting on the right track.
Welcome in the club.
 
Old 11-10-2009, 02:44 AM   #11
Martinezio
Member
 
Registered: May 2009
Location: Warsaw, Poland
Distribution: Slackware64-current
Posts: 191

Original Poster
Rep: Reputation: 32
There is some incompatibility with the recent gcj library - when I try to run pdftk made by myself, I got "Wrong ABI version" error message.
Still fighting
 
Old 11-10-2009, 03:27 PM   #12
larryhaja
Member
 
Registered: Jul 2008
Distribution: Slackware 13.1
Posts: 292

Rep: Reputation: 75
Quote:
Originally Posted by Martinezio View Post
Almost done. I found on slacky.eu repository a SlackBuild script for this tool, and a patch to enable compilation on gcc 4.3.
Here is the patch:
http://repository.slacky.eu/slackwar...-gcc-4.3.patch

But the source files are not clean, and this patch is not applied for every file they should. You probably get some rejection on 3 Makefiles:

$SRC-DIR/java_libs/com/lowagie/text/pdf/codec/Makefile
$SRC-DIR/java_libs/com/lowagie/text/pdf/codec/postscript/Makefile
$SRC-DIR/java_libs/com/lowagie/text/pdf/codec/wmf/Makefile
The problem with the patch from slacky.eu is that it is entirely UNIX formatted and the files you mentioned above are in DOS format. If you want to get a patch that actually works try this.
Code:
# wget http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/app-text/pdftk/files/pdftk-1.41-gcc-4.3.patch
Don't open this up in a text editor as it may change the formatting. I used this patch in conjunction with another patch for gcc 4.4 on Slackware 13.0 and pdftk runs fine. I tested converting and combining some pdf's and it worked without any issues.
Code:
# wget http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/app-text/pdftk/files/pdftk-1.41-gcc-4.4.patch
This patch may be needed for people running current with the newer gcc 4.4.2.

I've tried this on i486 so I don't know if the above works on x86_64.

Last edited by larryhaja; 11-10-2009 at 10:06 PM.
 
Old 11-10-2009, 09:03 PM   #13
escaflown
Member
 
Registered: Apr 2009
Location: Canada
Distribution: Slackware
Posts: 237

Rep: Reputation: 30
Just tried larryhaja's patch and it worked. Thanks!
 
Old 11-11-2009, 12:04 AM   #14
hemp4fuel
Member
 
Registered: Jun 2003
Location: Topeka, KS
Distribution: Slackware
Posts: 192

Rep: Reputation: 45
Doesn't seem to work on x86_64 but it is good to have it working on my 32bit machine, thanks!
 
Old 11-12-2009, 08:05 AM   #15
Martinezio
Member
 
Registered: May 2009
Location: Warsaw, Poland
Distribution: Slackware64-current
Posts: 191

Original Poster
Rep: Reputation: 32
Disagree - works for me on x86_64 platform with small change

In Makefile.Generic You need to add -fPIC option into CPPFLAGS and CXXFLAGS vars, and run the make with LDFLAGS="-L/usr/lib64" envar

No more "Incorrect ABI version" issues, and pdftk is fully working now!
Thanks for the patches
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating from Slackware64-current to Slackware64 13. glore2002 Slackware 4 08-28-2009 06:50 PM
Slackware64-current on a second HD. glore2002 Slackware 7 08-23-2009 11:38 AM
Slackware64-Current / slackpkg slackass Slackware 31 06-06-2009 10:51 PM
[SOLVED] what's that directory (slackware64-current) sycamorex Slackware 3 05-30-2009 09:03 AM
Slackware64 -current and KDE mlangdn Slackware 7 05-29-2009 08:57 AM


All times are GMT -5. The time now is 11:22 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration