Linux
As tracking down issues which result from missing or outdated third party tools such as compilers are always hard do diagnose, we have extended the build of PLC4X with a prerequisiteCheck that automatically checks if required tools are installed and if a required minimum version is available.
If any of the prerequisites are not met, the build fails with an error message that will help finding out what’s wrong.
The number of checks is highly dependent on which profiles are enabled. So for example, the availability and version of the C compiler is only checked if the with-c profile is enabled.
If the check is reporting any issues, please feel free to follow the corresponding steps in this guide to install the tools.
Git
Checking:
git --versionIf you get any successful output, you probably don’t need to do anything.
Apt-based systems:
sudo apt install gitYum-based systems:
sudo yum install gitJava
Checking:
java --versionIf you get output successfully indicating at least Java 11, you don’t need to do anything.
Apt-based systems:
sudo apt install openjdk-21-jdkOptional and other language support
Git an Java should be all you need for building the Java part of PLC4X.
LibPCAP (For raw-ethernet support)
Apt-based systems:
sudo apt install libpcap-devYum-based systems:
sudo yum install libpcap-develUsing libpcap usually requires root privileges. However, the java process can be granted permission to do so by executing the following command.
sudo setcap cap_net_raw,cap_net_admin=eip /path/to/java/path/to/java however needs to be a real file and not a symlink. So on my Ubuntu 22.04 system, where I installed java as described above, the command is as follows:
sudo setcap cap_net_raw,cap_net_admin=eip /usr/lib/jvm/java-21-openjdk-arm64/bin/javaSometimes I had to set the uid to execute the java executable with the permissions of the owner (root) … However, this is a quite suboptimal solution.
sudo chmod 4755 /path/to/javagcc (For PLC4C)
It seems that when running Linux on aarch64 (Apple’s Silicon Chips), that there are issues … we’re working on that. Feel free to watch https://github.com/apache/plc4x/issues/1582 on updates to this. |
|---|
Checking:
gcc --versionIf you get any successful output, you probably don’t need to do anything.
Apt-based systems:
sudo apt install gccYum-based systems:
sudo yum install gccdotnet (For PLC4Net)
Checking:
dotnet --versionIf you get any successful output, you probably don’t need to do anything.
Microsoft has documented what is needed to install .Net SDK here
For Ubuntu this would be:
sudo mkdir -p /etc/apt/keyrings
wget https://packages.microsoft.com/keys/microsoft.asc -O /etc/apt/keyrings/microsoft.asc
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/microsoft.asc] https://packages.microsoft.com/ubuntu/24.04/prod noble main" | sudo tee /etc/apt/sources.list.d/microsoft-dotnet.list
sudo apt update
sudo apt install dotnet-sdk-8.0For other distributions, please select the distribution in the drop-down menu and follow the instructions there.
If, when checking the version again after installing, you are getting an error:
A fatal error occurred. The folder [/usr/share/dotnet/host/fxr] does not existThen please have a look at this Stackoverflow post (the accepted solution) https://stackoverflow.com/questions/73753672/a-fatal-error-occurred-the-folder-usr-share-dotnet-host-fxr-does-not-exist
python (For PLC4Py)
Checking:
python3 --versionIf you get a version of 3.7 or higher reported, you probably don’t need to do anything.
Apt-based systems:
sudo apt install python3Yum-based systems:
yum intall python3Python venv (For PLC4Py)
Checking:
python3 -Im ensurepipIf you are getting anything else than a: No module named ensurepip, you’re ok. It seems that this manually needs to be installed on some systems.
Apt-based systems:
sudo apt install python3-venv评论
登录后参与评论
KnowForge