Problem installing GCC on Porteus 5.0 64 bit

Post here if you are a new Porteus member and you're looking for some help.
hector9
Ronin
Ronin
Posts: 1
Joined: 03 Jul 2024, 03:26
Distribution: CINNAMON

Problem installing GCC on Porteus 5.0 64 bit

Post#1 by hector9 » 03 Jul 2024, 03:37

Hi, I have installed GCC on Porteus but when launching the file I get the message "Error: test.c:1:10: fatal error: stdio.h: No such file or directory".

Does anyone know the cause? Thank.

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4114
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Problem installing GCC on Porteus 5.0 64 bit

Post#2 by ncmprhnsbl » 03 Jul 2024, 04:55

hector9 wrote:
03 Jul 2024, 03:37
I have installed GCC
hi, welcome to porteus forum,
more details please. eg. what version of GCC and from where?
also, the 05-devel.xzm module contains GCC and other development tools including all the headers (one of which, stdio.h which is part of glibc)
link: 05-devel.xzm
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

rych
Warlord
Warlord
Posts: 724
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

Problem installing GCC on Porteus 5.0 64 bit

Post#3 by rych » 18 Aug 2024, 05:58

ncmprhnsbl wrote:
03 Jul 2024, 04:55
05-devel.xzm
Yes, but what if I'm building with -std=c++23 and a newer GCC is needed for that!? Could we install a separate, optional, standalone, all-inclusive, huge GCC 14.2 package? I'm having a difficulty even finding prebuilt binaries of newer gcc though...

i3slkiller
Contributor
Contributor
Posts: 110
Joined: 03 Feb 2020, 18:51
Distribution: Porteus XFCE v5.0rc2 x86_64
Location: Poland

Problem installing GCC on Porteus 5.0 64 bit

Post#4 by i3slkiller » 18 Aug 2024, 06:39

rych wrote:
18 Aug 2024, 05:58
-std=c++23
rych wrote:
18 Aug 2024, 05:58
GCC 14.2
Some time ago I built "slightly" older, gcc 13.2 (there was no gcc 14 yet), because I needed at least this version of it to build serenityos on porteus, maybe it will be useful for you
https://e.pcloud.link/publink/show?code ... foldergrid

SHA256:

Code: Select all

873d0580c2f45e26fc7872ad03384a2b918144508d103ce3568287be072838c7  gcc-13.2.0-x86_64-1.xzm
cdb29ee3fbef90eebc4e753618eba992c7116e1d0f2722ab4abe47cf640451e4  gcc-g++-13.2.0-x86_64-1.xzm
These modules *won't* replace 05-devel ofc.

rych
Warlord
Warlord
Posts: 724
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

Problem installing GCC on Porteus 5.0 64 bit

Post#5 by rych » 20 Aug 2024, 11:03

i3slkiller wrote:
18 Aug 2024, 06:39
These modules *won't* replace 05-devel ofc.
Thanks, this gives me an idea. I've been trying the latest binary from https://jwakely.github.io/pkg-gcc-latest/ obtained through the suggested command

Code: Select all

wget --content-disposition https://kayari.org/gcc-latest/gcc-latest.deb
then deb2xzm, extract, and used it as a standalone compiler in a separate folder. It didn't quite work.


Now I'm making a module that to be activated on top of the 05-develop populating all the standard locations with the news gcc stuff. (So inside that prebuilt binary package I rename the opt directory to 07-gcc_15.0.0 and its subfolder to usr, and make the 07-gcc_15.0.0.xzm)

And it works! Even though my 07-gcc_15.0.0.xzm is nearly 600MB(!) it still needs the 05-develop underneath. And who knows what things are broken in this method of overlaying the new gcc over the old. Also, notice how this binary was build in comparison to Porteus's native gcc:

Code: Select all

root@porteus:~# gcc -v
Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/11.2.0/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/11.2.0/lto-wrapper
Target: x86_64-slackware-linux
Configured with: ../configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/man --infodir=/usr/info --enable-shared --enable-bootstrap --enable-languages=ada,brig,c,c++,d,fortran,go,lto,objc,obj-c++ --enable-threads=posix --enable-checking=release --enable-objc-gc --with-system-zlib --enable-libstdcxx-dual-abi --with-default-libstdcxx-abi=new --disable-libstdcxx-pch --disable-libunwind-exceptions --enable-__cxa_atexit --disable-libssp --enable-gnu-unique-object --enable-plugin --enable-lto --disable-install-libiberty --disable-werror --with-gnu-ld --with-isl --verbose --with-arch-directory=amd64 --disable-gtktest --enable-clocale=gnu --disable-multilib --target=x86_64-slackware-linux --build=x86_64-slackware-linux --host=x86_64-slackware-linux
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (GCC)

AFTER ACTIVATING 07-gcc_15.0.0.xzm:

root@porteus:~# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/opt/gcc-latest --enable-languages=c,c++ --enable-libstdcxx-debug --enable-libstdcxx-backtrace --disable-bootstrap --disable-multilib --disable-libvtv --with-system-zlib --without-isl --enable-multiarch
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240818 (experimental) (GCC) 
Of course, I'd be thankful if someone made a proper gcc 14 or 15 for my C++23 programming. I also use clang++, but clang++ is not a standalone compiler: it relies on the corresponding gcc and std existing in the system.

i3slkiller
Contributor
Contributor
Posts: 110
Joined: 03 Feb 2020, 18:51
Distribution: Porteus XFCE v5.0rc2 x86_64
Location: Poland

