LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-04-2018, 03:20 PM   #1
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,049

Rep: Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104
libjpeg.la replacement?


I need some libjpeg.la that fools the OCR program I'm struggling with. I have tried
  1. Jpeg-6b which comes up first on google. The project is dead, last repackaged 10 years ago, last file change 20 years ago. The build is knackered beyond belief.
  2. Libopenjpeg.la symlinked to libjpeg.la. It failed to give me one word of English; when I changed the pics to png, and it was ok.
  3. Libjpeg-turbo, but that won't build a static lib despite a '-DENABLE_STATIC=TRUE' instruction. It does build .o files, and even a libjpeg.a but doesn't build any .la files.
I admit, static libs stink of closed source, but tesseract is GPL. It was originally developed by HP, which may account for the nonsense. Any ideas for the static lib?

/boring background
I am fiddling with this awful (to build anyhow) ocr program tesseract. I have the 4.0.0.beta4-111 version from github. It uses STATIC libs (lpbpng, liblzma, libtiff, libjpeg). I recompiled libpng, libtiff, & liblzma, extracted the single .la file and threw them in the ~/lib64 directory where I was packaging tesseract; they would go in when tesseract was installed, and be removed with it also :-D. Previous versions of tesseract are difficult to build (to put it MILDLY). And an ocr program that won't do jpegs is lame.
/end boring background
 
Old 09-04-2018, 03:33 PM   #2
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 4,750

Rep: Reputation: Disabled
*.la files are not static libraries, but libtool archive files

http://www.linuxfromscratch.org/blfs.../la-files.html

