Skip to content

FAQ: how to make jit not recompile when problem is unchanged

jgillis edited this page Nov 26, 2020 · 3 revisions

Requires installation of ccache

from casadi import *

x = MX.sym("x")

options = {"jit":True,"compiler":"shell","jit_temp_suffix":False}
options["jit_options"] = {"compiler": "ccache gcc", "verbose":True}

solver = nlpsol("solver","ipopt",{"x":x,"f":x**2,"g":x},options)

solver()

You can use ccache --show-stats to validate that you are indeed benefitting from "cache hits"

Clone this wiki locally