|
1 |
| -# Building MOOSE from source |
| 1 | +# Building MOOSE |
2 | 2 |
|
3 |
| -To build `MOOSE` from source, you need `cmake`. |
| 3 | +To build `MOOSE` from source, you need `cmake` and `python-setuptools`. We |
| 4 | +recommend to use Python 3.5 or higher. Python 2.7 is also supported. |
4 | 5 |
|
5 |
| -Download the latest source code of moose from github. |
6 |
| - |
7 |
| - $ git clone -b master https://github.com/BhallaLab/moose-core --depth 50 |
8 |
| - |
9 |
| -## Install dependencies |
| 6 | +Before running the following command to build and install, make sure that |
| 7 | +followings are installed. |
10 | 8 |
|
11 | 9 | - gsl-1.16 or higher.
|
12 |
| -- libhdf5-dev (optional) |
13 |
| -- python-dev |
14 | 10 | - python-numpy
|
15 | 11 |
|
16 |
| -On Ubuntu-14.04 or higher, these can be installed with: |
| 12 | +On Ubuntu-16.04 or higher, these dependencies can be installed with: |
17 | 13 |
|
18 |
| - sudo apt-get install python-dev python-numpy libhdf5-dev cmake libgsl0-dev g++ |
| 14 | +``` |
| 15 | +sudo apt-get install python-pip python-numpy cmake libgsl-dev g++ |
| 16 | +``` |
19 | 17 |
|
20 |
| -SBML support is enabled by installing [python-libsbml](http://sbml.org/Software/libSBML/docs/python-api/libsbml-installation.html). Alternatively, it can be installed by using `python-pip` |
| 18 | +Now use `pip` to download and install the `pymoose`. |
21 | 19 |
|
22 |
| - $ sudo pip install python-libsbml |
| 20 | +``` |
| 21 | +$ pip install git+https://github.com/BhallaLab/moose-core --user |
| 22 | +``` |
| 23 | + |
| 24 | +## Using cmake (For developers) |
| 25 | + |
| 26 | +`pip` builds `pymoose` with default options, it runs `cmake` behind the scene. |
| 27 | +If you are developing moose, build it with different options, or needs to test |
| 28 | +and profile it, `cmake` based flow is recommended. |
23 | 29 |
|
24 |
| -## Use `cmake` to build moose: |
| 30 | +Install the required dependencies and download the latest source code of moose |
| 31 | +from github. |
25 | 32 |
|
26 |
| - $ cd /path/to/moose-core |
| 33 | + $ git clone https://github.com/BhallaLab/moose-core --depth 50 |
| 34 | + $ cd moose-core |
27 | 35 | $ mkdir _build
|
28 | 36 | $ cd _build
|
29 | 37 | $ cmake ..
|
30 | 38 | $ make -j3
|
31 | 39 | $ ctest -j3 --output-on-failure
|
32 | 40 |
|
33 |
| -This will build moose, `ctest` will run few tests to check if build process was successful. |
| 41 | +This will build moose, `ctest` will run few tests to check if build process was |
| 42 | +successful. |
34 | 43 |
|
35 |
| -To install MOOSE into non-standard directory, pass additional argument `-DCMAKE_INSTALL_PREFIX=path/to/install/dir` to cmake. |
| 44 | +To install MOOSE into non-standard directory, pass additional argument |
| 45 | +`-DCMAKE_INSTALL_PREFIX=path/to/install/dir` to during configuration. E.g., |
36 | 46 |
|
37 |
| -### Python3 |
| 47 | + $ mkdir _build && cd _build # inside moose-core directory. |
| 48 | + $ cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local .. |
| 49 | + $ make && make install |
38 | 50 |
|
39 |
| - cmake -DPYTHON_EXECUTABLE=/opt/bin/python3 .. |
| 51 | +Will build and install pymoose to `~/.local`. |
40 | 52 |
|
41 |
| -### Install |
| 53 | +To use a non-default python installation, set |
| 54 | +`PYTHON_EXECUTATBLE=/path/to/python` e.g., |
42 | 55 |
|
43 |
| - $ sudo make install |
| 56 | + $ cmake -DPYTHON_EXECUTABLE=/opt/bin/python3 .. |
44 | 57 |
|
45 | 58 | ## Post installation
|
46 | 59 |
|
47 | 60 | Now you can import moose in a Python script or interpreter with the statement:
|
48 | 61 |
|
49 |
| - import moose |
50 |
| - moose.test() # will take time. Not all tests will pass. |
| 62 | + >>> import moose |
| 63 | + >>> moose.test() # will take time. Not all tests will pass. |
| 64 | + |
| 65 | +# Notes |
| 66 | + |
| 67 | +SBML support is enabled by installing |
| 68 | +[python-libsbml](http://sbml.org/Software/libSBML/docs/python-api/libsbml-installation.html). |
| 69 | +Alternatively, it can be installed by using `python-pip` |
| 70 | + |
| 71 | + $ sudo pip install python-libsbml |
0 commit comments