I suppose you are using current, right? you most probably have something installed that looks for libjpeg.la.
I think you should be fine following Pat's suggestion in april's ChangeLog
Code:
Thu Apr 19 01:04:06 UTC 2018
Hi folks, and welcome to the third ever Slackware Mass Rebuild (and the
longest ChangeLog entry in project history). There were two primary
motivations for rebuilding everything in the main tree. The first was to
switch to the new C++ ABI. The second was to get rid of all the .la files
in the LD_LIBRARY_PATH. Really, having .la files installed has been mostly
obsolete since things began to use pkg-config instead, but it's not easy
to get rid of them unless you do it all at once. If you just take them out
of one package, any other packages containing .la files that refer to the
removed ones will be broken. We've removed a few here and there before
(and then handled any packages that had referred to them with a rebuild),
but it was time to finally remove all the ones in /lib{,64} and
/usr/lib{,64}. One of the reasons that this really needed to happen is that
many projects are starting to migrate to build systems other than autotools,
and those systems do not generate .la files. So if we didn't get rid of them
now, we might end up in a situation later on where they are being removed
by upstream and then we would have to chase down the dependency breakage and
recompile (possibly many) other packages. The .la files that are outside of
the LD_LIBRARY_PATH were not removed (and shouldn't be) - those ones are
often used by the lt_dlopen() function to load plugins and removing those
ones can break things. But those ones don't cause problems... they aren't
likely to try to infect .la files produced by other packages.
IMPORTANT NOTE: If you have any third party or other packages installed on
your system that don't come with Slackware, and those packages have installed
any .la files, it is very likely that they refer to some .la files which we
have just removed, and that trying to compile against these packages will no
longer work. Luckily, the solution is simple: remove them. This command will
remove any stale .la files from the LD_LIBRARY_PATH:
rm /{,usr/}lib{,64}/*.la
FYI I installed leptonica and tesseract from SBo with no issue.

Last edited by ponce; 09-04-2018 at 03:38 PM.
 
Old 09-04-2018, 03:39 PM   #3
ehartman
Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 523

Rep: Reputation: 247Reputation: 247Reputation: 247
> I need some libjpeg.la that fools the OCR program I'm struggling with.

You didn't tell which version of Slackware you're using, but the libjpeg.{a,so} files come from the openjpeg package (version will be dependant on the Slackware version and update level). So get from a mirror the SOURCE package of that, recompile just to create the .la file (it doesn't come with the already compiled packages) and use that.

Source can be found in the subdir (of the main slackware dir)
slackware{,64}-14.2/source/l/openjpeg/
(I don't believe the 32 and 64 versions are different, but just in case)
cq
slackware-current/source/l/openjpeg/
and the SlackBuild, to build it with, is in the same directory. You may have to adapt this as to provide the .la, I wouldn't know how, though.
 
Old 09-04-2018, 07:44 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.5 + 50+ other Linux OS, for test only.
Posts: 17,205

Rep: Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545
"libjpeg.la" is a small text file.

An example is attached : 471B. You can easily edit a file.la to your version.
Attached Files
File Type: txt libjpeg.la.txt (471 Bytes, 28 views)

Last edited by knudfl; 09-04-2018 at 07:46 PM.
 
Old 09-05-2018, 03:49 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,049

Original Poster
Rep: Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104
Thanks. That's from libopenjpeg, which makes one and pukes badly. But I get the drift - I'll go away and hack it :-).
 
Old 09-05-2018, 03:52 AM   #6
chrisretusn
Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 943

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
Is there a specific reason for going with the beta of tesseract? I am using the 3.05.01 release of tesseract, the 1.76.0 of leptonica both compiled and run with no issues. I use it with front-end gImageReader version 3.2.3

I've tried several OCR programs, tesseract does a darn good job.
 
Old 09-05-2018, 04:00 AM   #7
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 4,750

Rep: Reputation: Disabled
if it can be useful, looking at the tesseract.SlackBuild on SBo
Code:
./autogen.sh
CFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --mandir=/usr/man \
  --disable-static \
  --build=$ARCH-slackware-linux
the configure seems to support also the "--disable-static" option.
 
Old 09-05-2018, 09:47 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,049

Original Poster
Rep: Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104
@chrisretusn; Agreed, tesseract is about the best of them in GPL. I've had a background using Abbyy Fine Reader under windows. That's stuff you pay well for and about the best there is. It's not perfect either. Lack of older fonts was it's biggest weakness. From the dawn of printing until the 17th or 18th centuries, English used an 's' much like our modern 'f' half the time but without the crossbar. Of course that gives every OCR program nightmares.

There is a reason why I'm in tesseract beta. A while back I built 2.x. I first tried 3.05, on Slackware-current and found the build system knackered and it wasn't worth the hassle sorting it. It's always been A PITA to shoehorn in. I successfully built many things, but gcc-8.3.0 in Slackware-current throws some.

@ponce: The build instruction is instructive. I believe, though, that that prevents tesseract building it's own static libs (libtesseract.la, etc). It doesn't prevent the dependency on other static libs, about which I was bellyaching.

For the record, I hacked the supplied libjpeg.la, and used it to point to libjpeg-turbo. That also gave me gibberish, hung terminals, etc. So there's currently no jpeg support here. This
Code:
tesseract 4.0.0-beta.4-111-g3a7c
 leptonica-1.76.0
  libgif 5.1.1 : libjpeg 6b (libjpeg-turbo 1.5.0) : libpng 1.6.34 : libtiff 4.0.9 : zlib 1.2.11 : libopenjp2 1.5.2
 Found AVX
 Found SSE
bash-4.4$
implies that jpeg-6b (Pause for laughter) or libjpeg-turbo 1.5.0+ (I have 1.5.3) or even libopenjp2-1.5.2 (I tried 2.3.0) would do the trick for jpegs. Not so. All the others compile and work without issue, and liblzma, which isn't mentioned there.
 
Old 09-06-2018, 03:53 AM   #9
chrisretusn
Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 943

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
Quote:
Originally Posted by business_kid View Post
@chrisretusn; Agreed, tesseract is about the best of them in GPL. I've had a background using Abbyy Fine Reader under windows. That's stuff you pay well for and about the best there is. It's not perfect either. Lack of older fonts was it's biggest weakness. From the dawn of printing until the 17th or 18th centuries, English used an 's' much like our modern 'f' half the time but without the crossbar. Of course that gives every OCR program nightmares.
Thanks for the feedback. Yes tesseract is not perfect. I've converted many a document and it does by far the best I've seen. I found it best works when taking part of documents, not a whole page. Using it with gimagereader helps. I've heard of Abby Fine Reader, think a trail version came with a scanner I bought years ago. Never tried it, no Windows here.

Quote:
There is a reason why I'm in tesseract beta. A while back I built 2.x. I first tried 3.05, on Slackware-current and found the build system knackered and it wasn't worth the hassle sorting it. It's always been A PITA to shoehorn in. I successfully built many things, but gcc-8.3.0 in Slackware-current throws some.
I've never had issues compiling tesseract on -current. In fact just built 3.05.02 to upgrade my installed 3.05.01. I gave 4.0.0-beta.4 a shot, only changes made to the SlackBuild was version and documents, build completed without issues.

Code:
tesseract --version
tesseract 3.05.02
 leptonica-1.76.0
  libgif 5.1.4 : libjpeg 6b (libjpeg-turbo 1.5.3) : libpng 1.6.34 : libtiff 4.0.9 : zlib 1.2.11 : libwebp 1.0.0 : libopenjp2 2.3.0

tesseract --version
tesseract 4.0.0-beta.3
 leptonica-1.76.0
  libgif 5.1.4 : libjpeg 6b (libjpeg-turbo 1.5.3) : libpng 1.6.34 : libtiff 4.0.9 : zlib 1.2.11 : libwebp 1.0.0 : libopenjp2 2.3.0
One basic difference I see is gcc, I am using 8.2.0 that comes with -current, you are using 8.3.0.

As a side note, gimagereader has issues with 4.0.0-beta.4.
 
Old 09-07-2018, 03:45 AM   #10
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,049

Original Poster
Rep: Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104
There's an option in 4.0beta where you can specify different algorithms to use. I think it's using LTSM, which is probably worse, but under active development. They obviously see potential in it. I don't know why it alone wants the .la file to point it to a .so file, and would love to provide feedback, but I'm not going to resurrect my google account to join a google group just to do that.
 
  


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
rpm libjpeg conflicts with libjpeg-turbo jspence Red Hat 2 11-07-2016 06:46 AM
libjpeg.so.62 tesseract4d Linux - Newbie 1 09-13-2010 08:47 AM
libJpeg programming Shioni Programming 3 07-06-2006 12:55 PM
Linking libjpeg Shioni Programming 2 07-05-2006 11:05 PM
libjpeg nightmare!!!!!!!!!! Beauford-2 Slackware 3 06-20-2006 07:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:15 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration