Hey Mike! Former student of yours here (CS5500 F23), just wanted to say thanks for these instructions! Used them to get gcc13 installed in WSL at work 👍
Back in the day (in the 90s) I did a bootstrap installation of gcc on a microVAX running Ultrix32. Now *that* was an experience, all Ultrix32 had was a K&R C compiler, and somehow vi didn't want to recognize our original DEC VT102 terminal, so all I had to fix non-working stuff (because DEC's K&R C was not 100% K&R C, missing tools etc. pp.) had to be done in vi's so-called "open mode", which is basically ed with vi keybindings. You can try it with modern vi like eg. vim with ":open". Just remember ":visual" to regain your sanity :P Oh, and it took *days*, not "half an hour". Remember, the microVAX was just 0.9 VUP (VAX unit of performance), with contemporary "big VAXen" having 2-3 per processor (and of course the microVAX only had one processor, unlike the bigger ones). But anyway, I got it running, and that experience will stay with me forever!
this may seem like a dim question but.. Isnt the purpose of bulding the compiler so we have a compiler? How are we compiling with out a compiler? I mean what if we want to build from source so we have a compiler since its the whole point?
Not a bad question at all -- during this process we are bootstrapping from the compiler that is already installed with the operating system (Could be an older version of the compiler to build the new compiler, which the new compiler then understands new instructions/syntax/etc).
very nice, many thanks. One question, this build also provides libstdc++ and so on. However when using the binaries of the compiler of this build (and for example using them in a cmake project where cmake was instructed to these binaries -DCMAKE_CXX_COMPILER=/full/path/to/g++) it seems the linking is still done with the system versions installed (by inspecting ldd output), and not the brand new ones created ... Any suggestions ?
hi, could you talk aout the something about the common bug: clang: error: linker command failed with exit code 1 (use -v to see invocation) ? It seems that it some times work and sometimes not
I believe it is bootstrapping and using a previous compiler to compile it the first time, then rebuilding a second time with the compiler as you suggest (perhaps adding in any new optimizations, improvements, etc.)
MSVC is indeed leading the way right now. Can keep an eye on this for now: en.cppreference.com/w/cpp/compiler_support/23 When modules support comes, I think it will be wonderful -- but might have to wait a bit.
Q5. Can you show me the contents of contrib directory.. I want to se if there is. Gmp resources there? I am facing the same problem with the gcc 12.0 instalation
@@MikeShah Yeah a lot🙃, GCC and G++ needed to be pre-installed, MPFR, GMP, MPC had to be built from official source and GCC 13.1.0 MinGW-w64 and Binutils had to be downloaded from official websites using "wget" and then "tar -xf" for unpacking Important: While "make install" for GMP,MPFR,MPC I had to use "sudo make install" instead else it would not be able to install in internal directory (usr/local) All this just to make my own GCC C,C++ only compiler for college first semester
@@debankurdas6104 Good to know, at some point I'll go through the process and make a video as well. I guess the install deps script doesn't work for windows then and that is the bottleneck?
@@MikeShah basically the lack of Modules Support is what made me switch to using MSVC exclusively, for I just can't go back to using headers - I freaking love the way Modules let me organise my code. Clang does have dependency scan, but still has, for example, problems with `std::format`, so, yeah, MSVC is like years ahead of them. It has C++20 done and even some C++23. I use the Preview Version of Visual Studio, and I even have `import std;` already. And yes, I can do `std::print(...)`☺️😁😁😁 Anyways... Looking forward to your next videos✌🏽 Greetings from Germany.
Hi, thanks for the video but I get an error after "make -j 24" like this: cc1plus: fatal error: gengtype-lex.cc: No such file or directory compilation terminated. make[3]: *** [Makefile:2977: build/gengtype-lex.o] Error 1 make[3]: *** Waiting for unfinished jobs.... echo timestamp > s-options rm gfdl.pod gcc.pod gcov-dump.pod gcov-tool.pod fsf-funding.pod gpl.pod cpp.pod gcov.pod lto-dump.pod Anyone else got the same error ? what is the solution here? I have ubuntu 22.04
Hey Mike! Former student of yours here (CS5500 F23), just wanted to say thanks for these instructions! Used them to get gcc13 installed in WSL at work 👍
John happy to hear that! Nice to see you here 😁Hope you're out doing great things!
Back in the day (in the 90s) I did a bootstrap installation of gcc on a microVAX running Ultrix32. Now *that* was an experience, all Ultrix32 had was a K&R C compiler, and somehow vi didn't want to recognize our original DEC VT102 terminal, so all I had to fix non-working stuff (because DEC's K&R C was not 100% K&R C, missing tools etc. pp.) had to be done in vi's so-called "open mode", which is basically ed with vi keybindings. You can try it with modern vi like eg. vim with ":open". Just remember ":visual" to regain your sanity :P
Oh, and it took *days*, not "half an hour". Remember, the microVAX was just 0.9 VUP (VAX unit of performance), with contemporary "big VAXen" having 2-3 per processor (and of course the microVAX only had one processor, unlike the bigger ones).
But anyway, I got it running, and that experience will stay with me forever!
Very cool -- waiting days is something I have a hard time processing 🙃
this may seem like a dim question but..
Isnt the purpose of bulding the compiler so we have a compiler? How are we compiling with out a compiler? I mean what if we want to build from source so we have a compiler since its the whole point?
Not a bad question at all -- during this process we are bootstrapping from the compiler that is already installed with the operating system (Could be an older version of the compiler to build the new compiler, which the new compiler then understands new instructions/syntax/etc).
Haha, nice one with the -j 65536👍
😁
Thanks a lot Mike. 🙂
You are most welcome!
very nice, many thanks. One question, this build also provides libstdc++ and so on. However when using the binaries of the compiler of this build (and for example using them in a cmake project where cmake was instructed to these binaries -DCMAKE_CXX_COMPILER=/full/path/to/g++) it seems the linking is still done with the system versions installed (by inspecting ldd output), and not the brand new ones created ...
Any suggestions ?
hi, could you talk aout the something about the common bug: clang: error: linker command failed with exit code 1 (use -v to see invocation) ? It seems that it some times work and sometimes not
Does it then use the new compiler to compile itself?? Or there will be no optimisations inside the binary of itself.
I believe it is bootstrapping and using a previous compiler to compile it the first time, then rebuilding a second time with the compiler as you suggest (perhaps adding in any new optimizations, improvements, etc.)
Hi Mike any suggestions for those who are learning c++20 modules on linux(vs code) ?
I changed to Windows because of this - MSVC Modules support is good. The other compilers still suck at supporting the new features.
MSVC is indeed leading the way right now. Can keep an eye on this for now: en.cppreference.com/w/cpp/compiler_support/23 When modules support comes, I think it will be wonderful -- but might have to wait a bit.
Q4. You are cloning from git repository. Does this equally applicable to ftp server tarballs packages?
Q5. Can you show me the contents of contrib directory.. I want to se if there is. Gmp resources there? I am facing the same problem with the gcc 12.0 instalation
Fascinating, thanks so much
You are most welcome!
Thank you so much.
You are most welcome!
don't we need to make check after make -j?
Running the testsuite is not a bad idea :)
Q2. Ubuntu 22.04.02 jammy jellyfish comes with a gcc compiler? If not why
Build essential can be run offline??
Gmp source is in which directory
Q1. In the prerequisite section you need some version of gcc to install some other version. What if u don't have any??
A1. then you can't compile gcc until you get one
Hi!! any idea on how to make mingw for windows from linux. I did try out using "--host=x86_64-mingw32" but cant figure out the "--target=" for windows
I haven't played around with building for mingw , will have to revisit that!
Ok...I have built myself...trust me it was a nightmare experience 💀...but finally managed to build one.
@@debankurdas6104 glad to hear it! Hmm lots of dependencies to get working?
@@MikeShah Yeah a lot🙃, GCC and G++ needed to be pre-installed, MPFR, GMP, MPC had to be built from official source and GCC 13.1.0 MinGW-w64 and Binutils had to be downloaded from official websites using "wget" and then "tar -xf" for unpacking
Important: While "make install" for GMP,MPFR,MPC I had to use "sudo make install" instead else it would not be able to install in internal directory (usr/local)
All this just to make my own GCC C,C++ only compiler for college first semester
@@debankurdas6104 Good to know, at some point I'll go through the process and make a video as well. I guess the install deps script doesn't work for windows then and that is the bottleneck?
Q5. How to get build essential package offline
Q3. What's diff between gcc and gdc
C23 .. wow! 🦏
It seems to be updating every 6 years or so :)
Did someone also accidentally typed make in build dir instead of make -j [num] ....?
Still no P1689R5🤦🏽♂️ [-fdep (module dependency scan)]
Oh, boy...
Maybe the next major release? Will look forward to more module support in the future
@@MikeShah basically the lack of Modules Support is what made me switch to using MSVC exclusively, for I just can't go back to using headers - I freaking love the way Modules let me organise my code.
Clang does have dependency scan, but still has, for example, problems with `std::format`, so, yeah, MSVC is like years ahead of them. It has C++20 done and even some C++23.
I use the Preview Version of Visual Studio, and I even have `import std;` already. And yes, I can do `std::print(...)`☺️😁😁😁
Anyways...
Looking forward to your next videos✌🏽
Greetings from Germany.
@@theintjengineer 🥂 cheers!
Hi, thanks for the video but I get an error after "make -j 24" like this:
cc1plus: fatal error: gengtype-lex.cc: No such file or directory
compilation terminated.
make[3]: *** [Makefile:2977: build/gengtype-lex.o] Error 1
make[3]: *** Waiting for unfinished jobs....
echo timestamp > s-options
rm gfdl.pod gcc.pod gcov-dump.pod gcov-tool.pod fsf-funding.pod gpl.pod cpp.pod gcov.pod lto-dump.pod
Anyone else got the same error ? what is the solution here?
I have ubuntu 22.04
Same error if you just try with 'make' ?
@@MikeShah Yes, I just tried it with "make"
, but the error is the same. I use the same commands as in the video.
@@omerfaiq2487 Probably missing flex library (apt-get install flex) See: gibsonic.org/tools/2019/08/08/gcc_building.html