openFPGALoader/INSTALL.md

99 lines
2.4 KiB
Markdown
Raw Normal View History

2021-08-03 21:02:36 +02:00
# Installing openFPGALoader
2020-01-23 14:48:44 +01:00
2021-08-03 21:02:36 +02:00
## Linux
### Arch Linux
openFPGALoader is available is the default repositories:
```
sudo pacman -S openfpgaloader
```
### Fedora
openFPGALoader is available as a Copr repository:
2020-11-04 20:29:28 +01:00
```
2021-08-03 21:02:36 +02:00
sudo dnf copr enable mobicarte/openFPGALoader
sudo dnf install openFPGALoader
2020-11-04 20:29:28 +01:00
```
2021-08-03 21:02:36 +02:00
### From source (Debian, Ubuntu)
2020-01-23 13:17:46 +01:00
2021-08-03 21:02:36 +02:00
This application uses **libftdi1**, so this library must be installed (and,
depending of the distribution, headers too)
```bash
apt-get install libftdi1-2 libftdi1-dev libhidapi-libusb0 libhidapi-dev libudev-dev cmake pkg-config make g++
2020-01-23 13:17:46 +01:00
```
2021-08-03 21:02:36 +02:00
**libudev-dev** is optional, may be replaced by **eudev-dev** or just not installed.
By default, **(e)udev** support is enabled (used to open a device by his */dev/xx*
node). If you don't want this option, use:
```bash
-DENABLE_UDEV=OFF
```
By default, **cmsisdap** support is enabled (used for colorlight I5).
If you don't want this option, use:
```bash
-DENABLE_CMSISDAP=OFF
```
Alternatively you can manually specify the location of **libusb** and **libftdi1**:
```bash
-DUSE_PKGCONFIG=OFF -DLIBUSB_LIBRARIES=<path_to_libusb> -DLIBFTDI_LIBRARIES=<path_to_libftdi> -DLIBFTDI_VERSION=<version> -DCMAKE_CXX_FLAGS="-I<libusb_include_dir> -I<libftdi1_include_dir>"
```
You may also need to add this if you see link errors between **libusb** and **pthread**:
```bash
-DLINK_CMAKE_THREADS=ON
```
To build the app:
```bash
2020-01-23 13:17:46 +01:00
$ mkdir build
$ cd build
$ cmake ../ # add -DBUILD_STATIC=ON to build a static version
# add -DENABLE_UDEV=OFF to disable udev support and -d /dev/xxx
2021-08-03 21:02:36 +02:00
# add -DENABLE_CMSISDAP=OFF to disable CMSIS DAP support
2020-01-23 13:17:46 +01:00
$ cmake --build .
or
$ make -j$(nproc)
2020-01-23 14:45:15 +01:00
```
2021-08-03 21:02:36 +02:00
To install
```bash
$ sudo make install
```
The default install path is `/usr/local`, to change it, use
`-DCMAKE_INSTALL_PREFIX=myInstallDir` in cmake invokation.
2020-11-04 20:28:37 +01:00
2021-08-03 21:02:36 +02:00
## Udev rules
2020-11-04 20:28:37 +01:00
2021-08-03 21:02:36 +02:00
By default, users have no access to converters. A rule file
(*99-openfpgaloader.rules*) for *udev* is provided at the root directory
of this repository. These rules set access right and group (*plugdev*)
when a converter is plugged.
2020-11-04 20:28:37 +01:00
2021-08-03 21:02:36 +02:00
```bash
$ sudo cp 99-openfpgaloader.rules /etc/udev/rules.d/
$ sudo udevadm control --reload-rules && sudo udevadm trigger # force udev to take new rule
$ sudo usermod -a YourUserName -G plugdev # add user to plugdev group
2020-11-04 20:28:37 +01:00
```
2021-08-03 21:02:36 +02:00
After that you need to unplug and replug your device.
## macOS
openFPGALoader is available as a [Homebrew](https://brew.sh) formula:
2020-11-04 20:28:37 +01:00
```
2021-08-03 21:02:36 +02:00
brew install openfpgaloader
```
## Windows