Skip to content

Commit

Permalink
Merge pull request #10 from munechika-koyo/develop
Browse files Browse the repository at this point in the history
🔧 Improve build config
  • Loading branch information
munechika-koyo authored Nov 22, 2023
2 parents bdfea95 + 36cd516 commit bbbd4de
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 21 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,30 @@ For more information, see the [documentation pages](https://cherab-inversion.rea

Quick installation
-------------------
`pip` command enables us to install `cherab-inversion` from [PyPI](https://pypi.org/project/cherab-inversion/) repository.
`mamba`/`conda` is recommended to install `cherab-inversion`.
```Shell
mamba install -c conda-forge cherab-inversion
```

If you want to use `pip`, please install `suitesparse` at first, then install `cherab-inversion`.
```Shell
# Linux (Debian/Ubuntu)
sudo apt install libsuitesparse-dev
```
```Shell
# macOS
brew install suite-sparse
```
```Shell
python -m pip install cherab-inversion
pip install cherab-inversion
```

For Developpers
---
If you would like to develop `cherab-inversion`, it is much easier to create a conda environment after cloning repository.
```Shell
conda env create -f environment.yaml
conda activate cherab-inv-dev
mamba env create -f environment.yaml
mamba activate cherab-inv-dev
python dev.py build
python dev.py install
```
Expand Down
2 changes: 1 addition & 1 deletion cherab/inversion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
from .mfr import Mfr

__all__ = ["compute_svd", "_SVDBase", "Lcurve", "GCV", "Mfr"]
__version__ = "0.1.2"
__version__ = "0.1.3"
4 changes: 2 additions & 2 deletions docs/source/_static/switcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
},
{
"name": "0.1",
"version": "v0.1.2",
"url": "https://cherab-inversion.readthedocs.io/en/v0.1.2/",
"version": "v0.1.3",
"url": "https://cherab-inversion.readthedocs.io/en/v0.1.3/",
"preferred": true
}
]
30 changes: 20 additions & 10 deletions docs/source/user/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,31 @@ Installation
============


Prerequisites
=============
If you want install ``pip``, you need to install suite-sparse library for `scikit-sparse` package.
Installing via Conda
====================
`conda` (or `mamba`, a faster `conda` alternative) is the most recommended way to install
CHERAB-Inversion.

.. prompt:: bash

# debian
sudo apt-get install libsuitesparse-dev
conda install -c conda-forge cherab-inversion

If you install by ``conda``, it is not required to install suite-sparse library.


Installing using pip
====================
Using ``pip`` command allows us to install cherab-inversion including dependencies.
Installing with Pip
===================
If you want install ``pip``, you need to install `suitesparse` library for `scikit-sparse` package
firstly.

.. prompt:: bash

# Linux (Debian/Ubuntu)
sudo apt-get install libsuitesparse-dev

# macOS
brew install suite-sparse

Then, you can install CHERAB-Inversion by ``pip``:

.. prompt:: bash

Expand Down Expand Up @@ -53,7 +63,7 @@ The easiest way is to create a conda development environment:

.. prompt:: bash

conda env create -f environment.yaml # `mamba` works too for this command
conda env create -f environment.yaml
conda activate cherab-inv-dev

you need to build this package using the ``dev.py`` CLI:
Expand Down
8 changes: 5 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
project(
'cherab-inversion',
'c',
'cython',
# Note that version cannot dinamically changed now.
version: '0.1.2',
version: '0.1.3',
meson_version: '>= 0.64.0',
default_options: [
'cython_args=-3',
'c_args=-fopenmp',
'c_link_args=-fopenmp',
],
)

# https://mesonbuild.com/Python-module.html
py = import('python').find_installation(pure: false)
py_dep = py.dependency()

# OpenMP dependency
# NOTE: uncomment if you want to use prange in cython
# omp_dep = dependency('openmp')

# NumPy include directory - needed in all submodules
incdir_numpy = run_command(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build-backend = "mesonpy"
[project]
name = "cherab-inversion"
description = "Cherab inversion framework"
version = "0.1.2"
version = "0.1.3"
readme = "README.md"
authors = [
{ name = "Koyo Munechika", email = "[email protected]" },
Expand Down

0 comments on commit bbbd4de

Please sign in to comment.