Can we use ccache with VDSP++?

Compiling programs on Linux with GCC is much faster than most other environments if ccache is enabled.  It caches compilation results and returns them if the compiler is provably going to generate the same result.

Anytime you clean out all your object files and start a fresh compile, ccache makes a huge improvement in speed.  Also, VisualDSP++ seems to spend a lot of time recompiling the same files for no discernable reason, so it would speed up that process immensely too.

Has anyone been able to use ccache with VisualDSP++?

Before I look into it, does anyone know if it is possible or impossible?

  • I will check into the -no-implicit-inclusion switch.  Thanks.

    But regardless of how good the compiler is, it could benefit from ccache.

    I found two older projects that implement Windows versions: ccache-win32 and gocache.

    I'm not sure what the effort/reward ratio will be, but I'm going to try this.

  • Hi Ken,

    Did you ever get ccache to work with VisualDSP++? I'm going to attempt the same thing. I'll try to remember to report back here with my results. It seems to be a huge win if our team could share a repository of compiled object files. How much time do you spend sitting there waiting to your project to compile after checking out a different revision? It's madness! :-)


  • 0
    •  Analog Employees 
    on Apr 13, 2020 11:14 AM 9 months ago in reply to 2sb18


    For VisualDSP++ does not offer support for ccache, if you used the "Add Startup Code/LDF" option, and therefore have System-builder managed resources in your project this will be set under "Project: Project Options: Startup Code Settings: Cache and Memory Protection"

    To specify the cache please refer the below help path:
    VisualDSP++ Help > Graphical Environment > IDDE > How To > Projects > Code Development Tools - Project Options > Specifying Cache and Memory Protection

    We have some general guidelines to reducing the build time for projects where the build is particularly time-consuming:

    • If you have C++ files in your project you could try using the "-no-implicit-inclusion" switch. (Some customers have seen a significant improvement in compile times when using this switch). By default, when the source contains a #include directive for "file.h" the compiler will also include "file.cpp" to find the template definitions, this switch directs the compiler to not implicitly include the .cpp file.
    • Don't use mounted/networked source/include directories.
    • Clean out your temporary directory occasionally. A lot of files can slow down the system in general.
    • Similar to what’s mentioned above, identify files which take a long time to compile and consider breaking them down into smaller files, perhaps on a per-function basis. If any files are taking an unacceptable length of time to compile, report them to tools support.
    • Disable pre-processing in generated assembly, if you don't need it (with "-flags-asm -sp").
    • Keep files local (so that network traffic isn't required).
    • Keep PATHs short and local (as above)
    • Reduce amount of rebuilds needed because of dependencies (i.e. don't have an auto-generated .h file that's included by everything, if you can avoid it)
    • -ipa takes much longer than -O.
    • Re-configure virus scanner (so that it's not re-scanning all of the tool-chain every time you re-build).
    • Add more memory.
    • Export the project to an external makefile and build the project from the command line by invoking the makefile.


  • Hi Nishanthi,

    I'm making some progress on the ccache front. But one ccblkfn option that doesn't work with ccache is -MM. I set -MD as an additional option, but I get the following error:

    cc3106: {D} warning: Option `-MM' overrides option `-MD'

    What project option can I use to switch from MM to MD?



Reply Children
  • +1
    •  Analog Employees 
    on Apr 20, 2020 10:58 AM 9 months ago in reply to 2sb18

    Hi Steve,
    The VisualDSP++ IDDE adds -MM implicitly in order to get the makefile dependencies it uses and there's no way to change that. As the warning you've seen indicates, -MM and -MD are not expected to be used together as one is to put dependencies to the console and the other specifies that they should go to a file.

    Unfortunately I think you'll have to use a Makefile to build rather than the VisualDSP++ project in order to get enough control of the command-lines used and avoid conflicting with the VisualDSP++ dependencies. You can export a Makefile from VisualDSP++ from the Project menu.

  • that makes sense, thanks for the reply Stuart. Steve