Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-23-2014, 12:46 AM   #1
wayt
Junior Member
wayt began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2014
Device: Raspberry Pi
Building Calibre from source for Raspberry Pi

The latest version of Calibre available in the Raspbian (Wheezy) repositories for Raspberry Pi is 0.85, which has some bugs and lacks some features for my use case (a digital sheet music display for a grand piano). So I have been working on building the latest version of Calibre from source.

I was able to satisfy nearly all the dependencies by using libraries already available in the RasPi repositories, with the notable exception of ICU--I downloaded source for ICUv49 and built it successfully (at least no errors reported in make or installation).

However compilation of Calibre fails after the extensions are compiled with an error related to ICU:

Code:
pi@BaldwinR1 ~/opt/calibre_source/calibre $ python setup.py install --prefix=/home/pi/opt

*
* Running build
*


####### Building calibre style #######
make: Nothing to be done for `first'.

####### Building extension hunspell #######

####### Building extension _regex #######

####### Building extension speedup #######

####### Building extension html #######

####### Building extension tokenizer #######

####### Building extension _patiencediff_c #######

####### Building extension icu #######

####### Building extension sqlite_custom #######

####### Building extension chmlib #######

####### Building extension chm_extra #######

####### Building extension magick #######

####### Building extension lzx #######

####### Building extension freetype #######

####### Building extension woff #######

####### Building extension msdes #######

####### Building extension cPalmdoc #######

####### Building extension bzzdec #######

####### Building extension matcher #######

####### Building extension podofo #######

####### Building extension pictureflow #######

####### Building extension progress_indicator #######

####### Building extension unrar #######

####### Building extension libusb #######

####### Building extension libmtp #######

*
* Running gui
*

Traceback (most recent call last):
  File "setup.py", line 99, in <module>
    sys.exit(main())
  File "setup.py", line 85, in main
    command.run_all(opts)
  File "/home/pi/opt/calibre_source/calibre/setup/__init__.py", line 181, in run_all
    self.run_cmd(self, opts)
  File "/home/pi/opt/calibre_source/calibre/setup/__init__.py", line 175, in run_cmd
    self.run_cmd(scmd, opts)
  File "/home/pi/opt/calibre_source/calibre/setup/__init__.py", line 178, in run_cmd
    cmd.run(opts)
  File "/home/pi/opt/calibre_source/calibre/setup/gui.py", line 41, in run
    self.build_forms(summary=opts.summary)
  File "/home/pi/opt/calibre_source/calibre/setup/gui.py", line 63, in build_forms
    from calibre.gui2 import build_forms
  File "/home/pi/opt/calibre_source/calibre/src/calibre/__init__.py", line 21, in <module>
    from calibre.startup import winutil, winutilerror
  File "/home/pi/opt/calibre_source/calibre/src/calibre/startup.py", line 178, in <module>
    from calibre.utils.icu import title_case, lower as icu_lower, upper as icu_upper
  File "/home/pi/opt/calibre_source/calibre/src/calibre/utils/icu.py", line 28, in <module>
    raise RuntimeError('Failed to load icu with error: %s' % err)
RuntimeError: Failed to load icu with error: /home/pi/opt/calibre_source/calibre/src/calibre/plugins/icu.so: undefined symbol: usearch_first
/home/pi/opt/calibre_source/calibre/src/calibre/ptempfile.py:27: RuntimeWarning: Parent module 'calibre' not found while handling absolute import
  import shutil

pi@BaldwinR1 ~/opt/calibre_source/calibre $ locate icu.so
/home/pi/opt/calibre_source/calibre/src/calibre/plugins/icu.so
/usr/lib/calibre/calibre/plugins/icu.so
As you can see from the results of the locate command, icu.so does exist in the calibre source tree and plugins folder, but the make routine is unhappy with it for reasons I don't understand.

Any suggestions about how to fix this?
wayt is offline   Reply With Quote
Old 07-23-2014, 12:52 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,840
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
See the line:

RuntimeError: Failed to load icu with error: /home/pi/opt/calibre_source/calibre/src/calibre/plugins/icu.so: undefined symbol: usearch_first

That means that the linker could not locate the usearch_first symbol in your ICU DLLs. http://icu-project.org/apiref/icu4c/...fee8473e0353d4 You can use

LD_DEBUG=all

to get more information. But most likely the linker is picking up some stub ICU library from somewhere.
kovidgoyal is online now   Reply With Quote
Advert
Old 07-29-2014, 05:26 PM   #3
wayt
Junior Member
wayt began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2014
Device: Raspberry Pi
Thanks for the quick reply, Kovid.

The problem was that I had a previous version of calibre (0.85, from the apt-get repository) installed. I removed that and, after satisfying a few more dependencies, successfully built and installed Calibre 1.45 to my Raspberry Pi.

It works great!
wayt is offline   Reply With Quote
Old 07-30-2014, 08:40 PM   #4
wayt
Junior Member
wayt began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2014
Device: Raspberry Pi
Streamlining the Calibre build for faster performance

Now that I have an up-to-date version of Calibre running on the Pi, I'd like to try to trim unnecessary features from the program so that it is more responsive. (In the default state, it takes a few seconds to respond to keystrokes or mouse clicks.)

I'm using Calibre to organize a large library of PDF files only (sheet music), and to open them in a third-party viewer for display on a local monitor.

I have no need for the app's support for other document formats, conversion, or device connections (although it would be nice to keep the content server operable).

Are there options I can pass to setup.py when building from source to exclude unneeded features and thereby improve performance? Perhaps sections of extensions.py (and other files?) I can comment out?

I'm writing a column about this project for IEEE Spectrum and will be making a video of it in operation, and I'm hoping to make Calibre look as sleek as possible.
wayt is offline   Reply With Quote
Old 07-30-2014, 10:19 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,840
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Unused features dont slow down calibre. They are loaded on demand. Your biggest performance improvement will come from hiding the Tag Browser. You can also disable animations in the look & feel section of preferences.
kovidgoyal is online now   Reply With Quote
Advert
Old 07-31-2014, 12:05 AM   #6
wayt
Junior Member
wayt began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2014
Device: Raspberry Pi
Done, and done. Thanks!
wayt is offline   Reply With Quote
Old 08-03-2014, 11:52 AM   #7
tombs
Junior Member
tombs began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2013
Device: ipad
wayt did you document your installation process? I am attempting to build from source on a cubietruck but failing. Thanks
tombs is offline   Reply With Quote
Old 08-03-2014, 12:52 PM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Might be worth noting that Archlinuxarm builds all the Archlinux i686/x64 PKGBUILDS under arm as well. Unless special sauce patches are needed it should work fine, if not, you can contribute those patches.

Arch Linux gets frequent updates and calibre is currently available as the latest stable beta 1.204.1-2

Last edited by eschwartz; 08-03-2014 at 01:30 PM.
eschwartz is offline   Reply With Quote
Old 08-03-2014, 01:19 PM   #9
tombs
Junior Member
tombs began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2013
Device: ipad
Thanks, I will have a look. Been awhile since I ran Arch on my cubieboards.
tombs is offline   Reply With Quote
Old 08-03-2014, 08:07 PM   #10
wayt
Junior Member
wayt began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2014
Device: Raspberry Pi
tombs, let us know if the prebuilt doesn't work for you, and I'll try to help you build from source.

Basically I followed the directions Kovid posted here:
http://calibre-ebook.com/download_linux
and used apt-get to install latest available repository version of everything on the list of dependencies. After that, it was an iterative process of executing 'sudo python setup.py install', guessing from the error messages returned by make what dependencies remained to be installed, and trying again once I had added the needed libraries.

The only dependency I had to build from source was ICU, because the version in the repository was too out of date. I got the ICU code here:
http://site.icu-project.org/download/49
wayt is offline   Reply With Quote
Old 08-07-2014, 05:27 PM   #11
tombs
Junior Member
tombs began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2013
Device: ipad
I finally got archlinux running on my cubietruck. Calibre beta running nicely. Thanks all.
tombs is offline   Reply With Quote
Old 08-07-2014, 05:32 PM   #12
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by tombs View Post
I finally got archlinux running on my cubietruck. Calibre beta running nicely. Thanks all.
Nice!

The regular autobuild works fine?
eschwartz is offline   Reply With Quote
Old 08-08-2014, 12:53 PM   #13
Katsunami
Grand Sorcerer
Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.
 
Katsunami's Avatar
 
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
I've been implementing an embedded system, based on a Pi board, running a completely stripped Raspbian, apart from Xorg and Openbox (using a browser to control it) . It executes its task well, but it is too slow for general usage such as webbrowsing. I can't believe Calibre is usable on a Pi.
Katsunami is offline   Reply With Quote
Reply

Tags
compile, icu, raspberrypi, source

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
building 0.9.33 from source on openSUSE 12.2 - Error mhomann Development 2 06-02-2013 06:13 AM
Building Sigil from source on Linux xingenter Sigil 10 04-29-2013 01:18 PM
building from source - qt4.8.1? platt Sigil 10 05-21-2012 09:32 AM
Problem building Calibre from source on Ubuntu 10.10 rozen Calibre 1 03-28-2011 02:02 AM
Building Calibre from source al35 Calibre 3 03-24-2010 02:22 PM


All times are GMT -4. The time now is 09:40 PM.


MobileRead.com is a privately owned, operated and funded community.