Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Tasking compiler toolchain #841

Open
vsplesk opened this issue Apr 29, 2021 · 15 comments · May be fixed by #942
Open

Support for Tasking compiler toolchain #841

vsplesk opened this issue Apr 29, 2021 · 15 comments · May be fixed by #942
Labels
feature New or improved feature

Comments

@vsplesk
Copy link
Contributor

vsplesk commented Apr 29, 2021

Hi,

I would like to use ccache in combination with TASKING VX-toolset. This is a commercial C/C++ compiler which command line syntax is unfortunately not fully GCC compatible. See https://www.tasking.com/support/tricore/ctc_user_guide_v6.2r2.pdf for its documentation. Another toolchain coming close is from Green Hills which is listed as semi-supported on your features page.

In theory, I could hack the support into ccache but the code looks quite complicated. It would be good if someone could highlight the relevant locations to add a new compiler. Or I can offer testing a few things if needed. Please note that this compiler includes its own caching functionality already but I would like to benchmark this and ccache against each other.

@vsplesk vsplesk added the feature New or improved feature label Apr 29, 2021
@vsplesk vsplesk changed the title Support of Tasking compiler toolchain Support for Tasking compiler toolchain Apr 29, 2021
@jrosdahl
Copy link
Member

jrosdahl commented May 1, 2021

Hi,

There are no specific locations where you can add support for a new compiler since there is no such compiler abstraction in the code. Instead, the current (relatively small variation in) compiler-specific behavior is handled in a few different places. You can search for config.compiler_type() to find them.

I know next to nothing about the TASKING compiler, but if you want to work on a proof of concept we could certainly have a look at it or give guidance about specific issues.

@louiscaron
Copy link
Contributor

louiscaron commented Sep 18, 2021

Hello @vsplesk , were you able to add support for tasking compiler in ccache ? I have tried using the tasking internal cache mechanism (--cache), but the time gain I get is so small that I am evaluating switching to ccache where I would get a better control over the cache search algorithm. Thanks for any advice!

@vsplesk
Copy link
Contributor Author

vsplesk commented Sep 19, 2021

I am sorry, I couldn't find time to work on this project. I have also found --cache option to be not very effective most of the time, i.e. greatly varying between 5% and >> 50% speedup. It's simply not reliable and not as fast as ccache used to be in regular FOSS projects (not sure about our code base, this is yet to be investigated).

In case you start implementing this soon, please send me a note about your fork/branch and I might collaborate there.

@louiscaron
Copy link
Contributor

louiscaron commented Sep 19, 2021 via email

@vsplesk
Copy link
Contributor Author

vsplesk commented Sep 19, 2021

There was no demand for the preprocessor mode yet.

@Joldiges
Copy link

I observed ~10% improvement as well on the codebase I used for "--cache"

In case you start implementing this soon, please send me a note about your fork/branch and I might collaborate there.

Same here.

@louiscaron
Copy link
Contributor

louiscaron commented Sep 20, 2021 via email

@Joldiges
Copy link

I have started, but I am targeting the tasking tricore compiler (ctc and cctc), is this what you guys are waiting for?

It is for me

@louiscaron louiscaron linked a pull request Oct 6, 2021 that will close this issue
@louiscaron
Copy link
Contributor

I have started the development, I have submitted a first draft for initial merge so that we can start collaborating. #942

@louiscaron
Copy link
Contributor

@jrosdahl : I have submitted the pull request #942 , it looks like it is waiting for some administrator action. Would you mind having a look and eventually indicating what I need to do to move forward? any advice is welcome!

@vsplesk
Copy link
Contributor Author

vsplesk commented Nov 2, 2021

I tried #942 on a few real-life projects and it worked very smoothly. Build time reduction way over 90% and no inconsistency issues observed so far. Good job!

This was referenced Nov 2, 2021
@Joldiges
Copy link

@louiscaron, tried on the project i'm touching. Good news is that I also saw (unmeasured) 90% improvement.
Unfortunately, there are compilation issues encountered when library files are included with artc component. Perhaps I'm missing something in cmake.

CCache - Failure with artc

@louiscaron
Copy link
Contributor

@Joldiges : in my tests, I have only prefixed calls to ctc and cctc with ccache, not artc . still, the error message from ccache is very strange, it probably should not fail even if you prefixed everything with ccache.

I have two questions:

  • do you have working elements (ccache prefixing calls to ctc or cctc)?
  • can you print the artc full command so I can reproduce your error?

@Joldiges
Copy link

Joldiges commented Nov 18, 2021

@Joldiges : in my tests, I have only prefixed calls to ctc and cctc with ccache, not artc . still, the error message from ccache is very strange, it probably should not fail even if you prefixed everything with ccache.

I have two questions:

  • do you have working elements (ccache prefixing calls to ctc or cctc)?
  • can you print the artc full command so I can reproduce your error?

I have identified the problem and it was specific to the CMake command I was using.
The issue was resolved removing RULE_LAUNCH_LINK/RULE_LAUNCH_COMPILE to use CMAKE_C_COMPILER_LAUNCHER.

@jrosdahl
Copy link
Member

Just a note on the status of this feature:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New or improved feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants