Private
Public Access
11
1

Create SetupComputer20.04

2021-12-08 22:09:39 +01:00
parent bbbd5e5cc7
commit 5fd488a015

215
SetupComputer20.04.md Normal file

@@ -0,0 +1,215 @@
**Prepare Computer**
- Install a basic Ubuntu 20.04 LTS Desktop 64 Bit http://www.ubuntu.com/download/desktop ,username: control with sudo permissions
- Add various packages:
```
sudo apt-get install fakeroot build-essential cvs flex bison openssh-server git-core geany synaptic joe jed subversion autoconf-archive cmake libreadline-dev libhdf5-dev pkg-config libxml2-dev libzmq3-dev liblog4cpp5-dev libelf-dev libssl-dev libarchive-dev libgtkmm-3.0-dev libatkmm-1.6-dev libglibmm-2.4-dev libncurses5-dev libxerces-c-dev libboost-dev xsltproc cifs-utils xterm meld default-jre autogen autoconf libtool libqwt-qt5-dev qt5-default gcc-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 1
```
- get the software form the repository, including the System Installation files:
```
cd
mkdir work
cd work
svn co https://svn.semafor.ch/stxm/trunk stxm
```
- Compile Epics
```
cd /usr/local/
sudo mkdir epics
cd epics/
sudo chown control .
tar xfvz ~/work/stxm/SystemInstall/baseR3.14.12.8.tar.gz
cd base-3.14.12.8/
make
# edit /etc/environmet:
# PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/epics/base-3.14.12.8/bin/linux-x86_64/"
sudo cp ~/work/stxm/SystemInstall/epics-64.conf /etc/ld.so.conf.d
sudo ldconfig
```
- Compile Nexus Library
```
mkdir ~/BaseSystem
cd ~/BaseSystem/
# get latest Version of Nexus
wget https://github.com/nexusformat/code/archive/master.zip
unzip master.zip
mv code-master nexus
cd nexus
cmake -DENABLE_CXX=1 .
make
sudo make install
```
- Install Intens
```
cd /usr/local
sudo mkdir intens
sudo tar xfvz ~/work/stxm/SystemInstall/intens-4.5.15-snapshot-64.tar.gz
```
- Install PI libs
```
cd ~/BaseSystem
tar xfvj ../work/stxm/SystemInstall/PI_Application_Software-1.4.0.1-INSTALL.tar.bz2
cd PI_Application_Software/
sudo ./INSTALL
#n
#n 32 bit Lib
#y 64 bit lib
#n UBS rights
#y PiPython
#y Stage Database
#n PiTerminal 32
#y PiTerminal 64
#n USB rights
```
- Compile RT Kernel and untar RTAI
```
cd ~/BaseSystem
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.14.111.tar.gz
tar xfz linux-4.14.111.tar.gz
tar xfj ../work/stxm/SystemInstall/rtai-5.2.tar.bz2
cd linux-4.14.111
patch -p1 < ../rtai-5.2/base/arch/x86/patches/hal-linux-4.14.111-x86-3.patch
cp ~/work/stxm/SystemInstall/config_4.14.111_for_rtai-52 .config
make localmodconfig # Compile only Modules, as they are used on the current computer
make -j5 deb-pkg LOCALVERSION=-rt1
cd ..
sudo dpkg -i linux-headers-4.14.11-rt1_4.14.111-rt1-1_amd64.deb linux-image-4.14.111-rt1_4.14.111-rt1-1_amd64.deb
```
- To modify Grub load order with a gui:
```
cd ~/BaseSystem
tar xfvz ../work/stxm/SystemInstall/grub-customizer_5.1.0.tar.gz
cd grub-customizer-5.1.0/
cmake .
make
sudo make install
```
- Compile RTAI 1st run
```
cd ~/BaseSystem
cd rtai-5.2
cp ~/work/stxm/SystemInstall/rtai_config_5.1_first_run .rtai_config
make
#- check that numer of CPU (in Machine (x86)) matches your computer
#- check, that Net RPC is disabled (Base System -> Supported Services)
#- check eager inlining (General)
sudo make install
#- to test installation
cd /usr/realtime/testsuite/kern/latency/
./run
```
- Compile Comedi
```
cd ~/BaseSystem
unzip ../work/stxm/SystemInstall/comedi-master-20190305.zip
unzip ../work/stxm/SystemInstall/comedilib-master-20190305.zip
cd comedi-master
cp ../../work/stxm/SystemInstall/N1231B_reg.h comedi/drivers
patch -p1 < ~/work/stxm/SystemInstall/comedi.patch
./autogen.sh
./configure --with-rtaidir=/usr/realtime
make
sudo make install
sudo depmod -a
cd ../comedilib-master
./autogen.sh
./configure
make
sudo make install
```
- Compile RTAI 2nd run
```
cd ~/BaseSystem
cd rtai-5.2
cp ~/work/stxm/SystemInstall/rtai_config_5.1_second_run .rtai_config
make clean
make
#- check that numer of CPU (in Machine (x86)) matches your computer
#- check, that Net RPC is disabled (Base System -> Supported Services)
#- check eager inlining (General)
sudo make install
```
- Install Orchestra
```
cd ~/BaseSystem
tar xfvz ../work/stxm/SystemInstall/Orchestra-master.tar.gz
cd Orchestra-master/OrchestraCoreLib
make
sudo make install
cd ../OrchestraHostSupervisor
make
sudo make install
cd ../OrchestraCore
make
sudo make install
cd /usr/local/Orchestra/
sudo cp -a ~/BaseSystem/Orchestra-master/HMI/ .
cd /usr/local/bin
sudo ln -s /usr/local/Orchestra/HMI/OrchestraHMI .
```
- Load Comedi driver and configure cards
```
sudo cp ~/work/stxm/SystemInstall/ComediLoadModules /etc/init.d
cd /etc/rc2.d
sudo ln -s ../init.d/ComediLoadModules S98ComediLoadModules
sudo cp ~/work/stxm/SystemInstall/comedi.conf /etc/modprobe.d
```
- Install STXM Software
```
cd ~/work/stxm/
autoreconf -i
mkdir build
cd build
../configure
make
```
- Adapt configuration
```
edit /etc/security/limits.conf
add at the end:
control soft memlock 200000
control hard memlock 200000
```