Difference between revisions of "Elphel Software Kit for Ubuntu"
(→Temporary replacing current GCC (4.4.x) with the older one (gcc-4.2) to compile gcc-cris) |
m (→Obsolette: Temporary replacing current GCC (4.4.x) with the older one (gcc-4.2) to compile gcc-cris) |
||
Line 159: | Line 159: | ||
patch -p0 < ../cris-dist-1.64-1--1.64-2.patch | patch -p0 < ../cris-dist-1.64-1--1.64-2.patch | ||
− | ==== | + | ==== Obsolete: Temporary replacing current GCC (4.4.x) with the older one (gcc-4.2) to compile gcc-cris ==== |
Unfortunately CRIS compiler does not compile with GCC 4.3.x and the only know working solution would be to temporary downgrade the compiler. You'll rather upgrade it back to the current one after gcc-cris is built: | Unfortunately CRIS compiler does not compile with GCC 4.3.x and the only know working solution would be to temporary downgrade the compiler. You'll rather upgrade it back to the current one after gcc-cris is built: |
Revision as of 23:15, 29 April 2011
Contents
- 1 About
- 2 If you are new to GNU / Linux
- 3 User software
- 4 For developers
- 4.1 Adding universe and multiverse sources
- 4.2 Install needed packages
- 4.3 Configure your NFS server
- 4.4 Installation of GCC Compiler kit for Axis ETRAX processor
- 4.5 Build Elphel Software
- 4.6 Installation of Kdevelop 3.5
- 4.7 Install Icarus Verilog and GTKWave
- 4.8 Installing Xilinx WebPack (to be moved to a separate page, just a link here)
- 4.9 Installation of the source code of Elphel camera software
- 4.10 ImageJ and Elphel plugins for imageJ
About
This page is a simple howto for running Elphel software on (K)Ubuntu GNU/Linux.
Instructions below are updated for the Kubuntu 9.04 , should work with Ubuntu 9.04 also --Andrey.filippov 02:52, 24 May 2009 (CDT)
You can download this GNU/Linux distribution freely from http://www.kubuntu.org/
If you are new to GNU / Linux
Many forums and wikis are available in many languages to help you to install and use Ubuntu. Ex: http://www.google.com/search?q=forum+ubuntu (you can add "&hl=fr" or any language code to the URL)
Most instructions below are commands that you need to enter in the in the terminal window. For the lines that do not end with "\" sign you just copy them one-by-one and paste in the terminal window (in KDE it is Konsole in the "System" menu). For pasting you can not use <cntrl-V> - you need to right-click in the terminal window and select "Paste" from the drop-down context menu. Alternatively you can use the middle mouse button to both copy (drag while middle mouse pressed) and paste - click it in the console window.
Character "\" at the end of the line means continuation, so you can copy the whole block of text where each line but the very last ends with "\" and paste them together.
Many of the commands start with "sudo" - first time system will ask you for your user password that you enter without any starts (provided you have administrative privileges).
If you get some problems it is very useful to copy the error message that system outputs (avoiding anything specific to your particular installation - like user directories names) and paste them into the search box of you browser.
User software
Some software need to be patched and recompiled even if they exist in Ubuntu software repositories, some softwares are not yet packaged in Ubuntu, so you have to compile them from sources also. We try to push our software patches to the mainstream applications, but it take time and is not always possible.
Mplayer
Kubuntu 9.10 includes MPlayer that is working with Elphel camera "out of the box" So for (K)Ubuntu 9.10 you just need to install
sudo apt-get install mplayer-nogui mplayer gecko-mediaplayer
Mplayer - installation for (K)Ubuntu older than 9.10 release
With the previous verions MPlayer has to be patched and recompiled, following instructions document how to do it on (K)Ubuntu or Debian based workstation.
Install gecko-mediaplayer before compiling/installing MPlayer, if you do it later it will install non-patched version of MPlayer
sudo apt-get gecko-mediaplayer
First install some compilation dependencies, mainly libraries...
sudo apt-get install build-essential debhelper libncurses5-dev libesd0-dev liblircclient-dev libgtk2.0-dev \ libvorbis-dev libsdl1.2-dev sharutils libasound2-dev gawk libjpeg62-dev libaudiofile-dev \ libsmbclient-dev libxv-dev libpng12-dev libgif-dev libcdparanoia-dev libdv4-dev \ liblivemedia-dev libfreetype6-dev libgl1-mesa-dev libdvdread-dev libdts-dev libtheora-dev \ libglu1-mesa-dev libfontconfig-dev libxxf86dga-dev libxinerama-dev libxxf86vm-dev \ libxvmc-dev libggi2-dev libmpcdec-dev libspeex-dev libfribidi-dev libfaac-dev libaa1-dev libcaca-dev \ libx264-dev libpulse-dev libmad0-dev ladspa-sdk libdbus-glib-1-dev libaudio-dev liblzo2-dev libdvdnav-dev \ libopenal-dev libjack-dev libtwolame-dev libsvga1-dev libenca-dev libmp3lame-dev
Current MPlayer code is capable of working with full resolution video produced by Elphel cameras. That is not yet true for the MPlayer packages in Ubuntu repositories, so you'll have to obtain the source code from MPlayer recommended source - their Subversion (SVN) source. First you need to install Subversion itself:
sudo apt-get install subversion
Now create a download directory and get MPlayer source:
mkdir download; cd download svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
Configure, compile and prepare Debian package from that source (will take some time):
cd mplayer sudo dpkg-buildpackage
Occasionally dpkg-buildpackage fails to build, try the comon ./configure, make, make install way then.
Now uninstall the default Ubuntu's mplayer and mencoder & install the created package:
sudo apt-get remove mplayer mencoder mplayer-nogui cd .. sudo dpkg --install mplayer_1.0svn*.deb
MPlayer - testing with Elphel camera
You should be able now to play videos with up to 5MB frames (highest quality 5MPix images are around 1 MB) as a multicast or unicast video stream. (the streamer in the camera should be ENABLED)
mplayer rtsp://192.168.0.9:554 -vo x11 -fs -zoom
Update 10/09/2009: In (K)Ubuntu 9.10 (Karmic Koala) repository the 50,000 bytes limit on the frame size is fixed, but unfortunately the other one -frame width limit of 2048 pixels (submitted to MPlayer SVN on May, 5, 2009) - is not--Andrey.filippov 19:03, 9 October 2009 (CDT)
The first (50,000) makes you picture break after the first 50,000 bytes (only top is shown), the second (current for the 9.10) makes MPlayer to report fatal error. So you still have to use MPlayer SVN to have the full resolution from Elphel cameras.
Additionally, to make MPlayer work inside the web page you need to specify video output as "x11" in the MPlayer config file - add a line
vo="x11"
To ~/.mplayer/config file
For developers
Following was written for (K)Ubuntu 9.10 and earlier, it also works with 10.04, please see revision-specific notes.
Adding universe and multiverse sources
Please follow this howto for adding universe and multiverse sources.
https://help.ubuntu.com/community/Repositories/Ubuntu
or
https://help.ubuntu.com/community/Repositories/Kubuntu
Install needed packages
Minimal packages:
sudo apt-get install cvs build-essential autoconf flex byacc bison libglib2.0-dev tcl gettext libncurses5-dev patch zlib1g-dev nfs-kernel-server bash xutils-dev
Suggested packages:
sudo apt-get install kinfocenter minicom firefox graphviz doxygen ctags cervisia php5 php5-cli xchat ssh kompare git-core
Configure your NFS server
Let's say you want to configure an NFS server on your machine and your IP address is 192.168.0.15.
Modify the configuration file:
kdesudo kate /etc/exports
Add at the end of the file:
/nfs 192.168.0.0/255.255.0.0(rw,sync,no_root_squash)
save the file.
If it does not yet exist make /nfs directory and make it world writable to make it possible to write logs from the camera.
sudo mkdir /nfs sudo chmod 777 -R /nfs
And finally export the filesystem.
sudo exportfs -a
Installation of GCC Compiler kit for Axis ETRAX processor
Downloading and unpacking gcc-cris
Download and install Cris-GCC compiler. It is needed to compile C and C++ programs for the CPU used in Elphel cameras - Axis ETRAX FS :
mkdir -p ~/Downloads/axis ; cd ~/Downloads/axis wget http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist-linux-headers-1.64.tar.gz wget http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist-linux-headersv32-1.64.tar.gz wget http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist-glibc-1.64.tar.gz wget http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist-1.64.tar.gz wget http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist-1.64-1--1.64-2.patch tar zxvf cris-dist-1.64.tar.gz cd cris-dist-1.64/ tar zxvf ../cris-dist-linux-headers-1.64.tar.gz tar zxvf ../cris-dist-linux-headersv32-1.64.tar.gz tar zxvf ../cris-dist-glibc-1.64.tar.gz patch -p0 < ../cris-dist-1.64-1--1.64-2.patch
Obsolete: Temporary replacing current GCC (4.4.x) with the older one (gcc-4.2) to compile gcc-cris
Unfortunately CRIS compiler does not compile with GCC 4.3.x and the only know working solution would be to temporary downgrade the compiler. You'll rather upgrade it back to the current one after gcc-cris is built:
sudo apt-get remove gcc
See what other packages are removed as being dependent on GCC. You may copy that list an re-install them later with "sudo apt-get install list of removed packages
Additional step for (K)Ubuntu 10.04(Lucid) & 10.10(Maverick)
There is no gcc-4.2 in Lucid/Maverick repository, you need to add older one to your /etc/apt/sources.list file (i.e. with "sudo kate /etc/apt/sources.list"):
deb http://us.archive.ubuntu.com/ubuntu/ karmic main deb http://us.archive.ubuntu.com/ubuntu/ karmic universe
and then run
sudo apt-get update
Installing gcc-4.2 (all versions)
sudo apt-get install gcc-4.2 g++-4.2
And link them as default version:
sudo ln -sf /usr/bin/gcc-4.2 /usr/bin/gcc sudo ln -sf /usr/bin/g++-4.2 /usr/bin/g++ sudo ln -sf /usr/bin/gcc-4.2 /usr/bin/cc
You may verify the current GCC version (make sure it is 4.2.x) with the following command:
gcc --version
Compiling gcc-cris
Now you may proceed with compiling gcc-cris (takes some time):
sudo ./install-cris-tools
answer by default (enter, enter, ...)
If everything finished OK you may reinstall the GCC back (and add other packages you may have removed):
sudo apt-get install build-essential g++ gcc
Build Elphel Software
Get the script. Unpack & Launch.
Installation of Kdevelop 3.5
note: Newer KDevelop 4 does not work with Elphel software
pre (K)Ubuntu 9.10
sudo apt-get install kdevelop
(K)Ubuntu 9.10 (Karmic), 10.4 (Lucid)
see Installation of KDevelop 3.5 on (K)Ubuntu 9.10
Install Icarus Verilog and GTKWave
(If you plan to develop FPGA code or at least look how it works)
GTKWave is OK from repository:
sudo apt-get install gtkwave
But unfortunately Icarus Verilog (package verilog) is compiled without needed support for compressed output format, so you'll have to compile it
cd ~/Downloads wget "ftp://ftp.icarus.com/pub/eda/verilog/v0.9/verilog-0.9.3.tar.gz" tar zxvf verilog-0.9.3.tar.gz cd verilog-0.9.3/ ./configure make sudo make install
Installing Xilinx WebPack (to be moved to a separate page, just a link here)
If you plan to compile the FPGA code from the source code you will need to install appropriate software from the FPGA manufacturer web site. This is proprietary (and non-free) software provided by Xilinx free of charge. This software is called the ISE WebPACK and you may download it (currently some 2.2GB) after registering at Xilinx web site. Currently tested version is 10.1.03, we'll try to update our code when Xilinx will release the new version of their software.
You will also need that software if you would like to simulate the FPGA functionality. Elphel camera FPGA code (written in Verilog HDL) is licensed under GNU GPLv3, simulator and waveform viewer (see below) are also Free Software, but there are a few Verilog models of some primitives of Xilinx FPGA that are not and can be only obtained from Xilinx as a part of their unisims library. For simulation we use small subset of the unisims library components and only for functional simulation so it will probably make sense to re-write those primitives models so the 2.2 GB distribution will not be needed to extract just few kilobytes of required source code.
Such independent re-implementation will help us to solve another problem - we have to patch the Xilinx library components to make them work correctly with our code and the simulator we use and currently each Xilinx library update breaks our patches.
When you will build Elphel software (as described later) the installation script will try to locate Xilinx software on your computer and patch a copy of unisims library. If you'll install Xilinx WebPack after building the camera software - you'll need to navigate to fpga subdirectory of the source tree and execute
make clean ; make
It is described in file README.simulation in that subdirectory.
There are additional steps required for the Xilinx WebPACK installation if you have a 64-bit GNU/Linux operation system. The next command line detects if you are running on 64 bit version of GNU/Linux and conditionally installs ia64-libs. That library is needed if you'll install Xilinx WebPack software (Xilinx does not allow to use 64-bit programs in their free for download software and the provided installation script does not install 32-bit version on its own). There is another trick you'll need to be aware of if you are using 32-bit Xilinx WebPack on a 64-bit GNU/Linux system.
if [ `uname -m` = "x86_64" ] ; then sudo apt-get install ia32-libs ; fi
Installation of the source code of Elphel camera software
You may install Elphel source code by either of the two methods. Either from the CVS (the most current code) and form the tarball files.
Installation from the CVS
Get elphel353_80_install_from_cvs.sh open archive that contains the shell script and execute it. It is recommended that you create subdirectory in your home directory, i.e. "elphel_projects", move and execute elphel353_80_install_from_cvs.sh script there. Directory "distfiles" will be created there and used as a cache for software archives that will be downloaded during installation.
mkdir -p ~/elphel_projects; cd ~/elphel_projects wget "http://downloads.sourceforge.net/elphel/elphel353_80_install_from_cvs.sh.tar.gz" tar zxvf elphel353_80_install_from_cvs.sh.tar.gz ./elphel353_80_install_from_cvs.sh
Installation from the tarball (release file)
http://sourceforge.net/projects/elphel
- get one of the elphel353-8.0.* releases
- decompress the archive
- execute the ./install_elphel script
./install_elphel
There will be created a file build.log in the top installation directory. If you get any installation problems you can compress that file and email it to Elphel support.
At the end of installation the script will generate a list of all the files in the target (camera) file system that are to be installed and compares it against the contents of the file target.list that is included in the distribution. If there are any differences -- they will be reported (there should be none). If there are some missing files it is likely that something failed to install correctly.
After the installation will be completed successfully you may want to execute the following command in the top installation directory (the one that has apps, configure-files, ... subdirectories)
./prep_kdevelop.php
That will create elphel353.kdevelop - a project file for KDevelop IDE (version 3.5.x), you can use it as described here - KDevelop
ImageJ and Elphel plugins for imageJ
ImageJ is a powerful open source image processing package, written in Java. There are plugins to work with Elphel cameras, the most universal one allows opening JP46 files (stored on a file system or downloaded directly from the camera). This plugin reads meta data from the image and un-applies in-camera non-linear conversion resulting in the linearized image, where each pixel is represented by a floating point value proportional to the number of photons that were detected in that pixel.
It is a very useful tool to do quantitative analysis of the camera images.
ImageJ installation
You may download ImageJ bundled with Java from the download page:
With 32-bit Java
cd ~/Download; wget "http://rsbweb.nih.gov/ij/download/linux/ij143-x86.tar.gz" ; tar zxvf ij143-x86.tar.gz
With 64-bit Java
cd ~/Download; wget "http://rsbweb.nih.gov/ij/download/linux/ij143-linux64.tar.gz" ; tar zxvf ij143-linux64.tar.gz
http://rsbweb.nih.gov/ij/download/linux/ij143-linux64.tar.gz - 64-bit Java version
Running ImageJ
There is "run" command the newly crated directory. You may start ImageJ with the following command:
/Downloads/ImageJ/run
That command allows Java to use 512M of system memory. If you need more you can change "512" to say "1024" in a single-line "run" script. If the run command is started from the command prompt, you'll be able to see some debug output - either from existent plugins or from your own ones. It is also very useful to see any error diagnostic output.
Installation of Elphel plugins for ImageJ
Elphel plugins are available in Elphel project page Git repository. To use it you first need to install git (if it was not already done):
sudo apt-get install git-core
Then clone the repository - directly to the ImageJ plugins directory. Provided you used the same directory for ImageJ as written above:
cd ~/Downloads/ImageJ/plugins git clone git://elphel.git.sourceforge.net/gitroot/elphel/ImageJ-Elphel
Updating Elphel plugins for ImageJ
Later, when you'll need to update your files from the repository you will need another command:
cd ~/Downloads/ImageJ/plugins/ImageJ-Elphel git pull
Running Elphel plugin for ImageJ
When you just install Elphel plugins you need to select
~/Downloads/ImageJ/plugins/ImageJ-Elphel/JP46_Reader_camera.java
That command will do exactly as it is named - first compile that source file to the Java bytecode, then execute it. Next time after you close and re-start ImageJ there will be a submenu in Plugins: Plugins->ImageJ-Elphel and JP46_Reader_camera command there,
When you'll update the source files, you 'll need to re-run "Compile and run...". meanwhile just use the item in Plugins->ImageJ-Elphel menu.