Author Topic: Unified cross-development toolchain for Linux/Windows/MacOSX  (Read 2019 times)

0 Members and 1 Guest are viewing this topic.

Offline krusty_benediction

  • CPC664
  • ***
  • Posts: 100
  • Country: fr
  • Liked: 81
For my previous demos (Wake Up! by benediction & Sector One :: pouët.net
Wake Up! by benediction & Sector One :: pouët.net, Stop that nyan cat! by benediction & HOOY-PROGRAM :: pouët.net
Stop that nyan cat! by benediction & HOOY-PROGRAM :: pouët.net, Bloc Us ! by benediction & Brainstorm :: pouët.net
Bloc Us ! by benediction & Brainstorm :: pouët.net) I had to be able to build them on Linux (my OS) and Windows (the OS of the other members of the group).
The solution I implemented was not good:
 - need to manually install tons of software under windows
 - need to write Makefiles with different rules depending on the OS
 - accepting to not be able to build the data from a windows machine (in order to avoid the installation and configuration of tons of python packages)

I think I have found a better solution where exactly the same tools are used with Linux, Windows (and eventually MacOSX) from to Docker containers.
This time, Windows users only have to install one tool and nothing else.

The container can be the same for all the projects are specialized for specific projects.

Under linux, the container is executed as any Linux application, but under windows, the container is executed within a Linux virtual machine.

As already said in another post related to Linux, If you are interested, here is the link of the project: cpcsdk/docker-amstrad-crossdev · GitHub

I can change the content if the container if needed.



Offline ronaldo

  • Dev
  • 6128 Plus
  • *****
  • Posts: 564
  • Country: es
    • Fremos Blog
  • Liked: 755
Re: Unified cross-development toolchain for Linux/Windows/MacOSX
« Reply #1 on: 22:51, 22 November 15 »
The multiplatform issue is one of the toughest. I've dealt with this problem many times in different contexts. For instance, building game projects for PC in Windows, Linux and MacOSX, even compiling with different toolsets: for this problem cmake was of great help. It generates either makefiles or IDE project files (for Visual Studio or Netbeans, for instance). It helped us solve these issues (or manage).

For Amstrad CPC cross-compiling I decided to stick to POSIX tools, that work perfectly on Linux and MacOSX. Then, if you wanted to develop from Windows you have 2 alternatives: a virtual machine with Linux, or Cygwin. Working this way, there are very few platform-specific problems for the development team. Almost everything is developed under Linux and MacOSX, then it usually runs fine over Cygwin. The main idea is minimizing differences among platforms, as these differences cost plenty of development time.

As I told you before, haven't had the opportunity to test Docker yet, but I'll definitely have a look at it as soon as I have some time for that :) .

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 14.374
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 2587
Re: Unified cross-development toolchain for Linux/Windows/MacOSX
« Reply #2 on: 13:52, 23 November 15 »
I'm thinking about running this on my NAS just for the fun of it :D

Offline krusty_benediction

  • CPC664
  • ***
  • Posts: 100
  • Country: fr
  • Liked: 81
Re: Unified cross-development toolchain for Linux/Windows/MacOSX
« Reply #3 on: 00:17, 10 February 16 »
In order to ease the use of such thing, I have just created a template (GitHub - cpcsdk/cookiecutter-amstrad-crossdev: Cookiecutter template to create) which automatizes the creation of new projects.

It uses the Makefile library I am using for the anniversary demo which treat assembly / crunching / file management

I guess it can be easily adapted for a cpctelera-like template

Offline krusty_benediction

  • CPC664
  • ***
  • Posts: 100
  • Country: fr
  • Liked: 81
The toolchain (docker container + makefiles in the cookiecutter stuff) now contains the xfer tool to automatize exchange through the CPC WIFI card.
I guess, vasm is updated of several versions since November 2015.

Arnold emulator is also installed, but I guess it does not work well with such environment (at least it is the case on my computer)

Offline krusty_benediction

  • CPC664
  • ***
  • Posts: 100
  • Country: fr
  • Liked: 81
Latest version includes grafx2.

Offline johnlobo

  • CPC464
  • **
  • Posts: 8
  • Country: es
  • Liked: 6

