disable python and gui build of nextpnr-ecp5
[dev-env-setup.git] / nextpnr-ecp5-install
1 #!/bin/bash
2 if [ "$EUID" -ne 0 ]
3 then echo "Please run as root using 'sudo bash'"
4 exit
5 fi
6
7 apt-get update -y
8 apt-get install -y python3 python3-dev clang cmake libboost-dev \
9 libboost-filesystem-dev libboost-thread-dev \
10 libboost-program-options-dev libboost-iostreams-dev \
11 openocd libeigen3-dev
12
13 # change into $SUDO_USER home directory
14 cd /home/$SUDO_USER
15 mkdir -p src/nextpnr
16 cd src/nextpnr
17
18 git clone --recursive https://github.com/YosysHQ/prjtrellis
19 git clone --recursive https://github.com/YosysHQ/nextpnr
20
21 cd prjtrellis
22 cd libtrellis
23 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/libtrellis .
24 make -j$(nproc)
25 make install
26 cd ../..
27
28 cd nextpnr
29 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nextpnr-ecp5 \
30 -DBUILD_PYTHON=OFF \
31 -DBUILD_GUI=OFF \
32 -DARCH=ecp5 \
33 -DTRELLIS_INSTALL_PREFIX=/usr/local/libtrellis .
34 make -j$(nproc)
35 make install
36
37 cd /home/$SUDO_USER/src/nextpnr
38 chown -R $SUDO_USER .
39 chgrp -R $SUDO_USER .
40