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

Enabling casting in Crocoddyl #1346

Open
wants to merge 132 commits into
base: devel
Choose a base branch
from
Open

Conversation

cmastalli
Copy link
Member

This PR brings a massive effort to enabling casting to floats of each Crocoddyl's model class (action, diff-action, residuals, costs, activations, actuation, and costs).

It also includes a software infrastructure for Python bindings with multiple scalars and their casting methods. Currently, this PR supports casting to floats only. It also doesn't support the casting of solvers or the pair-collision residual yet. I will address the former limitation as soon as possible, while the latter requires effort from Pinocchio developers (see this discussion: stack-of-tasks/pinocchio#2560). The casting methods are also vastly tested, and hopefully, everything is OK.

This PR is not breaking the API. However, it is mandatory to support the casting of each Crocoddyl's model class. This can be done easily by

  1. declaring this MACRO:
    https://github.com/cmastalli/crocoddyl/blob/topic/casting/include/crocoddyl/core/actions/diff-lqr.hpp#L51-L52
  2. defining a casting method as in
    https://github.com/cmastalli/crocoddyl/blob/9caec433f30834e3c5b7f3038be1b2fedc9f526e/include/crocoddyl/core/actions/diff-lqr.hxx#L231-L244

Additionally, this PR benchmarks the computational reduction of using floats, compared to doubles. I attached the results below.

I am excited about reaching this milestone, reported in #762. However, the technical solution suggested in that thread is not appropriate and feasible.

********************Talos 4DoF Arm******************
NQ: 7
Number of nodes: 100

Without Code Generation:
1 threaded calcDiff [us]:       399.057 +- 53.4844 (max: 1990, min: 381, per nodes: 3.99057 +- 0.534844)
2 threaded calcDiff [us]:       217.329 +- 17.1909 (max: 426, min: 199, per nodes: 4.34658 +- 0.343819)
3 threaded calcDiff [us]:       152.701 +- 22.8045 (max: 389, min: 137, per nodes: 4.58103 +- 0.684134)
4 threaded calcDiff [us]:       122.834 +- 16.4601 (max: 328, min: 106, per nodes: 4.91336 +- 0.658405)
5 threaded calcDiff [us]:       124.503 +- 16.881 (max: 292, min: 98, per nodes: 6.22515 +- 0.844048)
1 threaded calc [us]:           119.593 +- 8.44445 (max: 268, min: 113, per nodes: 1.19593 +- 0.0844445)
2 threaded calc [us]:           70.423 +- 10.9427 (max: 220, min: 63, per nodes: 1.40846 +- 0.218853)
3 threaded calc [us]:           51.417 +- 9.67361 (max: 203, min: 42, per nodes: 1.54251 +- 0.290208)
4 threaded calc [us]:           48.448 +- 10.6631 (max: 206, min: 35, per nodes: 1.93792 +- 0.426523)
5 threaded calc [us]:           60.276 +- 6.95372 (max: 114, min: 38, per nodes: 3.0138 +- 0.347686)
Without Code Generation (floats):
1 threaded calcDiff [us]:       387.319 +- 17.3046 (max: 840, min: 375, per nodes: 3.87319 +- 0.173046)
2 threaded calcDiff [us]:       209.575 +- 10.0108 (max: 365, min: 194, per nodes: 4.1915 +- 0.200216)
3 threaded calcDiff [us]:       145.512 +- 8.63345 (max: 259, min: 134, per nodes: 4.36536 +- 0.259003)
4 threaded calcDiff [us]:       117.933 +- 9.30436 (max: 276, min: 108, per nodes: 4.71732 +- 0.372174)
5 threaded calcDiff [us]:       115.445 +- 14.0692 (max: 237, min: 98, per nodes: 5.77225 +- 0.703461)
1 threaded calc [us]:           123.806 +- 8.04183 (max: 304, min: 118, per nodes: 1.23806 +- 0.0804183)
2 threaded calc [us]:           76.346 +- 7.34617 (max: 184, min: 64, per nodes: 1.52692 +- 0.146923)
3 threaded calc [us]:           55.494 +- 7.4928 (max: 172, min: 45, per nodes: 1.66482 +- 0.224784)
4 threaded calc [us]:           49.077 +- 8.99622 (max: 178, min: 37, per nodes: 1.96308 +- 0.359849)
5 threaded calc [us]:           59.39 +- 4.63026 (max: 125, min: 46, per nodes: 2.9695 +- 0.231513)
backwardPass [us]:              231.631 +- 7.05596 (max: 349, min: 224, per nodes: 2.31631 +- 0.0705596)
forwardPass [us]:               131.625 +- 12.5554 (max: 354, min: 126, per nodes: 1.31625 +- 0.125554)
********************  Kinova Arm  ******************
NQ: 9
Number of nodes: 100

