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)
> python
c:\python24\python) or add path to your $PATH, which is platform specific.
R and rpy (optional)
wxPython (optional)
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
Linux
> tar -zxf simuPOP-XXX.tar.gz
usr/lib64/python2.4/site-packages usr/share/simuPOP usr/share/simuPOP/doc usr/share/simuPOP/test
/usr/lib/python/lib64/site-packages or dist-packages. You can copy the 'share' directory to any directory you like.
PYTHONPATH to the local site-packages directory.
Mac OSX
Solaris
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 installpython-develor similar packages if this file is unavailable. - zlib header files (*nix systems only): zlib and its header file
zlib.hare usually available under a *nix system. However, for a Ubuntu system, you will need to install thezlib1g-devpackage to get this header file. Please install packagebuild-essentialif 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
> 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$PATHunder windows. You will need to go to control panel -> advanced -> environmental variable and add something likec:\program files\R\R-2.8.0\binto thePATHvariable. You can verify if R is in yourPATHby typing $$R$$ in a command window. - Can you import
rpyfrom an interactive python shell? If not, you will need to check if you have installed the correct version ofrpybecause the binary installer works only for certain versions ofRand Python. You may have to either install matching versions ofRand Python, or compilerpyfrom its source code (see the next Q/A). - If
rpycan be found but cannot be imported (with an error message). You may missed some supporting modules such asnumpy. Please refer to the rpy documentation or rpy mailing list for help. - If
rpycan be imported correctly butsimuRPydoes 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.hnot find, edit the source code and remove the offending line.Rdevice.hhas been removed after certain version of R. - If you cannot link
rpybecause it cannot link toRlapack, your R installation does not have this library. Edit thesetup.pyfile and remove all occurrence ofRlapackshould work. - If ..., please send an email to the
rpymailing list. :-)
