Different compilers
Different compilers
Poll: What other compilers would you like to be able to use with PB, besides the usual ones like MSVC and Clang?
I've been playing around with different compilers since Alpha1 and am now able to compile my PB sources with GCC, MSVC, Clang and a little bit TCC. Everything runs fine, but it's still in the state where I have to use scroll-lock, num-lock, shift-lock, ... to tell PB what to do. Not really a problem for me, but definitely not ready for release. So now I'm considering writing a program that combines all these compilers into a single UI, but that's a pretty big task (imagine all available compiler flags, LTCG etc.) and if nobody is interested in such a program, I'd rather spend my time on something else. I also want to make it clear right from the start that it won't be free (depending on features and time spent).
Anyway, would you be interested in such a 'ToolChainSwitcher'? Which compilers should be supported?
I've been playing around with different compilers since Alpha1 and am now able to compile my PB sources with GCC, MSVC, Clang and a little bit TCC. Everything runs fine, but it's still in the state where I have to use scroll-lock, num-lock, shift-lock, ... to tell PB what to do. Not really a problem for me, but definitely not ready for release. So now I'm considering writing a program that combines all these compilers into a single UI, but that's a pretty big task (imagine all available compiler flags, LTCG etc.) and if nobody is interested in such a program, I'd rather spend my time on something else. I also want to make it clear right from the start that it won't be free (depending on features and time spent).
Anyway, would you be interested in such a 'ToolChainSwitcher'? Which compilers should be supported?
Et cetera is my worst enemy
Re: Different compilers
What was wrong with my approach where you just write compiler flags in c comments, you could just as easily tell it which compiler to use that way as well.
Re: Different compilers
Nothing was wrong , just a different approach. Mine would be more UI driven and switching from GCC to MSVC to Clang or whatever is just a matter of pushing a button and selecting a (customizable) preset.
MSVC also needs some special handling of the C source before compiling and it's done all automatically, or you can tell my program to generate a solution file for Visual Studio and continue to code/run/debug/build in the VS Editor. It is easy to use and works out of the box for beginners, not much knowledge required. But you can also tweak like a pro ^^.
As a bonus for the PB IDE, you'll get a more detailed error log:
But based on the feedback on PBCex so far, it seems only a few people here are really interested in this topic. Guess I'll have to wait and see
MSVC also needs some special handling of the C source before compiling and it's done all automatically, or you can tell my program to generate a solution file for Visual Studio and continue to code/run/debug/build in the VS Editor. It is easy to use and works out of the box for beginners, not much knowledge required. But you can also tweak like a pro ^^.
As a bonus for the PB IDE, you'll get a more detailed error log:
But based on the feedback on PBCex so far, it seems only a few people here are really interested in this topic. Guess I'll have to wait and see
Et cetera is my worst enemy
Re: Different compilers
I wasn't meaning to sound critical. I think it would be very useful for sure and I agree if you do it as a compiler tool in the ide it does make it easier. It sounds good and you've got it linking with link.exe as well so now you can benefit from Link time optimizations as well. That might be interesting if you're working with c libs.
Re: Different compilers
Don't worry, that was a valid question. I think both programs could complement each other well. However, I haven't done any testing in this regard yet. The ability to include C headers in PB is not on my agenda at the moment.
The screenshot is fairly old, it predates the C backend . Back then, Link time optimization was not possible with the ASM backend, because /LTCG only works if you compile the .obj and link it with a single call to cl.exe and not if you call the linker separately. But that is taken care of now...
The screenshot is fairly old, it predates the C backend . Back then, Link time optimization was not possible with the ASM backend, because /LTCG only works if you compile the .obj and link it with a single call to cl.exe and not if you call the linker separately. But that is taken care of now...
Et cetera is my worst enemy
Re: Different compilers
Didn't Fred advocate Pelles C at one time? http://www.smorgasbordet.com/pellesc/
- It was too lonely at the top.
System : PB 6.10 LTS (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
System : PB 6.10 LTS (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
Re: Different compilers
perhaps, but PellesC is Windows only
Re: Different compilers
A small question between parenthesis : is C backend available on demo version ?
If no, why not ? I am late to buy a licence, but I am not without searching the compiling mistakes.
If no, why not ? I am late to buy a licence, but I am not without searching the compiling mistakes.
Re: Different compilers
Thx for the Pelles C suggestion! I remember trying some things with Pelles 8 when it came out, but I wasn't very happy with the optimization results compared to other compilers. Maybe it's time to revisit and check out Pelles 11.blueb wrote: ↑Thu Jul 28, 2022 12:13 pm Didn't Fred advocate Pelles C at one time? http://www.smorgasbordet.com/pellesc/
Yeah, I should have mentioned that I only work with Windows (hence MSVC).
The C backend is available in the demo version but you can't create a DLL and the source is limited to ~800 lines of code.
Et cetera is my worst enemy
Re: Different compilers
I did not care about this... I will test this !chi wrote:The C backend is available in the demo version
Re: Different compilers
I did some tests with Pelles 10 (was already installed on my drive), but encountered some problems with strict type checking. So there is no easy way to simply convert PB to Pelles C without first running a linter (static analyzer) that could detect and fix these problems. I use clang-tidy and cppcheck with VS, so maybe there is a chance with these tools?! Guess I'm down another rabbit hole, cyablueb wrote: ↑Thu Jul 28, 2022 12:13 pm Didn't Fred advocate Pelles C at one time? http://www.smorgasbordet.com/pellesc/
Et cetera is my worst enemy
Re: Different compilers
I thank you for this info : now I have donwloaded PB6 Demo.
I can see two compilers pb now in the last and same directory :Also in the IDE, I don't reach the pbcompilerc in the compiler options.
There is a combobox named "use compiler :" but there is only one choice, and nothing to be able to add the c compiler. Any hint ?
I can see two compilers pb now in the last and same directory :
Code: Select all
pbcompiler.exe
pbcompilerc.exe
There is a combobox named "use compiler :" but there is only one choice, and nothing to be able to add the c compiler. Any hint ?
Re: Different compilers
Menu -> Preferences -> Compiler -> Additional Compilers
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Different compilers
Ok ! I had to tell you I just found it. Thank you mk-soft.
Re: Different compilers
Rookie question here. Why was the C backend compiler added. Does it have any advantages over the default compiler ?
Spec: Linux Mint 20.3 Cinnamon, i7-3770K, 16GB RAM, RTX 2070 Super