Availability

simuPOP is distributed under a GPL license. simuPOP is available on any platform where Python is available, and is currently tested under Windows (Windows 2000 and later), both 32 and 64 bit versions of Linux (Redhat), MacOS X and Sun Solaris systems. Different C++ compilers such as Microsoft Visual C++, gcc and Intel icc are supported under different operating systems.

Download

simuPOP is hosted on http://www.sourceforge.net. All download files are avaiable from the download page of the simuPOP project. Please download the latest simuPOP binary that matches your python distribution. For example, if you have the official Python 2.5 distribution installed on a windows (32bit) system, you should download simupop-x.x.x-py25-win32.exe. The installation procedure is platform dependent and should be familiar to you.

Prerequisite and recommended tools

Python (required)

simuPOP works as a python library so a working version of python is required. Python is widely available on Linux/Mac systems but not for windows. For windows systems, you can use an official Python distribution, or ActiveState python.
To test if you have python installed, open a terminal (or command window) and type in the command
> python
You may need to type full path name (e.f. c:\python24\python) or add path to your $PATH, which is platform specific.

R and rpy (optional)

Owing to the ''glue language'’ nature of Python, it is easy to inter-operate Python with other applications within a simuPOP script. For example, users can call any R function from Python/simuPOP for the purposes of visualization and statistical analysis, using R and a Python module rpy. This technique is widely used in simuPOP so it is recommended that you install R and rpy if your are familiar with R.
Note: Because it is currently very difficult to use, simuPOP does not yet support rpy2, the next generation of rpy. I have expressed my frustration to rpy2 in an email I sent to the rpy mailing list.
Note: Installation of rpy can be troublesome and you may have some compatibility problems. Please refer to the Q/A section of this page if you cannot make it running.

wxPython (optional)

Although simuPOP uses the standard tkInter GUI toolkit when a graphical user interface is needed, it can make use of a wxPython toolkit if it is available. wxPython is recommended because it generally produces nicer and more user-friendly dialogs and some functions can only use wxPython.

simuPOP installers (binary versions)

Installers for some specific combination of architecture (32 or 64 bit), operating systems (windows, Linux, Solaris or MacOS) and Python (2.4, 2.5, etc) are provided. If there is a binary package for your system, installation should be pretty straightforward.

Windows

Standard windows installers (32bit) are provided for Python 2.4, 2.5 and 2.6 versions. Windows 2000, XP and Vista systems are supported. If you have a version of Python installed on your system, you should be able to simply download, double click and install.
Due to the lack of testing environment, simuPOP is not tested under the 64bit version of the Windows Vista system. Please make sure that you test simuPOP before you use simuPOP under this system. Please report any problem (or success story) to the simuPOP mailing list.

Linux

Because there are so many different Linux flavors, it is generally recommended that you compile simuPOP from source. A compiled .tar.gz file for the RHEL5 (x86_64) operating systems is provided, more or less for testing purposes. To install this file, you will need to
> tar -zxf simuPOP-XXX.tar.gz
and you can see directories like
	usr/lib64/python2.4/site-packages
	usr/share/simuPOP
	usr/share/simuPOP/doc
	usr/share/simuPOP/test
Copy python modules under site-packages to an appropriate directory, which is usually the python library directory. On a *nix system, it is something similar to /usr/lib/python/lib64/site-packages or dist-packages. You can copy the 'share' directory to any directory you like.
If you do not have write permission to system python library directory, you can unpack simuPOP to a local directory and set environment variable PYTHONPATH to the local site-packages directory.

Mac OSX

A compiled .tar.gz file is provided so that you can uncompress to the Python site package directory or your user's directory. This binary is in Mac Universal format and supports both the PPC/x86 version of mac.

Solaris

A compiled .tar.gz file is provided for the Solaris 10 (SPARC) operating system. You can uncompress it to the Python site package directory or your user's directory. It should be straightforward to compile simuPOP from source on this system.

Build simuPOP from source

The source code of each simuPOP release is available in .zip and .tgz formats. Make sure you have

  • A C++ Compiler: Get a C++ compiler. This is usually not a problem for Linux/Solaris/MacOS systems because GNU gcc/c++ is widely available on these operating systems. Under windows, you can get a copy of the free Visual C++ Express edition from here. Note that this version only works with Python 2.6 and you will have to purchase a copy of Visual Stuidio.NET 2003 for previous versions of Python.
  • Python header files: The Python header files (e.g. Python.h) are usually installed with Python but you should install python-devel or similar packages if this file is unavailable.
  • zlib header files (*nix systems only): zlib and its header file zlib.h are usually available under a *nix system. However, for a Ubuntu system, you will need to install the zlib1g-dev package to get this header file. Please install package build-essential if you still get missing header files.

With all the tools ready, it is usually as easy as running

> tar zxf simuPOP-x.x.x.tar.gz
> cd simuPOP-x.x.x
> python setup.py install

to build and install simuPOP.

It is not uncommon that you do not have write permission to the Python site library directory. In this case, you can install simuPOP to some local directory where you have write permission. If you are building simuPOP from source, you can use the prefix option of the setup.py script. For example,

> python setup.py install --prefix=/home/me/PythonModules

or

> scons install prefix=/home/me/PythonModules

if you use scons to build simuPOP.

Python will build and install simuPOP to a local directory such as /home/me/PythonModules/python2.x/lib/site-packages. You then need to tell Python where to look for simuPOP modules, using environment variable PYTHONPATH. For linux bash, the syntax is

> PYTHONPATH=/home/me/PythonModules/python2.x/lib/site-packages
> export PYTHONPATH

