Shop OBEX P1 Docs P2 Docs Learn Events
Catalina 2.6 - a FREE C compiler for the Propeller - The Final Frontier! - Page 10 — Parallax Forums

Catalina 2.6 - a FREE C compiler for the Propeller - The Final Frontier!

17810121320

Comments

  • RossHRossH Posts: 5,573
    edited 2010-06-17 00:03
    Hi Steve,

    Thanks for this - I'll try it out tonight. I can also use it in the kernel (which now uses PASM overlays). Currently, I do it manually!

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • kuronekokuroneko Posts: 3,623
    edited 2010-06-17 00:26
    jazzed said...
    The output should be a nicely formatted C array.
    What's the purpose of the trailing 0 in the array?
  • jazzedjazzed Posts: 11,803
    edited 2010-06-17 02:05
    kuroneko said...
    jazzed said...
    The output should be a nicely formatted C array.
    What's the purpose of the trailing 0 in the array?
    Pick one smile.gif
    • In case the array comes up empty.
    • So I can visually recognize the end.
    • An old habit that's hard to break.
    • I forgot.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Pages: Propeller JVM
  • kuronekokuroneko Posts: 3,623
    edited 2010-06-17 02:10
    I settle for In case the array comes up empty. [noparse]:)[/noparse]
  • RossHRossH Posts: 5,573
    edited 2010-06-17 09:39
    Steve,

    All I get when I try to execute spinc.exe is "This application failed to start because the application configuration is incorrect."

    Am I missing something?

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • jazzedjazzed Posts: 11,803
    edited 2010-06-17 17:47
    Hi Ross, the program was compiled for 32 bit windows. This is why I said:
    "Either it works or it doesn't ... that's all I can do for you."

    The source is on line if you want that, but will fail as is with a 16 bit compiler [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Pages: Propeller JVM
  • RossHRossH Posts: 5,573
    edited 2010-06-17 22:56
    Hi Steve,

    Thanks - I found the source, and it now compiles and works ok.

    With your permission, I'd like to include it as a utility with Catalina (with due credit of course). Is that ok?

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • jazzedjazzed Posts: 11,803
    edited 2010-06-17 23:18
    Sure Ross. Glad you found the source and see value in using it.

    Cheers,
    --Steve
    RossH said...
    Hi Steve,

    Thanks - I found the source, and it now compiles and works ok.

    With your permission, I'd like to include it as a utility with Catalina (with due credit of course). Is that ok?

    Ross.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Pages: Propeller JVM
  • RossHRossH Posts: 5,573
    edited 2010-06-19 05:35
    @All,

    Calling PASM programs from C is a subject that has come up several times recently - both in this thread and in various PM's I've received. Since Steve's 'spinc' utility simplifies the whole process dramatically, I've decided I should provide some better examples.

    I have added a file called 'Catalina_Using_PASM.zip' to the first post in this thread - it gives working examples of two methods of using PASM in conjunction with Catalina:
    • starting a PASM program in a cog using _coginit()
    • calling a function written in PASM directly from C
    .

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina

    Post Edited (RossH) : 6/19/2010 8:00:03 AM GMT
  • park1231park1231 Posts: 4
    edited 2010-06-21 08:01
    I just upgraded to the new version of code::blocks and am receiving an error during build. The build log output is below.
    -------------- Clean: Release in Catalina ---------------
    
    Cleaned "Catalina - Release"
    
    -------------- Build: Release in Catalina ---------------
    
    catalina.exe -D HYDRA -x0 -M32k      -c "..\..\..\..\..\Program Files (x86)\catalina\demos\hello_world.c" -o "obj\Release\Program Files (x86)\catalina\demos\hello_world.obj"
    : Invalid argument
    lcc: 
    Catalina Compiler 2.5
    Process terminated with status 1 (0 minutes, 1 seconds)
    0 errors, 0 warnings
     
    
    



    In the configuration file for Code::Blocks the linker is defined as catalina.exe. Is this correct? There is an "-lc" switch in the command which does not seem to be supported by catalina.exe

    TIA
  • RossHRossH Posts: 5,573
    edited 2010-06-21 08:34
    Hi Park1231,

    Yes, catalina is the name of a "wrapper" program for both the compiler and linker. And the '-lc' option is quite valid - it tells Catalina to include the standard C library when linking.

    But the -o "obj\Release\Program Files (x86)\catalina\demos\hello_world.obj" part looks wrong - that doesn't look like the a correct path. Are you sure you copied it correctly?

    If so, can you post your default.conf file, and also your hello_world.cbp file? Something in there must have been corrupted.

    Ross.

    P.S. On 64 bit windows, I generally recommend recompiling Catalina from source (after editing Catalina\source\lcc\etc\catalina_win32.c, Catalina\source\catalina\catalina.c and Catalina\source\catalina\catbind.c to change C:\\Program Files\\Catalina to C:\\Program Files (X86)\\Catalina). Have you tried this?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina

    Post Edited (RossH) : 6/21/2010 8:42:07 AM GMT
  • park1231park1231 Posts: 4
    edited 2010-06-21 11:59
    I have been trying to recompile from source but run into this error
    C:\Users\Rich-Workstation\Downloads\catalina_catalyst\source\catalina>build_all
    rm -f catbind.exe catalina.exe payload.exe blackbox.exe
    rm -f y_tab.c y_tab.h blackbox_l.c
    gcc -D WIN32_PATHS -o catbind.exe catbind.c
    gcc -D WIN32_PATHS -o catalina.exe catalina.c
    gcc -D WIN32_PATHS -o payload.exe payload.c rs232.c
    bison -y -d blackbox_y.y
    process_begin: CreateProcess(NULL, bison -y -d blackbox_y.y, ...) failed.
    make (e=2): The system cannot find the file specified.
    mingw32-make: *** [noparse][[/noparse]y_tab.c] Error 2
    cp catbind.exe "C:\\Progra~2\\catalina\\bin\\"catbind.exe
    cp catalina.exe "C:\\Progra~2\\catalina\\bin\\"catalina.exe
    cp payload.exe "C:\\Progra~2\\catalina\\bin\\"payload.exe
    cp blackbox.exe "C:\\Progra~2\\catalina\\bin\\"blackbox.exe
    cp: cannot stat `blackbox.exe': No such file or directory
    mingw32-make: *** [noparse][[/noparse]install] Error 1
    
    



    I edited the three files, makefile and batch file, but still no dice.
    Thank You for your help.
  • RossHRossH Posts: 5,573
    edited 2010-06-21 12:10
    Hi Park1231,

    It looks like you do not have Bison installed. You need both Flex and Bison. You can download them from http://sourceforge.net/projects/mingw/files/

    I still think your problem is probably related to a corruption somewhere in your configuration files. Can you post them?

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • park1231park1231 Posts: 4
    edited 2010-06-21 21:33
    This is kinda embarrassing , but I went back through the catalina_win32.c file and it seems I entered an extra line with the words "program files". It must have happened when I was searching the file for that string. I recompiled without it and now everything works perfect. I'm really stoked to get started on this and a big thumbs up for making it possible.
  • RossHRossH Posts: 5,573
    edited 2010-06-21 21:34
    @Park1231,

    No worries - glad you got it working.

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • RossHRossH Posts: 5,573
    edited 2010-06-22 09:20
    @All,

    I have just issued a patch release for Catalina 2.5 (22 Jun 10). It is in the first post of this thread. This patch fixes two problems in Catalina 2.5:

    1. The lock functions _lockset() and _lockclr() were not correctly returning the previous state of the lock, and _locknew() now returns the value 8 on error (i.e. if there are no more locks available).

    2. All the predefined targets incorrectly gave an error if the combination of HMI options LORES_TV (or just TV), NO_KEYBOARD and NO_MOUSE was specified - even on platforms that support this combination.

    This patch release applies to both Windows and Linux versions of Catalina, and should be unzipped in the main Catalina directory. It will overwrite some files in the source, lib and target directories. There is no need to rebuild Catalina.

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • RossHRossH Posts: 5,573
    edited 2010-07-01 13:15
    @All,

    Catalina 2.6 has been released.

    The main addition in release 2.6 is support for running C programs on all eight Propeller cogs simultaneously. Programs demonstrating this capability are included in the demos\multicog directory. There are also other minor enhancements - see the README.WhatsNew file attached to the first post in this thread for more details.

    Note that from this release onwards, Catalina will be hosted and released via SourceForge - see catalina-c.sourceforge.net. At present you will see only a default sourceforge project page - but you will find a link to the project downloads on that page. Since SourceForge has generous file size limits, each of the Windows and Linux distributions are provided in a single download containing all documentation, source code and binaries - this should simplify the download and installation process.

    You will also find a button on the Sourceforge project page that enables you to donate money to support Catalina! All donations will be used to enhance Catalina - in particular, to allow Catalina to be ported to additional Propeller platforms.

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • RossHRossH Posts: 5,573
    edited 2010-07-01 23:52
    @All,

    Since posting Catalina on SourceForge (just hours ago) it's had a larger number of downloads than I would see in weeks through these forums. I think the program description is perectly clear and I only notified this forum about the posting, so presumably nobody without a Propeller or who doesn't read these forums would bother downloading it - or would they?

    Does anyone have experience with SourceForge? Are there people or companies who just download any new projects posted there for some reason? Or could these be genuine user downloads, and the downloads reported on these pages (which I've always presumed to be accurate) is in fact be a significant underestimate of actual downloads?

    If you read about the new release of Catalina here, and have downloaded it in the last few hours from SourceForge, can you please post in this thread? - I would just like to know whether it is actually Propeller owners from these forums who are downloading it.

    Thanks,

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-07-01 23:58
    I suspect they are real downloads. People outside of the propeller world would not not necessarily know about this forum. But lots of people visit sourceforge.

    The next thing you might find is people wanting to buy a propeller!

    As an aside, I think this has been true for some time, but Catalina supports the 512k ram chip, does it not?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • RossHRossH Posts: 5,573
    edited 2010-07-02 00:39
    @Dr_Acula,

    Yes - I can't recall what SRAM chip the DracBlade has (I'm at work at present), but I support 512K chips on the TriBlade, RamBlade and Morpheus.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • hover1hover1 Posts: 1,929
    edited 2010-07-02 02:05
    Ross,

    I was one that visited the SoundForge page. I REALLY like the fact that the download is 1 file. This was a great move!

    Still newbie on C, but thanks for the great effort that you have put out. I'm sure I'll appeciate it more as I learn C.

    Jim
    RossH said...
    @All,

    Since posting Catalina on SourceForge (just hours ago) it's had a larger number of downloads than I would see in weeks through these forums. I think the program description is perectly clear and I only notified this forum about the posting, so presumably nobody without a Propeller or who doesn't read these forums would bother downloading it - or would they?

    Does anyone have experience with SourceForge? Are there people or companies who just download any new projects posted there for some reason? Or could these be genuine user downloads, and the downloads reported on these pages (which I've always presumed to be accurate) is in fact be a significant underestimate of actual downloads?

    If you read about the new release of Catalina here, and have downloaded it in the last few hours from SourceForge, can you please post in this thread? - I would just like to know whether it is actually Propeller owners from these forums who are downloading it.

    Thanks,

    Ross.

  • heaterheater Posts: 3,370
    edited 2010-07-02 07:33
    I wonder if sourceforge gets mirrored a lot. I know they have lots of mirrors around the world and presumably moving files among these mirrors does not count as downloads. But what about other people mirroring?

    Then there may be a lot of people otherwise not interested in the Propeller as such but perhaps with an interest in what can be done with LCC.

    Then there is the name "Catalina C" well it sounds so good you have to check it out[noparse]:)[/noparse]

    It's a big world out there !

    I have made one download each of the Windows, Linux and doc archives.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-07-02 09:16
    Maybe there are others that like the description and are downloading to look at it. Maybe that may bring some more people to become propheads. We can only hope.

    Anyway, I didn't download.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • RossHRossH Posts: 5,573
    edited 2010-07-02 09:54
    @all

    I think the mirroring idea may be it. After the initial flurry, downloads seem to have calmed down to more normal levels.

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • RossHRossH Posts: 5,573
    edited 2010-07-16 02:08
    @All,

    I've mentioned it in several forum threads, and had a few private enquiries about it, so I figured it was time I officially announced the Catalina Code Optimizer. I hadn't intended to release it just yet (it's still undergoing final testing) but a preliminary release is available for Windows if anyone is interested. A Linux release will follow shortly.

    Here is some information about the Optimizer:

    The Catalina Code Optimizer is a standalone program that integrates seamlessly with Catalina 2.6 or later. Just copy the optimizer binaries to your existing Catalina binary directory - no need to reinstall or recompile anything.

    The Optimizer is invoked by adding -Ox to any existing Catalina command, where x is the desired optimization level. For example:
    catalina -lc hello_world.c -O2
    

    Initially, three levels of optimization will be supported:

    -O1 : basic optimization (single pass optimization)
    -O2 : intensive optimization (performs a second optimization pass)
    -O3 : same as -O2 but with automatic inlining

    The single optimization pass (-O1) does most of the work, and typically reduces the size of code segments by 10%. The increase in overall program performance achieved typically ranges from 5% to 15% depending on the program itself (the larger savings are typical for programs that use the XMM memory model). The second optimizer pass (-O2) can save an additional few percent in both space and execution time in larger programs. The third option (-O3) searches for functions where inlining the body of the function would save the overhead of actually performing the function call - provided the inlining does not make the code size any larger (this optimization can make a very large difference in programs that are constructed from many small functions).

    A fourth optimization level (-O4) may be added later for more agressive inlining - it would inline functions provided this made the final executable no more than 10% larger. Given that the previous passes typically result in saving of around 10%, the effect of this option would be to optimize speciifcally for performance - the final program size would most likely be about the same size as the original.

    Note that the optimizer works on ALL the C code in the program - including library functions (i.e. you don't need to maintain two versions of either the standard C libraries or your own libraries - one compiled with the optimizer and one without).

    Optimized code can still be used with either the BlackBox and BlackCat debuggers (except that inlining should not be used when you want to debug functions that may have been inlined!)

    Note that the Catalina Optimizer is NOT open source software, and is not included with the free version of Catalina. The optimizer will be licensed and distributed in binary form only. I have not decided on a final price yet, but I am currently thinking of US$25. This price will include the right to updates to the Optimizer for one year.

    PM or email me if you are interested.

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • Bill HenningBill Henning Posts: 6,445
    edited 2010-07-16 03:16
    Nice work Ross, and a good way for you to hopefully get a few $ for your incredible effort to date!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com E-mail: mikronauts _at_ gmail _dot_ com
    My products: Morpheus / Mem+ / PropCade / FlexMem / VMCOG / Propteus / Proteus / SerPlug
    and 6.250MHz Crystals to run Propellers at 100MHz & 5.0" OEM TFT VGA LCD modules
    Las - Large model assembler Largos - upcoming nano operating system
  • RossHRossH Posts: 5,573
    edited 2010-07-23 13:26
    @All,

    Well, the answer is in ... it's ... 42!

    And the question? ... "What's the biggest percentage saving the new Code Optimizer can make to the size of a Catalina program?"

    Code segment size without any optimization = 284 longs
    Code segment size with -O2 optimization = 252 longs (saving 11%)
    Code segment size with -O3 optimization = 164 longs (saving 42%)

    Ross.

    P.S. Okay, I should probably admit that this massive reduction was only achieved on one of the usual Catalina demo programs - and it was one that I already knew was pretty bad in terms of code generation. More typically, the code size saving the Catalina Opimizer makes is around 15%.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • heaterheater Posts: 3,370
    edited 2010-07-23 14:16
    Amazing.

    Good that it did not take 7½ million years to get that result[noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • jazzedjazzed Posts: 11,803
    edited 2010-07-23 14:43
    Fascinating that in other threads that you insist size does not matter, but here
    you're suggesting people should pay for a program to optimize code size.

    Interesting contradiction, and I'm sure you'll have a good explanation.

    Don't get me wrong. I do believe you deserve something for your efforts
    from anyone who embraces the solution.

    Cheers,
    --Steve

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Pages: Propeller JVM
Sign In or Register to comment.