Email: helpdesk@telkomuniversity.ac.id

This Portal for internal use only!

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Categories
  • Microsoft
    • Microsoft Apps
    • Office
    • Operating System
    • VLS
    • Developer Tools
    • Productivity Tools
    • Database
    • AI + Machine Learning
    • Middleware System
    • Learning Services
    • Analytics
    • Networking
    • Compute
    • Security
    • Internet Of Things
  • Adobe
  • Matlab
  • Google
  • Visual Paradigm
  • WordPress
    • Plugin WP
    • Themes WP
  • Opensource
  • Others
More Categories Less Categories
  • Get Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • My Account
    • Download
    • Cart
    • Checkout
    • Login
  • About Us
    • Contact
    • Forum
    • Frequently Questions
    • Privacy Policy
  • Forum
    • News
      • Category
      • News Tag

iconTicket Service Desk

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Menu
  • Home
    • Download Application Package Repository Telkom University
    • Application Package Repository Telkom University
    • Download Official License Telkom University
    • Download Installer Application Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • All Pack
    • Microsoft
      • Operating System
      • Productivity Tools
      • Developer Tools
      • Database
      • AI + Machine Learning
      • Middleware System
      • Networking
      • Compute
      • Security
      • Analytics
      • Internet Of Things
      • Learning Services
    • Microsoft Apps
      • VLS
    • Adobe
    • Matlab
    • WordPress
      • Themes WP
      • Plugin WP
    • Google
    • Opensource
    • Others
  • My account
    • Download
    • Get Pack
    • Cart
    • Checkout
  • News
    • Category
    • News Tag
  • Forum
  • About Us
    • Privacy Policy
    • Frequently Questions
    • Contact
Home/Matlab/Decrease compilation time with mex using compiler cache (e.g. ccache in Linux)

Decrease compilation time with mex using compiler cache (e.g. ccache in Linux)

PuTI / 2025-01-16
Decrease compilation time with mex using compiler cache (e.g. ccache in Linux)
Matlab News

