This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler: Parallel build of multiple files with same file name

Tool/software: TI C/C++ Compiler

Dear All,

first to my used environment. It ist CCS 8.1.0.11 and CGT 8.2.4. Parallel build is enabled. A lot files of my project are linked resources.

I post this in the CCS forum because I think the issue is releated to the way how CCS is invoking CGT.

I have run into strange assembler errors during compilation.

It appears that when i have different files with the same filename but in anohter folder hierachy, then the code generation toosl are working on the same assembler file!

If i manually build the files one after another then there is no error. But I see that the same asm file is touched and shows (of course) different content.

Is this behavour known or is there a hack for example with the --asm_directory option to overcome this?

Disabling parallel build is not really an option since i already have an long project build time (~20 minutes after clean)

Looking forward to get some ideas

Bernhard

  • Please clean your project, then perform a problem build, in parallel.  Once it is done, in the Console (not Problems) view, use the icon Copy Build Log to save off the entire build log to a text file.  Be sure to use the file extension .txt.  Attach that build log to your next post.

    Thanks and regards,

    -George

  • Please submit the build log that was requested.

    Thanks and regards,

    -George

  • Dear George,

    I have to postone this due to project deadlines.

    I will prepare a test project with source where you can see this.
    This will be this or next week. I am sorry for the delay.

    Kind Regards
    Bernhard
  • Have you been able to produce the requested build log?

    Thanks and regards,

    -George

  • Dear George,

    I am really sorry for the delay. Thank you for your patience!

    I have created a test project with sources. Please find it attched.

    You will see that for the two source files "Console.cpp" the same assembler file (appA/Debug/Console.asm) is created and used during build. You can check if you build each file manually by its own an check the content.

    I expected CCS to create diffrent temp folders and therefore different assembler files.

    I also have played with the compiler options for directories (--asm_directory, --temp_directory) together with the build variable "selected_resource_loc" or similar. But this works only if i use "Build Selected File(s)". It doesn't work with "Build Project".

    Please tell me:

    Is this intended?

    Is there a chance to get this fixed?

    or

    Is there a chance to extend the available build variables by a kind of "resource_loc" compared to "selected_resource_loc" that can work together with "Build Project"? Then I am able to setup a workaround.

    For the moment i just renamed the source files to "comanyA_moduleA_Console.cpp". But we dont want to do this.

    Due to the complexity of our production code i have a long build time with build in parallel. So the initial error i ran to probably was invalid content in assembler file. I guess this comes from the fact that 2 compiler/assembler processes running in parallel are accessing the same temporary file.

    Looking forward to your thoughts.

    Bernhard

    3678.test.zip

  • Thank you for submitting the test case.  I can reproduce the problem.  I filed CODEGEN-5953 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.  

    More details on the problem ... As you've noted, the problem starts when the same source file name is present in different directories.  Part of the compiling process is auto-generating an assembly file.  By default, this file has an auto-generated name guaranteed to be unique.  But, if you use certain build options, the file has the same name as the source file, with the extension changed to .asm.  This file is written in either the current directory (by default), or the directory named with the option --asm_directory.  In your CCS build, Console.asm is written to the directory appA\Debug two times.  In the case of parallel builds, this behavior is not predictable.  Both writes might occur at the same time.  

    In your case, the certain build option is --debug_software_pipeline.  This is the full list of options which contribute to the problem by keeping the auto-generated assembly file.

    • --debug_software_pipeline
    • --skip_assembler
    • --keep_asm
    • --c_src_interlist
    • --src_interlist
    • --optimizer_interlist

    Here are some workarounds to consider.  I realize they are not all practical.  Hopefully, one of these will work for you.

    Never allow source files to have the same name, even if they are in different directories.

    Disable parallel builds in CCS. 

    Do not use any of the above build options.

    Write a custom makefile which causes the --asm_directory option for each build command to be modeled on the location of the source file.  As the source file directory changes, this option changes with it.  Note there is no method by which CCS can be made to do this automatically.  Build outside of CCS.  Or ... It is possible to have a build within CCS use a custom makefile.  But you have to completely reorganize the project.  Instead of organizing the project the CCS way, do it the Eclipse way.

    For source files known to have the same name in different directories, use file specific options to force a unique setting for --asm_directory.

    Thanks and regards,

    -George

  • Dear George,

    thank you for your detailed explanations!

    I cannot find the entry in the SDOWP. Is there the capability to give me a direct link?

    We may apply a workaround as suggested to avoid a specific compiler option.

    Bernhard
  • Bernhard Seiz said:
    I cannot find the entry in the SDOWP.

    I apologize.  The record was not marked for public view.  I just fixed it.  Please wait a few hours for that change to propagate through the system, then search for it again.

    Thanks and regards,

    -George