Skip to content

clseitz/Psi46testDesy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

psi46testDesy

code for testing psi46dig ROCs with a DTB. DESY development branched off from https://github.com/psi46/psi46test

Prerequisites:

The FTDI D2XX USB driver is needed, available at

http://www.ftdichip.com/Drivers/D2XX.htm

and follow the instructions in the ReadMe file there. You only need to install the shared library libftd2xx.so

ROOT is required as $(ROOTSYS)/bin/root-config

readline is used

Installation:

Linux or Darwin (Mac OS X):

  1. Compile the software by typing

    make

  2. If your environment variable PATH contains /usr/local/bin, skip to the next step. You can find out if you type

    echo $PATH

    If the path is not in the variable then edit your ~/.bashrc file and append

    export PATH=$PATH:/usr/local/bin

    Newly opened shells will then have the PATH environment variable set correctly.

  3. If your environment variable LD_LIBRARY_PATH contains /usr/local/lib, skip to the next step. You can find out by typing

`echo $LD_LIBRARY_PATH`

 If the path is missing, edit your ~/.bashrc file and append

`export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib`

 Newly opened shells will then have the LD_LIBRARY_PATH environment
 variable set correctly.
  1. (Skip on a Mac) If you want regular users to use the software you must grant them permission to the USB devices. You can do this by adding the file /etc/udev/rules.d/10-testboard.rules (needs sudo) or edit it, if the file already exists. Add the line
`SUBSYSTEM == "usb", ATTR{manufacturer}=="PSI", GROUP="usb", MODE="0664"`

 and it should work now.
  1. If you get an error that your USB device is busy, then your Linux box has a generic serial driver for the FTDI chip already installed. To prevent the driver ftdi_sio from taking ownership of the testboard check first if this is really the case. Disconnect and reconnect the testboard. Then issue
`dmesg | tail -20`

 If you see that the driver ftdi_sio gets loaded and a serial usb 
 interface has been established for your testboard, then you lost.
 Fix it as follows:

 Add a line with "blacklist ftdi_sio" to /etc/modprobe.d/blacklist.conf
 (needs sudo) and issue the command sudo update-initramfs -u. After a 
 reboot test it again. If the serial USB connection is no longer 
 established you should be able to talk to the board.

 This comes at a disadvantage: Every other USB device using that chip
 may stop to work. So be careful. If you have a better solution report
 this or even better update this README.

 More usb info (on Linux):
 lsusb -v | less
 and search for FTD
  1. Run
`bin/psi46test <logfilename>`

 <logfilename> is just a name of your choice for the logfile that 
 psi64test is going to write to. It is recreated every time anew, i.e.
 it overwrites any old one with the same name.

Common issues

  • Some Ubuntu installations miss header. When you call make the compiler will complain. You can install them with

    sudo apt-get install libreadline-dev libx11-dev

  • Some Ubuntu installations show take over of the device by ehci_hcd. Blacklisting doesn't help. Currently we are stuck. If anybody found a solution, please let us know and update this file.

  • On Ubuntu 12.04 at least one user report says that you will need to add

    -ltermcap

    to the variable LDFLAGS in the Makefile (in the Linux case, not Darwin).

  • If you are on Mac OS 10.8: You must install X11 (http://support.apple.com/kb/HT5293) and create a symbolic link

    ln -s /opt/X11/include/X11 /usr/local/include/X11

  • If you are on Mac OS 10.7 (or lower): make sure you have the most recent version of Xcode and gcc installed. See

    http://woss.name/2012/01/24/how-to-install-a-working-set-of-compilers-on-mac-os-x-10-7-lion/

    for instructions.

nlopt

One macro (phroc2ps.C) requires nlopt for fitting http://ab-initio.mit.edu/wiki/index.php/NLopt

Download: http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz
cd nlopt-2.4.2
./configure --enable-shared
make
sudo make install

Documentation:

man.pdf
man.tex (pdflatex, created by LYX)

Code style:

use indent command: indent *.cpp and indent *.h
uses .indent.pro
see indent.cpp