Skip to content

hperrey/psi46expert

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build and installation of psi46expert for the digital testboard

  1. Dependencies

To install psi46expert for the digital testboard a few libraries and programs are required:

  • libusb-1.0 and libusb-0.1 normally available as a package for your Linux distribution

  • either libftdi (open-source) or libftd2xx (proprietary, version 1.1.x) the former is normally available as a package for your Linux distribution (e.g. for Ubuntu, use 'sudo apt-get install libftdi-dev' or compile from source code at http://www.intra2net.com/en/developer/libftdi) while the latter can be downloaded from http://www.ftdichip.com/Drivers/D2XX.htm (follow the installation instructions on the webpage)

    Both libftdi and libftd2xx were tested with Ubuntu 12.10. [Default choice: libftdi with libftd2xx as fallback]

    Currently we encourage you to use the FTD2XX library since there seem to be data transfer speed issues with the current configuration of libftdi. This is being looked into.

  • ROOT download from http://root.cern.ch or try your Linux distriution's package repository export LD_LIBRARY_PATH=$HOME/root/lib:$LD_LIBRARY_PATH

    cd $HOME/root/lib ln -s /usr/lib/libusb.so libusb.so

  • libtool, autoconf, automake always available as a package for your Linux distribution, normally installed by default

If these are installed in special directories (not /usr or /usr/local) then you have to take measures that the compiler finds your files (set and export PATH, CPATH, LIBRARY_PATH environment variables).

  1. Fetch the source code

There are two options to get the code, choose the right for you particular setup and requirements:

  • Stable versions are meant for production use in laboratory setups. You can find the most recent one at https://github.com/psi46/psi46expert/releases Just download the tarball and follow the instructions given below to compile it on your machine.
  • The git development version is only meant to be used by developers or if you want to try out a new feature on your laptop. This version might not work because of some unfinished features and should never be used in production. You can clone the repository by running: git clone [email protected]:psi46/psi46expert.git
  1. Preparing the sources

After checking out the sources from github, run the following command in the working directory:

./autogen.sh
  1. Compiling the sources

Run ./configure [--prefix=SOMEDIR] make or to use the ftd2xx libraries: ./configure [--prefix=SOMEDIR] --with-ftd2xx make

with the option [--prefix=SOMEDIR] optional. The prefix determines where the installed files would go. By default this is /usr/local (binaries would go to /usr/local/bin, libraries to /usr/local/lib and so on).

Multiple versions (e.g. branches) of the software can be installed in parallel by changing the names of the produced programs by running

./configure [--prefix=SOMEDIR] --program-suffix=SUFFIX

Program names will then be for example psi46expertSUFFIX. Beware that library names will not be affected by this (see below).

NOTE: Some linux versions ship with an old glibc version not compatible with libftd2xx-1.1.x; either use the open-source driver (libftdi) or follow the instructions in section 5.6 below.

  1. Installing the software

The software is installed by typing

make install

If multiple versions of the software should be installed in parallel (see above) then the installation will overwrite previously installed library versions (like libpsi46ana for example). You can avoid this by specifying

./configure <other args> --libdir=$PWD

which doesn't really install the libraries at all.

  1. Running the software

You will need a configuration directory for Modules/ROCs:

cp -r data/defaultParameters<X> WHEREVER

Then you can run

psi46expert -dir WHEREVER
  1. Frequent problems

  1. If ./autogen.sh does not work, you probably don't have libtool installed. Or autoconf, automake. These are standard packages in a Linux system. Check your Linux manual on how to install packages.

  2. If ./configure doesn't find some header or library, install what is requested and make sure it can be found by the compiler. The libraries libusb-1.0.so or libusb-0.1.so may require a symbolic link to libusb.so. This may also be true for libftd2xx. Make sure you follow the instructions of the libftd2xx library! libusb comes as a package in all Linux distributions. There are two versions: 0.1 and 1.0. Install both to be safe. (Your favourite distribution should provide the packages.) For libraries in special directories you can use

    export PATH=$PATH:whatever export CPATH=$CPATH:whatever export LIBRARY_PATH=$LIBRARY_PATH:whatever

before calling ./configure . This is best put in your .bashrc
file in your home directory.
  1. If 'make' fails, you should talk to a code maintainer. There are two cases which is known to fail: On is that the call to rootcint fails because it cannot find the libraries. Make sure that you set LD_LIBRARY_PATH correctly:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:YOURPATH

The other case is if you try to compile
the software against the older version libftd2xx-0.4.x
on a 32 bit machine, then there may be a compilation error
in USBInterface.cc, depending on which compiler version you
are using. It might say something about being unable to
convert a 'unsigned long *' into a 'unsigned int *'. On a
32 bit Linux system, they are actually exactly the same, so
you can pass the variable

	./configure CFLAGS=-fpermissive

to the configuration script, which should make the compiler
ignore the problem.
  1. If psi46expert won't start because a library is missing, set your custom library path with

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:YOURPATH

  2. If psi46expert cannot open a port to the testboard, then make sure the testboard name is correct in the configParameters.dat file in you config directory. If this is the case, make sure that you have write access to your USB devices:

    ls -l /dev/bus/usb/00?/*

You can change these permissions permanently if you create a file
/etc/udev/rules.d/10-testboard.rules which contains

        SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6014", ATTR{manufacturer}=="PSI", GROUP="plugdev", MODE="0664"

and make sure your user belongs to the group "plugdev":

        groups youruser

Newly plugged devices will have the correct permissions. For the
libftd2xx-0.4.x library version it may be that you need the
usbfs. You can get this by putting the following line into your
/etc/fstab file:

	none /proc/bus/usb usbfs devgid=1000,devmode=0660 0 0

where you should replace the number 1000 with the group id of
your group 'usb'. You can then either reboot the machine or
do a

	mount -a

as root.
Lastly, it is possible that the automatic detachment of the
usb serial kernel modules was not enabled during compilation.
This happens if the libusb-1.0 headers are missing on the
system. Some systems have -devel packages for their libraries
and you should install such package and then recompile and
reinstall psi46expert.
  1. Some linux versions, like RedHat Enterprise 6, have an old glibc version not compatible with libftd2xx-1.1.x

    To use the software on such a linux system you can either use the open-source driver (libftdi) or install GLIBC2.14 manually and use the following commands for compiling

    export LD_PRELOAD="/PATH/TO/GLIBC2.14/lib/libc.so.6:${LD_PRELOAD}" ./configure LDFLAGS="-L/PATH/TO/GLIBC2.14/lib"

  2. If all things fail, you should talk to a code maintainer. Post a message to the hypernews list 'Pixel psi46 Testboard':

    [email protected]

This requires a CERN account.

About

Suite for module testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 92.5%
  • Perl 4.6%
  • C 2.8%
  • Other 0.1%