Skip to content

Commit

Permalink
Merge pull request #36 from cpmech/remove-dependency-on-russell-lab
Browse files Browse the repository at this point in the history
Remove dependency on russell lab
  • Loading branch information
cpmech authored Oct 9, 2023
2 parents 401fd0b + b5c03cd commit 54fe7f0
Show file tree
Hide file tree
Showing 93 changed files with 37,995 additions and 34,369 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/test_and_coverage.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
name: Test & Coverage
on: [pull_request, push]
on: [pull_request]
jobs:
test_and_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Libraries
run: |
bash zscripts/01-ubuntu-matplotlib-and-openblas.bash
- name: Install Rust
run: |
rustup toolchain install nightly --component llvm-tools-preview
rustup default nightly
sudo apt-get update -y && sudo apt-get install -y python3-matplotlib
- name: Run tests
run: |
cargo test -- --nocapture
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ categories = ["mathematics", "science"]
keywords = ["plot", "2D", "3D", "python", "matplotlib"]

[dependencies]
russell_lab = { path = "../russell/russell_lab", version = "0.5" }
44 changes: 5 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
## Contents

* [Introduction](#introduction)
* [Installation on Debian/Ubuntu/Linux](#installation)
* [Installation on macOS](#macos)
* [Installation](#installation)
* [Setting Cargo.toml](#cargo)
* [Examples](#examples)

Expand All @@ -22,44 +21,12 @@ See also the [examples directory](https://github.com/cpmech/plotpy/tree/main/exa

## <a name="installation"></a> Installation on Debian/Ubuntu/Linux

In addition to Matplotlib (version >= 3.3.0), this crate depends on `russell_lab`, which, in turn, depends on an efficient BLAS library such as [OpenBLAS](https://github.com/OpenMathLib/OpenBLAS) and [Intel MKL](https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-c/2023-2/overview.html). Thus, we have two options:
This crate needs Python3 and Matplotlib, of course.

1. Use the standard Debian packages based on OpenBLAS (default)
2. **(XOR)** Install Intel MKL, which includes LAPACK

Option 2 requires the following environment variable:

```bash
export RUSSELL_LAB_USE_INTEL_MKL=1
```

For convenience, you may use the scripts in the [zscripts](https://github.com/cpmech/plotpy/tree/main/zscripts) directory.

**1.** Install Matplotlib and use the standard Debian packages based on OpenBLAS:

```bash
bash zscripts/01-ubuntu-matplotlib-and-openblas.bash
```

**2.** Install Matplotlib and install Intel MKL:

```bash
bash zscripts/02-ubuntu-matplotlib-and-intel-mkl.bash
```

### <a name="macos"></a> Installation on macOS

In macOS, you may use [Homebrew](https://brew.sh/) (and pip) to install the dependencies:

```bash
brew install openblas lapack
pip3 install matplotlib
```

**Note** In macOS, we have to set the `LIBRARY_PATH` all the time when using `plotpy`:
On Debian/Ubuntu/Linux, run:

```bash
export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix)/opt/openblas/lib:$(brew --prefix)/opt/lapack/lib
sudo apt install python3-matplotlib
```

## <a name="cargo"></a> Setting Cargo.toml
Expand All @@ -78,8 +45,7 @@ plotpy = "*"
### Contour

```rust
use plotpy::{Contour, Plot, StrError};
use russell_lab::generate3d;
use plotpy::{generate3d, Contour, Plot, StrError};

fn main() -> Result<(), StrError> {
// generate (x,y,z) matrices
Expand Down
39 changes: 20 additions & 19 deletions figures/doc_canvas.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions figures/doc_canvas_polycurve.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 54fe7f0

Please sign in to comment.