Without Code Generation:
1 threaded calcDiff [us]:       301.187 +- 17.3329 (max: 679, min: 290, per nodes: 3.01187 +- 0.173329)
2 threaded calcDiff [us]:       166.675 +- 9.63484 (max: 240, min: 153, per nodes: 3.3335 +- 0.192697)
3 threaded calcDiff [us]:       117.084 +- 10.1435 (max: 242, min: 103, per nodes: 3.51252 +- 0.304304)
4 threaded calcDiff [us]:       97.341 +- 12.4898 (max: 244, min: 82, per nodes: 3.89364 +- 0.499591)
5 threaded calcDiff [us]:       108.758 +- 9.36745 (max: 185, min: 81, per nodes: 5.4379 +- 0.468373)
1 threaded calc [us]:           105.678 +- 9.15654 (max: 293, min: 100, per nodes: 1.05678 +- 0.0915654)
2 threaded calc [us]:           63.423 +- 10.7093 (max: 202, min: 54, per nodes: 1.26846 +- 0.214186)
3 threaded calc [us]:           53.758 +- 14.219 (max: 136, min: 38, per nodes: 1.61274 +- 0.42657)
4 threaded calc [us]:           57.451 +- 14.0838 (max: 196, min: 32, per nodes: 2.29804 +- 0.563353)
5 threaded calc [us]:           49.912 +- 12.1237 (max: 202, min: 31, per nodes: 2.4956 +- 0.606183)
Without Code Generation (floats):
1 threaded calcDiff [us]:       313.905 +- 35.8385 (max: 1020, min: 295, per nodes: 3.13905 +- 0.358385)
2 threaded calcDiff [us]:       190.694 +- 21.4206 (max: 388, min: 155, per nodes: 3.81388 +- 0.428413)
3 threaded calcDiff [us]:       130.294 +- 19.5898 (max: 310, min: 106, per nodes: 3.90882 +- 0.587693)
4 threaded calcDiff [us]:       109.675 +- 21.9193 (max: 304, min: 82, per nodes: 4.387 +- 0.876774)
5 threaded calcDiff [us]:       104.099 +- 32.7786 (max: 350, min: 71, per nodes: 5.20495 +- 1.63893)
1 threaded calc [us]:           117.939 +- 41.8171 (max: 661, min: 102, per nodes: 1.17939 +- 0.418171)
2 threaded calc [us]:           85.877 +- 31.4885 (max: 466, min: 57, per nodes: 1.71754 +- 0.62977)
3 threaded calc [us]:           71.963 +- 34.939 (max: 342, min: 38, per nodes: 2.15889 +- 1.04817)
4 threaded calc [us]:           65.883 +- 29.7934 (max: 348, min: 33, per nodes: 2.63532 +- 1.19174)
5 threaded calc [us]:           82.058 +- 43.6001 (max: 415, min: 33, per nodes: 4.1029 +- 2.18001)
backwardPass [us]:              185.11 +- 59.939 (max: 743, min: 157, per nodes: 1.8511 +- 0.59939)
forwardPass [us]:               175.336 +- 112.942 (max: 1063, min: 118, per nodes: 1.75336 +- 1.12942)
********************Quadruped Solo******************
NQ: 15
Number of nodes: 100

