Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates Build Instructions to Adjust for Devcontainer Instructions and Remove Stale Information #1179

Merged
59 changes: 39 additions & 20 deletions docs/source/developer_guide/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,49 @@ git clone https://github.com/rapidsai/cuspatial.git $CUSPATIAL_HOME
2. clone the cuSpatial repo

```shell
conda env update --file conda/environments/all_cuda-118_arch-x86_64.yaml
conda env create -n cuspatial --file conda/environments/all_cuda-118_arch-x86_64.yaml
```

## Build and install cuSpatial
## Build cuSpatial

1. Compile and install
```shell
cd $CUSPATIAL_HOME && \
chmod +x ./build.sh && \
./build.sh
```
### From the cuSpatial Dev Container:

2. Run C++/Python test code
Execute `build-cuspatial-cpp to build `libcuspatial`. The following options may be added.
- `-DBUILD_TESTS=ON`: build `libcuspatial` unit tests.
- `-DBUILD_BENCHMARKS=ON`: build `libcuspatial` benchmarks.
- `-DCMAKE_BUILD_TYPE=Debug`: Create a Debug build of `libcuspatial` (default is Release).
In addition, `build-cuspatial-python` to build cuspatial cython components.

Some tests using inline data can be run directly, e.g.:
### From Bare Metal:

```shell
$CUSPATIAL_HOME/cpp/build/gtests/LEGACY_HAUSDORFF_TEST
$CUSPATIAL_HOME/cpp/build/gtests/POINT_IN_POLYGON_TEST
python python/cuspatial/cuspatial/tests/legacy/test_hausdorff_distance.py
python python/cuspatial/cuspatial/tests/test_pip.py
```
Compile libcuspatial (C++), cuspatial (cython) and C++ tests:
```shell
cd $CUSPATIAL_HOME && \
chmod +x ./build.sh && \
./build.sh libcuspatial cuspatial tests
isVoid marked this conversation as resolved.
Show resolved Hide resolved
```
Additionally, the following options are also commonly used:
- `benchmarks`: build libcuspatial benchmarks
- `clean`: remove all existing build artifacts and configuration
Execute `./build.sh -h` for full list of available options.

## Validate Installation with C++ and Python Tests

- C++ tests are located within the `$CUSPATIAL_HOME/cpp/build/gtests` directory.
isVoid marked this conversation as resolved.
Show resolved Hide resolved
- Python tests are located within the `$CUSPATIAL_HOME/python/cuspatial/cuspatial/tests` directory.

```note
Dev Container users:
To manage difference between branches and build types, the build directories are located at
`$CUSPATIAL_HOME/cpp/build/[release|debug]` depending on build type, and `$CUSPATIAL_HOME/cpp/build/latest`.
is a symbolic link to the most recent build directory.

Some other tests involve I/O from data files under `$CUSPATIAL_HOME/test_fixtures`.
For example, `$CUSPATIAL_HOME/cpp/build/gtests/SHAPEFILE_READER_TEST` requires three
pre-generated polygon shapefiles that contain 0, 1 and 2 polygons, respectively. They are available at
`$CUSPATIAL_HOME/test_fixtures/shapefiles` <br>
Execute C++ tests:
isVoid marked this conversation as resolved.
Show resolved Hide resolved
```shell
ninja -C $CUSPATIAL_HOME/cpp/build/ test
isVoid marked this conversation as resolved.
Show resolved Hide resolved
```

Execute Python tests:
```
pytest $CUSPATIAL_HOME/python/cuspatial/cuspatial/tests/
```
36 changes: 23 additions & 13 deletions docs/source/developer_guide/development_environment.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
# Creating a Development Environment

cuSpatial follows the RAPIDS release schedule, so developers are encouraged to develop
using the latest development branch of RAPIDS libraries that cuspatial depends on. Other
cuspatial dependencies can be found in `conda/environments/`.

Maintaining a local development environment can be an arduous task, especially after each
RAPIDS release. Most cuspatial developers today use
[rapids-compose](https://github.com/trxcllnt/rapids-compose) to setup their development environment.
It contains helpful scripts to build a RAPIDS development container image with the required
dependencies and RAPIDS libraries automatically fetched and correctly versioned. It also provides
script commands for simple building and testing of all RAPIDS libraries, including cuSpatial.
`rapids-compose` is the recommended way to set up your environment to develop for cuspatial.

For developers who would like to build from conda or from source, see the [build page](https://docs.rapids.ai/api/cuspatial/stable/developer_guide/build.html).
cuSpatial recommends using [Dev Containers](https://containers.dev/) to setup the development environment.
To setup Dev Containers for cuspatial, please refer to [documentation](https://github.com/rapidsai/cuspatial/tree/main/.devcontainer).

## From Bare Metal

RAPIDS keeps a single source of truth for library dependencies in `dependencies.yaml`. This file divides
isVoid marked this conversation as resolved.
Show resolved Hide resolved
the dependencies into several dimensions: building, testing, documentations, notebooks etc. As a developer,
you generally want to generate an environment recipe that includes everything that the library *may* use.

To do so, install the rapids-dependency-file-generator via pip:
```shell
pip install rapids-dependency-file-generator
isVoid marked this conversation as resolved.
Show resolved Hide resolved
```

And run under the repo root:
```shell
rapids-dependency-file-generator --clean
```

The environment recipe is generated within the `conda/environments` directory. To continue the next step of building,
see the [build page](https://docs.rapids.ai/api/cuspatial/stable/developer_guide/build.html).

For more information about how RAPIDS manages dependencies, see [README of rapids-dependency-file-generator repo](https://github.com/rapidsai/dependency-file-generator).
1 change: 0 additions & 1 deletion test_fixtures/shapefiles/empty_poly.cpg

This file was deleted.

Binary file removed test_fixtures/shapefiles/empty_poly.dbf
Binary file not shown.
Binary file removed test_fixtures/shapefiles/empty_poly.sbn
Binary file not shown.
Binary file removed test_fixtures/shapefiles/empty_poly.sbx
Binary file not shown.
Binary file removed test_fixtures/shapefiles/empty_poly.shp
Binary file not shown.
Binary file removed test_fixtures/shapefiles/empty_poly.shx
Binary file not shown.
1 change: 0 additions & 1 deletion test_fixtures/shapefiles/one_poly.cpg

This file was deleted.

Binary file removed test_fixtures/shapefiles/one_poly.dbf
Binary file not shown.
Binary file removed test_fixtures/shapefiles/one_poly.sbn
Binary file not shown.
Binary file removed test_fixtures/shapefiles/one_poly.sbx
Binary file not shown.
Binary file removed test_fixtures/shapefiles/one_poly.shp
Binary file not shown.
Binary file removed test_fixtures/shapefiles/one_poly.shx
Binary file not shown.
Binary file removed test_fixtures/shapefiles/two_polys.dbf
Binary file not shown.
Binary file removed test_fixtures/shapefiles/two_polys.sbn
Binary file not shown.
Binary file removed test_fixtures/shapefiles/two_polys.sbx
Binary file not shown.
Binary file removed test_fixtures/shapefiles/two_polys.shp
Binary file not shown.
Binary file removed test_fixtures/shapefiles/two_polys.shx
Binary file not shown.