View previous topic :: View next topic |
Author |
Message |
PICoHolic
Joined: 04 Jan 2005 Posts: 224
|
[RESOLVED] CCS command line version selection |
Posted: Fri Nov 06, 2015 3:15 am |
|
|
Hello,
CCS IDE gives the option to select an already installed version of the compiler, when compiling a specific project.
I need to be able to select a specific version but via command line. I cant find it in CCS (command line) help.
Anyone?
Thank you
Last edited by PICoHolic on Fri Nov 06, 2015 8:59 am; edited 1 time in total |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19537
|
|
Posted: Fri Nov 06, 2015 4:07 am |
|
|
In the compiler directory. Subdirectory 'DLL', it creates subdirectories for each version, in which it keeps the .dat files and the DLL's. If you change the search path before calling CCSC, explicitly to the directory for the version you want (and the other directories necessary for the compile), it uses this version.
I must admit I find it much simpler to have all the versions in completely separate directories. So I have PICC5042 PICC5043 etc. etc.. Then you can just call the CCSC or IDE in the required directory, and not only does it get the dat/dll, it also gets the corresponding _includes_. There is a problem with the 'old version' option from the IDE, in that though it changes the compiler behaviour to the older version, it keeps the current include files. Where these change with versions, and you rely on the compiler's 'old version' behaviour, it becomes necessary to include all include files you use, with your project.... |
|
|
PICoHolic
Joined: 04 Jan 2005 Posts: 224
|
|
Posted: Fri Nov 06, 2015 5:32 am |
|
|
Hi Ttelmah,
Thank you.
I already know that different compilers are located in different folders
What do you mean by changing the search path?
CCS location: "C:\Program Files (x86)\PICC\"
Project location: "C:\TestCode\"
What I'm doing is that I'm calling the compiler from within the project location (prompt):
C:\TestCode> "C:\Program Files (x86)\PICC\Ccsc.exe" +FH +LS +STDOUT filename.c
("filename.c" is in "C:\TestCode\" folder)
I even tried this (in a batch file):
CD "C:\Program Files (x86)\PICC\DLL\5.048"
C:\Program Files (x86)\PICC\Ccsc.exe" +FH +LS +STDOUT "C:\TestCode\filename.c"
with no luck, the compiler version used is still 5.051 and not 5.048
Thanks again |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19537
|
|
Posted: Fri Nov 06, 2015 6:09 am |
|
|
Launch a command prompt, and type 'set<return>'.
This shows the default 'paths' that any program receives.
You have to change the path to access the version you require (and then set it back to the default after the program has run).
It is messy and difficult, and as I say does not actually give you genuine compilation as if you had the old version (neither does the IDE), which is why if you really need the original version you need to store it 'complete', not use this method.... |
|
|
PICoHolic
Joined: 04 Jan 2005 Posts: 224
|
|
Posted: Fri Nov 06, 2015 6:18 am |
|
|
Thank you.
I understand that. But sometimes include files (of a specific chip) do not change; thus, just a change of compiler version will do. (in the case of 5.048 and 5.051).
BTW I can't see any path related to compiler version in this list.
Thanks again Ttelmah |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19537
|
|
Posted: Fri Nov 06, 2015 8:23 am |
|
|
There isn't.
It searches the path _first_, then ./DLL/current_version. If the path to the older version is in the path, it gets found instead of the current version. |
|
|
PICoHolic
Joined: 04 Jan 2005 Posts: 224
|
|
Posted: Fri Nov 06, 2015 9:01 am |
|
|
Hello Ttelmah,
I just sent an email to CCS support, apparently there's a command line option that does that:
version=x.xxx
Thanks |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19537
|
|
Posted: Fri Nov 06, 2015 2:46 pm |
|
|
That simplifies things, but still with the caveats about this. |
|
|
|