Small contribution.


Right now I'm developing an Amstrad project, simultaneouslly in mac and windows, using an online IDE.
I'm using "Code Anywhere" but I've also tested that it works on "Cloud9".
In both IDEs, you can open a free account an create your instance of a small linux machine (I guess it's Ubuntu) with gcc and git pre-installed. You can access the cloud machine through a web browser, were you can execute a ssh console and an rich code editor. Thanks to the "apt-get" package manager (also pre-installed) and the ssh console, you can install everything that Cpctelera needs to work properly, and compile your applications.


Once the evironment is setup, you can use github, gitlab, bitbucket, or any GIT repository as the central repository for your code, to be able to develop either from your local machine (os x in my case) or the online IDE (while working on Windows, Android...).


The only drawback is that, while in the online environment, testing your app requires to install winape on your local machine, and download the excutable file of your project, every time you want to see it running.

Even though downloading the dsk it's just a few seconds, I've  tried  to have a full online evironment, setting up an HTML page with CPCInaJar hosted in the cloud environment to execute your dsk in the browser too.

The good news are that It works, the bad news are that not as good as I would like to, because you are tied to test in Explorer (Firefox and Chrome do not support Java applets anymore), sometiemes I get some weird results in the execution of  the application (probably due to some unsupported features in the emulator), and of course you lack of the debug tools of winape. So, for now, I will continue downloading the dsk and testing in the local Winape.


And, that's it.


If someone is interested in going deeper into this, I can write a small tutorial of how to setup an online environment, it's pretty easy.


Regards.

The multiplatform issue is one of the toughest. I've dealt with this problem many times in different contexts. For instance, building game projects for PC in Windows, Linux and MacOSX, even compiling with different toolsets: for this problem cmake was of great help. It generates either makefiles or IDE project files (for Visual Studio or Netbeans, for instance). It helped us solve these issues (or manage).

For Amstrad CPC cross-compiling I decided to stick to POSIX tools, that work perfectly on Linux and MacOSX. Then, if you wanted to develop from Windows you have 2 alternatives: a virtual machine with Linux, or Cygwin. Working this way, there are very few platform-specific problems for the development team. Almost everything is developed under Linux and MacOSX, then it usually runs fine over Cygwin. The main idea is minimizing differences among platforms, as these differences cost plenty of development time.

As I told you before, haven't had the opportunity to test Docker yet, but I'll definitely have a look at it as soon as I have some time for that :) .
« Last Edit: 13:05, 30 October 17 by johnlobo »

Offline krusty_benediction

  • CPC664
  • ***
  • Posts: 100
  • Country: fr
  • Liked: 81
Re: Unified cross-development toolchain for Linux/Windows/MacOSX
« Reply #7 on: 21:47, 05 November 17 »
Latest version includes grafx2.
Latest version now includes Arkos Tracker (in /opt). I'll update my crossdev toolchain to add makefil target as soon as possible.

To properly use it, docker must be able to access t othe audio card (Arkos Tracker make a segfault if is not the case)
docker run -e DISPLAY=:0 \
    -v /tmp/.X11-unix:/tmp/.X11-unix   \
          -v /dev/snd:/dev/snd \
     -v /dev/shm:/dev/shm \
     -v /etc/machine-id:/etc/machine-id \
     -v /run/user/$(id -u)/pulse:/run/user/$(id -u)/pulse \
     -v /var/lib/dbus:/var/lib/dbus \
     -v ~/.pulse:/home/arnold/.pulse \
     --privileged \
    --rm=true \
    -i -t cpcsdk/crossdev

Offline krusty_benediction

  • CPC664
  • ***
  • Posts: 100
  • Country: fr
  • Liked: 81
Re: Unified cross-development toolchain for Linux/Windows/MacOSX
« Reply #8 on: 13:34, 12 November 17 »
I've fixed the installation of cpctelera. It seems it was not properly installed because of the lack of mono.


@ronaldo I 've only tested it on kungfuguns. Could you confirm that it works for your other projects ? (and in this case promote this toolchain for your future contests?)

I've added  rasm
@roudoudou are you able t ocompile your latest demo with the container ? Do I need to add additional tools ?

