GNU Linux - saprykin/plibsys GitHub Wiki
Configurations
Version | Compilers | Status | Tests |
---|---|---|---|
Rocky 9.5 (x64) | PGI 24.11.0 (x64) | Compiled | Passed |
Fedora 41 (x64) | Intel Classic 2021.10.0 (x86, x64) | Compiled | Passed |
Fedora 41 (x64) | Intel oneAPI 2025.1.0 (x64) | Compiled | Passed |
Fedora 41 (x64) | Intel oneAPI 2024.2.0 (x86) | Compiled | Passed |
Fedora 41 (x64) | GCC 14.2.1 (x86, x64) | Compiled | Passed |
Fedora 41 (x64) | Clang 19.1.0 (x86, x64) | Compiled | Passed |
Fedora 41 (S390x) | GCC 14.2.1 | Compiled | Passed |
Fedora 41 (S390x) | Clang 19.1.0 | Compiled | Passed |
Fedora 41 (AArch64) | GCC 14.2.1 | Compiled | Passed |
Fedora 41 (AArch64) | Clang 19.1.0 | Compiled | Passed |
CentOS 7 (PPC64le) | GCC 4.8.5 | Compiled | Passed |
CentOS 7 (PPC64le) | XL C 16.1.1 | Compiled | Passed |
CentOS 7 (PPC64le) | PGI 19.10 | Compiled | Passed |
Ubuntu 22.04 (PPC64le) | GCC 11.4.0 | Compiled | Passed |
Ubuntu 22.04 (PPC64le) | Clang 14.0.0 | Compiled | Passed |
Ubuntu 22.04 (PPC64le) | Open XL C 17.1.1 | Compiled | Passed |
Debian 10.13 (MIPS64) | GCC 8.3.0 (MIPS 64, n32) | Compiled | Passed |
Debian 10.13 (MIPS64) | Clang 13.0.1 (MIPS 64, n32) | Compiled | Passed |
Debian 13.0 (LoongArch64) | GCC 14.2.0 | Compiled | Passed |
Debian 13.0 (LoongArch64) | Clang 17.0.6 | Compiled | Passed |
Ubuntu 22.04 (RISC-V64) | GCC 11.4.0 | Compiled | Passed |
Ubuntu 22.04 (RISC-V64) | Clang 14.0.0 | Compiled | Passed |
Regular test builds are run on GitHub Actions.
Installation
There a lot of GNU/Linux distributions all around the world, and Fedora is used for development and testing builds right now. Please refer to documentation of your distribution to obtain information on how to install or build required software.
To build x86 binaries on a x64 host (GCC and Clang only, for Intel compiler you need x86 version separately) you may need to install additional multilib packages. For example, on Debian it is called g++-multilib
, and on Fedora packages glibc-devel.i686
and libstdc++-devel.i686
are required. After that you should pass -m32
option to the compilers. For MIPS, compiler flags like -mabi=64
and -mabi=n32
can be used to switch between 64/32-bit builds.
QEMU and x64
GNU/Linux can be installed on emulated x64 hardware of QEMU using the command below:
qemu-system-x86_64 -m 2048 -M q35 -cpu SandyBridge -smp cpus=2,sockets=1,cores=2,threads=1 \
-display default,show-cursor=on \
-device intel-hda -device hda-output \
-device qemu-xhci \
-device nec-usb-xhci,id=usb-bus \
-device usb-tablet,bus=usb-bus.0 \
-device usb-kbd,bus=usb-bus.0 \
-device virtio-net-pci,netdev=net0 \
-device virtio-gpu-pci \
-netdev user,id=net0,ipv6=off,hostfwd=tcp::10022-:22 \
-drive if=none,media=cdrom,id=cd_main,file=install.iso,readonly=on \
-device usb-storage,drive=cd_main,removable=true,bootindex=0,bus=usb-bus.0 \
-drive if=none,media=disk,id=hdd_main,file=linux.qcow2,discard=unmap,detect-zeroes=unmap \
-device virtio-blk-pci,drive=hdd_main,bootindex=1
Note. Sandy Bridge with AVX is required to execute binaries compiled with recent PGI versions.
QEMU and AArch64
GNU/Linux can be installed on emulated/virtualized AArch64 hardware of QEMU using the command below:
qemu-system-aarch64 \
-machine virt,accel=hvf,highmem=off \
-cpu host -smp 2 -m 2048 \
-display default,show-cursor=on \
-device intel-hda -device hda-output \
-device qemu-xhci \
-device nec-usb-xhci,id=usb-bus \
-device usb-tablet,bus=usb-bus.0 \
-device usb-kbd,bus=usb-bus.0 \
-device virtio-net-pci,netdev=net0 \
-device virtio-gpu-pci \
-netdev user,id=net0,ipv6=off,hostfwd=tcp::10022-:22 \
-drive if=pflash,format=raw,unit=0,file=edk2-aarch64-code.fd,readonly=on \
-drive if=pflash,format=raw,unit=1,file=edk2-arm-vars.fd,discard=on \
-drive if=none,media=cdrom,id=cd_main,file=install.iso,readonly=on \
-device usb-storage,drive=cd_main,removable=true,bootindex=0,bus=usb-bus.0 \
-drive if=none,media=disk,id=hdd_main,file=linux.qcow2,discard=unmap,detect-zeroes=unmap \
-device virtio-blk-pci,drive=hdd_main,bootindex=1
This is a scenario of virtualized machine running on AArch64 hardware (Apple M1/M2). Note that UEFI firmware is required in this case.
QEMU and S390x
GNU/Linux can be installed on emulated S390x hardware of QEMU using the command below:
qemu-system-s390x -machine s390-ccw-virtio -cpu max,zpci=on,msa5-base=off \
-serial telnet::4441,server -display none -m 2048 \
-cdrom install.iso \
-drive file=s390x.img,format=raw
To run installed distribution, another command can be used:
qemu-system-s390x -M s390-ccw-virtio -m 2048 \
-cpu max,zpci=on,msa5-base=off -smp 2 \
-serial telnet::4441,server \
-display none \
-drive file=s390x.img,if=none,id=drive-virtio-disk0,format=raw,cache=none \
-device virtio-blk-ccw,devno=fe.0.0001,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
-nic user,hostfwd=tcp::10022-:22
QEMU and PPC64
GNU/Linux can be installed on emulated PowerPC hardware of QEMU using the command below:
qemu-system-ppc64 \
-M pseries -smp 2 -m 2048 \
-cdrom install.iso \
-drive if=none,media=disk,id=hdd_main,file=linux-le.qcow2,discard=unmap,detect-zeroes=unmap \
-device virtio-blk-pci,drive=hdd_main,bootindex=1 \
-netdev user,id=net0,ipv6=off,hostfwd=tcp::10022-:22 \
-device rtl8139,netdev=net0
As some modern distributions for PowerPC may have problems with QEMU, another configuration may work (tested with Ubuntu 22.04) better:
qemu-system-ppc64 -M pseries,cap-cfpc=workaround,cap-sbbc=workaround,cap-ibs=workaround,cap-ccf-assist=on,ic-mode=dual \
-m 4G -accel tcg,thread=multi -cpu POWER9 -smp 4,cores=4,maxcpus=8,threads=1 \
-device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x1 \
-drive file=linux-le.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none \
-device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 \
-device qemu-xhci,id=usb,bus=pci.0,addr=0x4 \
-device virtio-net-pci,netdev=net0,mac=C0:FF:EE:00:00:02,bus=pci.0,addr=0x2 \
-netdev user,id=net0,hostfwd=tcp::10022-:22 \
-nographic -nodefaults -serial mon:stdio \
-cdrom install.iso
Distributions compiled for little/big endianness should run with the same configuration.
GCC
You should not have any problems compiling with GCC.
Clang
You should not have any problems compiling with Clang.
Intel
Intel C/C++ compiler was a part of the Intel Parallel Studio (XE) which is a commercial software. However, in 2021, Intel announced a move to LLVM-based DPC++/C++ compiler as part of oneAPI toolkit, while renaming the existing by then compilers to classic versions. On some old distributions you may encounter problems with Parallel Studio (XE) installation due to wget security certificates check for Intel's site. To fix it you can edit an installation script and pass --no-check-certificate
option to wget everywhere in the script. You should also setup LD_LIBRARY_PATH
variable to make Intel libraries available for dynamic linker to run compiled binaries, or use provided setvars.sh
(or vars.sh
) script with either intel64
or ia32
argument passed. Note that for x86 builds with oneAPI you need to install the 32-bit version of the toolkit from the same repository. You would also need a recent CMake 3.20+ version which supports oneAPI compilers.
Compiler | Description |
---|---|
icc | Intel classic C compiler |
icpc | Intel classic C++ compiler |
icx | Intel LLVM-based (oneAPI) C compiler |
icpx | Intel LLVM-based (oneAPI) C++ compiler |
Note. Intel has deprecated support for classic versions of the compilers, and marked them for removal since 2024. The classic compilers also do not work properly on modern Linux distributions due to the lack of compatibility maintenance with glibc and GCC. One solution to bypass this problem is to use the classic compiler for the C code and a new oneAPI C++ compiler for the rest; however, their versions should match.
Note. Intel dropeed support for 32-bit binaries in oneAPI since version 2025.0.
XL C
IBM XL C compiler builds the library without any problem. Note that there are two versions of the XL C compilers: general and thread-safe, the latter one has _r
suffix in its name and is highly recommended to use. Note that there are multiple versions of _IBM XL C compiler available: original one, Clang-based, and modernized and re-branded IBM Open XL C (also Clang-based). All versions are supported.
PGI
You should not have any problems compiling with PGI. Note that Nvidia bought PGI in 2020 and rebranded it under NVIDIA HPC SDK (Linux only).
Cray
CMake has improved support for Cray environment starting from version 3.5, thus it is recommended to use a new version if possible. By default Cray uses static linking for libraries, but if you still want to build a shared one as well, perform export CRAYPE_LINK_TYPE=dynamic
before configuring the library.
Usually you compile binaries on a special terminal, thus to produce an optimized binary for a compute node you need to cross-compile. This is done by passing -DCMAKE_SYSTEM_NAME=CrayLinuxEnvironment
while configuring the library.
Support
GCC Compile Farm kindly provides access to machines with PowerPC, MIPS and LoongArch architectures for testing and development.