Without Code Generation:
1 threaded calcDiff [us]:       2060.79 +- 718.571 (max: 7564, min: 1274, per nodes: 20.6079 +- 7.18571)
2 threaded calcDiff [us]:       942.121 +- 340.644 (max: 2848, min: 634, per nodes: 18.8424 +- 6.81288)
3 threaded calcDiff [us]:       564.272 +- 122.224 (max: 1874, min: 440, per nodes: 16.9282 +- 3.66671)
4 threaded calcDiff [us]:       480.662 +- 139.001 (max: 1310, min: 321, per nodes: 19.2265 +- 5.56006)
5 threaded calcDiff [us]:       436.341 +- 166.458 (max: 1246, min: 255, per nodes: 21.817 +- 8.3229)
1 threaded calc [us]:           463.578 +- 119.164 (max: 1727, min: 397, per nodes: 4.63578 +- 1.19164)
2 threaded calc [us]:           299.752 +- 89.363 (max: 1043, min: 211, per nodes: 5.99504 +- 1.78726)
3 threaded calc [us]:           238.779 +- 87.3181 (max: 828, min: 145, per nodes: 7.16337 +- 2.61954)
4 threaded calc [us]:           227.695 +- 106.926 (max: 865, min: 111, per nodes: 9.1078 +- 4.27702)
5 threaded calc [us]:           277.846 +- 120.497 (max: 1261, min: 95, per nodes: 13.8923 +- 6.02483)
Without Code Generation (floats):
1 threaded calcDiff [us]:       1288.31 +- 424.704 (max: 11393, min: 1041, per nodes: 12.8831 +- 4.24704)
2 threaded calcDiff [us]:       620.097 +- 133.595 (max: 3121, min: 531, per nodes: 12.4019 +- 2.67191)
3 threaded calcDiff [us]:       399.904 +- 47.5057 (max: 1004, min: 365, per nodes: 11.9971 +- 1.42517)
4 threaded calcDiff [us]:       308.429 +- 27.9088 (max: 589, min: 272, per nodes: 12.3372 +- 1.11635)
5 threaded calcDiff [us]:       264.658 +- 28.1762 (max: 486, min: 220, per nodes: 13.2329 +- 1.40881)
1 threaded calc [us]:           402.262 +- 22.2468 (max: 676, min: 383, per nodes: 4.02262 +- 0.222468)
2 threaded calc [us]:           217.028 +- 13.2636 (max: 451, min: 199, per nodes: 4.34056 +- 0.265272)
3 threaded calc [us]:           154.863 +- 17.7563 (max: 353, min: 138, per nodes: 4.64589 +- 0.53269)
4 threaded calc [us]:           128.03 +- 18.5006 (max: 306, min: 107, per nodes: 5.1212 +- 0.740025)
5 threaded calc [us]:           126.268 +- 11.4966 (max: 281, min: 94, per nodes: 6.3134 +- 0.574831)
backwardPass [us]:              656.337 +- 91.7568 (max: 2587, min: 634, per nodes: 6.56337 +- 0.917568)
forwardPass [us]:               447.704 +- 22.3245 (max: 916, min: 430, per nodes: 4.47704 +- 0.223245)
********************Quadruped Anymal******************
NQ: 19
Number of nodes: 100

Without Code Generation:
1 threaded calcDiff [us]:       2271.74 +- 154.109 (max: 3224, min: 2043, per nodes: 22.7174 +- 1.54109)
2 threaded calcDiff [us]:       1222.02 +- 122.487 (max: 2305, min: 1014, per nodes: 24.4405 +- 2.44974)
3 threaded calcDiff [us]:       822.62 +- 128.037 (max: 1858, min: 708, per nodes: 24.6786 +- 3.84112)
4 threaded calcDiff [us]:       646.891 +- 110.621 (max: 1473, min: 521, per nodes: 25.8756 +- 4.42484)
5 threaded calcDiff [us]:       848.516 +- 298.982 (max: 3086, min: 433, per nodes: 42.4258 +- 14.9491)
1 threaded calc [us]:           727.64 +- 179.684 (max: 4191, min: 617, per nodes: 7.2764 +- 1.79684)
2 threaded calc [us]:           374.341 +- 51.3855 (max: 762, min: 327, per nodes: 7.48682 +- 1.02771)
3 threaded calc [us]:           281.561 +- 51.2119 (max: 572, min: 221, per nodes: 8.44683 +- 1.53636)
4 threaded calc [us]:           237.628 +- 42.2112 (max: 529, min: 177, per nodes: 9.50512 +- 1.68845)
5 threaded calc [us]:           191.84 +- 34.3062 (max: 425, min: 147, per nodes: 9.592 +- 1.71531)
Without Code Generation (floats):
1 threaded calcDiff [us]:       1811.22 +- 477.196 (max: 16325, min: 1636, per nodes: 18.1122 +- 4.77196)
2 threaded calcDiff [us]:       905.341 +- 56.1551 (max: 1293, min: 820, per nodes: 18.1068 +- 1.1231)
3 threaded calcDiff [us]:       616.82 +- 37.6554 (max: 853, min: 554, per nodes: 18.5046 +- 1.12966)
4 threaded calcDiff [us]:       473.403 +- 34.8709 (max: 857, min: 438, per nodes: 18.9361 +- 1.39484)
5 threaded calcDiff [us]:       386.987 +- 57.5642 (max: 745, min: 342, per nodes: 19.3494 +- 2.87821)
1 threaded calc [us]:           641.654 +- 43.0906 (max: 994, min: 599, per nodes: 6.41654 +- 0.430906)
2 threaded calc [us]:           383.204 +- 49.3741 (max: 845, min: 316, per nodes: 7.66408 +- 0.987482)
3 threaded calc [us]:           275.314 +- 60.7983 (max: 799, min: 217, per nodes: 8.25942 +- 1.82395)
4 threaded calc [us]:           209.121 +- 48.5019 (max: 429, min: 162, per nodes: 8.36484 +- 1.94007)
5 threaded calc [us]:           178.079 +- 28.7417 (max: 460, min: 133, per nodes: 8.90395 +- 1.43708)
backwardPass [us]:              1288.36 +- 70.0738 (max: 2928, min: 1225, per nodes: 12.8836 +- 0.700738)
forwardPass [us]:               700.75 +- 42.2749 (max: 1303, min: 656, per nodes: 7.0075 +- 0.422749)
******************** Quadruped HyQ ******************
NQ: 19
Number of nodes: 100

