How to Build PySLGR¶
Before building PySLGR, please make sure that you have all the correct versions of the dependencies installed.
Linux¶
1. Make sure that Anaconda is installed. If it is not, you can download it here.
2. Make sure that your gcc compiler version is greater than 4.8, else follow the instructions to Installing the Correct Compiler.
3. Now compile the source code by running:
make
in the top level pyslgr directory
4. Then from the same directory build the package:
conda build pyslgr5. We can now install the package:
conda install --use-local pyslgr
Mac OSX¶
1. Make sure that Anaconda is installed. If it is not, you can download it here.
2. Set Anaconda’s python version as your default python. To confirm that you are using the correct python version:
>>> which python /<your_home_directory>/anaconda/bin/pythonNote
The makefiles of this package depend on the fact that the path to python is the correct one (namely the anaconda version). Creating an alias such as “pyconda” will not work.
3. Install Boost using Anaconda
>>> conda install -c anaconda boost=1.60.0Note
In some cases, installing boost through Anaconda is not sufficient and you must install it on your system using brew or port. You can use the following brew command:
brew install boost4. Install FFTW3 using Anaconda
>>> conda install -c salilab fftw=3.3.45. Make sure that you are using a C and C++ compiler version 4.8 or higher. See Installing the Correct Compiler.
Warning
Having a compiler that has a lower version number than 4.8 will result in a linking error later on. The default compiler from Xcode has version 4.3 and will not work.
6. Now run:
make
in the top level pyslgr directory.
7. Finally we can build the python module (from the same directoty):
conda build pyslgr8. We now use this local file to install pyslgr:
conda install --use-local pyslgr
Note
The package will only be available if python is started from the same directory where it was installed. To make the package available from any directory, find the location of the tar.bz2 file given after completion of step 7. Copy this file to a location of your choice and follow the instructions for installing.
Installing the Correct Compiler¶
1. Make sure you have Homebrew, if not, follow the instructions on their webpage: http://brew.sh/.
2. Run:
brew install gcc483. Update your PATH variable to include /usr/local/bin
4. Check if gcc-4.8 is your default compiler by running
which gccThis should return usr/local/bin/gcc-4.8. If it does repeat the same for g++, if not go to step 5.
5. Navigate to usr/local/bin and run
ln -s gcc-4.8 gcc6. Try
which gccNow, it should return usr/local/bin/gcc. Follow the same procedure for g++.