English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 30 July 2023, 14:56   #1
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
Should you develop on Amiga or cross compile (With C)?

In 2023, is it best/most convienient to develop natively on the Amiga, or to set up a cross compiling enviroment on Linux for example?

I know C compilers are available on the Amiga, what about make/cmake/git?

I'm currently cross compiling, the only disadvantage I can see is that it obviously takes longer to test the code because you need to plug it into an emulator.
Steam Ranger is offline  
Old 30 July 2023, 15:05   #2
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,188
Somebody was trying to port Git to Amiga but it's only available on MorphOS of the Amiga-likes. Trying to do version control on the host environment is as inconvenient as cross-compiling as a minimum.
Samurai_Crow is offline  
Old 30 July 2023, 15:44   #3
bifat
Registered User
 
Join Date: Mar 2021
Location: Berlin
Posts: 21
Every combination is possible, and an emulator is not needed. You can also have your working directory on a network filesystem and check in on another OS. Cross-compilation is nice, but optional.
bifat is offline  
Old 30 July 2023, 15:47   #4
Olaf Barthel
Registered User
 
Join Date: Aug 2010
Location: Germany
Posts: 532
Quote:
Originally Posted by Steam Ranger View Post
In 2023, is it best/most convienient to develop natively on the Amiga, or to set up a cross compiling enviroment on Linux for example?
If convenience is your primary concern, then you do not need to develop software on the operating system it is intended for. It's not that hard to use, mind you, it's just that the tools are much simpler than what today is considered standard fare.

The Amiga computers were limited by available memory, processing power, storage space and storage device performance. The tools available then had to work well even under these constraints. That said, those tools were both sensible and useful to produce software for the Amiga. The later Amiga operating system versions (Kickstart 2.0 onwards) were created using these Amiga tools which ran on Amigas and did not use cross-compilation.

The Amiga command line shell was sufficiently close to what, as a minimum, Unix shell commands required. The "one integrated tool which does everything" concept never quite took hold on the Amiga. If you squint, you can see similarities between the Amiga command line shell tools and the contemporary Unix tools. There were even Amiga ports of those tools available.

Quote:
I know C compilers are available on the Amiga, what about make/cmake/git?
"make" is available and shipped with Amiga compilers as early as 1987. You could also find a working older GNU make on Aminet, for example.

I don't know if there has ever been an attempt to port "CMake" to the Amiga and I doubt it would fit the environment well. This is "one integrated tool which does everything" which probably never ever ran out of memory on any platform it was used on.

The functionality of "git" exists on MorphOS, AmigaOS4 and not quite yet on the Amiga 68k operating system. One reason why it does not quite yet work for the 68k operating system is that "git", and even the "sgit" command, needs to leverage the performance of the file system in order to do its job well. The 68k Amiga operating system has no mmap() and certainly no high performance file systems to offer (with "high performance file system" meaning exactly what it does on a modern operating system, even if it runs on a vintage 2014 Raspberry Pi). What works to a degree is "subversion" if you want to give it a shot (this is still an old client which has yet to be adapted to use the most modern OpenSSL library).

Quote:
I'm currently cross compiling, the only disadvantage I can see is that it obviously takes longer to test the code because you need to plug it into an emulator.
Ain't that the truth: when the results have to be tested, the Amiga is the problem

Software was developed and tested on Amigas back in the day, and it's still being done today, too. You get an almost healthy respect for how good your game has to be in order to write, test and debug software all on the Amiga. One mistake will ruin your day, or it will teach you a lesson, sometimes both, and sometimes you don't realize it until much later. It happened to me...

This may sound as dumb as it sounds to me at the moment, but hear me out. If you can attain competence and even mastery of Amiga software development on the Amiga, using the tools available, you might build muscle and gain leverage where you previously relied upon more complex tools to build and test software.

This can actually be an interesting tour of the platform and its strengths and weaknesses if you want to explore it.
Olaf Barthel is offline  
Old 30 July 2023, 16:51   #5
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,234
It depends on what you are working on and for what reason.

If you are just hobby coding for fun and have a sensible backup regimen, you can do it all on the Amiga if that's your preference. I coded on my expanded A1200 for years. For quite some time I just used StormGCC and lived with all of its various foibles, discovering many odd hacks along the way. The IDE itself was quite comfortable in RTG and with a BlizzPPC, the compilation times weren't too bad since there was a PPC version of thr compiler.

If you want to use more modern iterations if C and/or C++ moving to cross compilation becomes more important due to the lack of up to date compiler infrastructure.

