View previous topic :: View next topic |
Author |
Message |
esko
Joined: 17 Nov 2016 Posts: 12
|
Pushing the limits of my PCH compiler |
Posted: Sun Nov 20, 2016 10:27 pm |
|
|
*** Error 44 "ADM_build.c" Line 129(222,228): Internal Error - Contact CCS Too many IDs
1 Errors, 0 Warnings.
Build Failed.
This is a rather large project with many small modules.
What are the limits of this compiler ?
I suspect that the compilation stumbled into the maximum number of #import directives. The one that this error appeared was #99.
I am NOT willing to start combining those small entities into bigger ones - that would seem to be one possible solution here.
Another thing I am NOT willing to do is to use #include directives for each of those small modules.
For those who wonder - not all of those modules get linked in into the final binary - the linking should remove most of the modules as they are not used.
Another option would be to manually figure out which modules are used and only #import those. This, however, is ridiculous as that is exactly what linker does - why do that manually....
esko@kotka:~/Dev/ADM/2.0a$ ccsc +V
PCH 5.062
esko@kotka:~/Dev/ADM/2.0a$ |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Mon Nov 21, 2016 12:45 am |
|
|
Honestly use the includes.
You need to understand that CCS is fundamentally a single pass compiler. Given the chance (compiling everything at once), it can save a lot of memory and optimise functions. Linking stuff, it can't.
Use the tool the way it is designed to be used. If you are not happy to do this, use another compiler. |
|
|
esko
Joined: 17 Nov 2016 Posts: 12
|
|
Posted: Mon Nov 21, 2016 2:45 am |
|
|
Well - I understand that this compiler is not a "conventional" preprocess->compile->link thing.
Actually it is not that hard to create a source file that includes everything needed. And You are right - the single pass compiling has a lot better chances to optimize the resulting code. I'll give this a try.
Has anyone experience of projects with 100+ files incuded ?
Edit: Actually I have been using MPLAB with this project. Changed over to CCS because the resulting code is quite large. Almost too large. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Mon Nov 21, 2016 5:19 am |
|
|
My current project has 42 includes, and 67000 lines of code.
I'd suggest 'compartmentalising' a little. Even a standard Unix compiler would fall over trying to import nearly 100 separate items. This is why on these you build 'libraries'. So have a include 'display', that then includes the subroutines used by the display system. Makes it easier to track what is going on as well... |
|
|
esko
Joined: 17 Nov 2016 Posts: 12
|
|
Posted: Sun Nov 27, 2016 5:08 pm |
|
|
AFter some investigation the easiest way to get around this is NOT using #include directives but the #import directives.
It appeared that using the include method makes all local symbols visible after the point of inclusion. This is a lot of work to come over.
It also appeared that the number if objects to be imported was well below the crash threshold.
So I created a "link" file which contains only the #import statements. I eliminated all object that were not needed and now it compiles allright. |
|
|
|