Shop OBEX P1 Docs P2 Docs Learn Events
Catalina 3.4 - Page 2 — Parallax Forums

Catalina 3.4

2456711

Comments

  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-10-27 21:08
    LOL! You're showing your age, Dr_A

    Guilty as charged. My kids don't know what to do with a ">" prompt. They just tell me to get online and buy them an ipad touch.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-10-27 22:45
    I just misread your post Drac. Its an iPad2 they want ;) Thought you originally meant an iPod Touch which is an iPhone without the phone part.

    Obviously they don't frequent your workshop much if they don't know what an ">" means!
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-10-28 00:04
    Yes I'm not even quite sure what it is called. I was told it was made by Apple, started with "i", everyone has one, and hand over the credit card.

    I need to get the kids to learn C :)
  • frank freedmanfrank freedman Posts: 1,983
    edited 2011-10-28 01:20
    My son has one to encourage exploration and for use as an augmentative comm device. My wife has one to preview some apps and books for him. I refuse to drink that brand of kool aid. They are great devices if you can accept apples my way or no way (highway not optional) approach to ipad use and apps. Want to save video you just shot to jump drive? Save a file to same or worse read one like a file system ? You get to experience the NO way! Just waiting for the right pad to evolve.........

    Frank

    Sorry to deviate...
  • David BetzDavid Betz Posts: 14,516
    edited 2011-10-28 08:28
    Has anyone run Catalina under Mac OS X recently? Any tips on building it? I got LCC to build but I had trouble getting the catalina driver program to build. I'll have to look at it more closely later. I just wondered if anyone else had tried and had any advice.

    Thanks,
    David
  • David BetzDavid Betz Posts: 14,516
    edited 2011-10-28 14:28
    With a little fooling around I got everything except payload to compile on the Mac. I'm now trying to build the demos. If I run the build_all script in the demos folder I get lots of instances of this error:
    Catalina Compiler 3.4
    lcc: fatal error in /Users/dbetz/Catalina_3.4/bin/rcc
    
    Any idea what might be causing this?
  • RossHRossH Posts: 5,512
    edited 2011-10-28 15:47
    David Betz wrote: »
    With a little fooling around I got everything except payload to compile on the Mac. I'm now trying to build the demos. If I run the build_all script in the demos folder I get lots of instances of this error:
    Catalina Compiler 3.4
    lcc: fatal error in /Users/dbetz/Catalina_3.4/bin/rcc
    
    Any idea what might be causing this?

    Hi David,

    One of the 2.X releases was built on OS/X - but I now no longer remember who built it, and I never heard any more about it.

    Also, remember that LCC supports other targets. To test out LCC independently of the Catlaina components, try a command like:
    lcc -target=x86/linux hello_world.c -v -c
    

    Note 1: the assembly language output will be put in hello_world.obj (remember that Catalina uses assembly language as its object format).

    Note 2: you need the -c flag as there is no assembler, linker or libraries provided for any target other than the Propeller - but this command will at least test out the lcc, cpp and rcc components. Once you have those working I can help you with the Catalina components.

    Ross.
  • David BetzDavid Betz Posts: 14,516
    edited 2011-10-28 18:45
    Thanks Ross! What does the rcc program do? I wasn't able to find any documentation on it. Is it the code generator for lcc?
  • RossHRossH Posts: 5,512
    edited 2011-10-28 19:04
    David Betz wrote: »
    Thanks Ross! What does the rcc program do? I wasn't able to find any documentation on it. Is it the code generator for lcc?

    Hi David,

    rcc is the actual compiler - the various code generators (including Catalina's) are just part of it.

    lcc
    is really just a wrapper program that marshalls all the arguments to rcc and then invokes it.

    Similarly, catalina is really just a wrapper program that marshalls all the arguments to lcc and then invokes it.

    Ross.
  • David BetzDavid Betz Posts: 14,516
    edited 2011-10-28 19:19
    RossH wrote: »
    Hi David,

    One of the 2.X releases was built on OS/X - but I now no longer remember who built it, and I never heard any more about it.

    Also, remember that LCC supports other targets. To test out LCC independently of the Catlaina components, try a command like:
    lcc -target=x86/linux hello_world.c -v -c
    

    Note 1: the assembly language output will be put in hello_world.obj (remember that Catalina uses assembly language as its object format).

    Note 2: you need the -c flag as there is no assembler, linker or libraries provided for any target other than the Propeller - but this command will at least test out the lcc, cpp and rcc components. Once you have those working I can help you with the Catalina components.

    Ross.

    I guess I'm in trouble because lcc even failed generating x86 code. Here is the output I got from the command line you suggested:
    david-betzs-macbook-pro:~ dbetz$ lcc -target=x86/linux fibo.c -v -c
    lcc $Id: lcc.c 355 2007-02-18 22:08:49Z drh $
    /Users/dbetz/Catalina_3.4/bin/cpp -U__GNUC__ -D_POSIX_SOURCE -D__STDC__=1 -D__STRICT_ANSI__ -Dunix -Di386 -Dlinux -D__extension__= -D__cdecl= -D__CATALINA__ -D__unix__ -D__i386__ -D__linux__ -D__signed__=signed -D__LCC__ -I/Users/dbetz/Catalina_3.4/include fibo.c /var/folders/84/9fr230z16p5fb9x9qq3p_z640000gn/T/lcc198850.i
    /Users/dbetz/Catalina_3.4/bin/rcc -target=catalina/linux -target=x86/linux -v /var/folders/84/9fr230z16p5fb9x9qq3p_z640000gn/T/lcc198850.i /var/folders/84/9fr230z16p5fb9x9qq3p_z640000gn/T/lcc198851.s
    /Users/dbetz/Catalina_3.4/bin/rcc $Name$($Id: main.c 355 2007-02-18 22:08:49Z drh $)
    lcc: fatal error in /Users/dbetz/Catalina_3.4/bin/rcc
    rm /var/folders/84/9fr230z16p5fb9x9qq3p_z640000gn/T/lcc198851.s /var/folders/84/9fr230z16p5fb9x9qq3p_z640000gn/T/lcc198850.i
    
  • RossHRossH Posts: 5,512
    edited 2011-10-28 19:45
    David Betz wrote: »
    ...
    lcc: fatal error in /Users/dbetz/Catalina_3.4/bin/rcc
    
    ...

    Yup - that looks bad. Run it under gdb and trap any exceptions - it's probably a memory violation or something. If you can narrow it down to a particular line of code (or library function call) then I'll take a look and see if I can think of anything.

    Ross.
  • David BetzDavid Betz Posts: 14,516
    edited 2011-10-29 04:49
    Is it possible that my problems running on the Mac have to do with the fact that the Mac is running a 64 bit compiler? Is there anything special that needs to be done to LCC to run in 64 bits?
  • RossHRossH Posts: 5,512
    edited 2011-10-29 06:25
    David Betz wrote: »
    Is it possible that my problems running on the Mac have to do with the fact that the Mac is running a 64 bit compiler? Is there anything special that needs to be done to LCC to run in 64 bits?

    Hi David,

    I doub it. But if you are using gcc, just tell it to compiler the program in 32 bit mode. Can't remember the exact option - maybe -m32?

    Ross.
  • David BetzDavid Betz Posts: 14,516
    edited 2011-10-29 09:19
    RossH wrote: »
    Hi David,

    I doub it. But if you are using gcc, just tell it to compiler the program in 32 bit mode. Can't remember the exact option - maybe -m32?

    Ross.
    Actually, I'm using Apple's LLVM C compiler. I suspect it has a similar option though. Thanks for the suggestion.
  • jazzedjazzed Posts: 11,803
    edited 2011-11-01 09:25
    I downloaded Catalina 3.4 for some testing. The InnoIDE installer does a nice job - I use it too.

    Some comments, then a question: Codeblocks makes Catalina look more attractive. Good job.

    I selected the C3 and Tiny mode, did a build, and hub download.
    After 1 minute 15 second download, I finally see the traditional greeting on my TV.

    Question:
    I almost never use TV, so I set the build options to select PC expecting to use a serial terminal.
    How do I open a serial port to work with that?
  • RaymanRayman Posts: 14,835
    edited 2011-11-01 09:51
  • Cats92Cats92 Posts: 149
    edited 2011-11-01 10:50
    Thanks RossH and Rayman.

    Rayman this <test_suite> program works nicely with my demoboard ( in fact I have no large memory board)

    Hope some other simple programs for beginners.

    For leds , servos or ping ?

    I used Arduino before because it comes with a lot of small programs and explanations.

    Jean Paul
  • jazzedjazzed Posts: 11,803
    edited 2011-11-01 11:02
    Rayman wrote: »
    Thanks Rayman.

    That helped. Somehow the baud-rate got set to 57600 though - no idea how that happened.

    There are only a few ways to avoid needing to use an extra terminal window.
    Built into the loader seems easiest and let's you see all output without struggling.

    Guess I'm forced to use TV for some things for now especially since I can't modify some code.
  • RossHRossH Posts: 5,512
    edited 2011-11-01 15:48
    jazzed wrote: »
    After 1 minute 15 second download, I finally see the traditional greeting on my TV.

    ... and ...

    There are only a few ways to avoid needing to use an extra terminal window.

    TINY programs don't need a special loader. They can be downloaded with Propellent, or with the Parallax Spin tool if you prefer. Or, if you prefer a downloader that comes combined with a terminal emulator, use PropTerm (compile your program with -D PROPTERM).

    Ross.
  • RossHRossH Posts: 5,512
    edited 2011-11-01 18:34
    All,

    Just a heads up!

    I think I may have a problem with dynamic memory management in this version of Catalina. Not sure exactly which version the bug crept in, but it will only affect programs that use malloc() etc.

    I need to do some more investigating. I'll post an update when I know more.

    Ross.
  • RossHRossH Posts: 5,512
    edited 2011-11-02 05:19
    RossH wrote: »
    All,

    Just a heads up!

    I think I may have a problem with dynamic memory management in this version of Catalina. Not sure exactly which version the bug crept in, but it will only affect programs that use malloc() etc.

    I need to do some more investigating. I'll post an update when I know more.

    Ross.

    Ok - on further investigation it appears I was just running out of memory :)

    I'm working on some code generaotr optimizations to allow Catalina to squeeze more C code into Hub RAM, and I think I just miscalculated. Sorry for the false alarm!

    Ross.
  • David BetzDavid Betz Posts: 14,516
    edited 2011-11-02 08:12
    I need to be able to define preprocessor symbols on the Catalina command line and it doesn't seem that -D does what I expect. How do I define the symbol PROPELLER_CAT such that I can use the following conditional code in my C files?
    #ifdef PROPELLER_CAT
    
    // stuff that is only used for Catalina compiles.
    
    #endif
    

    I tried this and it didn't work:
    catalina -c -DPROPELLER_CAT my_file.c
    
  • David BetzDavid Betz Posts: 14,516
    edited 2011-11-02 08:48
    David Betz wrote: »
    I need to be able to define preprocessor symbols on the Catalina command line and it doesn't seem that -D does what I expect. How do I define the symbol PROPELLER_CAT such that I can use the following conditional code in my C files?
    #ifdef PROPELLER_CAT
    
    // stuff that is only used for Catalina compiles.
    
    #endif
    

    I tried this and it didn't work:
    catalina -c -DPROPELLER_CAT my_file.c
    
    Never mind. I figured it out. For Catalina, I need -W-DPROPELLER_CAT rather than just -DPROPELLER_CAT. While this works it is different than every other C compiler I have ever used.
  • RossHRossH Posts: 5,512
    edited 2011-11-02 14:55
    David Betz wrote: »
    Never mind. I figured it out. For Catalina, I need -W-DPROPELLER_CAT rather than just -DPROPELLER_CAT. While this works it is different than every other C compiler I have ever used.

    Hi David,

    Yes, I had the choice of using -D for PASM symbols or for C symbols (there are various technical reasons why I didn't want the same flag to define a symbol for both). I suppose I could revert to using -D for C symbols and use another flag for PASM symbols.

    It seems a minor point, but if there is enough opinion one way or another it is easy to change. It seems to me that not many people use the command line anyway. You and I are probably the last of a dying breed :)

    Ross.
  • David BetzDavid Betz Posts: 14,516
    edited 2011-11-02 15:04
    RossH wrote: »
    Hi David,

    Yes, I had the choice of using -D for PASM symbols or for C symbols (there are various technical reasons why I didn't want the same flag to define a symbol for both). I suppose I could revert to using -D for C symbols and use another flag for PASM symbols.

    It seems a minor point, but if there is enough opinion one way or another it is easy to change. It seems to me that not many people use the command line anyway. You and I are probably the last of a dying breed :)

    Ross.
    It certainly isn't a blocking issue but I will say that I ran into this the last time I used Catalina as well. It's hard to break the habit of assuming -D can be used for C defines like most other C compilers allow. Keeping it this way may cause minor startup problems for people who want to port C code from another platform if the code uses conditional compilation.

    Wouldn't you still have this problem with the GUI? When I use Xcode or Visual C++ I often use conditional compilation and have to define symbols for the compile. Does the Code::Blocks GUI automatically supply the needed -W in front of any definitions that the user asks for?
  • RossHRossH Posts: 5,512
    edited 2011-11-02 15:51
    David Betz wrote: »
    Wouldn't you still have this problem with the GUI? When I use Xcode or Visual C++ I often use conditional compilation and have to define symbols for the compile. Does the Code::Blocks GUI automatically supply the needed -W in front of any definitions that the user asks for?

    Yes - adding <symbol> in the #define tab in Code::Blocks defines a C symbol as you would expect. If you ever need to add a PASM symbol you must specify -D<symbol> on the other options tab - but since Catalina is integrated fully in Code::Blocks, you hardly ever need to do this (you just select the appropriate build option instead).

    So using -D vs -W-D to define a C symbol really only affects command line users. My only hesitation in changing it is the amount of places I need to update documentation :frown: - but if I get one more request for this change then I will do so for the next release :smile:

    Ross.
  • David BetzDavid Betz Posts: 14,516
    edited 2011-11-02 16:23
    Oh boy, I guess I just need to create another forum account and make another request! :-)
  • RossHRossH Posts: 5,512
    edited 2011-11-02 16:51
    David Betz wrote: »
    Oh boy, I guess I just need to create another forum account and make another request! :-)

    Blast! I obviously need to be more specific - I'll do it if I get "one more request from a person registered on these forums prior to 2/11/2011 who sends me a certified extract of their birth certificate and who is unrelated to David Betz" :smile:

    Ross.
  • RaymanRayman Posts: 14,835
    edited 2011-11-02 17:57
    Ross, I wouldn't spend any time updating command line stuff. The GUI is great, I'd focus on that.
    Command-line people are used to suffering anyway...
  • David BetzDavid Betz Posts: 14,516
    edited 2011-11-02 18:31
    Rayman wrote: »
    Ross, I wouldn't spend any time updating command line stuff. The GUI is great, I'd focus on that.
    Command-line people are used to suffering anyway...
    I don't feel as though using command line tools is suffering. They offer far more flexiblity than GUI tools. Pretty much every company I've ever worked for built their systems using command line tools. Do you think Microsoft uses Visual Studio to build Windows? Is Linux built using a GUI? I doubt that Mac OS X is. Command line tools are still used by many people for important work. They aren't just a relic of the past.
Sign In or Register to comment.