Skip to content

Commit

Permalink
Doc: add development setup documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
wirew0rm committed Jul 12, 2024
1 parent e5f466f commit 96868b4
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
53 changes: 53 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# GNURadio 4.0 Development Environment

## Getting the source

Get the source from the GitHub Repository:
```bash
git clone [email protected]:fair-acc/gnuradio4.git
```

## Building
### Docker CLI
To just compile GNURadio4 without installing any dependencies you can just use the Docker image which is also used by our CI builds. The snippet below uses `docker run` to start the container with the current directory mapped into the container with the correct user and group IDs.
It then compiles the project and runs the testsuite.
Note that while the binaries inside of `./build` can be accessed on the host system, they are linked against the libraries of the container and will most probably not run on the host system.

```bash
me@host$ cd gnuradio4
me@host$ docker run \
--user `id -u`:`id -g` \
--volume="/etc/group:/etc/group:ro" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/shadow:/etc/shadow:ro" \
--workdir=/build --volume `pwd`:/build -it \
ghcr.io/fair-acc/gr4-build-container bash

me@aba123ef$ # export CXX=c++ # uncomment to use clang
me@aba123ef$ cmake -S . -B build
me@aba123ef$ cmake --build build
me@aba123ef$ cd build && ctest .
```
### Docker IDE
Some IDEs provide a simple way to specify a docker container to use for building and executing a project. For example in JetBrains CLion you can set this up in `Settings->Build,Execution,Deployment->Toolchains->[+]->Docker`, leaving everything as the default except for setting `Image` to `ghcr.io/fair-acc/gr4-build-container`.
By default this will use the gcc-14 compiler included in the image, by setting `CXX` to `clang++-18` you can also use clang.

### Native
To be able to natively compile some prerequisites have to be installed:
- gcc >= 13 and/or clang >= 17
- cmake >= 3.25.0
- ninja (or GNU make)
- optional for python block support: python3
- optional for soapy (limesdr,rtlsdr) blocks: soapysdr
- optional for compiling to webassembly: emscripten >= 3.1.50

To apply the project's formatting rules, you'll also need the correct formatters, `clang-format-18` and `cmake-format`. With these installed you can use the scripts in the repository to reformat your changes. Otherwise

Once these are installed, you should be able to just compile and run GNURadio4:

```bash
me@host$ cd gnuradio4
me@host$ cmake -S . -B build
me@host$ cmake --build build
me@host$ cd build && ctest .

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ led to adoption in hobbyist, academic, and commercial environments. GNU Radio ha
found use in software-defined radio, digital communications, nuclear physics, high-
energy particle physics, astrophysics, radio astronomy and more!

## Development

If you want to start working on the GNURadio 4.0 source, the [DEVELOPMENT.md](DEVELOPMENT.md) file describes how to set up a local development environment.

## Helpful Links

* [GNU Radio Website](https://gnuradio.org)
Expand Down

0 comments on commit 96868b4

Please sign in to comment.