Offline ronaldo

  • Dev
  • 6128 Plus
  • *****
  • Posts: 564
  • Country: es
    • Fremos Blog
  • Liked: 755
Re: Unified cross-development toolchain for Linux/Windows/MacOSX
« Reply #9 on: 14:04, 12 November 17 »
I've fixed the installation of cpctelera. It seems it was not properly installed because of the lack of mono.
It actually does not even start installing. It gives you an error message when doing prior tests because original Arkos Tracker tools require mono to be run. You sent the issue to our github with the message that was telling you to install mono.

@ronaldo I 've only tested it on kungfuguns. Could you confirm that it works for your other projects ? (and in this case promote this toolchain for your future contests?)
Well, if it works for kungfuguns, I see no reason why it shouldn't work on other projects. Testing is really easy. Go to CPCRetroDev website and you'll have many projects made with CPCtelera. You can test them same way as you did for kungfuguns. If CPCtelera is installed, just get the project and tape in make.

If you think your toolchain is mature enough for general users, there is no problem in adding it to the list of available toolchains on next contest web page. Remember it to me next time if I forget to add it.

Offline krusty_benediction

  • CPC664
  • ***
  • Posts: 100
  • Country: fr
  • Liked: 81
Re: Unified cross-development toolchain for Linux/Windows/MacOSX
« Reply #10 on: 19:40, 12 November 17 »
Quote
Well, if it works for kungfuguns, I see no reason why it shouldn't work on other projects. Testing is really easy. Go to CPCRetroDev website and you'll have many projects made with CPCtelera. You can test them same way as you did for kungfuguns. If CPCtelera is installed, just get the project and tape in make.

I've tested several of the examples (advanced and simples) provided by cpctelera in /tmp, modifed their configuration to be like that:ifndef CPCT_PATH
CPCT_PATH      := $(THIS_FILE_PATH)../../../../cpctelera/
endif
to be sure I use the right path of cpctelera and it workded
Quote
If you think your toolchain is mature enough for general users, there is no problem in adding it to the list of available toolchains on next contest web page. Remember it to me next time if I forget to add it.
Yes I think. Maybe it is better to say it more as adevelopement envrionement pre installed than a toolchain. cpctelera is one of the toolchains, the one I use for my edmos (https://github.com/cpcsdk/cookiecutter-amstrad-crossdev) another one.BTW, I think I'll modify progressively my own toolchain to be mor ebased on cpctelera



Offline roudoudou

  • 464 Plus
  • *****
  • Posts: 493
  • Country: fr
    • urban exploration
  • Liked: 549
Re: Unified cross-development toolchain for Linux/Windows/MacOSX
« Reply #11 on: 09:41, 13 November 17 »
I've added  rasm
@roudoudou are you able t ocompile your latest demo with the container ? Do I need to add additional tools ?


There is another version of rasm upcoming, with little modifications
While i had add the exomizer sources to rasm, i did not activate the incexo and lzexo directives (mostly because exomizer is sooooooo slow)
But while releasing our demo, the cheat part was a little to big to fit the remaining free space on the cartridge, so instead of compiling the cheat part standalone, i activated the directives in order to keep label sharing between all the code portions
And as far as i remember, i was working on code/nocode behaviour to use it like maxam in order to define structure
Anyway, when i see the interest for my latest intro sources, i don't know if i will release the code of CRTC³


BUT I plan to release my mini-library:
- many macros for rom connection
- many macros for CRTC transitions (in order to keep 50Hz VBL and 15KHz HBL during the whole demo)
- also future version of rasm will produce assembly code of decrunchers for all supported crunchers


About additionnal tools used, they are not integrated in rasm. All converters or code generators won't be part of Rasm



use RASM, the best assembler ever made :p

I will survive

Offline krusty_benediction

  • CPC664
  • ***
  • Posts: 100
  • Country: fr
  • Liked: 81
Re: Unified cross-development toolchain for Linux/Windows/MacOSX
« Reply #12 on: 21:25, 10 December 17 »
chipnsfx (http://cngsoft.no-ip.org/chipnsfx.htm) from @cngsoft just added to the toolbox