Without Code Generation:
1 threaded calcDiff [us]:       2399.1 +- 249.684 (max: 7476, min: 2098, per nodes: 23.991 +- 2.49684)
2 threaded calcDiff [us]:       1192.58 +- 79.442 (max: 1824, min: 996, per nodes: 23.8515 +- 1.58884)
3 threaded calcDiff [us]:       808.854 +- 139.141 (max: 3793, min: 684, per nodes: 24.2656 +- 4.17423)
4 threaded calcDiff [us]:       621.031 +- 53.2494 (max: 1161, min: 530, per nodes: 24.8412 +- 2.12998)
5 threaded calcDiff [us]:       494.03 +- 71.9314 (max: 925, min: 419, per nodes: 24.7015 +- 3.59657)
1 threaded calc [us]:           643.506 +- 33.7014 (max: 1184, min: 619, per nodes: 6.43506 +- 0.337014)
2 threaded calc [us]:           340.531 +- 19.0249 (max: 638, min: 313, per nodes: 6.81062 +- 0.380497)
3 threaded calc [us]:           232.202 +- 15.6659 (max: 382, min: 218, per nodes: 6.96606 +- 0.469977)
4 threaded calc [us]:           185.759 +- 20.0007 (max: 325, min: 167, per nodes: 7.43036 +- 0.800029)
5 threaded calc [us]:           193.563 +- 21.4393 (max: 306, min: 146, per nodes: 9.67815 +- 1.07197)
Without Code Generation (floats):
1 threaded calcDiff [us]:       1732.99 +- 177.507 (max: 6745, min: 1652, per nodes: 17.33 +- 1.77507)
2 threaded calcDiff [us]:       908.975 +- 45.6076 (max: 1302, min: 842, per nodes: 18.1795 +- 0.912153)
3 threaded calcDiff [us]:       632.129 +- 40.5425 (max: 1148, min: 575, per nodes: 18.9639 +- 1.21628)
4 threaded calcDiff [us]:       478.729 +- 37.2484 (max: 886, min: 431, per nodes: 19.1492 +- 1.48993)
5 threaded calcDiff [us]:       389.157 +- 42.5949 (max: 746, min: 348, per nodes: 19.4578 +- 2.12975)
1 threaded calc [us]:           624.871 +- 22.6787 (max: 962, min: 601, per nodes: 6.24871 +- 0.226787)
2 threaded calc [us]:           331.936 +- 13.891 (max: 532, min: 309, per nodes: 6.63872 +- 0.277819)
3 threaded calc [us]:           230.564 +- 18.4056 (max: 414, min: 213, per nodes: 6.91692 +- 0.552167)
4 threaded calc [us]:           181.543 +- 18.3662 (max: 445, min: 165, per nodes: 7.26172 +- 0.734646)
5 threaded calc [us]:           174.799 +- 15.8679 (max: 323, min: 132, per nodes: 8.73995 +- 0.793395)
backwardPass [us]:              1463.38 +- 644.479 (max: 7586, min: 1221, per nodes: 14.6338 +- 6.44479)
forwardPass [us]:               695.839 +- 120.857 (max: 4183, min: 652, per nodes: 6.95839 +- 1.20857)
********************Biped iCub ***********************
NQ: 36
Number of nodes: 100

