|
1 | | -# Building Open RV on Rocky 8 |
| 1 | +# Building OpenRV on Rocky Linux 8.7 |
2 | 2 |
|
3 | | -## Summary |
| 3 | +## Manual Build |
4 | 4 |
|
5 | | -1. [Install Basics](#install-basics) |
6 | | -2. [Install tools and build dependencies](#install-tools-and-build-dependencies) |
7 | | -3. [Install CMake](#install-cmake) |
8 | | -4. [Install Qt5](#install-qt) |
9 | | -5. [Build Open RV](build_rocky8_openrv) |
10 | | - 1. [Building from command line](building_rocky8_from_command_line) |
11 | | - 2. [Building with Docker](building_rocky8_with_docker) |
| 5 | +1. [Install Dependencies](#install-dependencies) |
| 6 | +2. [Install Qt5](#install-qt5) |
| 7 | +3. [Build and Install OpenRV](#build-and-install-openrv) |
12 | 8 |
|
13 | | -## Install Basics |
| 9 | +### Install Dependencies |
14 | 10 |
|
15 | 11 | Make sure we have some basic tools available on the workstation: |
16 | 12 |
|
17 | | -```bash |
18 | | -sudo dnf install wget git |
| 13 | +```shell |
| 14 | +sudo dnf install wget git cmake |
19 | 15 | ``` |
20 | 16 |
|
21 | | -## Install tools and build dependencies |
22 | | - |
23 | 17 | Some of the build dependencies come from outside the main AppStream repo. So first we will enable those and then install our dependencies: |
24 | 18 |
|
25 | | -```bash |
| 19 | +```shell |
26 | 20 | sudo dnf install epel-release |
27 | 21 | sudo dnf config-manager --set-enabled powertools |
28 | | -sudo dnf install alsa-lib-devel autoconf automake avahi-compat-libdns_sd-devel bison bzip2-devel cmake-gui curl-devel flex gcc gcc-c++ libXcomposite libXi-devel libaio-devel libffi-devel nasm ncurses-devel nss libtool libxkbcommon libXcomposite libXdamage libXrandr libXtst libXcursor mesa-libOSMesa mesa-libOSMesa-devel meson ninja-build openssl-devel patch pulseaudio-libs pulseaudio-libs-glib2 ocl-icd ocl-icd-devel opencl-headers python3 python3-devel qt5-qtbase-devel readline-devel sqlite-devel tcl-devel tcsh tk-devel yasm zip zlib-devel |
| 22 | +sudo dnf install alsa-lib-devel autoconf automake avahi-compat-libdns_sd-devel bison bzip2-devel cmake-gui curl-devel flex gcc gcc-c++ libXcomposite libXi-devel libaio-devel libffi-devel nasm ncurses-devel nss libtool libxkbcommon libXcomposite libXdamage libXrandr libXtst libXcursor mesa-libOSMesa mesa-libOSMesa-devel meson ninja-build openssl-devel patch pulseaudio-libs pulseaudio-libs-glib2 ocl-icd ocl-icd-devel opencl-headers python3 python3-devel readline-devel sqlite-devel tcl-devel tcsh tk-devel yasm zip zlib-devel |
29 | 23 | ``` |
30 | 24 |
|
31 | | -You can disable the devel repo afterwards since dnf will warn about it: |
32 | | -```bash |
33 | | -sudo dnf config-manager --set-disabled devel |
34 | | -``` |
35 | | - |
36 | | -### GLU |
37 | | - |
38 | 25 | You may or may not have libGLU on your system depending on your graphics driver setup. To know you can check if you have the lib /usr/lib64/libGLU.so.1. If it's there you can skip this step, there's nothing further to do in this section. If not, you can install the graphics drivers for your system. As as last resort, you can install a software (mesa) libGLU version, but you may not have ideal performance with this option. To do so: |
39 | 26 |
|
40 | | -```bash |
| 27 | +```shell |
41 | 28 | sudo dnf install mesa-libGLU mesa-libGLU-devel |
42 | 29 | ``` |
43 | 30 |
|
44 | | -### Install the python requirements |
45 | | - |
46 | | -Some of the RV build scripts requires extra python packages. They can be installed using the requirements.txt at the root of the repository. |
47 | | - |
48 | | -```bash |
49 | | -python3 -m pip install -r requirements.txt |
| 31 | +Ensure that your `python3` packages are installed and up to date: |
| 32 | +```shell |
| 33 | +dnf install -y python3-setuptools |
| 34 | +python3 -m pip install --upgrade pip setuptools wheel |
50 | 35 | ``` |
51 | 36 |
|
52 | | -## Install CMake |
53 | | - |
54 | | -You need CMake version 3.27+ to build RV. The dnf-installable version is not quite recent enough, you'll to build and install CMake from sources. |
55 | | - |
56 | | -```bash |
57 | | -wget https://github.com/Kitware/CMake/releases/download/v3.30.3/cmake-3.30.3.tar.gz |
58 | | -tar -zxvf cmake-3.30.3.tar.gz |
59 | | -cd cmake-3.30.3 |
60 | | -./bootstrap --parallel=32 # 32 or whatever your machine allows |
61 | | -make -j 32 # 32 or whatever your machine allows |
62 | | -sudo make install |
63 | | - |
64 | | -cmake --version # confirm the version of your newly installed version of CMake |
65 | | -cmake version3.30.3 |
| 37 | +Ensure that you have a symlink to `python3` at `/usr/bin/python`. |
| 38 | +```shell |
| 39 | +ln -sf /usr/bin/python3 /usr/bin/python |
66 | 40 | ``` |
67 | 41 |
|
68 | | -## Install Qt |
| 42 | +### Install Qt5 |
69 | 43 |
|
70 | 44 | Download the last version of Qt 5.15.x that you can get using the online installer on the [Qt page](https://www.qt.io/download-open-source). Logs, Android, iOS and WebAssembly are not required to build OpenRV. |
71 | 45 |
|
72 | 46 | WARNING: If you fetch Qt from another source, make sure to build it with SSL support, that it contains everything required to build PySide2, and that the file structure is similar to the official package. |
73 | 47 |
|
74 | | - |
75 | | -(build_rocky8_openrv)= |
76 | | -## Build Open RV |
77 | | - |
78 | | -(building_rocky8_from_command_line)= |
79 | | -### Building from command line |
80 | | - |
81 | | -(build_rocky8_openrv1)= |
82 | | -#### Before executing any commands |
83 | | - |
84 | | -To maximize your chances of successfully building Open RV, you must: |
85 | | -- Fully update your code base to the latest version (or the version you want to use) with a command like `git pull`. |
86 | | -- Fix all conflicts due to updating the code. |
87 | | -- Revisit all modified files to ensure they aren't using old code that changed during the update such as when the Visual Studio version changes. |
88 | | - |
89 | | -(build_rocky8_openrv2)= |
90 | | -#### Get Open RV source code |
91 | | - |
92 | | -Clone the Open RV repository and change directory into the newly created folder. Typically, the command would be: |
93 | | - |
94 | | -Using a password-protected SSH key: |
95 | 48 | ```shell |
96 | | -git clone --recursive [email protected]:AcademySoftwareFoundation/OpenRV.git |
97 | | -cd OpenRV |
| 49 | +./qt-unified-linux-x64-4.6.1-online.run --email "<email>" --password "<password>" --platform minimal --confirm-command --accept-licenses --accept-obligations --accept-messages install qt.qt5.5152.qtpdf qt.qt5.5152.qtpurchasing qt.qt5.5152.qtvirtualkeyboard qt.qt5.5152.qtquicktimeline qt.qt5.5152.qtlottie qt.qt5.5152.debug_info qt.qt5.5152.qtscript qt.qt5.5152.qtcharts qt.qt5.5152.qtwebengine qt.qt5.5152.qtwebglplugin qt.qt5.5152.qtnetworkauth qt.qt5.5152.qtwaylandcompositor qt.qt5.5152.qtdatavis3d qt.qt5.5152.logs qt.qt5.5152 qt.qt5.5152.src qt.qt5.5152.gcc_64 qt.qt5.5152.qtquick3d |
98 | 50 | ``` |
99 | 51 |
|
100 | | -Using the web URL: |
| 52 | +### Build and Install OpenRV |
| 53 | + |
| 54 | +Get the repository: |
101 | 55 | ```shell |
102 | 56 | git clone --recursive https://github.com/AcademySoftwareFoundation/OpenRV.git |
103 | | -cd OpenRV |
104 | 57 | ``` |
105 | 58 |
|
106 | | -(build_rocky8_openrv3)= |
107 | | -#### Load aliases for Open RV |
108 | | - |
109 | | -From the Open RV directory: |
| 59 | +Some of the RV build scripts requires extra python packages. |
| 60 | +They can be installed using the requirements.txt at the root of the repository. |
110 | 61 | ```shell |
111 | | -source rvcmds.sh |
| 62 | +python3 -m pip install -r requirements.txt |
112 | 63 | ``` |
113 | 64 |
|
114 | | -(build_rocky8_openrv4)= |
115 | | -#### Install Python dependencies |
116 | | - |
117 | | -````{note} |
118 | | -This section needs to be done only one time when a fresh Open RV repository is cloned. |
119 | | -The first time the `rvsetup` is executed, it will create a Python virtual environment in the current directory under `.venv`. |
120 | | -```` |
121 | | - |
122 | | -From the Open RV directory, the following command will download and install the Python dependencies. |
| 65 | +Set the QT_HOME to the install location, build and install: |
123 | 66 | ```shell |
124 | | -rvsetup |
125 | | -``` |
126 | | - |
127 | | -(build_rocky8_openrv5)= |
128 | | -#### Configure the project |
129 | | - |
130 | | -From the Open RV directory, the following command will configure CMake for the build: |
131 | | - |
132 | | -````{tabs} |
133 | | -```{code-tab} bash Release |
134 | | -rvcfg |
135 | | -``` |
136 | | -```{code-tab} bash Debug |
137 | | -rvcfgd |
138 | | -``` |
139 | | -```` |
140 | | - |
141 | | -(build_rocky8_openrv6)= |
142 | | -#### Build the dependencies |
143 | | - |
144 | | -From the Open RV directory, the following command will build the dependencies: |
145 | | - |
146 | | -````{tabs} |
147 | | -```{code-tab} bash Release |
148 | | -rvbuildt dependencies |
149 | | -``` |
150 | | -```{code-tab} bash Debug |
151 | | -rvbuildtd dependencies |
152 | | -``` |
153 | | -```` |
154 | | - |
155 | | -(build_rocky8_openrv7)= |
156 | | -#### Build the main executable |
157 | | - |
158 | | -From the Open RV directory, the following command will build the main executable: |
159 | | - |
160 | | -````{tabs} |
161 | | -```{code-tab} bash Release |
162 | | -rvbuildt main_executable |
163 | | -``` |
164 | | -```{code-tab} bash Debug |
165 | | -rvbuildtd main_executable |
166 | | -``` |
167 | | -```` |
168 | | - |
169 | | -(build_rocky8_openrv8)= |
170 | | -#### Opening Open RV executable |
171 | | - |
172 | | -````{tabs} |
173 | | -```{tab} Release |
174 | | -Once the build is completed, the Open RV application can be found in the Open RV directory under `_build/stage/app/bin/rv`. |
175 | | -``` |
176 | | -```{tab} Debug |
177 | | -Once the build is completed, the Open RV application can be found in the Open RV directory under `_build_debug/stage/app/bin/rv``. |
178 | | -``` |
179 | | -```` |
180 | | - |
181 | | -(building_rocky8_with_docker)= |
182 | | -### Building with Docker (Optional) |
183 | | - |
184 | | -To build Open RV using Docker, utilize the provided Dockerfile, which includes all required dependencies. |
185 | | - |
186 | | -(build_rocky8_image)= |
187 | | -#### Build the image |
188 | | -```bash |
189 | | -cd dockerfiles |
190 | | -docker build -t openrv-rocky8 -f Dockerfile.Linux-Rocky8 . |
191 | | -``` |
192 | | - |
193 | | -(run_rocky8_image)= |
194 | | -#### Create the container |
195 | | -```bash |
196 | | -docker run -d openrv-rocky8 /bin/bash -c "sleep infinity" |
197 | | -``` |
198 | | - |
199 | | -(go_into_the_rocky8_container)= |
200 | | -#### Go into the container |
201 | | -```bash |
202 | | -# Lookup the container id for openrv-rocky8 |
203 | | -docker container ls |
204 | | - |
205 | | -# Use the container id to go into it. |
206 | | -# e.g. |
207 | | -# CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
208 | | -# 59e7878debc4 openrv-rocky8 "/bin/bash -c 'sleep…" 21 minutes ago Up 21 minutes crazy_pare |
209 | | -# In this example, the <container id> would be 59e7878debc4. |
210 | | -docker container exec -it <container id> /bin/bash |
| 67 | +export QT_HOME=/opt/Qt/5.15.2/gcc_64 |
| 68 | +source rvcmds.sh |
| 69 | +rvbootstrap |
| 70 | +rvinst |
| 71 | +``` |
| 72 | + |
| 73 | +## Docker Build |
| 74 | + |
| 75 | +OpenRV can also be built inside a Docker Container. |
| 76 | + |
| 77 | +1. [Build the Image](#build-the-image) |
| 78 | +2. [Extract the Installation Files](#extract-the-installation-files) |
| 79 | +3. [Cleanup](#cleanup) |
| 80 | + |
| 81 | +### Build the Image |
| 82 | + |
| 83 | +Here's a `Dockerfile` that installs all dependencies, builds and installs OpenRV from source. |
| 84 | +> Note: You will need an email and password for Qt and you might have to update the url to the Qt5 online installer. |
| 85 | +
|
| 86 | +```dockerfile |
| 87 | +FROM rockylinux:8.7 |
| 88 | + |
| 89 | +# Install dependencies |
| 90 | +RUN dnf install -y epel-release |
| 91 | +RUN dnf config-manager --set-enabled powertools |
| 92 | +RUN dnf install -y alsa-lib-devel autoconf automake avahi-compat-libdns_sd-devel bison \ |
| 93 | + bzip2-devel cmake-gui curl-devel flex gcc gcc-c++ libXcomposite libXi-devel \ |
| 94 | + libaio-devel libffi-devel nasm ncurses-devel nss libtool libxkbcommon libXcomposite \ |
| 95 | + libXdamage libXrandr libXtst libXcursor mesa-libOSMesa mesa-libOSMesa-devel meson \ |
| 96 | + ninja-build openssl-devel patch pulseaudio-libs pulseaudio-libs-glib2 ocl-icd \ |
| 97 | + ocl-icd-devel opencl-headers qt5-qtbase-devel readline-devel \ |
| 98 | + sqlite-devel tcl-devel tcsh tk-devel yasm zip zlib-devel |
| 99 | +RUN dnf install -y mesa-libGLU mesa-libGLU-devel |
| 100 | +RUN dnf install -y cmake git wget |
| 101 | + |
| 102 | +# Note: /usr/bin/python needs to exist for OpenRV to build correctly. |
| 103 | +RUN dnf install -y python3-setuptools && \ |
| 104 | + python3 -m pip install --upgrade pip setuptools wheel && \ |
| 105 | + ln -sf /usr/bin/python3 /usr/bin/python |
| 106 | + |
| 107 | +# Install Qt5 |
| 108 | +ARG QT_EMAIL |
| 109 | +ARG QT_PASSWORD |
| 110 | +RUN wget https://d13lb3tujbc8s0.cloudfront.net/onlineinstallers/qt-unified-linux-x64-4.6.1-online.run && \ |
| 111 | + chmod a+x qt-unified-linux-x64-4.6.1-online.run && \ |
| 112 | + ./qt-unified-linux-x64-4.6.1-online.run \ |
| 113 | + --email "$QT_EMAIL" --password "$QT_PASSWORD" --platform minimal \ |
| 114 | + --confirm-command --accept-licenses --accept-obligations --accept-messages \ |
| 115 | + install qt.qt5.5152.qtpdf qt.qt5.5152.qtpurchasing qt.qt5.5152.qtvirtualkeyboard \ |
| 116 | + qt.qt5.5152.qtquicktimeline qt.qt5.5152.qtlottie qt.qt5.5152.debug_info \ |
| 117 | + qt.qt5.5152.qtscript qt.qt5.5152.qtcharts qt.qt5.5152.qtwebengine \ |
| 118 | + qt.qt5.5152.qtwebglplugin qt.qt5.5152.qtnetworkauth \ |
| 119 | + qt.qt5.5152.qtwaylandcompositor qt.qt5.5152.qtdatavis3d qt.qt5.5152.logs \ |
| 120 | + qt.qt5.5152 qt.qt5.5152.src qt.qt5.5152.gcc_64 qt.qt5.5152.qtquick3d |
| 121 | + |
| 122 | +# Get OpenRV Git Repo |
| 123 | +RUN git clone --recursive https://github.com/AcademySoftwareFoundation/OpenRV.git |
| 124 | +RUN python3 -m pip install -r /OpenRV/requirements.txt |
| 125 | + |
| 126 | +# Build and Install OpenRV |
| 127 | +WORKDIR /OpenRV |
| 128 | +# Note: Aliases only work in interactive shells. Use bash script with expand_aliases to |
| 129 | +# use commands set in rvcmds.sh |
| 130 | +RUN echo "#!/bin/bash" > install.sh && \ |
| 131 | + echo "set -e" >> install.sh && \ |
| 132 | + echo "shopt -s expand_aliases" >> install.sh && \ |
| 133 | + echo "export QT_HOME=/opt/Qt/5.15.2/gcc_64" >> install.sh && \ |
| 134 | + echo "source /OpenRV/rvcmds.sh" >> install.sh && \ |
| 135 | + echo "rvbootstrap" >> install.sh && \ |
| 136 | + echo "rvinst" >> install.sh |
| 137 | +RUN bash ./install.sh |
| 138 | +``` |
| 139 | + |
| 140 | +### Extract the Installation Files |
| 141 | + |
| 142 | +Next mount the image and copy the `_install` directory from it: |
| 143 | +```shell |
| 144 | +docker cp $(docker create --name temp_container openrv):/OpenRV/_install install && docker rm temp_container |
211 | 145 | ``` |
212 | 146 |
|
213 | | -Once you are into the container, you can follow the [standard process](build_rocky8_openrv2). |
214 | | - |
215 | | -#### Copy the stage folder outside of the container |
216 | | - |
217 | | -If you are on a host that is compatible with Rocky Linux 8, you can copy the stage folder outside of the container and |
218 | | -execute Open RV. |
219 | | - |
220 | | -Container id is the same as the one used in the step [Go into the container](go_into_the_rocky8_container). |
| 147 | +### Cleanup |
221 | 148 |
|
| 149 | +To clean up, simply remove the image: |
222 | 150 | ```bash |
223 | | -docker cp <container id>:/home/rv/OpenRV/_build/stage ./openrv_stage |
| 151 | +docker image rm openrv |
224 | 152 | ``` |
0 commit comments