Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 44 additions & 23 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,71 @@
# Building MOOSE from source
# Building MOOSE

To build `MOOSE` from source, you need `cmake`.
To build `MOOSE` from source, you need `cmake` and `python-setuptools`. We
recommend to use Python 3.5 or higher. Python 2.7 is also supported.

Download the latest source code of moose from github.

$ git clone -b master https://github.com/BhallaLab/moose-core --depth 50

## Install dependencies
Before running the following command to build and install, make sure that
followings are installed.

- gsl-1.16 or higher.
- libhdf5-dev (optional)
- python-dev
- python-numpy

On Ubuntu-14.04 or higher, these can be installed with:
On Ubuntu-16.04 or higher, these dependencies can be installed with:

sudo apt-get install python-dev python-numpy libhdf5-dev cmake libgsl0-dev g++
```
sudo apt-get install python-pip python-numpy cmake libgsl-dev g++
```

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`
Now use `pip` to download and install the `pymoose`.

$ sudo pip install python-libsbml
```
$ pip install git+https://github.com/BhallaLab/moose-core --user
```

## Using cmake (For developers)

`pip` builds `pymoose` with default options, it runs `cmake` behind the scene.
If you are developing moose, build it with different options, or needs to test
and profile it, `cmake` based flow is recommended.

## Use `cmake` to build moose:
Install the required dependencies and download the latest source code of moose
from github.

$ cd /path/to/moose-core
$ git clone https://github.com/BhallaLab/moose-core --depth 50
$ cd moose-core
$ mkdir _build
$ cd _build
$ cmake ..
$ make -j3
$ ctest -j3 --output-on-failure

This will build moose, `ctest` will run few tests to check if build process was successful.
This will build moose, `ctest` will run few tests to check if build process was
successful.

To install MOOSE into non-standard directory, pass additional argument `-DCMAKE_INSTALL_PREFIX=path/to/install/dir` to cmake.
To install MOOSE into non-standard directory, pass additional argument
`-DCMAKE_INSTALL_PREFIX=path/to/install/dir` to during configuration. E.g.,

### Python3
$ mkdir _build && cd _build # inside moose-core directory.
$ cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local ..
$ make && make install

cmake -DPYTHON_EXECUTABLE=/opt/bin/python3 ..
Will build and install pymoose to `~/.local`.

### Install
To use a non-default python installation, set
`PYTHON_EXECUTATBLE=/path/to/python` e.g.,

$ sudo make install
$ cmake -DPYTHON_EXECUTABLE=/opt/bin/python3 ..

## Post installation

Now you can import moose in a Python script or interpreter with the statement:

import moose
moose.test() # will take time. Not all tests will pass.
>>> import moose
>>> moose.test() # will take time. Not all tests will pass.

# Notes

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`

$ sudo pip install python-libsbml
20 changes: 10 additions & 10 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
AUTHORS
CMakeLists.txt
CONTRIBUTING.md
CheckCXXCompiler.cmake
INSTALL.md
LICENSE
MANIFEST.in
README.md
cmake_moose_cpack.cmake
cmake_uninstall.cmake.in
include AUTHORS
include CMakeLists.txt
include CONTRIBUTING.md
include CheckCXXCompiler.cmake
include INSTALL.md
include LICENSE
include MANIFEST.in
include README.md
include cmake_moose_cpack.cmake
include cmake_uninstall.cmake.in
recursive-include basecode *
recursive-include benchmarks *
recursive-include biophysics *
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# - Update setuptools using `python2 -m pip install setuptools --upgrade --user'.

__author__ = "Dilawar Singh"

__copyright__ = "Copyright 2019-, Dilawar Singh"
__maintainer__ = "Dilawar Singh"
__email__ = "[email protected]"
Expand Down Expand Up @@ -53,7 +54,7 @@
pass


version_ = '3.2.%s.rc1' % stamp
version_ = '3.2.1.dev%s' % stamp

# importlib is available only for python3. Since we build wheels, prefer .so
# extension. This way a wheel built by any python3.x will work with any python3.
Expand Down Expand Up @@ -112,7 +113,7 @@ def finalize_options(self):
# super().finalize_options()
_build_ext.finalize_options(self)
self.cmake_options['PYTHON_EXECUTABLE'] = os.path.realpath(sys.executable)
self.cmake_options['MOOSE_VERSION'] = version_
self.cmake_options['VERSION_MOOSE'] = version_
if self.with_boost:
self.cmake_options['WITH_BOOST'] = 'ON'
self.cmake_options['WITH_GSL'] = 'OFF'
Expand Down