CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Pushing the limits of my PCH compiler

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
esko



Joined: 17 Nov 2016
Posts: 12

View user's profile Send private message Visit poster's website

Pushing the limits of my PCH compiler
PostPosted: Sun Nov 20, 2016 10:27 pm     Reply with quote

*** 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: 19338

View user's profile Send private message

PostPosted: Mon Nov 21, 2016 12:45 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Mon Nov 21, 2016 2:45 am     Reply with quote

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: 19338

View user's profile Send private message

PostPosted: Mon Nov 21, 2016 5:19 am     Reply with quote

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... Smile
esko



Joined: 17 Nov 2016
Posts: 12

View user's profile Send private message Visit poster's website

PostPosted: Sun Nov 27, 2016 5:08 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group