If you are cross-compiling, lots of useful benefits come with it beyond more up to date compilers.

- You can host the code on the other machine and use samba to share the directory for accessing the executable.
- You can use more modern IDEs.
- You can use version control tools more easily.

Other benefits are that you can use UAE to test your code while developing and avoid exposing your real hardware to potentially buggy iterations of your project.

Last edited by Karlos; 30 July 2023 at 21:24.
Karlos is offline  
Old 30 July 2023, 18:37   #6
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,247
It's really hard to give good advice here because it depends on your personal preference. I personally build both on Amiga and on Linux, but I also cross-build (albeit probably not "cross compile" in the strict meaning of the word).

By the latter I mean that I prefer to run the native Amiga tool chain in vamos on a Linux system. You find the vamos I'm using for my purposes on my github page. This way, I get both good compilation, and also good integration of the linux toolchain. Thus, for example, I'm using SAS/C and DevPac for compiliation and assembling sources, the SAS/C SMake on the emulated console, but emacs from Linux, and subversion from Linux.

My A2000 is equipped with a network card, so I can also copy the binaries simply from Linux to Amiga, or also build natively on the Amiga by "checking out" from a CVS on a samba mount on linux - thanks Olaf for smbfs!

One goal of this architecture was to depend less on my (rather flaky) A2000 which works most of the time, but sometimes not, and to also backup my sources regularly on external media from the PC....

