Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: jennadk on March 03, 2016, 03:14:09 AM

Title: Compiling (esp C/C++) How do you like to do it?
Post by: jennadk on March 03, 2016, 03:14:09 AM
I'm curious as to how most people approach compiling new software for so many Amiga platforms, such as AROS x86/68k, OS4, MorphOS and OS3.X? I've seen directions for most on cross-compiling from Linux but each requires its own flavor of GCC/G++ and SDK/libraries. What do most folks seem to do?

Just from a speed perspective, it seems like cross compiling from Linux x86 is attractive, but do folks still compile directly on PPC & 68K? Also wondering if there's a good central guide on how to set up the various SDK / Compiler environments for all of those combinations out there?

This is not an inquiry about editors/IDEs, I view those as a separate preference. That said,  if you compile with whatever is included please reply!

Thank you,
JDK
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: HaukeVB on March 03, 2016, 10:22:33 AM
This is actually an interesting question!
I am starting to experiment with AROS on Ubuntu on Parallels (OSX).

Of cause it depends on what you want to aim for. (AOS, AROS, AOS4, MorphOS...)
I find the lack of easy to set-up dev-enviroments one of the main obstactles to return to Amiga Development... (yet AROS was reasonable easy)  but maybe I havn't found the right solution.
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: kolla on March 03, 2016, 10:30:26 AM
For AROS, I use whatever build system that AROS project is using.

For classic Amiga OS, I use whatever compiler the project I am hacking on was written for, typically under UAE for speed. And likewise, for Linux/m68k I build natively but under emulator, in this case Aranym (and soon Qemu, maybe).

MorphOS and OS4 are of little interest, but I am not a developer as much as I am someone who happily tinker with existing code in attempts to make it do what I want :)
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: eliyahu on March 03, 2016, 01:37:35 PM
@jennadk

i use the gcc compiler and toolchain provided by hyperion in the AOS4 SDK (link (http://www.hyperion-entertainment.com/index.php/downloads?view=details&file=82)). this way everything 'just works' on my next-gen systems, where i do the compilation. i haven't set up a cross-compiler environment on my x64 linux boxes, but i know folks who have.

-- eliyahu
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: jennadk on March 03, 2016, 10:54:37 PM
Yay, this is actually pretty handy. Something  I am thinking is, since it seems like all platforms 'support' using some form of  GCC + a SDK, it might be reasonable to set up vagrant or a similar downloadable compiling environment.

You'd download the vagrant 'box' and then point a predetermined share path in vagrant to your SDK (licensing) and another to your project and run vagrant to build. There would have to be a supporting site with documentation on use, set up and links to the supported SDKs as well. Might be a useful project?

That's in theory at least, it's what I do at work with Django and Laravel. I don't know what current developers in the Amiga community really use though, if most folks don't ever cross compile to multiple platforms it's not useful.

As a PHP/Python centric person I'm only aware of GCC/G++ from the perspective of compiling pre-packaged Python add-ons and Linux software. So getting all of the correct compiler settings, versions and flags is probably 90% of the work.
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: EDanaII on March 03, 2016, 11:20:26 PM
I prefer doing it in Eclipse, using ZeroHero's gcc crosscompiler. It supports all Amiga environments...
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: jennadk on March 04, 2016, 02:47:36 AM
That sounds fantastic, I see the .se site with that name but it doesn't seem to have anything for Amiga. Where are these stored at?
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: nicholas on March 04, 2016, 12:29:07 PM
Copy and paste is refusing to work here for some reason, but search github for Amiga Crosscompiling Toolchain
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: Varthall on March 04, 2016, 12:57:06 PM
Quote from: nicholas;805369
Copy and paste is refusing to work here for some reason, but search github for Amiga Crosscompiling Toolchain


This page?

https://github.com/cahirwpz/amigaos-cross-toolchain

I have noticed that for OS4 it has an older build of gcc (4.2.4), while this page has a newer 4.4.3:

http://kas1e.mikendezign.com/zerohero_crosscompilers_backup/cross-compiler_os4.html

and on Aminet there's a native OS4 port of 5.3.0:

http://aminet.net/package/dev/gcc/adtools-os4

Same regarding 68k (2.95.3 vs. 3.4.0):

http://kas1e.mikendezign.com/zerohero_crosscompilers_backup/cross-compiler_os3.html

Varthall
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: Varthall on March 04, 2016, 12:58:24 PM
Personally I compile natively for OS4, except for larger projects which are faster to crosscompile on my x64 laptop.

Varthall
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: guest11527 on March 04, 2016, 01:02:14 PM
Quote from: jennadk;805238
I'm curious as to how most people approach compiling new software for so many Amiga platforms, such as AROS x86/68k, OS4, MorphOS and OS3.X? I've seen directions for most on cross-compiling from Linux but each requires its own flavor of GCC/G++ and SDK/libraries. What do most folks seem to do?

Depends. I partially use the native development tools, like SAS/C or DevPac, on the native machine. I also partially run them on vamos now. Same tools, though no graphical interface.
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: nicholas on March 04, 2016, 01:53:58 PM
Quote from: Varthall;805371
This page?

https://github.com/cahirwpz/amigaos-cross-toolchain

I have noticed that for OS4 it has an older build of gcc (4.2.4), while this page has a newer 4.4.3:

http://kas1e.mikendezign.com/zerohero_crosscompilers_backup/cross-compiler_os4.html

and on Aminet there's a native OS4 port of 5.3.0:

http://aminet.net/package/dev/gcc/adtools-os4

Same regarding 68k (2.95.3 vs. 3.4.0):

http://kas1e.mikendezign.com/zerohero_crosscompilers_backup/cross-compiler_os3.html

Varthall

Yeah that's the one.

On MorphOS I compile natively, but for 68k I generally do it under emulation or cross compile.

I really should look into setting up a functioning distcc server tbh.
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: jennadk on March 04, 2016, 09:34:33 PM
DistCC seems neat for a speed bump. It seems like folks use different things all over the board. It's fantastic that there's still plenty of viable options.

@Varthall Thank you for the links!
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: EDanaII on March 04, 2016, 10:02:25 PM
@ jennadk

Looks like others have found the tool chain for you. So, here's the instructions on how to set it up: http://www.amigacoding.de/index.php?topic=17.0

I actually used AmiDevCpp to set it up, simply because I started with it first and then, when I discovered I could compile with Eclipse, had it there already. :)
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: Trev on March 04, 2016, 11:57:27 PM
I never targeted AROS, but for the others, I used a combination of vbcc and GCC running on Windows.

vbcc is great, but when compiled from source on Windows, the host binaries do not emulate the target's floating point environment. It's been years since I've done any Amiga programming, so I'm not sure how vbcc handles that today.

I usually built my own native GCC binaries from the adtools repository under MinGW. Cygwin is probably easier to manage, but at the time, Cygwin support for 64-bit Windows was very poor.
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: HaukeVB on March 07, 2016, 12:28:49 PM
Is it possible to debug a program from outside of WinUAE?
That would be my dream setup. Compile in Eclipse and target 68k or now PPC in WinUAE... and debug in Eclipse...

I suppose this would require some form of remote debugger...
Title: Re: Compiling (esp C/C++) How do you like to do it?
Post by: nicholas on March 07, 2016, 03:06:24 PM
Quote from: HaukeVB;805513
Is it possible to debug a program from outside of WinUAE?
That would be my dream setup. Compile in Eclipse and target 68k or now PPC in WinUAE... and debug in Eclipse...

I suppose this would require some form of remote debugger...

Not that I'm aware of but if you hit Shift-F12 in winuae it brings up the built-in 68k debugger.