Problem installing GCC on Porteus 5.0 64 bit

Post#6 by i3slkiller » 21 Aug 2024, 06:07

Under the same link I added gcc 14 modules built on Porteus 5.01

Code: Select all

e5263c344441b8bb7a626718135465998f343f27d40f17537d904cfab7dce2ee  gcc-14.2.0-x86_64-1.xzm
31eea90102230309cb1ecd9b73cee1794eeb5eddc0de9d3a2afd8eca13cea067  gcc-g++-14.2.0-x86_64-1.xzm

Code: Select all

root@porteus:/mnt/vbox/porteusbuilds/porteus/5.01/firejail# gcc -v
Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/14.2.0/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/14.2.0/lto-wrapper
Target: x86_64-slackware-linux
Configured with: ../configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/man --infodir=/usr/info --enable-shared --enable-bootstrap --enable-languages=c,c++ --enable-threads=posix --enable-checking=release --enable-objc-gc --with-system-zlib --enable-libstdcxx-dual-abi --with-default-libstdcxx-abi=new --disable-libstdcxx-pch --disable-libunwind-exceptions --enable-__cxa_atexit --disable-libssp --enable-gnu-unique-object --enable-plugin --enable-lto --disable-install-libiberty --disable-werror --with-gnu-ld --with-isl --verbose --with-arch-directory=amd64 --disable-gtktest --enable-clocale=gnu --disable-multilib --target=x86_64-slackware-linux --build=x86_64-slackware-linux --host=x86_64-slackware-linux
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.2.0 (GCC) 
root@porteus:/mnt/vbox/porteusbuilds/porteus/5.01/firejail# g++ -v
Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/14.2.0/specs
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/14.2.0/lto-wrapper
Target: x86_64-slackware-linux
Configured with: ../configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/man --infodir=/usr/info --enable-shared --enable-bootstrap --enable-languages=c,c++ --enable-threads=posix --enable-checking=release --enable-objc-gc --with-system-zlib --enable-libstdcxx-dual-abi --with-default-libstdcxx-abi=new --disable-libstdcxx-pch --disable-libunwind-exceptions --enable-__cxa_atexit --disable-libssp --enable-gnu-unique-object --enable-plugin --enable-lto --disable-install-libiberty --disable-werror --with-gnu-ld --with-isl --verbose --with-arch-directory=amd64 --disable-gtktest --enable-clocale=gnu --disable-multilib --target=x86_64-slackware-linux --build=x86_64-slackware-linux --host=x86_64-slackware-linux
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.2.0 (GCC)
Check if it works for you.

rych
Warlord
Warlord
Posts: 724
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

Problem installing GCC on Porteus 5.0 64 bit

Post#7 by rych » 22 Aug 2024, 11:35

i3slkiller wrote:
21 Aug 2024, 06:07
Check if it works for you
Yes, seems to be working. And much smaller in size. Thank you! I've renamed your modules as
07-gcc-14.2.0-x86_64-1.xzm
07-gcc-g++-14.2.0-x86_64-1.xzm

emphasizing that they are to be activated AFTER the 05-devel.xzm. But the whole porteus method of overlapping new files on top of the old ones is brilliant :) Now we have the latest GCC activated/de-activated on demand, without actually erasing the system default GCC!

rych
Warlord
Warlord
Posts: 724
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

Problem installing GCC on Porteus 5.0 64 bit

Post#8 by rych » 02 Oct 2024, 10:12

rych wrote:
20 Aug 2024, 11:03
I also use clang++, but clang++ is not a standalone compiler: it relies on the corresponding gcc and std existing in the system
It finds the latest GCC installation, so before and after activating i3slkiller's 07-gcc-14.2.0-x86_64-1.xzm and 07-gcc-g++-14.2.0-x86_64-1.xzm, clang will use different gcc:

Code: Select all

root@porteus:/G# clang -v
clang version 18.1.8
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /G/clang+llvm/bin
Found candidate GCC installation: /usr/lib64/gcc/x86_64-slackware-linux/11.2.0
root@porteus:/G# clang -v
clang version 18.1.8
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /G/clang+llvm/bin
Found candidate GCC installation: /usr/lib64/gcc/x86_64-slackware-linux/11.2.0
Found candidate GCC installation: /usr/lib64/gcc/x86_64-slackware-linux/14.2.0
Selected GCC installation: /usr/lib64/gcc/x86_64-slackware-linux/14.2.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
Another favor, i3slkiller, please. Could you make a 09-clang+llvm.xzm? Besides being a competitive compiler, it provides C++ language services to Sublime and other IDEs. At the moment I use a "portable" behemoth universal binary clang+llvm and place it outside the sysroot which is non-standard.

i3slkiller
Contributor
Contributor
Posts: 110
Joined: 03 Feb 2020, 18:51
Distribution: Porteus XFCE v5.0rc2 x86_64
Location: Poland

Problem installing GCC on Porteus 5.0 64 bit

Post#9 by i3slkiller » 02 Oct 2024, 13:30

rych wrote:
02 Oct 2024, 10:12
Another favor, i3slkiller, please. Could you make a 09-clang+llvm.xzm?
Maybe check first if llvm-18.1.8-x86_64-2_slack15.0.txz from slackware64-15.0/testing is suitable for your use case.

Code: Select all

root@porteus:/mnt/vbox/tmp# clang -v
clang version 18.1.8
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-slackware-linux/11.2.0
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-slackware-linux/14.2.0
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-slackware-linux/14.2.0
Candidate multilib: .;@m64
Selected multilib: .;@m64

Post Reply