I am using the Matlab codegen command quite often to decrease the runtime of my Matlab functions and compile them as mex. However, when working on my algorithm, I often need to recompile my functions in between my tests and validations. This takes up to 5min for complex functions which decreases my productivity.
Does anyone have experience using a compiler cache such as ccache (I am using Ubuntu 18.04) together with Matlab (R2021a)? I did a first attempt to implement this, but the compilation time did not really decrease, despite that ccache is used.
Workflow so far:
Install ccache (Ubuntu 18.04): sudo apt install ccache
use ccache for all compilers: sudo /usr/sbin/update-ccache-symlinks
call Matlab with ccache path: PATH="/usr/lib/ccache/:$PATH" matlab
check path in Matlab: !echo $PATH gives /usr/lib/ccache/:/home/username/bin:….
compile a function using the Matlab codegen command (with wrapper matlabfcn2mex)
That ccache is used can be seen in the buildLog.log file (in fcndir/codegen/mex/fcnname/build/glnxa64). Alle lines begin with /usr/lib/ccache/gcc instead of /usr/bin/gcc as before. The ccache statistics (ccache -s) gives increased values for "cache hit (direct)" and "cache hit (preprocessed)" after each call of codegen in Matlab. For my example file (6 DoF serial robot inverse kinematics using Newton Raphson) I still need around 120s, despite the file is not changed and should be fully in the cache. Without the cache the time is around the same. I would expect a drastic decrease of compilation time, as can be seen when using ccache+cmake e.g. in building a ROS workspace.
Any ideas or comments?I am using the Matlab codegen command quite often to decrease the runtime of my Matlab functions and compile them as mex. However, when working on my algorithm, I often need to recompile my functions in between my tests and validations. This takes up to 5min for complex functions which decreases my productivity.
Does anyone have experience using a compiler cache such as ccache (I am using Ubuntu 18.04) together with Matlab (R2021a)? I did a first attempt to implement this, but the compilation time did not really decrease, despite that ccache is used.
Workflow so far:
Install ccache (Ubuntu 18.04): sudo apt install ccache
use ccache for all compilers: sudo /usr/sbin/update-ccache-symlinks
call Matlab with ccache path: PATH="/usr/lib/ccache/:$PATH" matlab
check path in Matlab: !echo $PATH gives /usr/lib/ccache/:/home/username/bin:….
compile a function using the Matlab codegen command (with wrapper matlabfcn2mex)
That ccache is used can be seen in the buildLog.log file (in fcndir/codegen/mex/fcnname/build/glnxa64). Alle lines begin with /usr/lib/ccache/gcc instead of /usr/bin/gcc as before. The ccache statistics (ccache -s) gives increased values for "cache hit (direct)" and "cache hit (preprocessed)" after each call of codegen in Matlab. For my example file (6 DoF serial robot inverse kinematics using Newton Raphson) I still need around 120s, despite the file is not changed and should be fully in the cache. Without the cache the time is around the same. I would expect a drastic decrease of compilation time, as can be seen when using ccache+cmake e.g. in building a ROS workspace.
Any ideas or comments? I am using the Matlab codegen command quite often to decrease the runtime of my Matlab functions and compile them as mex. However, when working on my algorithm, I often need to recompile my functions in between my tests and validations. This takes up to 5min for complex functions which decreases my productivity.
Does anyone have experience using a compiler cache such as ccache (I am using Ubuntu 18.04) together with Matlab (R2021a)? I did a first attempt to implement this, but the compilation time did not really decrease, despite that ccache is used.
Workflow so far:
Install ccache (Ubuntu 18.04): sudo apt install ccache
use ccache for all compilers: sudo /usr/sbin/update-ccache-symlinks
call Matlab with ccache path: PATH="/usr/lib/ccache/:$PATH" matlab
check path in Matlab: !echo $PATH gives /usr/lib/ccache/:/home/username/bin:….
compile a function using the Matlab codegen command (with wrapper matlabfcn2mex)
That ccache is used can be seen in the buildLog.log file (in fcndir/codegen/mex/fcnname/build/glnxa64). Alle lines begin with /usr/lib/ccache/gcc instead of /usr/bin/gcc as before. The ccache statistics (ccache -s) gives increased values for "cache hit (direct)" and "cache hit (preprocessed)" after each call of codegen in Matlab. For my example file (6 DoF serial robot inverse kinematics using Newton Raphson) I still need around 120s, despite the file is not changed and should be fully in the cache. Without the cache the time is around the same. I would expect a drastic decrease of compilation time, as can be seen when using ccache+cmake e.g. in building a ROS workspace.
Any ideas or comments? matlab, mex, mex compiler, codegen, ccache, linux MATLAB Answers — New Questions

​

Tags: matlab

Share this!

Related posts

Inserting additional data in an already created table
2025-05-10

Inserting additional data in an already created table

Programmatically create histograms like Color Thresholder
2025-05-10

Programmatically create histograms like Color Thresholder

How to plot function x(2)=-1/2*x(1)+t?
2025-05-10

How to plot function x(2)=-1/2*x(1)+t?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Categories

  • Matlab
  • Microsoft
  • News
  • Other
Application Package Repository Telkom University

Tags

matlab microsoft opensources
Application Package Download License

Application Package Download License

Adobe
Google for Education
IBM
Matlab
Microsoft
Wordpress
Visual Paradigm
Opensource

Sign Up For Newsletters

Be the First to Know. Sign up for newsletter today

Application Package Repository Telkom University

Portal Application Package Repository Telkom University, for internal use only, empower civitas academica in study and research.

Information

  • Telkom University
  • About Us
  • Contact
  • Forum Discussion
  • FAQ
  • Helpdesk Ticket

Contact Us

  • Ask: Any question please read FAQ
  • Mail: helpdesk@telkomuniversity.ac.id
  • Call: +62 823-1994-9941
  • WA: +62 823-1994-9943
  • Site: Gedung Panambulai. Jl. Telekomunikasi

Copyright © Telkom University. All Rights Reserved. ch

  • FAQ
  • Privacy Policy
  • Term

This Application Package for internal Telkom University only (students and employee). Chiers... Dismiss