Without Code Generation:
1 threaded calcDiff [us]:       8351.57 +- 450.296 (max: 15152, min: 8039, per nodes: 83.5157 +- 4.50296)
2 threaded calcDiff [us]:       4377.88 +- 102.928 (max: 5188, min: 4076, per nodes: 87.5575 +- 2.05857)
3 threaded calcDiff [us]:       3051.19 +- 93.6561 (max: 3649, min: 2829, per nodes: 91.5358 +- 2.80968)
4 threaded calcDiff [us]:       2183.98 +- 53.3725 (max: 2579, min: 2117, per nodes: 87.3592 +- 2.1349)
5 threaded calcDiff [us]:       1887.82 +- 58.8538 (max: 2823, min: 1803, per nodes: 94.3909 +- 2.94269)
1 threaded calc [us]:           1516.2 +- 36.94 (max: 1925, min: 1480, per nodes: 15.162 +- 0.3694)
2 threaded calc [us]:           811.072 +- 19.4209 (max: 1140, min: 771, per nodes: 16.2214 +- 0.388418)
3 threaded calc [us]:           546.565 +- 20.7925 (max: 775, min: 530, per nodes: 16.397 +- 0.623774)
4 threaded calc [us]:           428.295 +- 30.756 (max: 619, min: 398, per nodes: 17.1318 +- 1.23024)
5 threaded calc [us]:           381.338 +- 68.6003 (max: 743, min: 321, per nodes: 19.0669 +- 3.43002)
Without Code Generation (floats):
1 threaded calcDiff [us]:       5993.69 +- 1321.57 (max: 28688, min: 5657, per nodes: 59.9369 +- 13.2157)
2 threaded calcDiff [us]:       3031.26 +- 98.6818 (max: 3782, min: 2749, per nodes: 60.6252 +- 1.97364)
3 threaded calcDiff [us]:       2071.3 +- 78.4896 (max: 2584, min: 1855, per nodes: 62.1389 +- 2.35469)
4 threaded calcDiff [us]:       1583.21 +- 75.9114 (max: 2728, min: 1493, per nodes: 63.3284 +- 3.03646)
5 threaded calcDiff [us]:       1249.35 +- 85.6204 (max: 2470, min: 1170, per nodes: 62.4677 +- 4.28102)
1 threaded calc [us]:           1528.67 +- 80.011 (max: 2024, min: 1404, per nodes: 15.2867 +- 0.80011)
2 threaded calc [us]:           776.553 +- 75.9864 (max: 1630, min: 708, per nodes: 15.5311 +- 1.51973)
3 threaded calc [us]:           536.42 +- 63.4188 (max: 1019, min: 488, per nodes: 16.0926 +- 1.90256)
4 threaded calc [us]:           417.104 +- 54.2116 (max: 823, min: 361, per nodes: 16.6842 +- 2.16846)
5 threaded calc [us]:           346.213 +- 46.649 (max: 630, min: 303, per nodes: 17.3106 +- 2.33245)
backwardPass [us]:              18583.3 +- 3777.73 (max: 44800, min: 15264, per nodes: 185.833 +- 37.7773)
forwardPass [us]:               1777.18 +- 145.62 (max: 2732, min: 1625, per nodes: 17.7718 +- 1.4562)
********************Biped Talos***********************
NQ: 39
Number of nodes: 100

