Project

General

Profile

Preparing a Linux machine for Bilder » History » Version 88

Ted Sume, 01/29/2025 12:45 PM

1 1 Redmine Admin
# Preparing a Linux machine for Bilder
2
3 15 John Cary
__If all you need is python and sphinx__ (e.g., for builds of documentation), then you need only
4 1 Redmine Admin
5 15 John Cary
* CMake (probably present)
6
* Python (probably present)
7 16 Ted Sume
* Python-dev or Python-devel (on Fedora)
8 15 John Cary
* Latex as installed below
9 53 John Cary
* Perl-dev or Perl-devel with perl-ExtUtils-Embed
10 1 Redmine Admin
11 15 John Cary
and then you can add the arguments,  -W python,cmake, and your installed Python and CMake will be used if your path is correct.
12
13 82 Ted Sume
## Required Packages. 
14
Rocky Linux 8
15
Copy/Paste to execute
16 1 Redmine Admin
17 82 Ted Sume
~~~~~~
18 83 Ted Sume
dnf install --enablerepo=powertools alsa-lib-devel bison cups-devel dbus-devel flex fontconfig-devel gperf  libcap-devel libevent-devel libffi-devel \
19
libGLU-devel libgcrypt-devel libglvnd-devel libicu-devel libpciaccess-devel   libwebp-devel libXcomposite-devel libXcursor-devel libXi-devel \
20
libxkbcommon-devel  libXrandr-devel libxslt-devel libXt-devel libXtst-devel mesa-libEGL-devel nss-devel numactl-devel  patch pciutils-devel \
21
pulseaudio-libs-devel readline-devel re2c ruby systemd-devel tcl-devel tk-devel lapack-devel libsndfile-devel libstdc++-static libxkbcommon-x11-devel \
22
opus-devel re2c git perl-interpreter dmidecode hdparm libcurl-devel m4 perl-Time-HiRes valgrind rsync bzip2 make wget tar unzip gcc-c++ gcc gcc-gfortran \
23
kernel-devel kernel-headers kernel subversion gd-devel tmux bc java-1.8.0-openjdk.x86_64 rdma-core libibverbs glibc-langpack-de xauth git-lfs glx-utils \
24 88 Ted Sume
unzip rdma-core-devel xcb-util-wm-devel mesa-libgbm-devel libdrm-devel librsvg2-devel jasper-devel gtk3-devel libmng-devel libinput-devel mtdev-devel \
25
xcb-util-image-devel xcb-util-devel xcb-util-keysyms-devel  xcb-util-renderutil-devel
26 82 Ted Sume
~~~~~~
27 1 Redmine Admin
28 85 Ted Sume
~~~~~~
29
dnf remove libidn2-devel
30
~~~~~~
31 22 John Cary
## GCC
32 1 Redmine Admin
33
Below are the instructions for building gcc
34
35 28 John Cary
### Get and unpack the source package
36 1 Redmine Admin
37
~~~~~~
38 78 John Cary
export GCCVER=11.2.0
39 1 Redmine Admin
wget ftp://ftp.gnu.org/gnu/gcc/gcc-${GCCVER}/gcc-${GCCVER}.tar.xz
40 33 Jonathan Smith
tar xf gcc-${GCCVER}.tar.xz && cd gcc-${GCCVER}
41 1 Redmine Admin
~~~~~~
42
43 28 John Cary
### Patch as needed
44
45 77 John Cary
No patching needs known as of now.
46 28 John Cary
47 1 Redmine Admin
### Build
48
49 72 John Cary
Define GCC_INSTS_DIR to be your tarball installation directory, e.g.,
50 1 Redmine Admin
51
~~~~~~
52 72 John Cary
export GCC_INSTS_DIR=/contrib
53 1 Redmine Admin
~~~~~~
54
55 72 John Cary
Usually GCC_INSTS_DIR=/contrib, but if one does not have root access, one has to put this in a user area. If one does have root access, one should execute the following commands:
56 1 Redmine Admin
57
~~~~~~
58
mkdir /internal /contrib /volatile
59
chmod 775 /internal /contrib /volatile
60
~~~~~~
61
62
Unpack gcc, go into the gcc source directory, and build according to the instructions below.
63
64
**gcc:**
65
66 78 John Cary
You may need to set some addition options, e.g., 
67
* ```ADDLOPTS=--with-cpu=power9``` on linuxppc64le
68
* ```ADDLOPTS=--disable-multilib``` if 32bit glibc libraries are not installed.
69 68 John Cary
70 22 John Cary
~~~~~~
71 1 Redmine Admin
./contrib/download_prerequisites
72
mkdir build && cd build
73 72 John Cary
../configure --prefix=$GCC_INSTS_DIR/gcc-${GCCVER} --enable-languages=c,c++,fortran --with-pic $ADDLOPTS
74
env LD_RUN_PATH=$GCC_INSTS_DIR/gcc-${GCCVER}/lib64 make -j 4
75 1 Redmine Admin
make install
76 75 John Cary
chmod -R a+rX $GCC_INSTS_DIR/gcc-${GCCVER} # Perms issues seen in 9.4.0: 9.4.0/include-fixed/openssl/bn.h
77 1 Redmine Admin
# Alias as desired.
78 72 John Cary
mkdir -p $GCC_INSTS_DIR/bin && cd $GCC_INSTS_DIR/bin
79
ln -s $GCC_INSTS_DIR/gcc-${GCCVER}/bin/{c,g}* .
80 1 Redmine Admin
~~~~~~
81
82
### Fix permissions
83
84
~~~~~~
85 80 John Cary
chown -R root:root $GCC_INSTS_DIR/gcc-${GCCVER}
86 72 John Cary
chmod -R g+rwX $GCC_INSTS_DIR/gcc-${GCCVER}
87 49 Nathan Neri
chmod -R o+rX $GCC_INSTS_DIR/gcc-${GCCVER}
88 54 Nathan Neri
find $GCC_INSTS_DIR/gcc-${GCCVER} -type d -exec chmod g+rs '{}' \;
89
~~~~~~
90
91
92
93 49 Nathan Neri
94 1 Redmine Admin
## LaTeX
95
96 46 John Cary
LaTeX is needed for building documentation using Sphinx.
97 1 Redmine Admin
98 46 John Cary
Bilder prefers the texlive-latex package. For gui usage, see texworks: http://www.tug.org/texworks
99
100 1 Redmine Admin
If you cannot install in the system area, you can download
101
102
~~~~~~
103
wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
104
tar xzf install-tl-unx.tar.gz
105 76 John Cary
cd install-tl-20230412 (date might be different)
106 1 Redmine Admin
./install-tl -no-gui
107
~~~~~~
108
109
This is now interactive, so set
110 11 Matt Copper
 
