py4sci

Table Of Contents

Previous topic

CERN PyMad

Next topic

Examples

This Page

Installation Instructions

Installation of PyMad is different depending on which underlying modules you want.

JPyMad

For JPyMad, you first need JMad which you can obtain here Then, download the source, and in pymad/src, run the command

python setup.py install --install-platlib

The argument –install-platlib means we exclude external modules. The reason is that the external module cern.madx requires the dynamic library of Mad-X available on your system (which we here assume you do not have)

CPyMad

First method, use installation script:

We provide an installation script which should do the full job for you. Download the script and run it. It will take a few minutes to finish. Upon successful completion, it will create an uninstall.sh script which you should keep somewhere. This script knows all the files you have installed, and will remove all files if you execute it (folders are not removed).

Dependencies: cmake, compilers for c/fortran, python 2.6 or 2.7

Second method, source script:

For CPymad on a 64 bit Linux machine with afs available, it is enough to source the script that we currently provide in

/afs/cern.ch/user/y/ylevinse/public/setupCPYMAD.sh

We hope to in the near future provide a tarball for Linux and OSX containing all needed files.

Third method, manual installation:

  • Download the Mad-X source from svn and unpack it.

  • Enter the folder madX and run the commands

    mkdir build; cd build
    cmake -DMADX_STATIC=OFF -DBUILD_SHARED_LIBS=ON -D ../
    make install
    
  • Download the PyMad source from github and unpack it

  • In the folder pymad/src, run the command

    python setup.py install
    

If you download JMad after following any of the methods described above for CPyMad, you will immediately have JPyMad available as well.