remove trailing spaces
[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 -b 1.2.1 https://github.com/YosysHQ/prjtrellis
19 git clone --recursive https://github.com/YosysHQ/nextpnr
20
21 # prjtrellis
22 cd prjtrellis
23 cd libtrellis
24 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/libtrellis .
25 make -j$(nproc)
26 make install
27 cd ../..
28
29 # nextpnr, use a specific version for now
30 cd nextpnr
31 git checkout e069b3bc
32 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nextpnr-ecp5 \
33 -DBUILD_PYTHON=OFF \
34 -DBUILD_GUI=OFF \
35 -DARCH=ecp5 \
36 -DTRELLIS_INSTALL_PREFIX=/usr/local/libtrellis .
37 make -j$(nproc)
38 make install
39
40 cd /home/$SUDO_USER/src/nextpnr
41 chown -R $SUDO_USER .
42 chgrp -R $SUDO_USER .
43