Without Code Generation:
1 threaded calcDiff [us]:       10590.3 +- 253.142 (max: 15431, min: 9894, per nodes: 105.903 +- 2.53142)
2 threaded calcDiff [us]:       5033.22 +- 155.168 (max: 6149, min: 4646, per nodes: 100.664 +- 3.10336)
3 threaded calcDiff [us]:       3500.15 +- 130.912 (max: 4847, min: 3236, per nodes: 105.004 +- 3.92737)
4 threaded calcDiff [us]:       2758.65 +- 938.963 (max: 13011, min: 2429, per nodes: 110.346 +- 37.5585)
5 threaded calcDiff [us]:       2223.39 +- 251.209 (max: 5120, min: 2079, per nodes: 111.17 +- 12.5605)
1 threaded calc [us]:           1839.1 +- 191.856 (max: 4736, min: 1615, per nodes: 18.391 +- 1.91856)
2 threaded calc [us]:           889.299 +- 37.8526 (max: 1190, min: 825, per nodes: 17.786 +- 0.757052)
3 threaded calc [us]:           602.043 +- 36.9758 (max: 868, min: 558, per nodes: 18.0613 +- 1.10927)
4 threaded calc [us]:           470.309 +- 36.822 (max: 758, min: 431, per nodes: 18.8124 +- 1.47288)
5 threaded calc [us]:           401.75 +- 32.1745 (max: 699, min: 355, per nodes: 20.0875 +- 1.60873)
Without Code Generation (floats):
1 threaded calcDiff [us]:       7964.25 +- 670.583 (max: 27251, min: 7283, per nodes: 79.6425 +- 6.70583)
2 threaded calcDiff [us]:       3511.45 +- 116.392 (max: 4184, min: 3209, per nodes: 70.229 +- 2.32785)
3 threaded calcDiff [us]:       2408.78 +- 86.6792 (max: 3028, min: 2191, per nodes: 72.2635 +- 2.60038)
4 threaded calcDiff [us]:       1831.69 +- 69.1039 (max: 3478, min: 1739, per nodes: 73.2677 +- 2.76416)
5 threaded calcDiff [us]:       1485.75 +- 156.708 (max: 2645, min: 1375, per nodes: 74.2874 +- 7.8354)
1 threaded calc [us]:           1556.18 +- 69.0353 (max: 2330, min: 1484, per nodes: 15.5618 +- 0.690353)
2 threaded calc [us]:           808.323 +- 33.855 (max: 1086, min: 754, per nodes: 16.1665 +- 0.677101)
3 threaded calc [us]:           550.369 +- 31.275 (max: 755, min: 509, per nodes: 16.5111 +- 0.938251)
4 threaded calc [us]:           434.195 +- 62.864 (max: 914, min: 391, per nodes: 17.3678 +- 2.51456)
5 threaded calc [us]:           351.74 +- 41.11 (max: 682, min: 316, per nodes: 17.587 +- 2.0555)
backwardPass [us]:              22610.2 +- 3899.11 (max: 66203, min: 17346, per nodes: 226.102 +- 38.9911)
forwardPass [us]:               1819.01 +- 96.4867 (max: 2492, min: 1724, per nodes: 18.1901 +- 0.964867)

@cmastalli
Copy link
Member Author

@nim65s -- The doc-coverage job took 300 minutes. I wonder if we are running codegen support in this job. As you can see, adding the casting support increases the compilation time. Do you think this is something we should care about now?

@nim65s
Copy link
Collaborator

nim65s commented Mar 13, 2025

We can decide to ignore gitlab CI for now, until I finish my work on the new documentation / coverage system and remove the doc-coverage gitlab job.

Bui to decide that we can ignore gitlab CI, we need to trust other CI systems I think. Here, conda, nix and ROS are all red.

@cmastalli
Copy link
Member Author

We can decide to ignore gitlab CI for now, until I finish my work on the new documentation / coverage system and remove the doc-coverage gitlab job.

Bui to decide that we can ignore gitlab CI, we need to trust other CI systems I think. Here, conda, nix and ROS are all red.

All are broken as we need to get merged and deployed the changes I suggest in Pinocchio.

@cmastalli cmastalli mentioned this pull request Mar 14, 2025
…sserts with floats (needed to handle this properly in Pinocchio)
Comment on lines +208 to +219
# Enable ccache automatically if available
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
message(STATUS "Using ccache: ${CCACHE_PROGRAM}")
set(CMAKE_C_COMPILER_LAUNCHER
${CCACHE_PROGRAM}
CACHE STRING "C compiler launcher" FORCE)
set(CMAKE_CXX_COMPILER_LAUNCHER
${CCACHE_PROGRAM}
CACHE STRING "C++ compiler launcher" FORCE)
endif()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never a good idea to force the use of ccache. It should be set using the CMAKE variable directly externally, not internally.

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

Successfully merging this pull request may close these issues.

3 participants