You may want to put these lines to your shell configuration file such as $HOME/.bashrc. Note that some Python distributions use dist-packages instead of site-packages for system packages and you will need to explicitly add site-packages (e.g. /usr/lib64/python26/site-packages) to PYTHONPATH.

Troubleshooting

1. I installed simuPOP successfully under a windows system, but got an error message "ImportError: DLL Load failed" when I import simuPOP.

Please download and install the Microsoft Visual C++ 2008 Redistributable Package. A similar problem exists for previous versions of simuPOP and windows, please refer to a list message for details.

2. I can not compile simuPOP under a linux system because the build script can not find zlib.h.

You may need to use some command like

> python setup.py config --include-dirs=/usr/include/linux install

if zlib.h is not in standard directories.

3. What compiler should I use on my mac?

You can install Xcode from here...

4. How can I use Intel i++?

Because Python has to be compiled with the same compiler as simuPOP, you will have to build python by yourself as well. I assume that you do not want to override system python, so here is what you need to do

  • Download and intall intel C++ compiler.
  • Download python source. Run, for example (assume you are running csh),
> tar zxf Python-2.4.3.tgz
> cd Python-2.4.3
> setenv CC icc 
> setenv CXX icpc
> ./configure --with-cxx=icpc --prefix=/home/username/Python24
> make
> make install
  • Build and install simuPOP
> cd simuPOP
> /home/username/Python24/bin/python setup.py install

simuPOP modules will be put under /home/username/Python24/lib(or lib64)/site-packages.

5. Can I compile simuPOP using mingw under windows?

The problem with cygwin is that it has its own gcc, zlib and boost and it is tricky to not use them. Using a system without cygwin, you can

  • download mingw.exe, choose g++ and install, add c:/mingw/bin to $PATH
  • download zlib, unpack to c:\zlib
  • (Optional) download and install boost, using commands like:
> cd \boost\boost-1_36_0\tools\build\jam_src
> build.bat
Copy bjam.exe to c:\boost\boost-1_36_0, and
> cd \boost\boost-1_36_0
> bjam.exe -j4 "-sBUILD=debug release <cxxflags>-fPIC" "-sTOOLS=mingw" \
    -sNO_COMPRESSION=0 -sNO_BZIP2=1 -sNO_ZLIB=0 -sZLIB_INCLUDE=c:/zlib/include \
    -sZLIB_LIBRARY=c:/zlib/lib -sZLIB_BINARY=zdll --prefix=c:/boost \
    --with-iostreams --with-serialization --with=regex install
  • download python, install to c:\python24, add c:\python24 to $PATH
  • download and unpack simuPOP source to c:\simuPOP
  • if needed, download swig, unpack to c:\swigwin and add c:\swigwin to $PATH
  • from the simuPOP directory, do
> python setup.py bdist_wininst

setup.py looks in the win32 directory for boost and zlib libraries. If you would like to link to your versions of them, remove this directory and add --library-dirs option to point to your libraries.

For python2.4, you may get an error message saying

import error: DSLL load failed: The specified procedure could not be found

This is because of a compatibility problem of mingw32/msvcrt and msv/msvcrt71. Please see http://jove.prohosting.com/iwave/ipython/issues.html for details. My fix is go to python24/Lib/distutils/cygwinccompiler.py, at line 139, change

self.dll_libraries = []

to

self.dll_libraries = ['msvcrt', 'python' + ''.join(sys.winver.split('.'))]

and comment out the following if/else block. This will force simuPOP to use msvcrt, not msvcrt70 or msvcrt71 with msvc.

6. When I compile rpy from source, I get some sort of link error indicating a missing libR.so, but I have R installed ...

Try to locate libR.so manually. If you cannot find it, you will need to reinstall R with option --enable-R-shlib at the ./configure step.

7. I have installed rpy but simuPOP cannot find it.

Please check

  • Is R in your $PATH? This is usually not a problem for *nix systems but the R installer does not add its path to $PATH under windows. You will need to go to control panel -> advanced -> environmental variable and add something like c:\program files\R\R-2.8.0\bin to the PATH variable. You can verify if R is in your PATH by typing $$R$$ in a command window.
  • Can you import rpy from an interactive python shell? If not, you will need to check if you have installed the correct version of rpy because the binary installer works only for certain versions of R and Python. You may have to either install matching versions of R and Python, or compile rpy from its source code (see the next Q/A).
  • If rpy can be found but cannot be imported (with an error message). You may missed some supporting modules such as numpy. Please refer to the rpy documentation or rpy mailing list for help.
  • If rpy can be imported correctly but simuRPy does not work. Please send an email to the simuPOP MailingList.

8. I cannot find rpy installer for Python2.6 under windows.

Unfortunately, you will have to compile rpy from source if you really want to use it. Here are the steps

  • Install Visual C++ 2008 Express (google for a download link).
  • Get rpy source code, uncompress.
  • Install R and add its path to $PATH (control panel, system, advanced, ...).
  • Download pexports and decompress.
  • In a Visual Studio 2008 Command Prompt (installed with VC),
    > cd \path\to\pexports-0.43\bin
    > pexports.exe "C:\Program Files\R\R-X.X.X\bin\R.dll" > R.exp
    > lib /def:R.exp /out:R.lib
    > move R.lib \path\to\rpy-x.x.x
    > cd \path\to\rpy-x.x.x
    > python setup.py install
    

If you get compile errors, see the next Q/A.

9. I am compiling rpy from source but I get compile or link errors

This is really not my business, but,

  • If you get something like Rdevice.h not find, edit the source code and remove the offending line. Rdevice.h has been removed after certain version of R.
  • If you cannot link rpy because it cannot link to Rlapack, your R installation does not have this library. Edit the setup.py file and remove all occurrence of Rlapack should work.
  • If ..., please send an email to the rpy mailing list. :-)