Skip to content

Commit

Permalink
Update install docs (#720)
Browse files Browse the repository at this point in the history
* Update install docs

Includes instruction for editable Python install.

* Update install instructions

* Close up some lines

---------

Co-authored-by: Matthew Scroggs <matthew.w.scroggs@gmail.com>
  • Loading branch information
garth-wells and mscroggs committed Nov 1, 2023
1 parent ac0ad58 commit 5efd94f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 37 deletions.
44 changes: 20 additions & 24 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,48 @@
## Standard

Basix can be installed using

```console
pip install .
```

## Advanced

In the standard install, the C++ library is built and installed inside the
Python package. This method is suitable for the majority of use cases.

It is also possible to install the C++ and Python interfaces separately
(see below). This is useful if you only need the C++ interface, and can
be helpful during development.
(see below). This is useful if you only need the C++ interface or during
development.

### C++ library

In the `cpp/` directory:

```console
cmake -DCMAKE_BUILD_TYPE=Release -B build-dir -S .
cmake --build build-dir
cmake --install build-dir
```

You may need to use `sudo` for the final install step. Using the CMake
build type `Release` is strongly recommended for performance.
Using the CMake build type `Release` is strongly recommended for
performance.


### Python interface

After installing the C++ library, install the Python interface by running in
the directory `python/`:

After installing the C++ library, install the Python interface by
running in the directory `python/`:
```console
pip install .
```

For an editable build and to avoid pip downloading the build
dependencies:
```console
pip install --no-build-isolation -e .
```
When using the `--no-build-isolation` option all build and runtime
dependencies must already be installed.

## Running the unit tests

To install Basix and the extra dependencies required to run the Python unit tests:
To install Basix and the extra dependencies required to run the Python
unit tests:

```console
pip install .[test]
Expand All @@ -63,18 +65,12 @@ Basix requires a C++20 compiler and depends on BLAS and LAPACK.
### Python

When using the standard install approach all build and runtime
dependencies for the C++ and Python parts of Basix will be fetched
dependencies for the C++ and Python parts of Basix are fetched
automatically.

Building the Python interface requires
[`nanobind`](https://github.com/wjakob/nanobind).

At runtime Basix requires [`numpy`](https://numpy.org).

Basix specifies sets of optional extras `docs`, `lint`, `optional`, `test`, and
`ci` for building documentation, linting, enabling optional features, testing
and for continuous integration, respectively, e.g.:

Basix specifies sets of optional extras `docs`, `lint`, `optional`,
`test`, and `ci` for building documentation, linting, enabling optional
features, testing and for continuous integration, respectively, e.g.:
```console
pip install .[docs,lint]
```
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Basix allows users to:
arbitrary meshes; and
- interpolate into and between finite element spaces.

Basix includes a range of built-in elements, and also allows the user to define
their own custom elements.
Basix includes a range of built-in elements, and also allows the user to
define their own custom elements.

Basix is one of the components of FEniCSx, alongside
[UFL](https://github.com/fenics/ufl),
Expand All @@ -31,13 +31,8 @@ pip install fenics-basix
```
We currently build binary wheels for Linux and macOS x86-64 architectures.

To install the `main` (development) branch of Basix:
```console
pip install git+https://github.com/FEniCS/basix.git
```

For advanced installation instructions see the detailed [install
instructions](INSTALL.md)
For advanced and developer installation instructions see the more
detailed [install instructions](INSTALL.md)


## Documentation
Expand All @@ -47,14 +42,17 @@ https://docs.fenicsproject.org/basix/main/.

## Support

If you find a bug in Basix, you can report it on the [GitHub issue tracker](https://github.com/fenics/basix/issues/new?labels=bug).
If you find a bug in Basix, you can report it on the [GitHub issue
tracker](https://github.com/fenics/basix/issues/new?labels=bug).

Questions about using Basix can be asked on the [FEniCS discourse group](https://fenicsproject.discourse.group/).
Questions about using Basix can be asked on the [FEniCS discourse
group](https://fenicsproject.discourse.group/).


## Contributing

Information about how to contribute to Basix can be found [here](CONTRIBUTING.md).
Information about how to contribute to Basix can be found
[here](CONTRIBUTING.md).

## Supported elements

Expand Down
1 change: 0 additions & 1 deletion python/basix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
The core of the library is written in C++, but the majority of Basix's
functionality can be used via this Python interface.
"""

from basix import cell, finite_element, lattice, polynomials, quadrature, sobolev_spaces, variants
from basix._basixcpp import (CellType, DPCVariant, ElementFamily, LagrangeVariant, LatticeSimplexMethod, LatticeType,
MapType, PolynomialType, PolysetType, QuadratureType, SobolevSpace, __version__,
Expand Down

0 comments on commit 5efd94f

Please sign in to comment.