![]() |
#1 |
Junior Member
![]() 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 Any suggestions about how to fix this? |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
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. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() 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! |
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() 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. ![]() |
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
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.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jul 2014
Device: Raspberry Pi
|
Done, and done. Thanks!
|
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() 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
|
![]() |
![]() |
![]() |
#8 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
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 ![]() Last edited by eschwartz; 08-03-2014 at 01:30 PM. |
![]() |
![]() |
![]() |
#9 |
Junior Member
![]() 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.
|
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() 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 |
![]() |
![]() |
![]() |
#11 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Dec 2013
Device: ipad
|
I finally got archlinux running on my cubietruck. Calibre beta running nicely. Thanks all.
|
![]() |
![]() |
![]() |
#12 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
|
![]() |
![]() |
![]() |
#13 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
Tags |
compile, icu, raspberrypi, source |
|
![]() |
||||
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 |