Project

General

Profile

Preparing a Linux machine for Bilder » History » Version 86

Ted Sume, 08/15/2024 05:30 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
unzip rdma-core-devel
25 82 Ted Sume
~~~~~~
26 1 Redmine Admin
27 85 Ted Sume
~~~~~~
28
dnf remove libidn2-devel
29
~~~~~~
30 22 John Cary
## GCC
31 1 Redmine Admin
32
Below are the instructions for building gcc
33
34 28 John Cary
### Get and unpack the source package
35 1 Redmine Admin
36
~~~~~~
37 78 John Cary
export GCCVER=11.2.0
38 1 Redmine Admin
wget ftp://ftp.gnu.org/gnu/gcc/gcc-${GCCVER}/gcc-${GCCVER}.tar.xz
39 33 Jonathan Smith
tar xf gcc-${GCCVER}.tar.xz && cd gcc-${GCCVER}
40 1 Redmine Admin
~~~~~~
41
42 28 John Cary
### Patch as needed
43
44 77 John Cary
No patching needs known as of now.
45 28 John Cary
46 1 Redmine Admin
### Build
47
48 72 John Cary
Define GCC_INSTS_DIR to be your tarball installation directory, e.g.,
49 1 Redmine Admin
50
~~~~~~
51 72 John Cary
export GCC_INSTS_DIR=/contrib
52 1 Redmine Admin
~~~~~~
53
54 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:
55 1 Redmine Admin
56
~~~~~~
57
mkdir /internal /contrib /volatile
58
chmod 775 /internal /contrib /volatile
59
~~~~~~
60
61
Unpack gcc, go into the gcc source directory, and build according to the instructions below.
62
63
**gcc:**
64
65 78 John Cary
You may need to set some addition options, e.g., 
66
* ```ADDLOPTS=--with-cpu=power9``` on linuxppc64le
67
* ```ADDLOPTS=--disable-multilib``` if 32bit glibc libraries are not installed.
68 68 John Cary
69 22 John Cary
~~~~~~
70 1 Redmine Admin
./contrib/download_prerequisites
71
mkdir build && cd build
72 72 John Cary
../configure --prefix=$GCC_INSTS_DIR/gcc-${GCCVER} --enable-languages=c,c++,fortran --with-pic $ADDLOPTS
73
env LD_RUN_PATH=$GCC_INSTS_DIR/gcc-${GCCVER}/lib64 make -j 4
74 1 Redmine Admin
make install
75 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
76 1 Redmine Admin
# Alias as desired.
77 72 John Cary
mkdir -p $GCC_INSTS_DIR/bin && cd $GCC_INSTS_DIR/bin
78
ln -s $GCC_INSTS_DIR/gcc-${GCCVER}/bin/{c,g}* .
79 1 Redmine Admin
~~~~~~
80
81
### Fix permissions
82
83
~~~~~~
84 80 John Cary
chown -R root:root $GCC_INSTS_DIR/gcc-${GCCVER}
85 72 John Cary
chmod -R g+rwX $GCC_INSTS_DIR/gcc-${GCCVER}
86 49 Nathan Neri
chmod -R o+rX $GCC_INSTS_DIR/gcc-${GCCVER}
87 54 Nathan Neri
find $GCC_INSTS_DIR/gcc-${GCCVER} -type d -exec chmod g+rs '{}' \;
88
~~~~~~
89
90
91
92 49 Nathan Neri
93 1 Redmine Admin
## LaTeX
94
95 46 John Cary
LaTeX is needed for building documentation using Sphinx.
96 1 Redmine Admin
97 46 John Cary
Bilder prefers the texlive-latex package. For gui usage, see texworks: http://www.tug.org/texworks
98
99 1 Redmine Admin
If you cannot install in the system area, you can download
100
101
~~~~~~
102
wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
103
tar xzf install-tl-unx.tar.gz
104 76 John Cary
cd install-tl-20230412 (date might be different)
105 1 Redmine Admin
./install-tl -no-gui
106
~~~~~~
107
108
This is now interactive, so set
109 11 Matt Copper
 