...well, just to find out that my PC died 3 weeks ago. (-:

Anyhow, the sources are on external media and the SSD of the PC, which survived the PC. Seems that the Amiga is, after all, more robust than the PC.

Luckily, I'm a backup maniac, so nothing is lost after all.
Thomas Richter is offline  
Old 30 July 2023, 19:06   #7
arcanist
Registered User
 
Join Date: Dec 2017
Location: Austin, TX
Age: 41
Posts: 410
My cross compile Makefile builds programs directly into a folder mounted as a drive in the emulator. The IDE tooling (code completion, live linting in VS Code) makes cross-compiling my go-to option.

Even back in the day cross compiling wasn't uncommon, particularly for system-unfriendly development. Restarting the target system when something goes wrong is a lot easier if your IDE stays up. Similarly, loading an emulator snapshot is a lot quicker. F12+Return+Return to get back to a good state on my setup.
arcanist is offline  
Old 31 July 2023, 00:45   #8
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,510
Quote:
Originally Posted by Steam Ranger View Post
In 2023, is it best/most convienient to develop natively on the Amiga
As others already wrote, this is much about your personal preferences. Additional factors might be the complexity of the project or the desire to relive the original experience. Also ask yourself if you prefer IDEs. Then all your development will probably be locked to one specific environment, which only exists for one specific system.

I prefer the command line, any editor, Makefiles and CVS or SVN as version control system, which makes me build my projects on nearly any platform. I am mostly developing and cross-compiling on MorphOS and NetBSD, but I can also check-out and compile on my A3000/060 anytime.

Quote:
or to set up a cross compiling enviroment on Linux for example?
"Setting up" a cross compiler shouldn't be any more difficult than a normal compiler.

Quote:
I know C compilers are available on the Amiga,
For native Amiga development you should probably stick with the original C compilers of the 90s, like SAS/C, preferably. Newer versions of gcc are not really useable on classic hardware. Even vbcc is not much fun to use below a 060.

Quote:
what about make/cmake/git?
I wonder why people always name git, as if it is the only version control system in existence. In all my projects I never needed a feature which was not covered by cvs or svn. With the advantage that they are much less resource-hungry than git, exist even on classic systems, and you can easily set up your own server.

Don't get me started on cmake!
(Short: There is no reason you will ever need it for Amiga development.)

Quote:
I'm currently cross compiling, the only disadvantage I can see is that it obviously takes longer to test the code because you need to plug it into an emulator.
Others already gave good replies. I also don't see the problem here. You will usually write to a local or network shared directory with the emulator, or let your Makefile/build-script generate an ADF.

For me the original hardware is still important for testing. Although I do most development and tests with an emulator, the real hardware should run the program every few days. Not only for verification, but also because it is the only reason to do the development. I wouldn't have any motivation to write Amiga programs for emulation only.
phx is offline  
Old 31 July 2023, 08:19   #9
Olaf Barthel
Registered User
 
Join Date: Aug 2010
Location: Germany
Posts: 532
Quote:
Originally Posted by phx View Post
I wonder why people always name git, as if it is the only version control system in existence. In all my projects I never needed a feature which was not covered by cvs or svn. With the advantage that they are much less resource-hungry than git, exist even on classic systems, and you can easily set up your own server.
There are other version control systems which work well but have been overshadowed by git, such as Mercurial and Fossil (which was designed by and is used by the sqlite developers).

git certainly is the most visible because it has been successfully commercialized. It also does what it says on the tin and will do the job more than just fine.

The downside to git, if you want to call it that, is that its complexity easily flips into becoming a burden. You wanted a cotton bag to carry things around, but what you got instead, and for free, is an Airbus Beluga and now you need to find a parking spot for it, learn how to crew and manage it, never mind how you source the kerosine

Given a choice with no other requirements attached, I would always opt for subversion or even CVS because what they do is easily remembered and you rarely need more than that.
Olaf Barthel is offline  
Old 31 July 2023, 09:35   #10
pink^abyss
Registered User
 
Join Date: Aug 2018
Location: Untergrund/Germany
Posts: 408
Quote:
Originally Posted by Steam Ranger View Post
I'm currently cross compiling, the only disadvantage I can see is that it obviously takes longer to test the code because you need to plug it into an emulator.

I use Bartmans C/C++ VsCode Solution for Windows.
I think the much faster compile times make up for a potentially slower startup.
Also crashing wont slow you down.
You also get debugging capabilities down to every cpu and chipset
cycle of your program.

Also I use LTO which would be too slow to use on real Amigas (it already takes 1-2 seconds on a 1000 times faster Pc ).
pink^abyss is offline  
Old 31 July 2023, 09:59   #11
Locutus
Registered User
 
Join Date: Jul 2014
Location: Finland
Posts: 1,181
Modern development tools are just so much better, i use Emacs with Clangd and lldb on C/C++ projects and i can't imagine why i would let go of the productivity improvements it provides.

I've been working a bit here and there on re-porting modern SSH to AmigaOS and it's all been cross-compiled + vamos for testing.
Locutus is offline  
Old 31 July 2023, 14:57   #12
mr.spiv
Registered User
 
mr.spiv's Avatar
 
Join Date: Aug 2006
Location: Finland
Age: 52
Posts: 244
Quote:
Originally Posted by Steam Ranger View Post
In 2023, is it best/most convienient to develop natively on the Amiga, or to set up a cross compiling enviroment on Linux for example?
A matter of preference.. I do +90% native just because I can and want to. You cannot beat the "efficiency" of cross-compilation or emulation in modern computers. But, for example, for my retro needs efficiency is not the main motivation.. although sometimes using a3000/040 is a bit on a "too tad slow" side Currently, what I miss most is a 68k version of a git client..
mr.spiv is offline  
Old 31 July 2023, 15:17   #13
bifat
Registered User
 
Join Date: Mar 2021
Location: Berlin
Posts: 21
I'm doing my coding on unixoids and cross-translate for Amiga. But I run the things on real machines, because, as phx said: "I wouldn't have any motivation to write Amiga programs for emulation only." Or at all. There's no point.
The development tools I wrote are usually targeted to ANSI/POSIX, so that I can take them with me and supply them to Mac/Win fellows. But one of my future endeavours will be to bring them all back to Amiga, so that I can visit future parties with just the real thing - and no foldable PC anymore. That would finish a lifetime's journey with many interesting perspectives, but also a lot of fruitless aberrations. But it's still a long way back home.
bifat is offline  
Old 31 July 2023, 23:53   #14
NorthWay
Registered User
 
Join Date: May 2013
Location: Grimstad / Norway
Posts: 848
Quote:
Originally Posted by Steam Ranger View Post
I'm currently cross compiling, the only disadvantage I can see is that it obviously takes longer to test the code because you need to plug it into an emulator.
Que? I'm using WinUAE and I simply have a mount that accesses a native directory that I have just called "FILE:" from which I can read and write anything that I plonk down there from the host side.
I can't think of anything simpler than just switching back to the emulator and test there.
NorthWay is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
I will develop on Amiga again!!! ecalius Coders. AMOS 9 08 May 2023 19:50
cross compile problem Amiga_1000 support.FS-UAE 0 03 April 2020 05:40
A library template (C/Asm, mainly cross-develop focused) alkis Coders. C/C++ 1 06 June 2018 21:58
I need a new Amiga game to develop - any requests? Graham Humphrey Amiga scene 55 25 November 2016 22:47
If I could develop an Amiga now, it would have..... 7-Zark-7 Retrogaming General Discussion 2 16 November 2001 18:41

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:23.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08744 seconds with 13 queries