Skip to content

Commit

Permalink
Doc updates:
Browse files Browse the repository at this point in the history
* update developer docs to remove mention of using setup.py
* update docs about building wheels
  • Loading branch information
molpopgen committed Apr 8, 2024
1 parent bb3c615 commit ad97c91
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 10 deletions.
24 changes: 16 additions & 8 deletions doc/misc/developersguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,18 @@ python3 -m pip install -r requirements/development.txt
It may be useful to add `--upgrade --no-cache-dir` to the above command.
```

### Building the code
### Building the code for development

To generate an "editable" (in-place) installation for development work:

```sh
git submodule init
git submodule update
python3 setup.py build_ext -i
python -m pip install -e .
```

The above command is equivalent to the deprecated `python setup.py build_ext -i`.

## Installing from a clone of the source repository

Install the `build` module if you have not:
Expand Down Expand Up @@ -88,6 +92,8 @@ pip install fwdpy11 --no-binary

## Running the Python test suite

After completing an editable build (see above):

```sh
python3 -p pytest tests -n 6
```
Expand Down Expand Up @@ -154,7 +160,7 @@ To generate this file, execute the following steps from the root of the source c
```sh
cmake -Bccommands . -DCMAKE_EXPORT_COMPILE_COMMANDS=1
mv ccommands/compile_commands.json ..
rm -rf ccomands
rm -rf ccommands
```

Now, language servers supporting `clangd` will have nice error checking and code completion for the C++ code!
Expand Down Expand Up @@ -185,7 +191,8 @@ To override these defaults:

```{code-block} bash
python setup.py build_ext -i --enable-profiling
cmake -DENABLE_PROFILING=On -Bbuild -S.
cmake --build build
```

Expand All @@ -206,7 +213,8 @@ To disable it:

```{code-block} bash
python setup.py build_ext -i --disable_lto
cmake -DDISALBE_LTO=On -Bbuild -S.
cmake --build build
```

Expand All @@ -219,8 +227,8 @@ This option only affects the main package and not the unit tests.
### Enabling debugging symbols in the C++ code

```{code-block} bash
python setup.py build_ext -i --debug
cmake -DCMAKE_BUILD_TYPE=Debug -Bbuild -S.
cmake --build build
```

Expand Down Expand Up @@ -260,7 +268,7 @@ Use the following flags to enable an "extreme" debugging mode of the C++ standar
```{code-block} bash
CXXFLAGS="-D_GLIBCXX_CONCEPT_CHECKS -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC" \
CPPFLAGS="-D_GLIBCXX_CONCEPT_CHECKS -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC" python3 setup.py build_ext -i
CPPFLAGS="-D_GLIBCXX_CONCEPT_CHECKS -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC" python3 -m pip install -e .
```

Expand Down
36 changes: 34 additions & 2 deletions doc/pages/deploymenttools.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,42 @@ If you have a script `$HOME/tmp/foo.py`, you can run it via:
docker run --rm -v $HOME/tmp:/app IMAGE_NAME /bin/bash -c ". /venv/bin/activate; python /app/foo.py"
```

## Linux wheel building
## Wheel building

### Using `build`

The simplest method is to use `build` to build a wheel for your local system:

```{code-block} bash
python -m pip install build
python -m build -w .
```

This approach requires that rust and the GNU Scientific Library (GSL) are installed on your system.

### Using `cibuildwheel`

```{code-block} bash
python -m pip install cibuildwheel
python -m cibuildwheel
```

This will build wheels for the Python versions declared in `pyproject.toml` in the root
of the `fwdpy11` source repo.
We use this method to automatically generate wheels for each release.

On Linux, the work is done in a Docker container.
Therefore, your system must be configured to allow your user to use `docker`.
(`podman` may also be used via `podman-docker`.)

On macos, you will need to have the GSL and rust installed using whatever method you prefer,
so long as the installs are visible to the `fwdpy11` build system.


### Alternate method for Linux

The directory `deployment/linux_wheels` defines a `Docker` work flow to build binary wheels on Linux.
These scripts are what we use to build wheels for each release.
These scripts were used to build wheels for each release but were recently replaced with `cibuildwheel` (see above).
They may also be used to make wheels for development versions on a local machine.

From the `root` of the `fwdpy11` repository.
Expand Down

0 comments on commit ad97c91

Please sign in to comment.