111 10 Matt Copper
* Set scheme to basic
112
** To do this type 'S' and hit enter.
113
** Then enter 'd' to set the scheme to basic.
114
** Type 'R' and hit enter to return to the main configuration page.
115 1 Redmine Admin
116 10 Matt Copper
* Set TEXDIR = $CONTRIB_DIR/texlive
117
** Start by typing 'D' and hit enter.
118
** Then enter '1' to change TEXDIR.
119
** Type $CONTRIB_DIR/texlive and hit return.
120
** To return to configuration type 'R' and return.
121 1 Redmine Admin
122 10 Matt Copper
* Set page size to Letter size
123
** Type 'O' and hit enter.
124
** Enter 'P'
125
** Return to main menu by typing 'R' and enter. 
126
127
* Install
128
** Type 'I' and hit enter to install.
129
130
* Put your texlive in your PATH.
131
** Edit you bashrc (vim ~/.bashrc)
132
** Add "export PATH=$PATH:<$CONTRIB_DIR>/texlive/bin/x86_64-linux/" (enter the full CONTRIB_DIR value)
133
** Exit and save. Then source ~/.bashrc.
134
135
To ensure you are using the correct texlive installation type "which pdflatex" and make sure it 
136
the one in $CONTRIB_DIR/texlive/bin/x86_64-linux/. If it is not the correct pdflatex, you may
137 1 Redmine Admin
have to remove the system version (sudo yum remove texlive). 
138 38 John Cary
139 46 John Cary
and then install the packages noted at
140 45 John Cary
141 46 John Cary
[[LaTeX packages needed by Bilder]]
142 38 John Cary
143 81 David Alexander
## Language Local
144
145
The txbase unit tests need a german local package. It can be generated by the command:
146
147
~~~~~~~
148
sudo locale-gen de_DE.UTF-8
149
~~~~~~~
150 1 Redmine Admin
151 25 John Cary
## Additional packages
152 1 Redmine Admin
153 25 John Cary
Other parts of the toolchain introduce other package requirements.  Below are the initial lists.
154
155 1 Redmine Admin
## Qt Prerequisites
156
157 25 John Cary
Qt-5 must be built with QtWebEngine, which particularly introduces requirements for other packages as noted at
158 24 John Cary
159 25 John Cary
* https://doc.qt.io/qt-5.10/qtwebengine-platform-notes.html
160
* https://wiki.qt.io/QtWebEngine/How_to_Try
161
* https://www.ics.com/blog/building-qtwebengine
162
* http://www.linuxfromscratch.org/blfs/view/svn/x/qtwebengine.html
163
164
Each of the above websites appears to have made assumptions about what is already installed, so as one encounters more workstations, one is likely to find yet another package missing.  This is our list so far.
165 1 Redmine Admin
166
## Vendor-specific version of graphics driver
167
168
If you are preparing a Linux machine for the VisIt Visualization package, the vendor-specific graphics driver for your graphics card should be installed.
169
170
By default, a generic graphics driver is installed.  On Fedora, the generic driver is "nouveau".
171
172
To determine if the nouveau driver is installed on your system, enter the command
173
174
~~~~~~
175 40 John Cary
lsmod | grep nouv
176 1 Redmine Admin
~~~~~~
177
178
You will need to download and install the appropriate driver from your graphics card vendor.  This generally uninstalls the nouveau drivers.
179 3 Matt Copper
180 4 Matt Copper
## NVIDIA CUDA Toolkit
181 3 Matt Copper
182
If you have a compatible GPU and wish to compile with nvcc code, you must first install the CUDA Toolkit. The linux installation page is 
183
184
~~~~~~
185 40 John Cary
https://developer.nvidia.com/cuda-toolkit-70
186 3 Matt Copper
~~~~~~
187
188
Download the applicable file. Your Linux distribution may or may not be natively supported for version 7.0. You may alternatively use version 7.5 if supported or an older version if necessary. As an example, we will include the steps known to work for Fedora 22. On Fedora 22, download the Fedora 21 Local RPM package. 
189
190
~~~~~~
191 40 John Cary
cd <location of download>
192
sudo rpm -i cuda-repo-fedora21-7-0-local-7.0-28.x86_64.rpm   #<or whatever file you downloaded> 
193
sudo dnf install cuda
194 3 Matt Copper
~~~~~~
195
196 5 Matt Copper
Different Linux distributions will have different package handlers (here we use dnf, ubuntu has apt-get, fedora < 22 uses yum). You should now have the directory /usr/local/cuda-7.0. Add /usr/local/cuda-7.0/bin to your path. To ensure you have gotten the necessary components, type:
197 3 Matt Copper
198
~~~~~~
199 40 John Cary
which nvcc
200 3 Matt Copper
~~~~~~
201 23 John Cary
The output should be /usr/local/cuda-7.0/bin/nvcc. This will allow bilder to build GPU c++ code.
202 31 Jonathan Smith
203
IMPORTANT NOTE: CUDA versions only support particular GCC versions, and the latest GCC may not support your CUDA.[[ CUDAgccCompatibility | See this wiki page for details ]]