Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaem authored Aug 22, 2024
1 parent ff1917e commit 2984e66
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ There are several implementations in the src directory:

In addition there is
* bin - An executable l2c that can run various tests
* results - Bash and Python files that can be used to recreate the figures in the paper above. They have obvious names, like table1.py. Note that the bash-files have precomputed data included and if you want to recompute something, then you need to open these files and modify at the top. For example, modify `rerun_fmm="no"` to `rerun_fmm="yes"` in order to rerun the results for the faster multipole method described in the paper.

# Installation
The code is set up to be compiled with the [meson](https://mesonbuild.com) build system. It should work by cloning this repository and then
The code is set up to be compiled with the [meson](https://mesonbuild.com) build system. If all dependencies are easily found, then it should work by cloning this repository and then

cd src
meson setup build
Expand All @@ -35,13 +36,32 @@ The installation can be tested with

meson test -C build

Note that the instructions above assume that all dependencies are found. For the C code there are only a few requirements besides meson itself, and that is basically BLAS and FFTW. For the rest see `l2cacc.yml` and `l2copenblas.yml` for two lists of dependencies, where the first makes use of the Accelerate framework and native compilers on a MacBook Pro M3. The `l2copenblas.yml` is more generic and pulls in everything from Conda, including compilers and OpenBlas. You can set up the environment using

conda env --create -f l2copenblas.yml
conda activate l2copenblas

You should then

cd src
./build_meson.sh
export PATH=$PWD/build-install/bin:$PATH
export LD_LIBRARY_PATH=$PWD/build-install/lib:$LD_LIBRARY_PATH

and you should then be ready to run the l2c executable, for example

l2c -N512 -d2

to run a L2C followed by a C2L, checking for accuracy.

# Codespace
Another simple way to test this code is to create a codespace. The environment.yml file in the root folder will then make sure that the codespace creates a conda environment with all necessary dependencies already built. Just press the codespace button and wait awhile for the environment to build. Then enable the environment and run some tests or test the executable `l2c`
Another simple way to test this code is to create a codespace. The l2copenblas.yml file in the root folder will then make sure that the codespace creates a conda environment with all necessary dependencies, including OpenBlas and FFTW, already installed. Just press the codespace button and wait awhile for the environment to build. Then enable the environment and run some tests or test the executable `l2c`

source activate ./venv
bash # Create new terminal that is set up to run l2c
cd src
meson setup build --prefix=$PWD/build-install --includedir=$CONDA_PREFIX/include --libdir=$CONDA_PREFIX/lib
meson install -C build
export PATH=$PWD/build-install/bin:$PATH
l2c -N1000 -d2 # runs a forward and backward transform and computes the error for an array of length 1000
meson test -C build # runs all the tests
cd results
python table1.py # Create Table 1 in the paper
python figure3.py # Create Figure 3 in the paper
etc..

0 comments on commit 2984e66

Please sign in to comment.