Jump to content
Sign in to follow this  
L de vries

C Compiler "chameleon" In Mplabx

Recommended Posts

L de vries    0

After some time, a lot of upgrades in Sourceboost V7.40, thanks for that.

 

 

When I build a project with MplabX, i get messages in the Output window of MPlabX:

 

 

C:\Program_Files\SourceBoost\include\system.h(40): WARNING: Try our new Chameleon C compiler. It's fast, free and 95% backward compatible with BoostC.

 

 

I would like to try this, I see in the Sourceboost IDE "Active Tollsuite Selection" where I can choose "Chameleon"

 

"normal" use of the MPlabx plugin works fine, with BoostC version 7.40.

Also I removed and installed the MPlabX plug-in (in Sourceboost 7.40 the version seems the same as in 7.3 (plug-in version 1.0)

The document "MplabX_Plugin.pdf" in the Sourceboost 7.40 directory does not describe the use of "Chameleon" either.

 

 

So how do I manage to use Chameleon in MplabX ?

Edited by L de vries

Share this post


Link to post
Share on other sites
Pavel    0

Currently the Chameleon compiler is in beta stage and does not have a corresponding MplabX plugin yet. The only way I can think of how to work around this is to save the BoostC compiler executable in a safe place, rename the Chameleon executable into BoostC and use MplabX with BoostC plugin. The command lines between these 2 is mostly compatible and this makes it possible for this approach to work.

 

Pavel

Share this post


Link to post
Share on other sites
L de vries    0

It works. " BoostC compiler executable in a safe place, rename the Chameleon executable into BoostC "
That will be boostc_pic16. exe / boostc_pic18.exe VS c_pic16.exe / c_pic18.exe.

Compiling works, it looks like Chameleon is more restrictive on the same code, i get errors, while i do not see those with BoostC.
Errors were the result of " extern volatile char eedata ; " in the code, of course there was already a declaration in the header file (include map in source boost installation).

" ..\EEprom16F87XA.c(30): error: failed to add variable 'eedata', variable with this name already declared on C:\Program_Files\SourceBoost\include\PIC16F877A.h:399 "

Edited by L de vries

Share this post


Link to post
Share on other sites
L de vries    0

Just curious about "Chameleon"

The fact that there is c_pic16.exe (2064Kb), boostc++_pic16.exe (2124Kb) and that c_pic16.exe (4156Kb), in combination with the name "Chameleon",
does this mean that the new compiler is a C and C++ combined ?
Microchip does have / borrows this, for their 8 bits Atmel parts (avr8-gnu-toolchain), but does not have it for their 8 bits (PIC16 and PIC18) parts.

Nice move, Pavel !

 

 

The compiler message: "WARNING: Try our new Chameleon C compiler. It's fast, free and 95% backward compatible with BoostC."

What is the 5% that is not?, what are the differences?

Share this post


Link to post
Share on other sites
Pavel    0

...Errors were the result of " extern volatile char eedata ; " in the code...

That's sounds like a compiler bug. We'll look into this.

 

 

...does this mean that the new compiler is a C and C++ combined ?...

Chameleon does not support C++ classes but has a very good support of data and function templates up to the point when template based meta programming can be done. In fact its code generation logic is based on this. For an example check very bottom of include\sys\sys_assign.h file where meta programming is used to generate code for assigning structs. It also supports auto data type and explicit enum types (like in the latest C++ standard).

 

...What is the 5% that is not?, what are the differences?...

From the top of my head:

- rom type specifier is ignored

- dynamic memory allocation is not supported (new/delete)

- complex array and struct initialisation works a bit differently

- system header system.h does not have to be included (it's included behind the scene)

- Chameleon does support bit fields

- Chameleon does support floating point data types natively

 

Pavel

Share this post


Link to post
Share on other sites
L de vries    0

Installed V7.41 with new souceboost MPLABX - plugin. into MPLABX v3.65

 

When I open a project in MPLABX , I can get to File>Project Properties.

It would be nice that i can switch between compiler Toolchains:

 

 

(screenshot print screen copy paste not allowed in this forum,)

"You are not allowed to use that image extension on this community."

 

 

The XC8 compiler in this example is selectable v1.42 or v1.43.

The Sourceboost compiler has just one taste.

It would be nice to have the option in this screen to switch between C, C++ and Chameleon.

 

A way that works is:

 

Go to Tools>Options>Embedded>Build Tools.

 

Default the C Compiler is : C:\Program Files (x86)\SourceBoost\xlaunch.exe

 

Click on the .... box after the line C:\Program Files (x86)\SourceBoost\xlaunch.exe ,

 

so you can chance this to :

 

C:\Program Files (x86)\SourceBoost\c_pic16.exe

 

 

and Apply

 

Now this project, and al other sourceboost projects, compiles with Chameleon, without altering file names.

To switch back, just select C:\Program Files (x86)\SourceBoost\xlaunch.exe again.

 

Lieuwe

Share this post


Link to post
Share on other sites
Pavel    0

...It would be nice to have the option in this screen to switch between C, C++ and Chameleon....

The reason we use xlaunch.exe instead of the actual compiler in the MplabX plugin is to allow different programming languages to be used in the same project. Xlaunch analyses the command line and based on the extension of the input source file launched a relevant compiler

 

For example a project can consist of .c, .c++ and .bas files an when compiling xlaunch.exe will use C, C++ and Basic compilers to compile these files.

Share this post


Link to post
Share on other sites
L de vries    0

I see that the document " MplabX_Plugin.pdf " in the source boost install is chanced.

 

On page 9 is an explanation how to force the compiler:

 

To force BoostC or BoostC++ use command line argument -force_c or -force_cpp.
To force Chameleon use command line argument -force_chameleon
To add command line argument right click on the project inside MPLAB-X and open
project properties dialog.

 

this is a far better method , so forget about chancing "build tools" file names

 

Lieuwe

Edited by L de vries

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×