110 10 Matt Copper
* Set scheme to basic
111
** To do this type 'S' and hit enter.
112
** Then enter 'd' to set the scheme to basic.
113
** Type 'R' and hit enter to return to the main configuration page.
114 1 Redmine Admin
115 10 Matt Copper
* Set TEXDIR = $CONTRIB_DIR/texlive
116
** Start by typing 'D' and hit enter.
117
** Then enter '1' to change TEXDIR.
118
** Type $CONTRIB_DIR/texlive and hit return.
119
** To return to configuration type 'R' and return.
120 1 Redmine Admin
121 10 Matt Copper
* Set page size to Letter size
122
** Type 'O' and hit enter.
123
** Enter 'P'
124
** Return to main menu by typing 'R' and enter. 
125
126
* Install
127
** Type 'I' and hit enter to install.
128
129
* Put your texlive in your PATH.
130
** Edit you bashrc (vim ~/.bashrc)
131
** Add "export PATH=$PATH:<$CONTRIB_DIR>/texlive/bin/x86_64-linux/" (enter the full CONTRIB_DIR value)
132
** Exit and save. Then source ~/.bashrc.
133
134
To ensure you are using the correct texlive installation type "which pdflatex" and make sure it 
135
the one in $CONTRIB_DIR/texlive/bin/x86_64-linux/. If it is not the correct pdflatex, you may
136 1 Redmine Admin
have to remove the system version (sudo yum remove texlive). 
137 38 John Cary
138 46 John Cary
and then install the packages noted at
139 45 John Cary
140 46 John Cary
[[LaTeX packages needed by Bilder]]
141 38 John Cary
142 81 David Alexander
## Language Local
143
144
The txbase unit tests need a german local package. It can be generated by the command:
145
146
~~~~~~~
147
sudo locale-gen de_DE.UTF-8
148
~~~~~~~
149 1 Redmine Admin
150 25 John Cary
## Additional packages
151 1 Redmine Admin
152 25 John Cary
Other parts of the toolchain introduce other package requirements.  Below are the initial lists.
153
154 1 Redmine Admin
## Qt Prerequisites
155
156 25 John Cary
Qt-5 must be built with QtWebEngine, which particularly introduces requirements for other packages as noted at
157 24 John Cary
158 25 John Cary
* https://doc.qt.io/qt-5.10/qtwebengine-platform-notes.html
159
* https://wiki.qt.io/QtWebEngine/How_to_Try
160
* https://www.ics.com/blog/building-qtwebengine
161
* http://www.linuxfromscratch.org/blfs/view/svn/x/qtwebengine.html
162
163
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.
164 1 Redmine Admin
165
## Vendor-specific version of graphics driver
166
167
If you are preparing a Linux machine for the VisIt Visualization package, the vendor-specific graphics driver for your graphics card should be installed.
168
169
By default, a generic graphics driver is installed.  On Fedora, the generic driver is "nouveau".
170
171
To determine if the nouveau driver is installed on your system, enter the command
172
173
~~~~~~
174 40 John Cary
lsmod | grep nouv
175 1 Redmine Admin
~~~~~~
176
177
You will need to download and install the appropriate driver from your graphics card vendor.  This generally uninstalls the nouveau drivers.
178 3 Matt Copper
179 4 Matt Copper
## NVIDIA CUDA Toolkit
180 3 Matt Copper
181
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 
182
183
~~~~~~
184 40 John Cary
https://developer.nvidia.com/cuda-toolkit-70
185 3 Matt Copper
~~~~~~
186
187
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. 
188
189
~~~~~~
190 40 John Cary
cd <location of download>
191
sudo rpm -i cuda-repo-fedora21-7-0-local-7.0-28.x86_64.rpm   #<or whatever file you downloaded> 
192
sudo dnf install cuda
193 3 Matt Copper
~~~~~~
194
195 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:
196 3 Matt Copper
197
~~~~~~
198 40 John Cary
which nvcc
199 3 Matt Copper
~~~~~~
200 23 John Cary
The output should be /usr/local/cuda-7.0/bin/nvcc. This will allow bilder to build GPU c++ code.
201 31 Jonathan Smith
202
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 ]]