Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8b8689a9f | ||
|
|
1150400339 | ||
|
|
96aea948c6 | ||
|
|
d77389c076 | ||
|
|
7f850e3f83 | ||
|
|
51350fcd6a | ||
|
|
de287acce5 | ||
|
|
719ba879a8 | ||
|
|
ef4e5de217 | ||
|
|
5064bcac1a | ||
|
|
d2059a76ad | ||
|
|
a37d680997 | ||
|
|
64773dd26f | ||
|
|
48be5bd710 | ||
|
|
1d436e3bb3 | ||
|
|
eb67611896 | ||
|
|
b37cd9ce26 | ||
|
|
1602f4c577 | ||
|
|
c3d0283c96 | ||
|
|
5a38e3f820 | ||
|
|
85ba4de8b0 | ||
|
|
769b81ad69 | ||
|
|
d4aec84493 | ||
|
|
78bbac517c | ||
|
|
bc66e85636 | ||
|
|
8e65cd93dc | ||
|
|
d009183a38 | ||
|
|
fa00aadcf3 | ||
|
|
d94cd2f90d | ||
|
|
98dd811d8c | ||
|
|
91d22ebe2f | ||
|
|
58abcf917a | ||
|
|
b1ee46279d | ||
|
|
4b0b8e2170 | ||
|
|
0befcc5bcf | ||
|
|
ea95ba08e2 | ||
|
|
b650340b8b | ||
|
|
17378ae351 | ||
|
|
c8727203d0 | ||
|
|
ac4673868c | ||
|
|
a2b97d056e | ||
|
|
e13f3cd10f | ||
|
|
9ea03296a1 | ||
|
|
30b2f90207 | ||
|
|
301ca92cf2 | ||
|
|
976f865ff4 | ||
|
|
e7326b3815 | ||
|
|
571ac807d7 | ||
|
|
91b223774b | ||
|
|
91e95723fe | ||
|
|
4101b947f2 | ||
|
|
d1231ef0d6 | ||
|
|
db350bdc75 | ||
|
|
424b8c37ae | ||
|
|
deb4d4cbaf | ||
|
|
0f943b2b68 | ||
|
|
95d496296e | ||
|
|
af885d09b8 | ||
|
|
9686ba2280 | ||
|
|
aecf26fbb9 | ||
|
|
cfee61a908 | ||
|
|
bfdc9635eb | ||
|
|
d892268952 | ||
|
|
5ff2a58401 | ||
|
|
c4cff77947 | ||
|
|
b921acb284 | ||
|
|
bbbf4249e7 | ||
|
|
286335bb99 | ||
|
|
5bd0240c4f | ||
|
|
89c6e67a32 | ||
|
|
87dd733679 | ||
|
|
a7fd523488 | ||
|
|
3fc5c85d4b | ||
|
|
62d1428b2b | ||
|
|
be00d9fab5 | ||
|
|
688abe475a | ||
|
|
d3fea168e9 | ||
|
|
1f51b27e0a | ||
|
|
663ac3641c | ||
|
|
39e4e54d95 | ||
|
|
229959f4f3 | ||
|
|
76b5614560 | ||
|
|
d922192fd4 | ||
|
|
f4f8322a80 | ||
|
|
5b9da095dc | ||
|
|
86687ea518 | ||
|
|
d206a1f8b7 | ||
|
|
83ad298c39 | ||
|
|
a0683cf7e5 | ||
|
|
72af1720a8 | ||
|
|
000534f74b | ||
|
|
00c895fc64 | ||
|
|
4699b3dcdf | ||
|
|
d27b779b30 | ||
|
|
8f0dbac9cb | ||
|
|
3ba0f3bf83 | ||
|
|
854c95feb9 | ||
|
|
06e8d24ebc | ||
|
|
1215128c3d | ||
|
|
81bec68ca9 | ||
|
|
c77141ca6f | ||
|
|
7ca797f3a5 | ||
|
|
fa4f1c8479 | ||
|
|
1f3a810554 | ||
|
|
ebc98bf5be | ||
|
|
1d744e5b54 | ||
|
|
a7bfaf09d0 | ||
|
|
7802ac31f7 | ||
|
|
9efefc74b9 | ||
|
|
f6c4430870 | ||
|
|
3206f48898 | ||
|
|
88c37b53fe | ||
|
|
1907e0f062 | ||
|
|
bcd2162311 | ||
|
|
1afa2caeae | ||
|
|
c5b2afa46d | ||
|
|
991c2247c5 | ||
|
|
0dc6f76d2f | ||
|
|
709f6e9c66 | ||
|
|
9cc760aeb9 | ||
|
|
1496406616 | ||
|
|
46a6157613 | ||
|
|
c629e52bff | ||
|
|
1f8950d056 | ||
|
|
c4cd20ce70 | ||
|
|
d141efa55d | ||
|
|
9d37207658 | ||
|
|
93cf9fc383 | ||
|
|
c0d873bc38 | ||
|
|
2835538c70 | ||
|
|
d5d0e5e003 | ||
|
|
fb2ab3c8f2 | ||
|
|
ddfb7bd850 | ||
|
|
6d8c2da928 | ||
|
|
7fac82d319 | ||
|
|
c40d3bd08d | ||
|
|
66d66fa563 | ||
|
|
9b3bd6fbc5 | ||
|
|
9d4e290e0b | ||
|
|
764b7cfb19 | ||
|
|
4bc80a488e | ||
|
|
46443af7ae | ||
|
|
3be75ac573 | ||
|
|
bf366d7a90 | ||
|
|
d31f4a1adc | ||
|
|
dd74962a77 | ||
|
|
0a178b5dc6 | ||
|
|
9d08f1a4ea | ||
|
|
1c1d80763b | ||
|
|
5fd4674e1b | ||
|
|
3e2d9a0202 | ||
|
|
d88ac8c5bc | ||
|
|
bdb473cbdb | ||
|
|
2ab21373fe | ||
|
|
630b4c042d | ||
|
|
d13efb1a4d | ||
|
|
c58f1c2b5a | ||
|
|
36dbb6d1db | ||
|
|
9bcf490363 | ||
|
|
a514421f92 | ||
|
|
9e64b14a35 | ||
|
|
3e9445129a | ||
|
|
fd6a9b1aee | ||
|
|
27e8d23f7c | ||
|
|
8668634be4 | ||
|
|
29cdfa8076 | ||
|
|
69a8ed2bff | ||
|
|
f39aa92589 | ||
|
|
cd7b411632 | ||
|
|
dd0756ea04 | ||
|
|
a9cd1a7cb6 | ||
|
|
6657ea218b | ||
|
|
9bf79896d4 | ||
|
|
4412863ad2 | ||
|
|
f9760fd650 | ||
|
|
53e59293b0 | ||
|
|
75fad5a91b | ||
|
|
302cb1edfa | ||
|
|
49f61bc980 | ||
|
|
6f7313ec83 | ||
|
|
25bbfda1fe | ||
|
|
bdb6aadb87 | ||
|
|
a488bf1ca7 | ||
|
|
743a40f3dc | ||
|
|
e000c81952 | ||
|
|
2f2a40da84 | ||
|
|
23722baa7f | ||
|
|
e4dabca271 | ||
|
|
f9bab2b54b | ||
|
|
0c80502221 | ||
|
|
d3f5048582 | ||
|
|
7443d28e5a | ||
|
|
01ced4a67a | ||
|
|
59fd03f3fd | ||
|
|
27d3e56d0f | ||
|
|
576b2187a2 | ||
|
|
249cabc065 | ||
|
|
206987a4ec | ||
|
|
61277ef168 | ||
|
|
94645220c0 | ||
|
|
74616c3707 | ||
|
|
d830562c2c | ||
|
|
38413a86dc | ||
|
|
e03055bc3f | ||
|
|
505b6aec10 | ||
|
|
7e66fa08a9 | ||
|
|
0d198ef2bb | ||
|
|
7547a89af0 | ||
|
|
0d5bc28867 | ||
|
|
0961da8a60 | ||
|
|
537b492fcc | ||
|
|
4de31bdc8c | ||
|
|
604f8f4ab0 | ||
|
|
95bf159f50 | ||
|
|
af601c1eca | ||
|
|
92ac514a33 | ||
|
|
265bd0d6b6 | ||
|
|
aca937412b | ||
|
|
0f5c2509c5 | ||
|
|
f099602007 | ||
|
|
80ab6c9063 | ||
|
|
ffc5303dcf | ||
|
|
7f6507781e | ||
|
|
874efa244b | ||
|
|
d2b754f250 | ||
|
|
b11e2a474b | ||
|
|
3b3b5d7e4b | ||
|
|
bf9be18d3b | ||
|
|
6af3a7b696 | ||
|
|
726af9c1bc | ||
|
|
4de3c81194 | ||
|
|
9a9040edb9 | ||
|
|
0862aa3bf0 | ||
|
|
e95f8cc13b | ||
|
|
ca90dc60c0 | ||
|
|
5b7a792fa4 | ||
|
|
490c6bc470 | ||
|
|
2683cfdc41 | ||
|
|
192b5ec716 | ||
|
|
70d939188d | ||
|
|
01b261986f | ||
|
|
b9a7526922 | ||
|
|
8740389dc4 | ||
|
|
31273227ea | ||
|
|
b62c2df2d3 | ||
|
|
4e9ed63eb7 | ||
|
|
36ff4fdd0a | ||
|
|
7cfbd36c43 | ||
|
|
4405871acd | ||
|
|
a26971dd71 | ||
|
|
489a918b68 | ||
|
|
ac1b692100 | ||
|
|
212e2e1c33 | ||
|
|
9068359c7a | ||
|
|
f70b8b9167 | ||
|
|
5f8b42a4b2 | ||
|
|
abb67e1563 | ||
|
|
d08cf0efa5 | ||
|
|
72ec80aec2 | ||
|
|
dbb11c6b55 | ||
|
|
e26cee88ef | ||
|
|
3d0a284e99 | ||
|
|
ba520cfb8f | ||
|
|
fba51a41cf | ||
|
|
917ec395bc | ||
|
|
be67e3d9af | ||
|
|
8ef7bebba4 | ||
|
|
de420f435b | ||
|
|
66f8c3ab83 | ||
|
|
1159d140cf | ||
|
|
5215df6603 | ||
|
|
18bd46aaf7 | ||
|
|
c2eee5e285 | ||
|
|
0dca86bc09 | ||
|
|
e886d52884 | ||
|
|
07509b764d | ||
|
|
951f32880f | ||
|
|
026f36215c | ||
|
|
9a1c0db20e | ||
|
|
21669bc2da | ||
|
|
4a0693a242 | ||
|
|
a54b44ba05 | ||
|
|
e0ef30ce11 | ||
|
|
ae303bc0d4 | ||
|
|
e7a36e906a | ||
|
|
84764f823b | ||
|
|
be720a31ea | ||
|
|
21716fd744 | ||
|
|
f682b75bb0 | ||
|
|
8c5898a184 | ||
|
|
f4ec638e6b | ||
|
|
2252e1ab64 | ||
|
|
e2c3743a3d | ||
|
|
9162a30915 | ||
|
|
5b7998e64f | ||
|
|
0f0ff37d3c | ||
|
|
25afa98528 | ||
|
|
710cc62f50 | ||
|
|
fc08ab5d21 | ||
|
|
de4efd000b | ||
|
|
3aba693fb5 | ||
|
|
1e6869039a | ||
|
|
edc52c053b | ||
|
|
0014b64aec | ||
|
|
f8bcfcf255 | ||
|
|
c76d6bac7e | ||
|
|
fe411bd1df | ||
|
|
cdf5c79d0d | ||
|
|
ffcf0c308c | ||
|
|
7b12e92eb9 | ||
|
|
6b242c6c29 | ||
|
|
7f75aae70d | ||
|
|
089ae7ea29 | ||
|
|
220b05cb43 | ||
|
|
3a06e88f6f | ||
|
|
d3206b99eb | ||
|
|
c042d24cfd | ||
|
|
f545b6c571 | ||
|
|
daffabf08c | ||
|
|
30f64c07c2 | ||
|
|
47ff9ec2e8 | ||
|
|
02d364e7cb | ||
|
|
55bd37b098 | ||
|
|
912633af99 | ||
|
|
af3024bf0c | ||
|
|
2b6e65b1a4 | ||
|
|
e4b59038ad | ||
|
|
530990b476 | ||
|
|
f4cf6a63c2 | ||
|
|
b4d4630fb8 | ||
|
|
00984c339f | ||
|
|
f0a0039ca9 | ||
|
|
9c8dd33483 | ||
|
|
473e1f6e2d | ||
|
|
8f4b755e2a | ||
|
|
5ee8f866e2 | ||
|
|
3635cd0e7e | ||
|
|
b6400e2b33 | ||
|
|
f6a00194b2 | ||
|
|
3f7a13ba5e | ||
|
|
5ddfae7da6 | ||
|
|
0245f94590 | ||
|
|
78c15321aa | ||
|
|
b6829608cf | ||
|
|
60d17dfd07 | ||
|
|
6e0deefa84 | ||
|
|
3b034a4fa3 | ||
|
|
1fd6847ca9 | ||
|
|
ae65c115b3 | ||
|
|
1cbec0627b | ||
|
|
bfb937878e | ||
|
|
22fb810ee1 | ||
|
|
a5d8381afb | ||
|
|
cb2f7b8cdc | ||
|
|
dc94e1317d | ||
|
|
3f936e280d | ||
|
|
dfa26a5c53 | ||
|
|
2dcd109094 | ||
|
|
2fa42516b9 | ||
|
|
9d867289f7 | ||
|
|
7b72d2f47d | ||
|
|
9766aedb79 | ||
|
|
5b4998764e | ||
|
|
184ae4fbf0 | ||
|
|
022eefb3e6 | ||
|
|
7d3f581a93 | ||
|
|
9956898e99 | ||
|
|
92f25382f1 | ||
|
|
9ee13e259d | ||
|
|
66459c4d29 | ||
|
|
652bd8dbea | ||
|
|
7e57304373 | ||
|
|
fae0ef0cad | ||
|
|
ced815834b | ||
|
|
f63818681d | ||
|
|
e73f8ab40d | ||
|
|
1a5dc143f5 | ||
|
|
d354337843 | ||
|
|
958272eac2 | ||
|
|
4b437777ce | ||
|
|
673cb79d35 | ||
|
|
cbf687f9ac | ||
|
|
35e1b04834 | ||
|
|
78b6e883bd | ||
|
|
7c89fc6052 | ||
|
|
d710e39fab | ||
|
|
79954a3916 | ||
|
|
fd5677342b | ||
|
|
3318375f31 | ||
|
|
e51663adb0 | ||
|
|
dcbea18e7f | ||
|
|
8b50e69a43 | ||
|
|
6d02dd72b5 | ||
|
|
c7480efbd5 | ||
|
|
3e1857fac5 | ||
|
|
e281f49f89 | ||
|
|
cf17ea5a0d | ||
|
|
99006ad468 | ||
|
|
b32a259bbb | ||
|
|
f2cb33543b | ||
|
|
76e6452708 | ||
|
|
6fdfc41fa4 | ||
|
|
cda5f6541e | ||
|
|
b3edc8ab3c | ||
|
|
11d52bac68 | ||
|
|
d54022fa2f | ||
|
|
493eccd5d5 | ||
|
|
5d0ea34369 | ||
|
|
661e0810a7 | ||
|
|
2bee9957f7 | ||
|
|
fdfc21ab22 | ||
|
|
b1b3ab8cf1 | ||
|
|
7f3b668c7f | ||
|
|
86db5b6cce | ||
|
|
5d0668e55c | ||
|
|
c4f19c69ac | ||
|
|
704d1a79b8 | ||
|
|
d3da6d12d4 | ||
|
|
2ecbb4cb90 | ||
|
|
0c778aa477 | ||
|
|
a52899642a | ||
|
|
17f53d53da | ||
|
|
2933d47842 | ||
|
|
2713e05c58 | ||
|
|
a32d05612f | ||
|
|
9da2eab1b2 | ||
|
|
0316d8bc9c | ||
|
|
144ad7ce55 | ||
|
|
954d345b35 | ||
|
|
d9a1c45d94 | ||
|
|
f7d53d9f21 | ||
|
|
987f585576 | ||
|
|
93833a6ef9 | ||
|
|
a29dc0fd94 | ||
|
|
7521c385ff | ||
|
|
df0d343e2a | ||
|
|
424f1ee32e | ||
|
|
bcb0de1925 | ||
|
|
7b6beb9117 | ||
|
|
fb338337df | ||
|
|
d54ab5181c | ||
|
|
aedc0ee33a | ||
|
|
30838077b7 | ||
|
|
3009615c31 | ||
|
|
971916f23e | ||
|
|
ce50efa951 | ||
|
|
a9dc8886c1 | ||
|
|
745a6c7ced | ||
|
|
ed76348c89 | ||
|
|
eda9e0f290 | ||
|
|
7363c10a27 | ||
|
|
2332f60ec5 | ||
|
|
31e1f4c6b3 | ||
|
|
e20730af4e | ||
|
|
f51907c205 | ||
|
|
5b246b0d3e | ||
|
|
ccc6d5015b | ||
|
|
b33262f50d | ||
|
|
74eb73a0c8 | ||
|
|
fd3bba1e13 | ||
|
|
93839e1c42 | ||
|
|
158efc4d6c | ||
|
|
9d64eb55f5 | ||
|
|
d25f8d6435 | ||
|
|
7d8b0b2540 | ||
|
|
ab44f553ca | ||
|
|
637fe3e833 | ||
|
|
d76bfeec4b | ||
|
|
524ffe306a | ||
|
|
27266344fb | ||
|
|
c0a4cdea9d | ||
|
|
5e839afa52 | ||
|
|
157e4657fa | ||
|
|
c66ccb6fb5 | ||
|
|
f865b5b252 | ||
|
|
3a080f70b0 | ||
|
|
66f52f8644 | ||
|
|
64dadf9b8f | ||
|
|
d6c375bc29 | ||
|
|
0169ab732e | ||
|
|
ffc58557a3 | ||
|
|
e9191e2440 | ||
|
|
5ec807c081 | ||
|
|
b4843323b0 | ||
|
|
f0bc9a91f3 | ||
|
|
d78dfc146e | ||
|
|
0e4296de4b | ||
|
|
22443fc4e9 | ||
|
|
3e3b528c73 | ||
|
|
7a56abdfb0 | ||
|
|
99ed27a535 | ||
|
|
3c8f214461 | ||
|
|
4d3d0c4804 | ||
|
|
de63270a19 | ||
|
|
585e3dcfba | ||
|
|
addb70fa65 | ||
|
|
18893a8484 | ||
|
|
fb3e125063 | ||
|
|
9d6d30b13c | ||
|
|
388f0370c7 | ||
|
|
182c02b28a | ||
|
|
6fb409d6eb | ||
|
|
ae64eadf48 | ||
|
|
4afb8d4cf0 | ||
|
|
7db5293d96 | ||
|
|
d595393728 | ||
|
|
f4b5846c28 | ||
|
|
0766be6328 | ||
|
|
d8c755bf5a | ||
|
|
d02cbb9b7c | ||
|
|
ad3d40c8df | ||
|
|
3b72f78f66 | ||
|
|
61fd99d06e | ||
|
|
a39f965544 | ||
|
|
edf7d842f7 | ||
|
|
98d71786f8 | ||
|
|
0efbf04f5c | ||
|
|
1e336440d9 | ||
|
|
379107eab3 | ||
|
|
36c714000f | ||
|
|
9a301e8153 | ||
|
|
d67b469898 | ||
|
|
ca1d377056 | ||
|
|
75aeade555 | ||
|
|
4d5eb61328 | ||
|
|
6f611fc009 | ||
|
|
539a5c4f7b | ||
|
|
49add4953c | ||
|
|
75012eb38e | ||
|
|
634c1d30d8 | ||
|
|
803713303a | ||
|
|
89faf72cd0 | ||
|
|
eac82a0087 | ||
|
|
020214b582 | ||
|
|
f19ab7ced8 | ||
|
|
0afc301019 | ||
|
|
db85b9af61 | ||
|
|
b036b11055 | ||
|
|
3fb1ca5eaf | ||
|
|
15b8664336 | ||
|
|
8a3242c1d5 | ||
|
|
b1ed8cc599 | ||
|
|
a271bfc786 | ||
|
|
a157358717 | ||
|
|
4d928f6623 | ||
|
|
926e98b408 | ||
|
|
83159c81b9 | ||
|
|
5a5766f85a | ||
|
|
e410f16a05 | ||
|
|
4cc1f66294 | ||
|
|
ca0738de90 | ||
|
|
2398438c0c | ||
|
|
7a0f6c3ddc | ||
|
|
778624d9fb | ||
|
|
e99fad5c45 | ||
|
|
62c1c3da0c | ||
|
|
6074cd0347 | ||
|
|
b0a680ff4e | ||
|
|
caef3c954a | ||
|
|
320e82ab37 | ||
|
|
cf58c7343d | ||
|
|
c505420eb6 | ||
|
|
b4c8d2850f | ||
|
|
ca0c6df4e0 | ||
|
|
967960dc54 | ||
|
|
2e2e2feb7c | ||
|
|
d0f158a7cd | ||
|
|
597b6b17e2 | ||
|
|
b52b3e673d | ||
|
|
714db4adb7 | ||
|
|
75461a12ae | ||
|
|
df98828efd | ||
|
|
cb9935cdf5 | ||
|
|
0729cca05b | ||
|
|
5f99b5c93d | ||
|
|
5fe0c5bd9a | ||
|
|
5ea1cceb8c | ||
|
|
cd6081e609 | ||
|
|
7f9372f7a2 | ||
|
|
897c20dce6 | ||
|
|
416d443f82 | ||
|
|
848aa8e6d7 | ||
|
|
18c3a0c620 | ||
|
|
d27879a7db | ||
|
|
bd28ff18c5 | ||
|
|
84e9205b5e | ||
|
|
61bb74ee65 | ||
|
|
01167e2a73 | ||
|
|
1bd2d67d88 | ||
|
|
f1ae57c75f | ||
|
|
3bf2494b28 | ||
|
|
43445591e4 | ||
|
|
9568e93d59 | ||
|
|
0647312733 | ||
|
|
c3d062b0ca | ||
|
|
9c83485a4a | ||
|
|
d541d1a113 | ||
|
|
0d058c798e | ||
|
|
86af7c880f | ||
|
|
99b0db748e | ||
|
|
dcb810a109 | ||
|
|
03b10d0d66 | ||
|
|
806e399c3f | ||
|
|
0f339174f2 | ||
|
|
f785cc28e0 | ||
|
|
0c6e557158 | ||
|
|
33bfadcf80 | ||
|
|
4c8cb6fc10 | ||
|
|
01b87c4ead | ||
|
|
027629b782 | ||
|
|
f9c6f95710 | ||
|
|
1233c398fa | ||
|
|
5fa7a54a8d | ||
|
|
4c4996f96b | ||
|
|
f260a5b30a | ||
|
|
2dd1476092 | ||
|
|
58a5935e05 | ||
|
|
e5536efe59 | ||
|
|
f37150ed0c | ||
|
|
6b9b167a8f | ||
|
|
c0db3d7135 | ||
|
|
3082a7cdd8 | ||
|
|
a734438111 | ||
|
|
9f575a9d24 | ||
|
|
442db05908 | ||
|
|
e061012a9a | ||
|
|
bbd90dcb62 | ||
|
|
104bd26e71 | ||
|
|
5328e3c2d3 | ||
|
|
1bb2b54366 | ||
|
|
3831f11df7 | ||
|
|
c74d13b40c | ||
|
|
8950cc5407 | ||
|
|
3a09775632 | ||
|
|
cb6f28c447 | ||
|
|
e9e55306ea | ||
|
|
fb69b916d9 | ||
|
|
3f271958ec | ||
|
|
d358b63cc9 | ||
|
|
eca73bde3c | ||
|
|
98aa2ac11b | ||
|
|
1ba9fd5816 | ||
|
|
43e65c2d54 | ||
|
|
76c3bdb8b2 | ||
|
|
93a8ec0102 | ||
|
|
2b59ea9a8c | ||
|
|
e6912d0a64 | ||
|
|
4c790a0800 | ||
|
|
6dc17faec9 | ||
|
|
1e20f6c300 | ||
|
|
993e4eb294 | ||
|
|
14aaf9ed7b | ||
|
|
0aeff68c12 | ||
|
|
1a2db9e892 | ||
|
|
b55af05cc4 | ||
|
|
3df9b1b9ef | ||
|
|
b5724e1072 | ||
|
|
e09dd0aed1 | ||
|
|
f7292fc024 | ||
|
|
41dbdae78c | ||
|
|
81ad4e78cd | ||
|
|
07b2406832 | ||
|
|
e6f921aec4 | ||
|
|
eb7b872166 | ||
|
|
3f6a926825 | ||
|
|
b8f8b2bfd5 | ||
|
|
c8ad35db7d | ||
|
|
d19ce99d76 | ||
|
|
20331f7c6e | ||
|
|
d671d259be | ||
|
|
8e2caa5ecd | ||
|
|
e9063df3fe | ||
|
|
b1c6522d50 | ||
|
|
54e54344da | ||
|
|
96bb3dea94 | ||
|
|
db18399e4b | ||
|
|
45a4d78876 | ||
|
|
01615adbc8 | ||
|
|
ef44fddc2f | ||
|
|
5a8f7d5a50 | ||
|
|
75b475c4ca | ||
|
|
13b04065ce | ||
|
|
1a02d84287 | ||
|
|
a90aa5b9f9 | ||
|
|
c554ee6e45 | ||
|
|
ee296dfe64 | ||
|
|
1055d07bf4 | ||
|
|
3c3d6e4c0c | ||
|
|
ded2c5d7d4 | ||
|
|
f406577eda | ||
|
|
5c0ac2e490 | ||
|
|
73d83836e1 | ||
|
|
aa367aa08e | ||
|
|
e0629074a3 | ||
|
|
a0fde55e1b | ||
|
|
a9c21bdf1d | ||
|
|
0af8bb046b | ||
|
|
0375b27f53 | ||
|
|
6a1fb96457 | ||
|
|
3e5fffe938 | ||
|
|
2d5e1b14a7 | ||
|
|
87c72dffa6 | ||
|
|
bc44f40b6d | ||
|
|
3e1c297618 | ||
|
|
f9498d3bd7 | ||
|
|
584979c835 | ||
|
|
d9afc5377f | ||
|
|
7aa8d05005 | ||
|
|
6708788928 | ||
|
|
cfe492cff7 | ||
|
|
0945e25b65 | ||
|
|
4d496f6699 | ||
|
|
dd4ed72897 | ||
|
|
4bafbffea3 | ||
|
|
e4f369b622 | ||
|
|
250ce429bd | ||
|
|
e24fff898b | ||
|
|
0f38d7e372 | ||
|
|
4f5999d598 | ||
|
|
9724cfd981 | ||
|
|
591ca7fd88 | ||
|
|
77586e863c | ||
|
|
acbba648c2 | ||
|
|
5f48c34441 | ||
|
|
76377f1879 | ||
|
|
4950d4caf2 | ||
|
|
5433a71a20 | ||
|
|
f6db0d5478 | ||
|
|
130860aec8 | ||
|
|
5fcf4810a1 | ||
|
|
d771ee8606 | ||
|
|
7b4de29116 | ||
|
|
316c99f05f | ||
|
|
128e4c315a | ||
|
|
da9a846a8a | ||
|
|
53a71ff617 | ||
|
|
979dc05e23 | ||
|
|
ef732a54c5 | ||
|
|
1e9bf2870d | ||
|
|
35cbb0dccf | ||
|
|
bb64bebe4e | ||
|
|
d2891ba748 | ||
|
|
e069245f21 | ||
|
|
c9daf35fde | ||
|
|
9159ddc4e4 | ||
|
|
1a3debc4f0 | ||
|
|
06e0b2695e | ||
|
|
59dce1bb9c | ||
|
|
300e3d4a3d | ||
|
|
d46bd9df18 | ||
|
|
e37603383f | ||
|
|
2ee362604c | ||
|
|
e930845606 | ||
|
|
474fd0afc6 | ||
|
|
77765fc07f | ||
|
|
7899a5f218 | ||
|
|
d0ea3579bd | ||
|
|
bc3516b411 | ||
|
|
92d9eaefc6 | ||
|
|
45a7e2ec02 | ||
|
|
91bbf453bc | ||
|
|
442312d4cd | ||
|
|
c8e38dfd63 | ||
|
|
7802882b36 | ||
|
|
a7dcb41ddf | ||
|
|
213e500a54 | ||
|
|
a5968de0b0 | ||
|
|
c87da2afec | ||
|
|
0385494ddc | ||
|
|
93e1b32a5f | ||
|
|
1d07a270cc | ||
|
|
ad3f10d6dc | ||
|
|
c7ad6768fd | ||
|
|
cf1b11695b | ||
|
|
2cd3113bd9 | ||
|
|
081c489264 | ||
|
|
a6a3b5c24a | ||
|
|
f06bd83036 | ||
|
|
89702bdcf9 | ||
|
|
8e0fce5a92 | ||
|
|
32bb890f53 | ||
|
|
df00e527e8 | ||
|
|
6390c1d52a | ||
|
|
56a55fb02f | ||
|
|
9d90766cf3 | ||
|
|
4f857898d2 | ||
|
|
7ce7beb8a0 | ||
|
|
fe6dcd0db4 | ||
|
|
5caa937dc3 | ||
|
|
948de98802 | ||
|
|
e3f49bbaae | ||
|
|
5c8c97334e | ||
|
|
17f821a80c | ||
|
|
fab9aa81f9 | ||
|
|
6cc91b7354 | ||
|
|
1f26b183ea | ||
|
|
67fad2b960 | ||
|
|
fd58c96dd6 | ||
|
|
42c3902892 | ||
|
|
1b6b7f527a | ||
|
|
4540bf9a63 | ||
|
|
52e5f3f267 | ||
|
|
1672ed597c | ||
|
|
ee7af7d8ac | ||
|
|
2b1ebba655 | ||
|
|
0ea950efb9 | ||
|
|
4203b539d6 | ||
|
|
a03b2f8e25 | ||
|
|
172f4e6b6e | ||
|
|
f5f2c12e16 | ||
|
|
3ea8957809 | ||
|
|
4781aeb9e5 | ||
|
|
4299503900 |
@@ -0,0 +1,139 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
Language: Cpp
|
||||
BasedOnStyle: WebKit
|
||||
SpaceBeforeParens: ControlStatements
|
||||
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: true
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignConsecutiveMacros: true
|
||||
AlignEscapedNewlines: Left
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllConstructorInitializersOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: true
|
||||
AllowShortCaseLabelsOnASingleLine: true
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: TopLevel
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: MultiLine
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: false
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: true
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
AfterExternBlock: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: false
|
||||
SplitEmptyNamespace: false
|
||||
BreakBeforeBinaryOperators: All
|
||||
BreakBeforeBraces: WebKit
|
||||
BreakBeforeInheritanceComma: false
|
||||
BreakInheritanceList: BeforeColon
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakStringLiterals: false
|
||||
ColumnLimit: 80
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: false
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
FixNamespaceComments: true
|
||||
ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
IncludeBlocks: Preserve
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||
Priority: 3
|
||||
- Regex: '<[[:alnum:].]+>'
|
||||
Priority: 4
|
||||
- Regex: '"[[:alnum:].]+"'
|
||||
Priority: 5
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
IncludeIsMainRegex: '(Test)?$'
|
||||
IndentCaseLabels: false
|
||||
IndentExternBlock: NoIndent
|
||||
IndentPPDirectives: AfterHash
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 3
|
||||
NamespaceIndentation: None
|
||||
#NamespaceIndentation: Inner
|
||||
ObjCBinPackProtocolList: Auto
|
||||
ObjCBlockIndentWidth: 4
|
||||
ObjCSpaceAfterProperty: true
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PenaltyBreakAssignment: 40
|
||||
PenaltyBreakBeforeFirstCallParameter: 100
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakTemplateDeclaration: 10
|
||||
PenaltyExcessCharacter: 75
|
||||
PenaltyReturnTypeOnItsOwnLine: 50
|
||||
PointerAlignment: Left
|
||||
ReflowComments: false
|
||||
SortIncludes: true
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCpp11BracedList: true
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceInEmptyBlock: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 2
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: c++14
|
||||
StatementMacros:
|
||||
- Q_UNUSED
|
||||
- QT_REQUIRE_VERSION
|
||||
TabWidth: 8
|
||||
UseTab: Never
|
||||
#...
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Start using clang-format on OSL code base (#1215)
|
||||
630b4c042d696c94ec9b2a1b6f5adc250bd61e05
|
||||
|
||||
# More clang-format (#1218)
|
||||
bdb473cbdb119f3d9060d48f75f965cbd45f6d7a
|
||||
|
||||
# More clang-format: liboslquery, oslinfo, oslc, osl.imageio, osltoy (#1220)
|
||||
bf366d7a90c46599b82071dac6dbef7c5e3ca157
|
||||
@@ -0,0 +1,40 @@
|
||||
<!--
|
||||
Please ask questions ("how do I...?" "why doesn't this work?") on the [osl-dev mail list](https://lists.aswf.io/g/osl-dev), not by filing issues.
|
||||
|
||||
Make concrete suggestions for fixing the code ("here is a patch") by filing
|
||||
a pull request, not an issue.
|
||||
-->
|
||||
|
||||
### Problem
|
||||
|
||||
<!-- Describe the problem or suggestion here.] -->
|
||||
|
||||
**Expected behavior:** <!-- What you expected to happen -->
|
||||
|
||||
**Actual behavior:** <!-- What actually happened -->
|
||||
|
||||
<!-- If your problem is a broken build, please create a -->
|
||||
<!-- [gist](https://gist.github.com) that contains the _full_ verbose -->
|
||||
<!-- build log, which you can create like this: -->
|
||||
<!-- ```make clean ; make VERBOSE=1 > build.log``` -->
|
||||
|
||||
<!-- If you are reporting a problem about a release branch, have you -->
|
||||
<!-- already tried the current head of `master` to see if the problem -->
|
||||
<!-- has been fixed? -->
|
||||
|
||||
|
||||
### Steps to Reproduce
|
||||
|
||||
1. [First Step]
|
||||
2. [Second Step]
|
||||
3. [and so on...]
|
||||
|
||||
|
||||
### Versions
|
||||
|
||||
* OSL branch/version:
|
||||
* OS:
|
||||
* C++ compiler:
|
||||
* LLVM version:
|
||||
* OIIO version:
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
## Description
|
||||
|
||||
<!-- Please provide a description of what this PR is meant to fix, and -->
|
||||
<!-- how it works (if it's not going to be very clear from the code). -->
|
||||
|
||||
## Tests
|
||||
|
||||
<!-- Did you / should you add a testsuite case (new test, or add to an -->
|
||||
<!-- existing test) to verify that this works? -->
|
||||
|
||||
|
||||
## Checklist:
|
||||
|
||||
<!-- Put an 'x' in the boxes as you complete the checklist items -->
|
||||
|
||||
- [ ] I have read the [contribution guidelines](../CONTRIBUTING.md).
|
||||
- [ ] I have previously submitted a [Contributor License Agreement](http://opensource.imageworks.com/cla/).
|
||||
- [ ] I have updated the documentation, if applicable.
|
||||
- [ ] I have ensured that the change is tested somewhere in the testsuite (adding new test cases if necessary).
|
||||
- [ ] My code follows the prevailing code style of this project.
|
||||
|
||||
@@ -0,0 +1,708 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# GitHub Actions workflow file for CI
|
||||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
||||
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
# Skip jobs when only documentation files are changed
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- '**.rst'
|
||||
- '**.tex'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- '**.rst'
|
||||
- '**.tex'
|
||||
schedule:
|
||||
# Full nightly build
|
||||
- cron: "0 8 * * *"
|
||||
|
||||
|
||||
jobs:
|
||||
vfxplatform-2019:
|
||||
name: "Linux VFXP-2019: gcc6 C++11 llvm7 py2.7 boost-1.66 exr-2.3 OIIO-2.0 sse2"
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: aswf/ci-osl:2019-clang7
|
||||
env:
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
CMAKE_CXX_STANDARD: 11
|
||||
PYTHON_VERSION: 2.7
|
||||
USE_PYTHON: 0
|
||||
OPENIMAGEIO_VERSION: Release-2.0.14
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prepare ccache timestamp
|
||||
id: ccache_cache_keys
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
||||
- name: ccache
|
||||
id: ccache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
|
||||
restore-keys: |
|
||||
${{ github.job }}-
|
||||
- name: Build setup
|
||||
run: |
|
||||
src/build-scripts/ci-startup.bash
|
||||
- name: Dependencies
|
||||
run: |
|
||||
# Remove pesky wrong installed OIIO version
|
||||
rm -rf /usr/local/include/OpenImageIO
|
||||
src/build-scripts/gh-installdeps.bash
|
||||
- name: Build
|
||||
run: |
|
||||
src/build-scripts/ci-build.bash
|
||||
- name: Testsuite
|
||||
run: |
|
||||
src/build-scripts/ci-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: |
|
||||
build/*/testsuite/*/*.*
|
||||
build/*/CMake*.{txt,log}
|
||||
|
||||
vfxplatform-2020:
|
||||
name: "Linux VFXP-2020 gcc6/C++14 llvm7 py3.7 boost-1.70 exr-2.4 OIIO-2.1 sse4"
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: aswf/ci-osl:2020
|
||||
env:
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
CMAKE_CXX_STANDARD: 14
|
||||
PYTHON_VERSION: 3.7
|
||||
USE_SIMD: sse4.2
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prepare ccache timestamp
|
||||
id: ccache_cache_keys
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
||||
- name: ccache
|
||||
id: ccache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
|
||||
restore-keys: |
|
||||
${{ github.job }}-
|
||||
- name: Build setup
|
||||
run: |
|
||||
src/build-scripts/ci-startup.bash
|
||||
- name: Dependencies
|
||||
run: |
|
||||
src/build-scripts/gh-installdeps.bash
|
||||
- name: Build
|
||||
run: |
|
||||
src/build-scripts/ci-build.bash
|
||||
- name: Testsuite
|
||||
run: |
|
||||
src/build-scripts/ci-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: |
|
||||
build/*/testsuite/*/*.*
|
||||
build/*/CMake*.{txt,log}
|
||||
|
||||
vfxplatform-2021:
|
||||
name: "Linux VFXP-2021 gcc9/C++17 llvm10 py3.7 boost-1.73 exr-2.5 OIIO-2.2 avx2"
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: aswf/ci-osl:2021
|
||||
env:
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
CMAKE_CXX_STANDARD: 17
|
||||
PYTHON_VERSION: 3.7
|
||||
USE_SIMD: avx2,f16c
|
||||
OPENEXR_VERSION: v2.5.5
|
||||
OPENIMAGEIO_VERSION: RB-2.2
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prepare ccache timestamp
|
||||
id: ccache_cache_keys
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
||||
- name: ccache
|
||||
id: ccache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
|
||||
restore-keys: |
|
||||
${{ github.job }}-
|
||||
- name: Build setup
|
||||
run: |
|
||||
src/build-scripts/ci-startup.bash
|
||||
- name: Dependencies
|
||||
run: |
|
||||
src/build-scripts/gh-installdeps.bash
|
||||
- name: Build
|
||||
run: |
|
||||
src/build-scripts/ci-build.bash
|
||||
- name: Testsuite
|
||||
run: |
|
||||
src/build-scripts/ci-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: |
|
||||
build/*/testsuite/*/*.*
|
||||
build/*/CMake*.{txt,log}
|
||||
|
||||
vfxplatform-2022:
|
||||
name: "Linux VFXP-2022 gcc9/C++17 llvm11 py3.9 boost-1.75 exr-3.1 OIIO-2.3 avx2"
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: aswf/ci-osl:2022-clang11
|
||||
env:
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
CMAKE_CXX_STANDARD: 17
|
||||
PYTHON_VERSION: 3.9
|
||||
USE_SIMD: avx2,f16c
|
||||
OPENCOLORIO_VERSION: v2.1.0
|
||||
OPENEXR_VERSION: v3.1.1
|
||||
OPENIMAGEIO_VERSION: release
|
||||
PYBIND11_VERSION: v2.7.1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prepare ccache timestamp
|
||||
id: ccache_cache_keys
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
||||
- name: ccache
|
||||
id: ccache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
|
||||
restore-keys: |
|
||||
${{ github.job }}-
|
||||
- name: Build setup
|
||||
run: |
|
||||
src/build-scripts/ci-startup.bash
|
||||
- name: Dependencies
|
||||
run: |
|
||||
rm -rf /usr/local/include/OpenImageIO /usr/local/lib/cmake/OpenImageIO
|
||||
src/build-scripts/gh-installdeps.bash
|
||||
- name: Build
|
||||
run: |
|
||||
src/build-scripts/ci-build.bash
|
||||
- name: Testsuite
|
||||
run: |
|
||||
src/build-scripts/ci-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: |
|
||||
build/*/testsuite/*/*.*
|
||||
build/*/CMake*.{txt,log}
|
||||
|
||||
# Build for OptiX, but don't run tests (will need a GPU instance for that)
|
||||
gpu-optix7-2019:
|
||||
name: "Linux GPU VFXP-2019 Cuda10 gcc6/C++14 llvm10 py2.7 boost-1.70 exr-2.4 OIIO-master avx2"
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: aswftesting/ci-osl:2019-clang10
|
||||
env:
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
CMAKE_CXX_STANDARD: 14
|
||||
PYTHON_VERSION: 2.7
|
||||
USE_SIMD: avx2,f16c
|
||||
OPENIMAGEIO_VERSION: master
|
||||
OSL_CMAKE_FLAGS: -DUSE_OPTIX=1
|
||||
OPTIX_VERSION: "7.0"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prepare ccache timestamp
|
||||
id: ccache_cache_keys
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
||||
- name: ccache
|
||||
id: ccache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
|
||||
restore-keys: |
|
||||
${{ github.job }}-
|
||||
- name: Build setup
|
||||
run: |
|
||||
src/build-scripts/ci-startup.bash
|
||||
- name: Dependencies
|
||||
run: |
|
||||
rm -rf /usr/local/include/OpenImageIO
|
||||
src/build-scripts/gh-installdeps.bash
|
||||
- name: Build
|
||||
run: |
|
||||
src/build-scripts/ci-build.bash
|
||||
# Testsuite disabled until we have GPU hardware to run on
|
||||
#- name: Testsuite
|
||||
# run: |
|
||||
# src/build-scripts/ci-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: |
|
||||
build/*/testsuite/*/*.*
|
||||
build/*/CMake*.{txt,log}
|
||||
optix.h
|
||||
|
||||
linux-debug-gcc7-llvm8:
|
||||
name: "Linux Debug gcc7, C++14, llvm8, OIIO release, py2.7, boost1.65, sse4, exr2.4"
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
CXX: g++-7
|
||||
CMAKE_BUILD_TYPE: Debug
|
||||
USE_CPP: 14
|
||||
CMAKE_CXX_STANDARD: 14
|
||||
# Debug build makes some tests run very slowly, increase timeout
|
||||
CTEST_TEST_TIMEOUT: 240
|
||||
LLVM_VERSION: 8.0.0
|
||||
OPENEXR_VERSION: v2.4.1
|
||||
OPENIMAGEIO_VERSION: release
|
||||
USE_SIMD: sse4.2
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prepare ccache timestamp
|
||||
id: ccache_cache_keys
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
||||
- name: ccache
|
||||
id: ccache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
|
||||
restore-keys: |
|
||||
${{ github.job }}-
|
||||
- name: Build setup
|
||||
run: |
|
||||
src/build-scripts/ci-startup.bash
|
||||
- name: Dependencies
|
||||
run: |
|
||||
src/build-scripts/gh-installdeps.bash
|
||||
- name: Build
|
||||
run: |
|
||||
src/build-scripts/ci-build.bash
|
||||
- name: Testsuite
|
||||
run: |
|
||||
src/build-scripts/ci-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: |
|
||||
build/*/testsuite/*/*.*
|
||||
build/*/CMake*.{txt,log}
|
||||
|
||||
linux-clang9-llvm9:
|
||||
name: "Linux clang9, C++14, llvm9, oiio release, boost1.66, avx2, exr2.3, py2.7"
|
||||
runs-on: ubuntu-18.04
|
||||
container:
|
||||
image: aswf/ci-osl:2019-clang9
|
||||
env:
|
||||
CXX: clang++
|
||||
CMAKE_CXX_STANDARD: 14
|
||||
USE_SIMD: avx
|
||||
OPENIMAGEIO_VERSION: release
|
||||
PYTHON_VERSION: 2.7
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prepare ccache timestamp
|
||||
id: ccache_cache_keys
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
||||
- name: ccache
|
||||
id: ccache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
|
||||
restore-keys: |
|
||||
${{ github.job }}-
|
||||
- name: Build setup
|
||||
run: |
|
||||
src/build-scripts/ci-startup.bash
|
||||
- name: Dependencies
|
||||
run: |
|
||||
# Remove pesky wrong installed OIIO version
|
||||
rm -rf /usr/local/include/OpenImageIO
|
||||
src/build-scripts/gh-installdeps.bash
|
||||
- name: Build
|
||||
run: |
|
||||
src/build-scripts/ci-build.bash
|
||||
- name: Testsuite
|
||||
run: |
|
||||
src/build-scripts/ci-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: |
|
||||
build/*/testsuite/*/*.*
|
||||
build/*/CMake*.{txt,log}
|
||||
|
||||
linux-clang11-llvm11:
|
||||
name: "Linux clang11/C++17 llvm-11 oiio-master avx2 exr3.0 py3.7 boost1.73"
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: aswf/ci-osl:2021-clang11
|
||||
env:
|
||||
CXX: clang++
|
||||
CC: clang
|
||||
CMAKE_CXX_STANDARD: 17
|
||||
PYTHON_VERSION: 3.7
|
||||
USE_SIMD: avx2,f16c
|
||||
OPENEXR_VERSION: v3.0.4
|
||||
OPENIMAGEIO_VERSION: master
|
||||
PYBIND11_VERSION: v2.6.2
|
||||
USE_OPENVDB: 0
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prepare ccache timestamp
|
||||
id: ccache_cache_keys
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
||||
- name: ccache
|
||||
id: ccache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
|
||||
restore-keys: |
|
||||
${{ github.job }}-
|
||||
- name: Build setup
|
||||
run: |
|
||||
src/build-scripts/ci-startup.bash
|
||||
- name: Dependencies
|
||||
run: |
|
||||
sudo rm -rf /usr/local/include/OpenEXR
|
||||
sudo rm -rf /usr/local/lib64/cmake/{IlmBase,OpenEXR}
|
||||
src/build-scripts/gh-installdeps.bash
|
||||
- name: Build
|
||||
run: |
|
||||
src/build-scripts/ci-build.bash
|
||||
- name: Testsuite
|
||||
run: |
|
||||
src/build-scripts/ci-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: |
|
||||
build/*/testsuite/*/*.*
|
||||
build/*/CMake*.{txt,log}
|
||||
|
||||
linux-2021ish-gcc8-llvm10:
|
||||
name: "Linux gcc8, C++17, llvm10, oiio master, avx2, exr2.5, boost1.65, avx2"
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
CXX: g++-8
|
||||
CMAKE_CXX_STANDARD: 17
|
||||
LLVM_VERSION: 10.0.0
|
||||
USE_SIMD: avx2,f16c
|
||||
OPENEXR_VERSION: v2.5.5
|
||||
OPENIMAGEIO_VERSION: master
|
||||
OPENIMAGEIO_CMAKE_FLAGS: -DBUILD_FMT_VERSION=7.0.1
|
||||
PUGIXML_VERSION: v1.10
|
||||
PYBIND11_VERSION: v2.5.0
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prepare ccache timestamp
|
||||
id: ccache_cache_keys
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
||||
- name: ccache
|
||||
id: ccache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
|
||||
restore-keys: |
|
||||
${{ github.job }}-
|
||||
- name: Build setup
|
||||
run: |
|
||||
src/build-scripts/ci-startup.bash
|
||||
- name: Dependencies
|
||||
run: |
|
||||
src/build-scripts/gh-installdeps.bash
|
||||
- name: Build
|
||||
run: |
|
||||
src/build-scripts/ci-build.bash
|
||||
- name: Testsuite
|
||||
run: |
|
||||
src/build-scripts/ci-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: |
|
||||
build/*/testsuite/*/*.*
|
||||
build/*/CMake*.{txt,log}
|
||||
|
||||
linux-latest-release:
|
||||
# Test against development master for relevant dependencies, latest
|
||||
# supported releases of everything else.
|
||||
name: "Linux latest releases: gcc10/C++17, llvm12, oiio-2.3, py3.8, boost1.71, exr3.1, ocio2.1, avx2"
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
CXX: g++-10
|
||||
USE_CPP: 17
|
||||
CMAKE_CXX_STANDARD: 17
|
||||
LLVM_VERSION: 12.0.0
|
||||
LLVM_DISTRO_NAME: ubuntu-20.04
|
||||
USE_SIMD: avx2,f16c
|
||||
OPENEXR_VERSION: v3.1.0
|
||||
OPENIMAGEIO_VERSION: release
|
||||
OPENIMAGEIO_CMAKE_FLAGS: -DBUILD_FMT_VERSION=8.0.0
|
||||
OPENCOLORIO_VERSION: v2.1.0
|
||||
PUGIXML_VERSION: v1.11.4
|
||||
PYBIND11_VERSION: v2.7.1
|
||||
PYTHON_VERSION: 3.8
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prepare ccache timestamp
|
||||
id: ccache_cache_keys
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
||||
- name: ccache
|
||||
id: ccache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
|
||||
restore-keys: |
|
||||
${{ github.job }}-
|
||||
- name: Build setup
|
||||
run: |
|
||||
src/build-scripts/ci-startup.bash
|
||||
- name: Dependencies
|
||||
run: |
|
||||
src/build-scripts/gh-installdeps.bash
|
||||
- name: Build
|
||||
run: |
|
||||
src/build-scripts/ci-build.bash
|
||||
- name: Testsuite
|
||||
run: |
|
||||
src/build-scripts/ci-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: |
|
||||
build/*/testsuite/*/*.*
|
||||
build/*/CMake*.{txt,log}
|
||||
|
||||
linux-bleeding-edge:
|
||||
# Test against development master for relevant dependencies, latest
|
||||
# supported releases of everything else.
|
||||
name: "Linux bleeding edge: gcc11, C++17, llvm12, oiio/ocio/exr/pybind-master, py3.8, avx2"
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
CXX: g++-11
|
||||
USE_CPP: 17
|
||||
CMAKE_CXX_STANDARD: 17
|
||||
LLVM_VERSION: 12.0.0
|
||||
LLVM_DISTRO_NAME: ubuntu-20.04
|
||||
USE_SIMD: avx2,f16c
|
||||
OPENEXR_VERSION: master
|
||||
OPENIMAGEIO_VERSION: master
|
||||
OPENIMAGEIO_CMAKE_FLAGS: -DBUILD_FMT_VERSION=master
|
||||
OPENCOLORIO_VERSION: main
|
||||
PUGIXML_VERSION: master
|
||||
PYBIND11_VERSION: master
|
||||
PYTHON_VERSION: 3.8
|
||||
OSL_BUILD_MATERIALX: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prepare ccache timestamp
|
||||
id: ccache_cache_keys
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
||||
- name: ccache
|
||||
id: ccache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
|
||||
restore-keys: |
|
||||
${{ github.job }}-
|
||||
- name: Build setup
|
||||
run: |
|
||||
src/build-scripts/ci-startup.bash
|
||||
- name: Dependencies
|
||||
run: |
|
||||
src/build-scripts/gh-installdeps.bash
|
||||
- name: Build
|
||||
run: |
|
||||
src/build-scripts/ci-build.bash
|
||||
- name: Testsuite
|
||||
run: |
|
||||
src/build-scripts/ci-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: |
|
||||
build/*/testsuite/*/*.*
|
||||
build/*/CMake*.{txt,log}
|
||||
|
||||
linux-oldest:
|
||||
# Oldest versions of the dependencies that we can muster, and various
|
||||
# things disabled.
|
||||
name: "Linux oldest everything: gcc6/C++11 llvm7 py-no boost-1.66 oiio-2.0 no-simd exr2.3"
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: aswf/ci-osl:2019-clang7
|
||||
env:
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
CMAKE_CXX_STANDARD: 11
|
||||
PYTHON_VERSION: 2.7
|
||||
USE_SIMD: 0
|
||||
USE_PYTHON: 0
|
||||
OPENIMAGEIO_VERSION: Release-2.0.14
|
||||
PUGIXML_VERSION: v1.8
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prepare ccache timestamp
|
||||
id: ccache_cache_keys
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
||||
- name: ccache
|
||||
id: ccache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
|
||||
restore-keys: |
|
||||
${{ github.job }}-
|
||||
- name: Build setup
|
||||
run: |
|
||||
src/build-scripts/ci-startup.bash
|
||||
- name: Dependencies
|
||||
run: |
|
||||
rm -rf /usr/local/include/OpenImageIO
|
||||
src/build-scripts/gh-installdeps.bash
|
||||
- name: Build
|
||||
run: |
|
||||
src/build-scripts/ci-build.bash
|
||||
- name: Testsuite
|
||||
run: |
|
||||
src/build-scripts/ci-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: |
|
||||
build/*/testsuite/*/*.*
|
||||
build/*/CMake*.{txt,log}
|
||||
|
||||
macos-py39:
|
||||
name: "Mac py39"
|
||||
runs-on: macOS-latest
|
||||
env:
|
||||
CXX: clang++
|
||||
USE_CPP: 14
|
||||
CMAKE_CXX_STANDARD: 14
|
||||
PYTHON_VERSION: 3.9
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prepare ccache timestamp
|
||||
id: ccache_cache_keys
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
||||
- name: ccache
|
||||
id: ccache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /Users/runner/.ccache
|
||||
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
|
||||
restore-keys: |
|
||||
${{ github.job }}-
|
||||
- name: Build setup
|
||||
run: |
|
||||
src/build-scripts/ci-startup.bash
|
||||
- name: Dependencies
|
||||
run: |
|
||||
source src/build-scripts/install_homebrew_deps.bash
|
||||
# OPENIMAGEIO_CMAKE_FLAGS="-DOIIO_BUILD_TESTS=0 -DUSE_OPENGL=0"
|
||||
# source src/build-scripts/build_openimageio.bash
|
||||
brew install --display-times -q openimageio
|
||||
PYTHONPATH=$PYTHONPATH:/usr/local/python${PYTHON_VERSION}/site-packages
|
||||
- name: Build
|
||||
run: |
|
||||
src/build-scripts/ci-build.bash
|
||||
- name: Testsuite
|
||||
run: |
|
||||
src/build-scripts/ci-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: |
|
||||
build/*/testsuite/*/*.*
|
||||
build/*/CMake*.{txt,log}
|
||||
|
||||
clang-format:
|
||||
# Test formatting. This test entry doesn't do a full build, it just runs
|
||||
# clang-format on everything, and passes if nothing is misformatted.
|
||||
# Upon failure, the build artifact will be the full source code with the
|
||||
# formatting fixed (diffs will also appear in the console output).
|
||||
name: "clang-format verification"
|
||||
runs-on: ubuntu-18.04
|
||||
container:
|
||||
image: aswf/ci-osl:2021-clang11
|
||||
env:
|
||||
BUILDTARGET: clang-format
|
||||
CMAKE_CXX_STANDARD: 17
|
||||
PYTHON_VERSION: 3.7
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build setup
|
||||
run: |
|
||||
src/build-scripts/ci-startup.bash
|
||||
- name: Dependencies
|
||||
run: |
|
||||
src/build-scripts/gh-installdeps.bash
|
||||
- name: Build
|
||||
run: |
|
||||
src/build-scripts/ci-build.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: src/*/*.{cpp,h}
|
||||
@@ -1,3 +1,7 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
dist
|
||||
build
|
||||
*~
|
||||
|
||||
@@ -1,156 +0,0 @@
|
||||
# .travis.yml for OSL
|
||||
|
||||
language: cpp
|
||||
sudo: false
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
#osx_image: xcode7.3
|
||||
dist: trusty
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- USE_CPP11=1
|
||||
- DEBUG=1
|
||||
|
||||
# Add-ons: specify apt packages for Linux
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- boost-latest
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- gcc-4.8
|
||||
- g++-4.8
|
||||
- gcc-5
|
||||
- g++-5
|
||||
- gcc-6
|
||||
- g++-6
|
||||
- libboost1.55-all-dev
|
||||
- libtiff4-dev
|
||||
- llvm-3.4-dev
|
||||
- clang-3.4
|
||||
|
||||
cache:
|
||||
ccache: true
|
||||
apt: true
|
||||
directories:
|
||||
- $HOME/.ccache
|
||||
|
||||
before_install:
|
||||
- if [ "$WHICHGCC" == "" ]; then export WHICHGCC="4.8" ; fi
|
||||
- if [ $TRAVIS_OS_NAME == osx ] ; then
|
||||
export PLATFORM=macosx ;
|
||||
sysctl machdep.cpu.features ;
|
||||
elif [ $TRAVIS_OS_NAME == linux ] ; then
|
||||
export PLATFORM=linux64 ;
|
||||
cat /proc/cpuinfo ;
|
||||
fi
|
||||
- export OIIOPLATFORM=$PLATFORM
|
||||
- if [ "$DEBUG" == 1 ] ; then export PLATFORM=${PLATFORM}.debug ; fi
|
||||
- echo "Build platform name is $PLATFORM"
|
||||
|
||||
install:
|
||||
- if [ "$CXX" == "g++" ]; then export CXX="g++-${WHICHGCC}" ; fi
|
||||
- export USE_CCACHE=1
|
||||
- export CCACHE_CPP2=1
|
||||
- if [ $TRAVIS_OS_NAME == osx ] ; then
|
||||
src/build-scripts/install_homebrew_deps.bash ;
|
||||
export LLVM_DIRECTORY=/usr/local/Cellar/llvm34/3.4.2/lib/llvm-3.4 ;
|
||||
elif [ $TRAVIS_OS_NAME == linux ] ; then
|
||||
CXX="ccache $CXX" CCACHE_CPP2=1 src/build-scripts/build_openexr.bash ;
|
||||
export ILMBASE_HOME=$PWD/openexr-install ;
|
||||
export OPENEXR_HOME=$PWD/openexr-install ;
|
||||
fi
|
||||
- export OIIOMAKEFLAGS="$OIIOMAKEFLAGS -j2 DEBUG= "
|
||||
- src/build-scripts/build_openimageio.bash
|
||||
- export OPENIMAGEIOHOME=$PWD/OpenImageIO/dist/$OIIOPLATFORM
|
||||
- export DYLD_LIBRARY_PATH=$OPENIMAGEIOHOME/lib:$DYLD_LIBRARY_PATH
|
||||
- export LD_LIBRARY_PATH=$OPENIMAGEIOHOME/lib:$LD_LIBRARY_PATH
|
||||
- export PATH=$OPENIMAGEIOHOME/bin:$PATH
|
||||
- if [ $TRAVIS_OS_NAME == linux ] ; then
|
||||
export BUILD_FLAGS="$BUILD_FLAGS LLVM_STATIC=1" ;
|
||||
export TEST_FLAGS="-E broken\|render-cornell\|render-oren-nayar\|render-veachmis\|render-ward" ;
|
||||
fi
|
||||
# ^^^ Linux only, can't make these test work. Exclude for now and return later. ;
|
||||
|
||||
# before_script:
|
||||
|
||||
script:
|
||||
- make VERBOSE=1 $BUILD_FLAGS cmakesetup
|
||||
- make -j2 $BUILD_FLAGS
|
||||
- export OSLHOME=$PWD/dist/$PLATFORM
|
||||
- export DYLD_LIBRARY_PATH=$OSLHOME/lib:$DYLD_LIBRARY_PATH
|
||||
- export LD_LIBRARY_PATH=$OSLHOME/lib:$LD_LIBRARY_PATH
|
||||
- export PYTHONPATH=$OSLHOME/python:$OPENIMAGEIOHOME/python:$PYTHONPATH
|
||||
- make $BUILD_FLAGS test
|
||||
|
||||
|
||||
after_success:
|
||||
- if [ "$CODECOV" == 1 ]; then bash <(curl -s https://codecov.io/bash) ; fi
|
||||
|
||||
after_failure:
|
||||
# FIXME: find failed logs, stash them or send them to lg?
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /RB-/
|
||||
- /lg-/
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
exclude:
|
||||
- os: osx
|
||||
compiler: gcc
|
||||
- os: linux
|
||||
compiler: clang
|
||||
include:
|
||||
# Make sure we can still build C++03, both platforms
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: gcc
|
||||
env: USE_CPP11=0
|
||||
- os: osx
|
||||
compiler: clang
|
||||
env: USE_CPP11=0
|
||||
# Test against the older release branch of OIIO (all the other tests
|
||||
# are against OIIO master)
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: gcc
|
||||
env: OIIOBRANCH=release USE_CPP11=1
|
||||
- os: osx
|
||||
compiler: clang
|
||||
env: OIIOBRANCH=release USE_CPP11=1
|
||||
# Linux only: test gcc 6 (catch new warnings hot off the presses) and
|
||||
# also use a higher SIMD level, avx and f16c, to make sure all is well.
|
||||
# TravisCI's OSX images don't yet support avx/f16c, so we only do this
|
||||
# on Linux for now, but eventually we'll want to separate these concerns
|
||||
# into separate tests.
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: gcc
|
||||
env: WHICHGCC=6 USE_SIMD=avx,f16c
|
||||
# Linux only: test gcc 5
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: gcc
|
||||
env: WHICHGCC=5
|
||||
# One more, just for the heck of it, turn all SIMD off. I guess this
|
||||
# should/could be both platforms, but in the interest of making the
|
||||
# tests go faster, don't bother doing it on OSX.
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: gcc
|
||||
env: USE_SIMD=0
|
||||
|
||||
notifications:
|
||||
email:
|
||||
# recipients:
|
||||
# -
|
||||
on_success: change
|
||||
on_failure: always
|
||||
@@ -0,0 +1,149 @@
|
||||
Project Name: Open Shading Language
|
||||
|
||||
Project Entity: Open Shading Language Project a Series of LF Projects, LLC
|
||||
|
||||
If emailing signed PDF, send to: manager@lfprojects.org
|
||||
|
||||
**Software Grant and Corporate Contributor License Agreement ("Agreement") v2.1**
|
||||
|
||||
Thank you for your interest in the project specified above (the “Project”). In
|
||||
order to clarify the intellectual property license granted with Contributions
|
||||
from any person or entity, the Project must have a Contributor License Agreement
|
||||
(CLA) on file that has been signed by each Contributor, indicating agreement to
|
||||
the license terms below. This license is for your protection as a Contributor as
|
||||
well as the protection of the Project and its users; it does not change your
|
||||
rights to use your own Contributions for any other purpose.
|
||||
|
||||
This version of the Agreement allows an entity (the “Corporation”) to submit
|
||||
Contributions to the Project, to authorize Contributions submitted by its
|
||||
designated employees to the Project, and to grant copyright and patent licenses
|
||||
thereto.
|
||||
|
||||
If you have not already done so, please complete and sign this Agreement using
|
||||
the electronic signature portal made available to you by the Project or its
|
||||
third-party service providers, or email a PDF of the signed agreement to the
|
||||
email address specified above. Please read this document carefully before
|
||||
signing and keep a copy for your records.
|
||||
|
||||
You accept and agree to the following terms and conditions for Your present and
|
||||
future Contributions submitted to the Project. In return, the Project shall not
|
||||
use Your Contributions in a way that is contrary to the public benefit or
|
||||
inconsistent with its charter at the time of the Contribution. Except for the
|
||||
license granted herein to the Project and recipients of software distributed by
|
||||
the Project, You reserve all right, title, and interest in and to Your
|
||||
Contributions.
|
||||
|
||||
1. Definitions.
|
||||
|
||||
“You” (or “Your”) shall mean the copyright owner or legal entity authorized by
|
||||
the copyright owner that is making this Agreement with the Project. For legal
|
||||
entities, the entity making a Contribution and all other entities that
|
||||
control, are controlled by, or are under common control with that entity are
|
||||
considered to be a single Contributor. For the purposes of this definition,
|
||||
“control” means (i) the power, direct or indirect, to cause the direction or
|
||||
management of such entity, whether by contract or otherwise, or (ii) ownership
|
||||
of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
|
||||
ownership of such entity.
|
||||
|
||||
“Contribution” shall mean the code, documentation or other original works of
|
||||
authorship, including any modifications or additions to an existing work, that
|
||||
is intentionally submitted by You to the Project for inclusion in, or
|
||||
documentation of, any of the products owned or managed by the Project (the
|
||||
“Work”). For the purposes of this definition, “submitted” means any form
|
||||
of electronic, verbal, or written communication sent to the Project or its
|
||||
representatives, including but not limited to communication on electronic
|
||||
mailing lists, source code control systems, and issue tracking systems that
|
||||
are managed by, or on behalf of, the Project for the purpose of discussing and
|
||||
improving the Work, but excluding communication that is conspicuously marked
|
||||
or otherwise designated in writing by You as “Not a Contribution.”
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this
|
||||
Agreement, You hereby grant to the Project and to recipients of software
|
||||
distributed by the Project a perpetual, worldwide, non-exclusive, no-charge,
|
||||
royalty-free, irrevocable copyright license to reproduce, prepare
|
||||
derivative works of, publicly display, publicly perform, sublicense,
|
||||
and distribute Your Contributions and such derivative works.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this
|
||||
Agreement, You hereby grant to the Project and to recipients of software
|
||||
distributed by the Project a perpetual, worldwide, non-exclusive, no-charge,
|
||||
royalty-free, irrevocable (except as stated in this section) patent
|
||||
license to make, have made, use, offer to sell, sell, import, and
|
||||
otherwise transfer the Work, where such license applies only to
|
||||
those patent claims licensable by You that are necessarily infringed
|
||||
by Your Contribution(s) alone or by combination of Your
|
||||
Contribution(s) with the Work to which such Contribution(s) were
|
||||
submitted. If any entity institutes patent litigation against You or
|
||||
any other entity (including a cross-claim or counterclaim in a
|
||||
lawsuit) alleging that your Contribution, or the Work to which
|
||||
you have contributed, constitutes direct or contributory patent
|
||||
infringement, then any patent licenses granted to that entity under
|
||||
this Agreement for that Contribution or Work shall terminate as of
|
||||
the date such litigation is filed.
|
||||
|
||||
4. You represent that You are legally entitled to grant the above license. You
|
||||
represent further that the employee of the Corporation designated as the Initial
|
||||
CLA Manager below (and each who is designated in a subsequent written
|
||||
modification to the list of CLA Managers) (each, a “CLA Manager”) is
|
||||
authorized to maintain with the Project (1) the list of employees of the
|
||||
Corporation who are authorized to submit Contributions on behalf of the
|
||||
Corporation, and (2) the list of CLA Managers.
|
||||
|
||||
5. You represent that each of Your Contributions is Your original creation (see
|
||||
section 7 for submissions on behalf of others).
|
||||
|
||||
6. You are not expected to provide support for Your Contributions, except to the
|
||||
extent You desire to provide support. You may provide support for free, for a
|
||||
fee, or not at all. Unless required by applicable law or agreed to in writing,
|
||||
You provide Your Contributions on an “AS IS” BASIS, WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, either express or implied, including, without
|
||||
limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
|
||||
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
7. Should You wish to submit work that is not Your original creation, You may
|
||||
submit it to the Project separately from any Contribution, identifying the
|
||||
complete details of its source and of any license or other restriction
|
||||
(including, but not limited to, related patents, trademarks, and license
|
||||
agreements) of which you are personally aware, and conspicuously marking the
|
||||
work as “Submitted on behalf of a third-party: [named here]”.
|
||||
|
||||
8. It is your responsibility to notify the Project when any change is required
|
||||
to the list of designated employees authorized to submit Contributions on behalf
|
||||
of the Corporation, or to the list of the CLA Managers.
|
||||
|
||||
\[Please complete and sign on the next page.\]
|
||||
|
||||
::: {style="page-break-after: always; visibility: hidden"}
|
||||
```{=tex}
|
||||
\pagebreak
|
||||
```
|
||||
:::
|
||||
|
||||
Please sign:
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Date:
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
|
||||
Signatory Name:
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
|
||||
Signatory E-mail:
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
|
||||
Signatory Title:
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
|
||||
Corporation Name:
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
|
||||
Corporation Address:
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
|
||||
Initial CLA Manager Name:
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
|
||||
Initial CLA Manager E-Mail:
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
@@ -0,0 +1,137 @@
|
||||
Project Name: Open Shading Language
|
||||
|
||||
Project Entity: Open Shading Language Project a Series of LF Projects, LLC
|
||||
|
||||
If emailing signed PDF, send to: manager@lfprojects.org
|
||||
|
||||
**Individual Contributor License Agreement ("Agreement") v2.1**
|
||||
|
||||
Thank you for your interest in the project specified above (the “Project”). In
|
||||
order to clarify the intellectual property license granted with Contributions
|
||||
from any person or entity, the Project must have a Contributor License Agreement
|
||||
(CLA) on file that has been signed by each Contributor, indicating agreement to
|
||||
the license terms below. This license is for your protection as a Contributor as
|
||||
well as the protection of the Project and its users; it does not change your
|
||||
rights to use your own Contributions for any other purpose.
|
||||
|
||||
If you have not already done so, please complete and sign this Agreement using
|
||||
the electronic signature portal made available to you by the Project or its
|
||||
third-party service providers, or email a PDF of the signed agreement to the
|
||||
email address specified above. Please read this document carefully before
|
||||
signing and keep a copy for your records.
|
||||
|
||||
You accept and agree to the following terms and conditions for Your present and
|
||||
future Contributions submitted to the Project. In return, the Project shall not
|
||||
use Your Contributions in a way that is contrary to the public benefit or
|
||||
inconsistent with its charter at the time of the Contribution. Except for the
|
||||
license granted herein to the Project and recipients of software distributed by
|
||||
the Project, You reserve all right, title, and interest in and to Your
|
||||
Contributions.
|
||||
|
||||
1. Definitions.
|
||||
|
||||
“You” (or “Your”) shall mean the copyright owner or legal entity authorized by
|
||||
the copyright owner that is making this Agreement with the Project. For legal
|
||||
entities, the entity making a Contribution and all other entities that control,
|
||||
are controlled by, or are under common control with that entity are considered
|
||||
to be a single Contributor. For the purposes of this definition, “control”
|
||||
means (i) the power, direct or indirect, to cause the direction or management
|
||||
of such entity, whether by contract or otherwise, or (ii) ownership of fifty
|
||||
percent (50%) or more of the outstanding shares, or (iii) beneficial ownership
|
||||
of such entity.
|
||||
|
||||
“Contribution” shall mean the code, documentation or other original works of
|
||||
authorship, including any modifications or additions to an existing work, that
|
||||
is intentionally submitted by You to the Project for inclusion in, or
|
||||
documentation of, any of the products owned or managed by the Project (the
|
||||
“Work”). For the purposes of this definition, “submitted” means any form of
|
||||
electronic, verbal, or written communication sent to the Project or its
|
||||
representatives, including but not limited to communication on electronic
|
||||
mailing lists, source code control systems, and issue tracking systems that are
|
||||
managed by, or on behalf of, the Project for the purpose of discussing and
|
||||
improving the Work, but excluding communication that is conspicuously marked or
|
||||
otherwise designated in writing by You as “Not a Contribution.”
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this
|
||||
Agreement, You hereby grant to the Project and to recipients of software
|
||||
distributed by the Project a perpetual, worldwide, non-exclusive, no-charge,
|
||||
royalty-free, irrevocable copyright license to reproduce, prepare
|
||||
derivative works of, publicly display, publicly perform, sublicense,
|
||||
and distribute Your Contributions and such derivative works.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this
|
||||
Agreement, You hereby grant to the Project and to recipients of software
|
||||
distributed by the Project a perpetual, worldwide, non-exclusive, no-charge,
|
||||
royalty-free, irrevocable (except as stated in this section) patent
|
||||
license to make, have made, use, offer to sell, sell, import, and
|
||||
otherwise transfer the Work, where such license applies only to
|
||||
those patent claims licensable by You that are necessarily infringed
|
||||
by Your Contribution(s) alone or by combination of Your
|
||||
Contribution(s) with the Work to which such Contribution(s) were
|
||||
submitted. If any entity institutes patent litigation against You or
|
||||
any other entity (including a cross-claim or counterclaim in a
|
||||
lawsuit) alleging that your Contribution, or the Work to which
|
||||
you have contributed, constitutes direct or contributory patent
|
||||
infringement, then any patent licenses granted to that entity under
|
||||
this Agreement for that Contribution or Work shall terminate as of
|
||||
the date such litigation is filed.
|
||||
|
||||
4. You represent that you are legally entitled to grant the above license. If
|
||||
your employer(s) has rights to intellectual property that you create that
|
||||
includes your Contributions, you represent that you have received permission to
|
||||
make Contributions on behalf of that employer, that your employer has waived
|
||||
such rights for your Contributions to the Project, or that your employer has
|
||||
executed a separate Corporate CLA with the Project.
|
||||
|
||||
5. You represent that each of Your Contributions is Your original creation (see
|
||||
section 7 for submissions on behalf of others). You represent that Your
|
||||
Contribution submissions include complete details of any third-party license or
|
||||
other restriction (including, but not limited to, related patents and
|
||||
trademarks) of which you are personally aware and which are associated with
|
||||
any part of Your Contributions.
|
||||
|
||||
6. You are not expected to provide support for Your Contributions, except to the
|
||||
extent You desire to provide support. You may provide support for free, for a
|
||||
fee, or not at all. Unless required by applicable law or agreed to in writing,
|
||||
You provide Your Contributions on an “AS IS” BASIS, WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, either express or implied, including, without
|
||||
limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
|
||||
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
7. Should You wish to submit work that is not Your original creation, You may
|
||||
submit it to the Project separately from any Contribution, identifying the
|
||||
complete details of its source and of any license or other restriction
|
||||
(including, but not limited to, related patents, trademarks, and license
|
||||
agreements) of which you are personally aware, and conspicuously marking the
|
||||
work as “Submitted on behalf of a third-party: [named here]”.
|
||||
|
||||
8. You agree to notify the Project of any facts or circumstances of which you
|
||||
become aware that would make these representations inaccurate in any respect.
|
||||
|
||||
\[Please complete and sign on the next page.\]
|
||||
|
||||
::: {style="page-break-after: always; visibility: hidden"}
|
||||
```{=tex}
|
||||
\pagebreak
|
||||
```
|
||||
:::
|
||||
|
||||
Please sign:
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
Date: \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
|
||||
Full name:
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
|
||||
Mailing Address:
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Country:
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
|
||||
E-Mail:
|
||||
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
|
||||
@@ -0,0 +1,253 @@
|
||||
# Technical Charter (the "Charter") for Open Shading Language a Series of LF Projects, LLC
|
||||
|
||||
This charter (the "Charter") sets forth the responsibilities and procedures
|
||||
for technical contribution to, and oversight of, the Open Shading Language
|
||||
project, which has been established as Open Shading Language a Series of LF
|
||||
Projects, LLC (the "Project"). LF Projects, LLC ("LF Projects") is a
|
||||
Delaware series limited liability company. All Contributors to the Project
|
||||
must comply with the terms of this Charter.
|
||||
|
||||
### 1. Mission and Scope of the Project
|
||||
|
||||
* **a.** The mission of the Project is to develop an open source project
|
||||
for programmable shading in advanced renderers and other applications,
|
||||
ideal for describing materials, lights, displacement, and pattern
|
||||
generation.
|
||||
|
||||
* **b.** The scope of the Project includes software development under an
|
||||
OSI-approved open source license supporting the mission, including
|
||||
documentation, testing, integration and the creation of other artifacts
|
||||
that aid the development, deployment, operation or adoption of the open
|
||||
source software project.
|
||||
|
||||
### 2. Technical Steering Committee
|
||||
|
||||
* **a.** The Technical Steering Committee (the "TSC") will be responsible
|
||||
for all technical oversight of the open source Project.
|
||||
|
||||
* **b.** The TSC voting members are initially the Project's Committers. At
|
||||
the inception of the project, the Committers of the Project will be as
|
||||
set forth within the "GOVERNANCE" file within the Project's code
|
||||
repository. The TSC may choose an alternative approach for determining
|
||||
the voting members of the TSC, and any such alternative approach will be
|
||||
documented in the GOVERNANCE file. Any meetings of the Technical
|
||||
Steering Committee are intended to be open to the public, and can be
|
||||
conducted electronically, via teleconference, or in person.
|
||||
|
||||
* **c.** TSC projects generally will involve Contributors and Committers.
|
||||
The TSC may adopt or modify roles so long as the roles are documented in
|
||||
the GOVERNANCE file. Unless otherwise documented:
|
||||
|
||||
- **i.** Contributors include anyone in the technical community that
|
||||
contributes code, documentation, or other technical artifacts to the
|
||||
Project;
|
||||
|
||||
- **ii.** Committers are Contributors who have earned the ability to
|
||||
modify ("commit") source code, documentation or other technical
|
||||
artifacts in a project's repository; and
|
||||
|
||||
- **iii.** A Contributor may become a Committer by a majority approval
|
||||
of the existing Committers or at the discretion of the TSC. A
|
||||
Committer may be removed by a majority approval of the other existing
|
||||
Committers, or at the discretion of the TSC.
|
||||
|
||||
* **d.** Participation in the Project through becoming a Contributor and
|
||||
Committer is open to anyone so long as they abide by the terms of this
|
||||
Charter.
|
||||
|
||||
* **e.** The TSC may (1) establish workflow procedures for the submission,
|
||||
approval, and closure/archiving of projects, (2) set requirements for
|
||||
the promotion of Contributors to Committer status, as applicable, and
|
||||
(3) amend, adjust, refine and/or eliminate the roles of Contributors,
|
||||
and Committers, and create new roles, and publicly document any TSC
|
||||
roles, as it sees fit.
|
||||
|
||||
* **f.** The TSC may elect a TSC Chair, who will preside over meetings of
|
||||
the TSC and will serve until his or her resignation or replacement by
|
||||
the TSC. The TSC Chair, or any other TSC member so designated by the
|
||||
TSC, will serve as the primary communication contact between the Project
|
||||
and the Academy Software Foundation Fund of The Linux Foundation.
|
||||
|
||||
* **g.** Responsibilities: The TSC will be responsible for all aspects of
|
||||
oversight relating to the Project, which may include:
|
||||
|
||||
- **i.** coordinating the technical direction of the Project;
|
||||
|
||||
- **ii.** approving project or system proposals (including, but not
|
||||
limited to, incubation, deprecation, and changes to a sub-project's
|
||||
scope);
|
||||
|
||||
- **iii.** organizing sub-projects and removing projects;
|
||||
|
||||
- **iv.** creating sub-committees or working groups to focus on
|
||||
cross-project technical issues and requirements;
|
||||
|
||||
- **v.** appointing representatives to work with other open source or
|
||||
open standards communities;
|
||||
|
||||
- **vi.** establishing community norms, workflows, issuing releases, and
|
||||
security issue reporting policies;
|
||||
|
||||
- **vii.** approving and implementing policies and processes for
|
||||
contributing (to be published in the CONTRIBUTING file) and
|
||||
coordinating with the Series Manager to resolve matters or concerns
|
||||
that may arise as set forth in Section 7 of this Charter;
|
||||
|
||||
- **viii.** discussions, seeking consensus, and where necessary, voting
|
||||
on technical matters relating to the code base that affect multiple
|
||||
projects; and
|
||||
|
||||
- **ix.** coordinating any marketing, events, or communications
|
||||
regarding the Project with the LF Projects Manager or their designee.
|
||||
|
||||
### 3. TSC Voting
|
||||
|
||||
* **a.** While the Project aims to operate as a consensus based community,
|
||||
if any TSC decision requires a vote to move the Project forward, the
|
||||
voting members of the TSC will vote on a one vote per voting member
|
||||
basis.
|
||||
|
||||
* **b.** At least fifty percent of all voting members of the TSC must be
|
||||
present at a TSC meeting in order to establish a quorum. The TSC may
|
||||
continue to meet if a quorum is not met, but will be prevented from
|
||||
making any decisions at such meeting.
|
||||
|
||||
* **c.** Except as provided in Section 7.c. and 8.a, decisions by vote at
|
||||
a meeting require a majority vote of those in attendance, provided
|
||||
quorum is met. Decisions made by electronic vote without a meeting
|
||||
require a majority vote of all voting members of the TSC.
|
||||
|
||||
* **d.** In the event a vote cannot be resolved by the TSC, any voting
|
||||
member of the TSC may refer the matter to the Series Manager or its
|
||||
designee for assistance in reaching a resolution.
|
||||
|
||||
### 4. Compliance with Policies
|
||||
|
||||
* **a.** This Charter is subject to the Series Agreement for the Project
|
||||
and the Operating Agreement of LF Projects. Contributors will comply
|
||||
with the policies of LF Projects as may be adopted and amended by LF
|
||||
Projects, including, without limitation the policies listed at
|
||||
https://lfprojects.org/policies/.
|
||||
|
||||
* **b.** The TSC may adopt a code of conduct ("CoC") for the Project,
|
||||
which is subject to approval by the Series Manager. Contributors to the
|
||||
Project will comply with the CoC or, in the event that a
|
||||
Project-specific CoC has not been approved, the LF Projects Code of
|
||||
Conduct listed at https://lfprojects.org/policies/.
|
||||
|
||||
* **c.** When amending or adopting any policy applicable to the Project,
|
||||
LF Projects will publish such policy, as to be amended or adopted, on
|
||||
its web site at least 30 days prior to such policy taking effect;
|
||||
provided, however, that in the case of any amendment of the Trademark
|
||||
Policy or Terms of Use of LF Projects, any such amendment is effective
|
||||
upon publication on LF Project's web site.
|
||||
|
||||
* **d.** All participants must allow open participation from any
|
||||
individual or organization meeting the requirements for contributing
|
||||
under this Charter and any policies adopted for all participants by the
|
||||
TSC, regardless of competitive interests. Put another way, the Project
|
||||
community must not seek to exclude any participant based on any
|
||||
criteria, requirement, or reason other than those that are reasonable
|
||||
and applied on a non-discriminatory basis to all participants in the
|
||||
Project community.
|
||||
|
||||
* **e.** The Project will operate in a transparent, open, collaborative,
|
||||
and ethical manner at all times. The output of all Project discussions,
|
||||
proposals, timelines, decisions, and status should be made open and
|
||||
easily visible to all. Any potential violations of this requirement
|
||||
should be reported immediately to the LF Projects Manager.
|
||||
|
||||
### 5. Community Assets
|
||||
|
||||
* **a.** LF Projects will hold title to all trade or service marks used by
|
||||
the Project ("Project Trademarks"), whether based on common law or
|
||||
registered rights. Project Trademarks will be transferred and assigned
|
||||
to LF Projects to hold on behalf of the Project. Any use of any Project
|
||||
Trademarks by participants in the Project will be in accordance with the
|
||||
license from LF Projects and inure to the benefit of LF Projects.
|
||||
|
||||
* **b.** The Project shall, as permitted and in accordance with such
|
||||
license from LF Projects, develop and own all Project GitHub and social
|
||||
media accounts, and domain name registrations created by the Project
|
||||
community.
|
||||
|
||||
* **c.** Under no circumstances will LF Projects be expected or required
|
||||
to undertake any action on behalf of the Project that is inconsistent
|
||||
with the tax-exempt status or purpose, as applicable, of LFP, Inc. or LF
|
||||
Projects, LLC.
|
||||
|
||||
### 6. General Rules and Operations.
|
||||
|
||||
* **a.** The Project will:
|
||||
|
||||
- **i.** engage in the work of the project in a professional manner
|
||||
consistent with maintaining a cohesive community, while also
|
||||
maintaining the goodwill and esteem of LF Projects, LFP, Inc. and
|
||||
other partner organizations in the open source software community; and
|
||||
|
||||
- **ii.** respect the rights of all trademark owners, including any
|
||||
branding and trademark usage guidelines.
|
||||
|
||||
### 7. Intellectual Property Policy
|
||||
|
||||
* **a.** Participants acknowledge that the copyright in all new
|
||||
contributions shall be retained by the copyright holder as independent
|
||||
works of authorship and that no contributor or copyright holder will be
|
||||
required to assign copyrights to the Project.
|
||||
|
||||
* **b.** Except as described in Section 7.c., all code contributions to
|
||||
the Project are subject to the following:
|
||||
|
||||
- **i.** All new inbound code contributions to the Project must be made
|
||||
using the BSD 3-Clause License (available here:
|
||||
https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/LICENSE.md)
|
||||
(the "Project License").
|
||||
|
||||
- **ii.** All new inbound code contributions must:
|
||||
|
||||
o **a.** be made pursuant to a binding Project Contribution License
|
||||
Agreement (the "CLA") available on the Project's web site; and
|
||||
|
||||
o **b.** be accompanied by a Developer Certificate of Origin
|
||||
(http://developercertificate.org) sign-off in the source code system
|
||||
that is submitted through a TSC-approved contribution process which
|
||||
will bind the authorized contributor and, if not self-employed,
|
||||
their employer to the applicable license;
|
||||
|
||||
- **iii.** All outbound code will be made available under the Project
|
||||
License.
|
||||
|
||||
- **iv.** Documentation will be received and made available by the
|
||||
Project under the Creative Commons Attribution 4.0 International
|
||||
License (available at http://creativecommons.org/licenses/by/4.0/).
|
||||
|
||||
- **v.** The Project may seek to integrate and contribute back to other
|
||||
open source projects ("Upstream Projects"). In such cases, the Project
|
||||
will conform to all license requirements of the Upstream Projects,
|
||||
including dependencies, leveraged by the Project. Upstream Project
|
||||
code contributions not stored within the Project's main code
|
||||
repository shall comply with the contribution process and license
|
||||
terms for the applicable Upstream Project.
|
||||
|
||||
* **c.** If an alternative inbound or outbound license is required for
|
||||
compliance with the license for a leveraged open source project or is
|
||||
otherwise required to achieve the Project's mission, the Governing Board
|
||||
of the Academy Software Foundation Fund of the Linux Foundation
|
||||
("Governing Board"), or the Governing Board's representatives designated
|
||||
for such purpose, may approve the use of an alternative license for
|
||||
specific inbound or outbound contributions on an exception basis. Any
|
||||
exceptions must be approved by a vote of the Governing Board and must be
|
||||
limited in scope to what is required for such a purpose. To request an
|
||||
exception, please describe the contribution, the alternative open source
|
||||
license(s), and the justification for using an alternative open source
|
||||
license for the Project.
|
||||
|
||||
* **d.** Contributed files should contain license information, such as
|
||||
SPDX short form identifiers, indicating the open source license or
|
||||
licenses pertaining to the file.
|
||||
|
||||
### 8. Amendments
|
||||
|
||||
* **a.** This charter may be amended by a two-thirds vote of the entire
|
||||
TSC, subject to reasonable approval by LF Projects.
|
||||
|
||||
|
After Width: | Height: | Size: 7.6 KiB |
@@ -0,0 +1,105 @@
|
||||
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
||||
<!-- Copyright Contributors to the Open Shading Language Project. -->
|
||||
|
||||
# TSC meeting 2020-04-02 (first TSC meeting!)
|
||||
|
||||
Host: John Mertic
|
||||
|
||||
### Attendees:
|
||||
|
||||
Meeting chair pro tem: John Mertic, Linux Foundation
|
||||
|
||||
TSC members:
|
||||
|
||||
* [x] Luke Emrose, Animal Logic
|
||||
* [x] Eric Enderton, NVIDIA
|
||||
* [x] Stephen Friedman, Pixar
|
||||
* [x] Larry Gritz, Sony Pictures Imageworks
|
||||
* [x] Derek Haase, DNEG
|
||||
* [x] Adrien Herubel, Autodesk
|
||||
* [x] Lee Kerley, Sony Pictures Imageworks
|
||||
* [x] Chris Kulla, Sony Pictures Imageworks
|
||||
* [x] Mitch Prater, Laika
|
||||
* [x] Brecht Van Lommel, Blender
|
||||
|
||||
Additional attendees:
|
||||
|
||||
* [x] Max Liani, Pixar
|
||||
* [x] Zap Anderson, Autodesk
|
||||
* [x] Pete Segal, Foundry
|
||||
* [x] JT Nelson, Pasadena Open Source
|
||||
* [x] Amir Shachar, DNEG
|
||||
* [x] Alex Wells, Intel
|
||||
|
||||
|
||||
### Agenda / Meeting notes
|
||||
|
||||
* Charter / legalities
|
||||
- All the proposed documents are in this PR:
|
||||
https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1137
|
||||
- **Action**: Everybody please look over the charter, etc., give a +1,
|
||||
raise any objections or ask questions.
|
||||
- **Action**: Look at the CLA, show to your legal depts if they care. It's
|
||||
identical to the other ASWF projects, so the bar to alter it will be
|
||||
extremely high, please resist the temptation.
|
||||
- Aim to vote on approval by the next TSC meeting
|
||||
|
||||
* TSC membership
|
||||
- As above, per pre-meeting correspondence and opportunities to
|
||||
volunteer.
|
||||
- **Action**: suggest any edits to TSC voting members
|
||||
- People or orgs not on the list who want to be members and can commit
|
||||
a high level of involvement.
|
||||
- Swapping, adding, or subtracting people in the future is easy as
|
||||
circumstances changes, so don't overthink it.
|
||||
|
||||
* Office elections
|
||||
- LG nominated himself as chief architect, Chris Kulla for chair.
|
||||
- Both passed by voice vote without objections.
|
||||
- Welcome to the ASWF TAC, Chris!
|
||||
- Elections (and/or ratification of people staying in their current roles)
|
||||
will be annual.
|
||||
|
||||
* John went over the infrastructure checklist as we transition the project:
|
||||
- Where does the code live, issues, etc: we're already on GitHub, nothing
|
||||
to do there
|
||||
- CI: we are already using GitHub Actions CI
|
||||
- short term, nothing to do
|
||||
- long term, we will want to enhance our lack of good Windows CI and
|
||||
ability to CI test both the GPU path and the CPU "wide SIMD" batch
|
||||
shading mode.
|
||||
- **Action**: look at the CLA, +1 it
|
||||
- When we set up the new EasyCLA system, even orgs who previously signed
|
||||
the old Sony CLA will need to sign the new LF one. We will want to have
|
||||
everybody do this before we move the repository.
|
||||
- **Action**: LG to turn over the openshadinglanguage.org domain to LF
|
||||
(right now it's just a redirect to our GitHub repo)
|
||||
- **Action**: LF/Steve Winslow will do the code scan, make sure licenses
|
||||
are in order, etc., as another prerequisite to moving the repo from
|
||||
imageworks GH account to ASWF GH account.
|
||||
- Mail list:
|
||||
- **Action**: John Mertic will set up osl-dev@lists.aswf.io (and a
|
||||
second osl-tsc-private for the occasional topics among TSC members
|
||||
that can't be public, like security or code of conduct issues)
|
||||
- **Action**: LG will let people know about the new list. You will need
|
||||
to sign up even if you were signed up to the old list.
|
||||
- **Action**: John will figure out how to transfer the archives of the
|
||||
old osl-dev so they are not lost.
|
||||
- Future action: in a few weeks, after everybody is signed up for the
|
||||
new list, we will throw the switch and stop using the old one.
|
||||
- Social media: there are no other accounts to transfer.
|
||||
- Trademarks: SPI never registered any.
|
||||
- Slack channel: John already set up on ASWF slack.
|
||||
|
||||
* Meeting cadence
|
||||
- Let's keep the Thursday 2pm PT time for now. (No objections.)
|
||||
- LG suggests that we meet every 2nd week -- because this project is
|
||||
starting with so much more already completed compared to the other
|
||||
projects when they joined (already have CI, documents are same as were
|
||||
approved by the orgs before, etc.), we probably don't need every week.
|
||||
Can adjust later.
|
||||
- Hopefully will get this administrivia done soon and can spend all our
|
||||
time on tech stuff.
|
||||
|
||||
* Items for next TSC meeting agenda:
|
||||
- Ratify charter, governance, CLAs
|
||||
@@ -0,0 +1,51 @@
|
||||
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
||||
<!-- Copyright Contributors to the Open Shading Language Project. -->
|
||||
|
||||
# OSL TSC meeting DATE
|
||||
|
||||
[Video link](https://zoom.us/j/100511909)
|
||||
[Agenda link](https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/)
|
||||
|
||||
### Attendees:
|
||||
|
||||
TSC voting members:
|
||||
* [ ] Luke Emrose, Animal Logic
|
||||
* [ ] Eric Enderton, NVIDIA
|
||||
* [ ] Stephen Friedman, Pixar
|
||||
* [ ] Larry Gritz (_Chief Architect_), Sony Pictures Imageworks
|
||||
* [ ] Derek Haase, DNEG
|
||||
* [ ] Adrien Herubel, Autodesk
|
||||
* [ ] Lee Kerley, Sony Pictures Imageworks
|
||||
* [ ] Chris Kulla (_TSC Chair_), Sony Pictures Imageworks
|
||||
* [ ] Mitch Prater, Laika
|
||||
* [ ] Brecht Van Lommel, Blender
|
||||
|
||||
Additional attendees:
|
||||
|
||||
* [ ] Name - Org
|
||||
* ...others...
|
||||
|
||||
|
||||
### Agenda / Meeting notes
|
||||
|
||||
* Status on last meeting's action items:
|
||||
- info
|
||||
- info
|
||||
|
||||
* Topic 1
|
||||
- info
|
||||
- info
|
||||
|
||||
* Topic 2
|
||||
- info
|
||||
- info
|
||||
|
||||
|
||||
### Next steps
|
||||
|
||||
* New action items:
|
||||
-
|
||||
-
|
||||
|
||||
* Items for next TSC meeting agenda:
|
||||
- xxx
|
||||
@@ -0,0 +1,53 @@
|
||||
# Project Intake checklist
|
||||
|
||||
This is a checklist for TSC's to review as part of the intake process. The TSC should review this entire list during the kickoff meeting. For anything outstanding, create an [issue](../issues) to track and link to it in the list
|
||||
|
||||
- Existing Project Governance
|
||||
- [X] Project License exists ( [LICENSE.md](../LICENSE.md) ) and is OSI-approved
|
||||
- [X] Any third-party components/dependencies included are listed along with their licenses ( [THIRD_PARTY.md](../THIRD_PARTY.md) )
|
||||
- [X] Governance defined, outlining community roles and how decsions are made ( [GOVERNANCE.md](../GOVERNANCE.md] )
|
||||
- Closed by https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1137
|
||||
- [X] Contribution Policy defined ( [CONTRIBUTING.md](../CONTRIBUTING.md) )
|
||||
- Closed by https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1137
|
||||
- [X] Code of Conduct defined ( existing or pull from [ASWF Sample Project](https://github.com/AcademySoftwareFoundation/aswf-sample-project/blob/master/CODE_OF_CONDUCT.md) )
|
||||
- Closed by https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1137
|
||||
- [ ] Release methodology defined ( [release.md](process/release.md) )
|
||||
- New Project Governance
|
||||
- [X] TSC members identified
|
||||
- [X] First TSC meeting held
|
||||
- [X] TSC meeting cadence set and added to project calendar
|
||||
- [X] CLA Approved ( if used ) ( [CCLA](CLA-corporate.md) and [ICLA](CLA-individual.md) )
|
||||
- Project charter ( [charter.md](charter.md) )
|
||||
- [X] Approved by TSC
|
||||
- Closed by https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1137
|
||||
- [X] Filed ( create pull request against [foundation repo](https://github.com/AcademySoftwareFoundation/foundation) )
|
||||
- Current tools
|
||||
- [X] Source Control ( https://github.com/AcademySoftwareFoundation/OpenShadingLanguage )
|
||||
- [X] Issue/feature tracker ( https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues )
|
||||
- Collaboration tools
|
||||
- [X] Mailing lists (old: http://groups.google.com/group/osl-dev )
|
||||
- [X] Move to groups.io ( create [issue on foundation repo](https://github.com/AcademySoftwareFoundation/foundation/issues/new ) to setup/transfer
|
||||
- [X] Slack or IRC ( #openshadinglanguage )
|
||||
- [ ] CI/build environment
|
||||
- Already using GitHub Actions CI
|
||||
- [ ] Needs work on Windows
|
||||
- [X] Needs to use ASWF docker images for more complete VFXPlatform coverage
|
||||
- [ ] Longer term: needs GPU tests
|
||||
- Project assets
|
||||
- [X] Domain name
|
||||
- [X] Logo(s) ( https://github.com/AcademySoftwareFoundation/artwork/blob/master/examples/incubating.md#open-shading-language-logos )
|
||||
- [X] Trademarks/mark ownership rights
|
||||
- Outreach
|
||||
- [X] New project announcement done ( https://www.aswf.io/osl-joins-aswf/ )
|
||||
- [X] Project added to ASWF website and ASWF landscape
|
||||
- Graduation
|
||||
- [ ] CII Badge achieved
|
||||
- [ ] Committer Diversity established
|
||||
- [ ] Commit/Contribution growth during incubation
|
||||
- [ ] Committers defined in the project ( [COMMITTERS.csv](COMMITTERS.csv) or [COMMITTERS.yml](COMMITTERS.yml) )
|
||||
- [X] TAC representative appointed
|
||||
- Chris Kulla, TSC chair, is our TAC rep for the project
|
||||
- [X] License scan completed and no issues found
|
||||
- Minor issues were found but already fixed in PR https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1145
|
||||
- [X] Code repository imported to ASWF GitHub organization
|
||||
- [ ] Developer Certificate of Origin past commit signoff done and DCO Probot enabled.
|
||||
@@ -1,634 +1,278 @@
|
||||
project (OSL)
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Release version of the library
|
||||
set (OSL_LIBRARY_VERSION_MAJOR 1)
|
||||
set (OSL_LIBRARY_VERSION_MINOR 8)
|
||||
set (OSL_LIBRARY_VERSION_PATCH 1)
|
||||
set (OSL_LIBRARY_VERSION_RELEASE_TYPE "dev") # "dev", "betaX", "RCY", ""
|
||||
|
||||
# Version of the OSO file format and instruction set
|
||||
set (OSO_FILE_VERSION_MAJOR 1)
|
||||
set (OSO_FILE_VERSION_MINOR 0)
|
||||
|
||||
cmake_minimum_required (VERSION 2.6)
|
||||
if (NOT CMAKE_VERSION VERSION_LESS 2.8.4)
|
||||
cmake_policy (SET CMP0017 NEW)
|
||||
cmake_minimum_required (VERSION 3.12)
|
||||
project (OSL VERSION 1.11.17.0
|
||||
LANGUAGES CXX C
|
||||
HOMEPAGE_URL "https://github.com/AcademySoftwareFoundation/OpenShadingLanguage")
|
||||
set (PROJ_NAME ${PROJECT_NAME}) # short name
|
||||
string (TOLOWER ${PROJ_NAME} PROJ_NAME_LOWER) # short name lower case
|
||||
string (TOUPPER ${PROJ_NAME} PROJ_NAME_UPPER) # short name upper case
|
||||
set (PROJECT_VERSION_RELEASE_TYPE "" CACHE STRING
|
||||
"Build type, for example: dev, beta2, RC1 (empty string for normal release)")
|
||||
set (${PROJECT_NAME}_VERSION_RELEASE_TYPE ${PROJECT_VERSION_RELEASE_TYPE})
|
||||
set (PROJECT_AUTHORS "Contributors to the Open Shading Language project")
|
||||
option (${PROJECT_NAME}_SUPPORTED_RELEASE
|
||||
"Set ON for supported release branch, OFF for master" ON)
|
||||
if (${PROJECT_NAME}_SUPPORTED_RELEASE)
|
||||
set (${PROJECT_NAME}_DEV_RELEASE OFF)
|
||||
else ()
|
||||
set (${PROJECT_NAME}_DEV_RELEASE ON)
|
||||
endif ()
|
||||
if (NOT CMAKE_VERSION VERSION_LESS 3.0)
|
||||
cmake_policy (SET CMP0025 NEW) # Detect AppleClang for new CMake
|
||||
endif ()
|
||||
if (NOT CMAKE_VERSION VERSION_LESS 3.2.2)
|
||||
cmake_policy (SET CMP0042 OLD)
|
||||
cmake_policy (SET CMP0046 OLD)
|
||||
endif ()
|
||||
set (CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
|
||||
|
||||
if (VERBOSE)
|
||||
message (STATUS "Project source dir = ${PROJECT_SOURCE_DIR}")
|
||||
endif ()
|
||||
message (STATUS "Project build dir = ${CMAKE_BINARY_DIR}")
|
||||
|
||||
if ("${PROJECT_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
message (FATAL_ERROR "Not allowed to run in-source build!")
|
||||
# Set PROJECT_IS_TOP_LEVEL to ON if if this is the top level project (not
|
||||
# if this is included as a subproject of something else). Note that this is
|
||||
# handled automatically for CMake >= 3.21.
|
||||
if (CMAKE_VERSION VERSION_LESS 3.21)
|
||||
if ("${CMAKE_PROJECT_NAME}" STREQUAL "${PROJECT_NAME}")
|
||||
set (PROJECT_IS_TOP_LEVEL ON)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set (CMAKE_BUILD_TYPE "Release")
|
||||
endif ()
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set (DEBUGMODE ON)
|
||||
endif ()
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||
# cmake bug workaround -- on some platforms, cmake doesn't set
|
||||
# NDEBUG for RelWithDebInfo mode
|
||||
add_definitions ("-DNDEBUG")
|
||||
|
||||
# If the user hasn't configured cmake with an explicit
|
||||
# -DCMAKE_INSTALL_PREFIX=..., then set it to safely install into ./dist, to
|
||||
# help prevent the user from accidentally writing over /usr/local or whatever.
|
||||
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND PROJECT_IS_TOP_LEVEL)
|
||||
set (CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/dist" CACHE PATH
|
||||
"Installation location" FORCE)
|
||||
endif()
|
||||
|
||||
message (STATUS "Configuring ${PROJECT_NAME} ${PROJECT_VERSION}")
|
||||
message (STATUS "CMake ${CMAKE_VERSION}")
|
||||
message (STATUS "CMake system = ${CMAKE_SYSTEM}")
|
||||
message (STATUS "CMake system name = ${CMAKE_SYSTEM_NAME}")
|
||||
message (STATUS "Project source dir = ${PROJECT_SOURCE_DIR}")
|
||||
message (STATUS "Project build dir = ${CMAKE_BINARY_DIR}")
|
||||
message (STATUS "Project install prefix = ${CMAKE_INSTALL_PREFIX}")
|
||||
message (STATUS "Configuration types = ${CMAKE_CONFIGURATION_TYPES}")
|
||||
message (STATUS "Build type = ${CMAKE_BUILD_TYPE}")
|
||||
|
||||
# Make the build area layout look a bit more like the final dist layout
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
if ("${PROJECT_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
message (FATAL_ERROR "Not allowed to run in-source build!")
|
||||
endif ()
|
||||
|
||||
|
||||
option (CMAKE_USE_FOLDERS "Use the FOLDER target property to organize targets into folders." ON)
|
||||
mark_as_advanced (CMAKE_USE_FOLDERS)
|
||||
if (CMAKE_USE_FOLDERS)
|
||||
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
endif ()
|
||||
|
||||
## turn on more detailed warnings and consider warnings as errors
|
||||
set (STOP_ON_WARNING ON CACHE BOOL "Stop building if there are any compiler warnings")
|
||||
if (NOT MSVC)
|
||||
add_definitions ("-Wall")
|
||||
if (STOP_ON_WARNING)
|
||||
add_definitions ("-Werror")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
message (STATUS "CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}")
|
||||
message (STATUS "CMAKE_CXX_COMPILER_ID is ${CMAKE_CXX_COMPILER_ID}")
|
||||
|
||||
# Figure out which compiler we're using
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
execute_process (COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
|
||||
OUTPUT_VARIABLE GCC_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (VERBOSE)
|
||||
message (STATUS "Using gcc ${GCC_VERSION} as the compiler")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Figure out which compiler we're using, for tricky cases
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER MATCHES "[Cc]lang")
|
||||
# If using any flavor of clang, set CMAKE_COMPILER_IS_CLANG. If it's
|
||||
# Apple's variety, set CMAKE_COMPILER_IS_APPLECLANG and
|
||||
# APPLECLANG_VERSION_STRING, otherwise for generic clang set
|
||||
# CLANG_VERSION_STRING.
|
||||
set (CMAKE_COMPILER_IS_CLANG 1)
|
||||
EXECUTE_PROCESS( COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE clang_full_version_string )
|
||||
if (clang_full_version_string MATCHES "Apple")
|
||||
set (CMAKE_CXX_COMPILER_ID "AppleClang")
|
||||
set (CMAKE_COMPILER_IS_APPLECLANG 1)
|
||||
string (REGEX REPLACE ".* version ([0-9]+\\.[0-9]+).*" "\\1" APPLECLANG_VERSION_STRING ${clang_full_version_string})
|
||||
if (VERBOSE)
|
||||
message (STATUS "The compiler is Clang: ${CMAKE_CXX_COMPILER_ID} version ${APPLECLANG_VERSION_STRING}")
|
||||
endif ()
|
||||
else ()
|
||||
string (REGEX REPLACE ".* version ([0-9]+\\.[0-9]+).*" "\\1" CLANG_VERSION_STRING ${clang_full_version_string})
|
||||
if (VERBOSE)
|
||||
message (STATUS "The compiler is Clang: ${CMAKE_CXX_COMPILER_ID} version ${CLANG_VERSION_STRING}")
|
||||
endif ()
|
||||
endif ()
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
set (CMAKE_COMPILER_IS_INTEL 1)
|
||||
if (VERBOSE)
|
||||
message (STATUS "Using Intel as the compiler")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Options common to gcc and clang
|
||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
|
||||
# CMake doesn't automatically know what do do with
|
||||
# include_directories(SYSTEM...) when using clang or gcc.
|
||||
set (CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
|
||||
# Ensure this macro is set for stdint.h
|
||||
add_definitions ("-D__STDC_LIMIT_MACROS")
|
||||
# this allows native instructions to be used for sqrtf instead of a function call
|
||||
add_definitions ("-fno-math-errno")
|
||||
if (HIDE_SYMBOLS AND NOT DEBUGMODE)
|
||||
# Turn default symbol visibility to hidden
|
||||
set (VISIBILITY_COMMAND "-fvisibility=hidden -fvisibility-inlines-hidden")
|
||||
add_definitions (${VISIBILITY_COMMAND})
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU")
|
||||
# Linux/FreeBSD/Hurd: also hide all the symbols of dependent
|
||||
# libraries to prevent clashes if an app using this library is
|
||||
# linked against other verions of our dependencies.
|
||||
set (VISIBILITY_MAP_COMMAND "-Wl,--version-script=${PROJECT_SOURCE_DIR}/src/libOpenImageIO/libOpenImageIO.map")
|
||||
endif ()
|
||||
endif ()
|
||||
if (LLVM_STATIC AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT DEBUGMODE)
|
||||
# Linux: When linking against LLVM statically, we can also hide
|
||||
# all its symbols to prevent clashes if OSL is linked against an
|
||||
# app that also embeds LLVM.
|
||||
set (VISIBILITY_MAP_COMMAND "-Wl,--version-script=${PROJECT_SOURCE_DIR}/src/liboslexec/liboslexec.map")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Clang-specific options
|
||||
if (CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_APPLECLANG)
|
||||
# Disable some warnings for Clang, for some things that are too awkward
|
||||
# to change just for the sake of having no warnings.
|
||||
add_definitions ("-Wno-unused-function")
|
||||
add_definitions ("-Wno-overloaded-virtual")
|
||||
add_definitions ("-Wno-unneeded-internal-declaration")
|
||||
add_definitions ("-Wno-unused-private-field")
|
||||
add_definitions ("-Wno-tautological-compare")
|
||||
# disable warning about unused command line arguments
|
||||
add_definitions ("-Qunused-arguments")
|
||||
# Don't warn if we ask it not to warn about warnings it doesn't know
|
||||
add_definitions ("-Wunknown-warning-option")
|
||||
add_definitions ("-Wno-unknown-pragmas")
|
||||
# disable warning in flex-generated code
|
||||
add_definitions ("-Wno-null-conversion")
|
||||
add_definitions ("-Wno-error=strict-overflow")
|
||||
if (DEBUGMODE)
|
||||
add_definitions ("-Wno-unused-function -Wno-unused-variable")
|
||||
endif ()
|
||||
if (CLANG_VERSION_STRING VERSION_GREATER 3.5 OR
|
||||
APPLECLANG_VERSION_STRING VERSION_GREATER 6.1)
|
||||
add_definitions ("-Wno-unused-local-typedefs")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# gcc specific options
|
||||
if (CMAKE_COMPILER_IS_GNUCC AND NOT (CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_APPLECLANG))
|
||||
if (NOT ${GCC_VERSION} VERSION_LESS 4.8)
|
||||
add_definitions ("-Wno-error=strict-overflow")
|
||||
# suppress a warning that Boost::Python hits in g++ 4.8
|
||||
add_definitions ("-Wno-error=unused-local-typedefs")
|
||||
add_definitions ("-Wno-unused-local-typedefs")
|
||||
endif ()
|
||||
if (NOT ${GCC_VERSION} VERSION_LESS 4.5)
|
||||
add_definitions ("-Wno-unused-result")
|
||||
endif ()
|
||||
endif ()
|
||||
# Version of the OSO file format and instruction set
|
||||
set (OSO_FILE_VERSION_MAJOR 1)
|
||||
set (OSO_FILE_VERSION_MINOR 0)
|
||||
|
||||
|
||||
## enable RTTI
|
||||
## NOTE: LLVM builds without RTTI by default so beware
|
||||
## if you find the need to turn this on, to use OSL in a
|
||||
## project that requires RTTI for example, you need to build
|
||||
## LLVM with RRTI, otherwise OSL classes extending LLVM ones
|
||||
## will cause linker errors.
|
||||
set (ENABLERTTI OFF CACHE BOOL "Build with RTTI. Requires a LLVM build with RTTI enabled.")
|
||||
|
||||
if (NOT ENABLERTTI)
|
||||
if (MSVC)
|
||||
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-" )
|
||||
else ()
|
||||
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti" )
|
||||
endif()
|
||||
|
||||
# For gcc < 4.3, Boost needs some extra help detecting that we've
|
||||
# disabled RTTI.
|
||||
if ((CMAKE_COMPILER_IS_GNUCC AND GCC_VERSION VERSION_LESS 4.3)
|
||||
OR CMAKE_COMPILER_IS_CLANG)
|
||||
add_definitions ("-DBOOST_NO_RTTI")
|
||||
add_definitions ("-DBOOST_NO_TYPEID")
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
# Needed for static boost libraries on Windows
|
||||
if (WIN32 AND Boost_USE_STATIC_LIBS)
|
||||
add_definitions ("-DBOOST_ALL_NO_LIB")
|
||||
add_definitions ("-DBOOST_THREAD_USE_LIB")
|
||||
endif ()
|
||||
|
||||
# Needed to disable dllimport/dllexport for static library
|
||||
if (BUILDSTATIC)
|
||||
add_definitions ("-DOSL_STATIC_LIBRARY")
|
||||
endif()
|
||||
|
||||
set (USE_fPIC OFF CACHE BOOL "Build with -fPIC")
|
||||
if (USE_fPIC)
|
||||
add_definitions ("-fPIC")
|
||||
endif ()
|
||||
|
||||
# Try to detect if this is an OSX distro new enough that the system library
|
||||
# is libc++.
|
||||
if (EXISTS "/usr/lib/libc++.dylib")
|
||||
set (OSL_SYSTEM_HAS_LIBCPP ON)
|
||||
endif ()
|
||||
# This needs to be early, for CMAKE_INSTALL_FULL_DATADIR
|
||||
include (GNUInstallDirs)
|
||||
|
||||
|
||||
set (VERBOSE OFF CACHE BOOL "Print lots of messages while compiling")
|
||||
set (OSL_BUILD_TESTS ON CACHE BOOL "Build the unit tests, testshade, testrender")
|
||||
set (BUILDSTATIC OFF CACHE BOOL "Build static library instead of shared")
|
||||
set (HIDE_SYMBOLS OFF CACHE BOOL "Hide symbols not in the public API")
|
||||
set (USE_EXTERNAL_PUGIXML OFF CACHE BOOL
|
||||
"Use an externally built shared library version of the pugixml library")
|
||||
set (PUGIXML_HOME "" CACHE STRING "Hint about where to find external PugiXML library")
|
||||
option (VERBOSE "Print lots of messages while compiling" OFF)
|
||||
set (${PROJ_NAME}_NAMESPACE ${PROJECT_NAME} CACHE STRING
|
||||
"Customized outer namespace base name (version will be added)")
|
||||
option (${PROJ_NAME}_NAMESPACE_INCLUDE_PATCH "Should the inner namespace include the patch number" OFF)
|
||||
set (SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
||||
CACHE STRING "Set the SO version in the SO name of the output library")
|
||||
set (OSL_LIBNAME_SUFFIX "" CACHE STRING
|
||||
"Optional name appended to ${PROJECT_NAME} libraries that are built")
|
||||
option (OSL_BUILD_TESTS "Build the unit tests, testshade, testrender" ON)
|
||||
if (WIN32)
|
||||
set (USE_LLVM_BITCODE OFF CACHE BOOL "Generate embedded LLVM bitcode")
|
||||
option (USE_LLVM_BITCODE "Generate embedded LLVM bitcode" OFF)
|
||||
else ()
|
||||
set (USE_LLVM_BITCODE ON CACHE BOOL "Generated embedded LLVM bitcode")
|
||||
option (USE_LLVM_BITCODE "Generate embedded LLVM bitcode" ON)
|
||||
endif ()
|
||||
set (USE_PARTIO ON CACHE BOOL "Use Partio if found")
|
||||
set (USE_FAST_MATH ON CACHE BOOL "Use fast math approximations (if no, then use system math library)")
|
||||
set (USE_CPP11 ON CACHE BOOL "Compile in C++11 mode")
|
||||
set (USE_CPP14 OFF CACHE BOOL "Compile in C++14 mode")
|
||||
set (USE_LIBCPLUSPLUS OFF CACHE BOOL "Compile with clang libc++")
|
||||
set (EXTRA_CPP_ARGS "" CACHE STRING "Extra C++ command line definitions")
|
||||
set (USE_SIMD "" CACHE STRING "Use SIMD directives (0, sse2, sse3, sse4.1, sse4.2)")
|
||||
option (OSL_BUILD_PLUGINS "Bool OSL plugins, for example OIIO plugin" ON)
|
||||
option (OSL_BUILD_SHADERS "Build shaders" ON)
|
||||
option (OSL_BUILD_MATERIALX "Build MaterialX shaders" OFF)
|
||||
option (USE_OPTIX "Include OptiX support" OFF)
|
||||
set (OPTIX_EXTRA_LIBS CACHE STRING "Extra lib targets needed for OptiX")
|
||||
set (CUDA_EXTRA_LIBS CACHE STRING "Extra lib targets needed for CUDA")
|
||||
set (CUDA_TARGET_ARCH "sm_35" CACHE STRING "CUDA GPU architecture (e.g. sm_35)")
|
||||
set (OSL_SHADER_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/shaders"
|
||||
CACHE STRING "Directory where shaders will be installed")
|
||||
set (OSL_PTX_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/ptx"
|
||||
CACHE STRING "Directory where OptiX PTX files will be installed")
|
||||
set (CMAKE_DEBUG_POSTFIX "" CACHE STRING "Library naming postfix for Debug builds (e.g., '_debug')")
|
||||
|
||||
|
||||
set (OSL_NO_DEFAULT_TEXTURESYSTEM OFF CACHE BOOL "Do not use create a raw OIIO::TextureSystem")
|
||||
set (OSL_BUILD_PLUGINS ON CACHE BOOL "Bool OSL plugins, for example OIIO plugin")
|
||||
set (USE_CCACHE ON CACHE BOOL "Use ccache if found")
|
||||
set (CODECOV OFF CACHE BOOL "Build code coverage tests")
|
||||
|
||||
# Use ccache if found
|
||||
find_program (CCACHE_FOUND ccache)
|
||||
if (CCACHE_FOUND AND USE_CCACHE)
|
||||
set_property (GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||
set_property (GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||
endif ()
|
||||
|
||||
if (LLVM_NAMESPACE)
|
||||
add_definitions ("-DLLVM_NAMESPACE=${LLVM_NAMESPACE}")
|
||||
endif ()
|
||||
|
||||
if (USE_EXTERNAL_PUGIXML)
|
||||
add_definitions ("-DUSE_EXTERNAL_PUGIXML")
|
||||
endif ()
|
||||
|
||||
if (USE_FAST_MATH)
|
||||
add_definitions ("-DOSL_FAST_MATH=1")
|
||||
else ()
|
||||
add_definitions ("-DOSL_FAST_MATH=0")
|
||||
endif ()
|
||||
|
||||
set (USE_OIIO_STATIC ON CACHE BOOL "If OIIO is built static")
|
||||
if (USE_OIIO_STATIC)
|
||||
add_definitions ("-DOIIO_STATIC_BUILD=1")
|
||||
endif ()
|
||||
|
||||
if (OSL_NO_DEFAULT_TEXTURESYSTEM)
|
||||
add_definitions ("-DOSL_NO_DEFAULT_TEXTURESYSTEM=1")
|
||||
endif ()
|
||||
|
||||
if (EXTRA_CPP_ARGS)
|
||||
message (STATUS "Extra C++ args: ${EXTRA_CPP_ARGS}")
|
||||
add_definitions ("${EXTRA_CPP_ARGS}")
|
||||
endif()
|
||||
|
||||
if (USE_CPP11 OR USE_CPP14)
|
||||
if (USE_CPP14)
|
||||
message (STATUS "Building for C++14")
|
||||
add_definitions ("-std=c++14")
|
||||
elseif (USE_CPP11)
|
||||
message (STATUS "Building for C++11")
|
||||
add_definitions ("-std=c++11")
|
||||
endif ()
|
||||
if (CMAKE_COMPILER_IS_CLANG)
|
||||
# C++ >= 11 doesn't like 'register' keyword, which is in Qt headers
|
||||
add_definitions ("-Wno-deprecated-register")
|
||||
endif ()
|
||||
option (USE_FAST_MATH "Use fast math approximations (if no, then use system math library)" ON)
|
||||
if (USE_FAST_MATH)
|
||||
add_definitions ("-DOSL_FAST_MATH=1")
|
||||
else ()
|
||||
message (STATUS "Building for C++98!")
|
||||
add_definitions ("-DOSL_FAST_MATH=0")
|
||||
endif ()
|
||||
|
||||
if (USE_LIBCPLUSPLUS AND CMAKE_COMPILER_IS_CLANG)
|
||||
message (STATUS "Using libc++")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
option (OIIO_FMATH_SIMD_FRIENDLY "Make sure OIIO fmath functions are SIMD-friendly" OFF)
|
||||
if (OIIO_FMATH_SIMD_FRIENDLY)
|
||||
add_definitions (-DOIIO_FMATH_SIMD_FRIENDLY=1)
|
||||
endif ()
|
||||
|
||||
# Options common to gcc and clang
|
||||
if (CODECOV AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG))
|
||||
message (STATUS "Compiling for code coverage analysis")
|
||||
add_definitions ("-ftest-coverage -fprofile-arcs -O0 -DOSL_CODE_COVERAGE=1")
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ftest-coverage -fprofile-arcs")
|
||||
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -ftest-coverage -fprofile-arcs")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -ftest-coverage -fprofile-arcs")
|
||||
if (USE_OPTIX)
|
||||
add_definitions ("-DOSL_USE_OPTIX=1")
|
||||
endif ()
|
||||
|
||||
if (DEFINED ENV{TRAVIS})
|
||||
add_definitions ("-DOSL_TRAVIS=1")
|
||||
|
||||
# Set the default namespace. For symbol hiding reasons, it's important that
|
||||
# the project name is a subset of the namespace name.
|
||||
set (PROJ_NAMESPACE "${${PROJ_NAME}_NAMESPACE}")
|
||||
string(REGEX MATCH ${PROJECT_NAME} NAMESPACE_HAS_PROJECT_NAME ${PROJ_NAMESPACE})
|
||||
if (NOT NAMESPACE_HAS_PROJECT_NAME)
|
||||
set (PROJ_NAMESPACE ${PROJECT_NAME}_${PROJ_NAMESPACE})
|
||||
endif ()
|
||||
|
||||
set (OSL_SIMD_FLAGS "")
|
||||
if (NOT USE_SIMD STREQUAL "")
|
||||
message (STATUS "Compiling with SIMD level ${USE_SIMD}")
|
||||
if (USE_SIMD STREQUAL "0")
|
||||
add_definitions ("-DOIIO_NO_SSE=1")
|
||||
else ()
|
||||
string (REPLACE "," ";" SIMD_FEATURE_LIST ${USE_SIMD})
|
||||
foreach (feature ${SIMD_FEATURE_LIST})
|
||||
if (VERBOSE)
|
||||
message (STATUS "SIMD feature: ${feature}")
|
||||
endif ()
|
||||
if (MSVC OR CMAKE_COMPILER_IS_INTEL)
|
||||
add_definitions ("/arch:${feature}")
|
||||
set (OSL_SIMD_FLAGS ${OSL_SIMD_FLAGS} "/arch:${feature}")
|
||||
else ()
|
||||
add_definitions ("-m${feature}")
|
||||
set (OSL_SIMD_FLAGS ${OSL_SIMD_FLAGS} "-m${feature}")
|
||||
endif ()
|
||||
endforeach()
|
||||
endif ()
|
||||
set (PROJ_NAMESPACE_V "${PROJ_NAMESPACE}_v${PROJECT_VERSION_MAJOR}_${PROJECT_VERSION_MINOR}")
|
||||
if (OIIO_NAMESPACE_INCLUDE_PATCH)
|
||||
set (PROJ_NAMESPACE_V "${PROJ_NAMESPACE_V}_${PROJECT_VERSION_PATCH}")
|
||||
endif ()
|
||||
message(STATUS "Setting Namespace to: ${PROJ_NAMESPACE_V}")
|
||||
|
||||
# Set the default namespace
|
||||
if (OSL_NAMESPACE)
|
||||
add_definitions ("-DOSL_NAMESPACE=${OSL_NAMESPACE}")
|
||||
endif ()
|
||||
message(STATUS "Setting Namespace to: ${OSL_NAMESPACE}")
|
||||
|
||||
set (CMAKE_MODULE_PATH
|
||||
"${PROJECT_SOURCE_DIR}/src/cmake/modules"
|
||||
"${PROJECT_SOURCE_DIR}/src/cmake")
|
||||
list (APPEND CMAKE_MODULE_PATH
|
||||
"${PROJECT_SOURCE_DIR}/src/cmake/modules"
|
||||
"${PROJECT_SOURCE_DIR}/src/cmake")
|
||||
|
||||
# Helpful functions and macros for our project
|
||||
include (colors)
|
||||
include (check_is_enabled)
|
||||
include (checked_find_package)
|
||||
|
||||
# All the C++ and compiler related options and adjustments
|
||||
include (compiler)
|
||||
|
||||
# Utilities and options related to finding python and making python bindings
|
||||
include (pythonutils)
|
||||
|
||||
include (util_macros)
|
||||
include (platform)
|
||||
include (externalpackages)
|
||||
include (oiio)
|
||||
include (flexbison)
|
||||
include (cuda_macros)
|
||||
|
||||
# Include all our testing apparatus and utils, but not if it's a subproject
|
||||
if (${PROJECT_NAME}_BUILD_TESTS AND PROJECT_IS_TOP_LEVEL)
|
||||
include (testing)
|
||||
endif ()
|
||||
|
||||
|
||||
|
||||
include_directories (
|
||||
BEFORE
|
||||
"${CMAKE_SOURCE_DIR}/src/include"
|
||||
"${CMAKE_BINARY_DIR}/include/OSL"
|
||||
"${OPENIMAGEIO_INCLUDES}"
|
||||
"${CMAKE_BINARY_DIR}/src/include"
|
||||
"${CMAKE_BINARY_DIR}/include"
|
||||
)
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Paths for install tree customization. Note that relative paths are relative
|
||||
# to CMAKE_INSTALL_PREFIX.
|
||||
set (DEFAULT_BIN_INSTALL_DIR "bin")
|
||||
set (DEFAULT_LIB_INSTALL_DIR "lib")
|
||||
set (DEFAULT_INCLUDE_INSTALL_DIR "include/OSL")
|
||||
if (UNIX AND NOT SELF_CONTAINED_INSTALL_TREE)
|
||||
# Try to be well-behaved and install into reasonable places according to
|
||||
# the "standard" unix directory heirarchy
|
||||
# TODO: Figure out how to get the correct python directory
|
||||
set (DEFAULT_PYLIB_INSTALL_DIR "lib/python/site-packages")
|
||||
set (DEFAULT_PYLIB3_INSTALL_DIR "lib/python3/site-packages")
|
||||
set (DEFAULT_DOC_INSTALL_DIR "share/doc/OSL")
|
||||
set (DEFAULT_MAN_INSTALL_DIR "share/man/man1")
|
||||
else ()
|
||||
# Here is the "self-contained install tree" case: the expectation here is
|
||||
# that everything OSL related will go into its own directory, not into
|
||||
# some standard system heirarchy.
|
||||
set (DEFAULT_PYLIB_INSTALL_DIR "python")
|
||||
set (DEFAULT_PYLIB3_INSTALL_DIR "python3")
|
||||
set (DEFAULT_DOC_INSTALL_DIR "doc")
|
||||
set (DEFAULT_MAN_INSTALL_DIR "doc/man")
|
||||
endif ()
|
||||
if (EXEC_INSTALL_PREFIX)
|
||||
# Tack on an extra prefix to support multi-arch builds.
|
||||
set (DEFAULT_BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/${DEFAULT_BIN_INSTALL_DIR}")
|
||||
set (DEFAULT_LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/${DEFAULT_LIB_INSTALL_DIR}")
|
||||
set (DEFAULT_PYLIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/${DEFAULT_PYLIB_INSTALL_DIR}")
|
||||
set (DEFAULT_PYLIB3_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/${DEFAULT_PYLIB3_INSTALL_DIR}")
|
||||
endif ()
|
||||
# Set up cmake cache variables corresponding to the defaults deduced above, so
|
||||
# that the user can override them as desired:
|
||||
set (BIN_INSTALL_DIR ${DEFAULT_BIN_INSTALL_DIR} CACHE STRING
|
||||
"Install location for binaries (relative to CMAKE_INSTALL_PREFIX or absolute)")
|
||||
set (LIB_INSTALL_DIR ${DEFAULT_LIB_INSTALL_DIR} CACHE STRING
|
||||
"Install location for libraries (relative to CMAKE_INSTALL_PREFIX or absolute)")
|
||||
set (PYLIB_INSTALL_DIR ${DEFAULT_PYLIB_INSTALL_DIR} CACHE STRING
|
||||
"Install location for python libraries (relative to CMAKE_INSTALL_PREFIX or absolute)")
|
||||
set (PYLIB3_INSTALL_DIR ${DEFAULT_PYLIB3_INSTALL_DIR} CACHE STRING
|
||||
"Install location for python3 libraries (relative to CMAKE_INSTALL_PREFIX or absolute)")
|
||||
set (INCLUDE_INSTALL_DIR ${DEFAULT_INCLUDE_INSTALL_DIR} CACHE STRING
|
||||
"Install location of header files (relative to CMAKE_INSTALL_PREFIX or absolute)")
|
||||
set (DOC_INSTALL_DIR ${DEFAULT_DOC_INSTALL_DIR} CACHE STRING
|
||||
"Install location for documentation (relative to CMAKE_INSTALL_PREFIX or absolute)")
|
||||
if (UNIX)
|
||||
set (MAN_INSTALL_DIR ${DEFAULT_MAN_INSTALL_DIR} CACHE STRING
|
||||
"Install location for manual pages (relative to CMAKE_INSTALL_PREFIX or absolute)")
|
||||
endif()
|
||||
set (PLUGIN_SEARCH_PATH "" CACHE STRING "Default plugin search path")
|
||||
set (INSTALL_DOCS ON CACHE BOOL "Install documentation")
|
||||
|
||||
|
||||
if (APPLE)
|
||||
set (MACOSX_RPATH ON)
|
||||
endif ()
|
||||
|
||||
# use, i.e. don't skip the full RPATH for the build tree
|
||||
set (CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
# when building, don't use the install RPATH already
|
||||
# (but later on when installing)
|
||||
set (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
# the RPATH to be used when installing
|
||||
set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
# add the automatically determined parts of the RPATH
|
||||
# which point to directories outside the build tree to the install RPATH
|
||||
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
message (STATUS "CMAKE_INSTALL_RPATH = ${CMAKE_INSTALL_RPATH}")
|
||||
|
||||
|
||||
###########################################################################
|
||||
if (MSVC)
|
||||
add_definitions (-D_CRT_SECURE_NO_DEPRECATE)
|
||||
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
|
||||
add_definitions (-D_CRT_NONSTDC_NO_WARNINGS)
|
||||
add_definitions (-D_SCL_SECURE_NO_WARNINGS)
|
||||
if(NOT LINKSTATIC)
|
||||
add_definitions (-DBOOST_ALL_DYN_LINK)
|
||||
add_definitions (-DOPENEXR_DLL)
|
||||
endif ()
|
||||
endif (MSVC)
|
||||
|
||||
|
||||
# We want CTest for testing
|
||||
# N.B. This needs to be added before any of the subdirectories, or
|
||||
# their add_test commands will not register.
|
||||
include (CTest)
|
||||
|
||||
|
||||
# Tell CMake to process the sub-directories
|
||||
add_subdirectory (src/include)
|
||||
add_subdirectory (src/liboslcomp)
|
||||
add_subdirectory (src/liboslquery)
|
||||
add_subdirectory (src/liboslexec)
|
||||
|
||||
add_subdirectory (src/liboslnoise)
|
||||
add_subdirectory (src/oslc)
|
||||
add_subdirectory (src/shaders)
|
||||
add_subdirectory (src/oslinfo)
|
||||
|
||||
if (OSL_BUILD_TESTS)
|
||||
add_subdirectory (src/testshade)
|
||||
add_subdirectory (src/testrender)
|
||||
add_subdirectory (src/testshade)
|
||||
add_subdirectory (src/testrender)
|
||||
endif ()
|
||||
|
||||
if (OSL_BUILD_PLUGINS)
|
||||
add_subdirectory (src/osl.imageio)
|
||||
add_subdirectory (src/osl.imageio)
|
||||
endif ()
|
||||
|
||||
add_subdirectory (src/include)
|
||||
add_subdirectory (src/doc)
|
||||
if (USE_QT AND Qt5_FOUND)
|
||||
add_subdirectory (src/osltoy)
|
||||
endif ()
|
||||
|
||||
|
||||
|
||||
#########################################################################
|
||||
# Testing
|
||||
|
||||
# Make a build/platform/testsuite directory, and copy the master runtest.py
|
||||
# there. The rest is up to the tests themselves.
|
||||
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testsuite")
|
||||
add_custom_command (OUTPUT "${CMAKE_BINARY_DIR}/testsuite/runtest.py"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${CMAKE_SOURCE_DIR}/testsuite/runtest.py"
|
||||
"${CMAKE_BINARY_DIR}/testsuite/runtest.py"
|
||||
MAIN_DEPENDENCY "${CMAKE_SOURCE_DIR}/testsuite/runtest.py")
|
||||
add_custom_target ( CopyFiles ALL DEPENDS "${CMAKE_BINARY_DIR}/testsuite/runtest.py" )
|
||||
|
||||
macro ( TESTSUITE )
|
||||
parse_arguments (_ats "LABEL" "" ${ARGN})
|
||||
# If there was a FOUNDVAR param specified and that variable name is
|
||||
# not defined, mark the test as broken.
|
||||
if (_ats_FOUNDVAR AND NOT ${_ats_FOUNDVAR})
|
||||
set (_ats_LABEL "broken")
|
||||
if (OSL_BUILD_SHADERS)
|
||||
add_subdirectory (src/shaders)
|
||||
if (OSL_BUILD_MATERIALX)
|
||||
add_subdirectory (src/shaders/MaterialX)
|
||||
endif ()
|
||||
# Add the tests if all is well.
|
||||
foreach (_testname ${_ats_DEFAULT_ARGS})
|
||||
set (_testsrcdir "${CMAKE_SOURCE_DIR}/testsuite/${_testname}")
|
||||
set (_testdir "${CMAKE_BINARY_DIR}/testsuite/${_testname}")
|
||||
if (_ats_LABEL MATCHES "broken")
|
||||
set (_testname "${_testname}-broken")
|
||||
endif ()
|
||||
set (_runtest python "${CMAKE_BINARY_DIR}/testsuite/runtest.py"
|
||||
${_testdir} ${_extra_test_args})
|
||||
if (MSVC_IDE)
|
||||
set (_runtest ${_runtest} --devenv-config $<CONFIGURATION>
|
||||
--solution-path "${CMAKE_BINARY_DIR}" )
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (VERBOSE)
|
||||
message (STATUS "TEST ${_testname}: ${CMAKE_BINARY_DIR}/testsuite/runtest.py ${_testdir} ${_extra_test_args}")
|
||||
endif ()
|
||||
option (INSTALL_DOCS "Install documentation" ON)
|
||||
if (INSTALL_DOCS)
|
||||
add_subdirectory (src/doc)
|
||||
endif ()
|
||||
|
||||
file (MAKE_DIRECTORY "${_testdir}")
|
||||
# Last minute site-specific instructions, if they exist
|
||||
if (OSL_SITE AND EXISTS "${PROJECT_SOURCE_DIR}/site/${OSL_SITE}/cmake/sitecustom.cmake")
|
||||
include ("${PROJECT_SOURCE_DIR}/site/${OSL_SITE}/cmake/sitecustom.cmake")
|
||||
endif ()
|
||||
|
||||
# Run the test unoptimized, unless it's a "render_*" or "oslinfo_*"
|
||||
# test, which we don't bother testing unoptimized.
|
||||
if (NOT _testname MATCHES "^render" AND
|
||||
NOT _testname MATCHES "^oslinfo" AND
|
||||
NOT EXISTS "${_testsrcdir}/OPTIMIZEONLY")
|
||||
set (_env TESTSHADE_OPT=0 OPENIMAGEIOHOME=${OPENIMAGEIOHOME})
|
||||
add_test ( NAME ${_testname}
|
||||
COMMAND env ${_env} ${_runtest} )
|
||||
endif ()
|
||||
# Run the same test again with aggressive -O2 runtime
|
||||
# optimization, triggered by setting TESTSHADE_OPT env variable
|
||||
set (_env TESTSHADE_OPT=2 OPENIMAGEIOHOME=${OPENIMAGEIOHOME})
|
||||
add_test ( NAME ${_testname}.opt
|
||||
COMMAND env ${_env} ${_runtest} )
|
||||
endforeach ()
|
||||
endmacro ()
|
||||
|
||||
if (OSL_BUILD_TESTS)
|
||||
# List all the individual testsuite tests here, except those that need
|
||||
# special installed tests.
|
||||
TESTSUITE ( and-or-not-synonyms aastep arithmetic array array-derivs array-range
|
||||
blackbody blendmath breakcont
|
||||
bug-array-heapoffsets
|
||||
bug-locallifetime bug-outputinit bug-param-duplicate bug-peep
|
||||
cellnoise closure closure-array color comparison
|
||||
compile-buffer
|
||||
component-range const-array-params const-array-fill
|
||||
debugnan debug-uninit
|
||||
derivs derivs-muldiv-clobber
|
||||
draw_string
|
||||
error-dupes exit exponential
|
||||
function-earlyreturn function-simple function-outputelem
|
||||
geomath getattribute-camera getsymbol-nonheap gettextureinfo
|
||||
group-outputs groupstring
|
||||
hex hyperb
|
||||
ieee_fp if incdec initops intbits isconnected isconstant
|
||||
layers layers-Ciassign layers-entry layers-lazy
|
||||
layers-nonlazycopy layers-repeatedoutputs
|
||||
linearstep
|
||||
logic loop matrix message
|
||||
mergeinstances-nouserdata mergeinstances-vararray
|
||||
metadata-braces miscmath missing-shader
|
||||
noise noise-cell
|
||||
noise-gabor noise-gabor2d-filter noise-gabor3d-filter
|
||||
noise-perlin noise-uperlin noise-simplex noise-usimplex
|
||||
pnoise pnoise-cell pnoise-gabor pnoise-perlin pnoise-uperlin
|
||||
oslc-comma oslc-D
|
||||
oslc-err-arrayindex oslc-err-closuremul
|
||||
oslc-err-format oslc-err-intoverflow
|
||||
oslc-err-noreturn oslc-err-outputparamvararray oslc-err-paramdefault
|
||||
oslc-err-struct-array-init oslc-err-struct-dup
|
||||
oslc-warn-commainit
|
||||
oslc-variadic-macro
|
||||
oslinfo-arrayparams oslinfo-colorctrfloat
|
||||
oslinfo-metadata oslinfo-noparams
|
||||
osl-imageio
|
||||
printf-whole-array
|
||||
raytype reparam
|
||||
render-background render-bumptest
|
||||
render-cornell render-furnace-diffuse
|
||||
render-microfacet render-oren-nayar render-veachmis render-ward
|
||||
shortcircuit spline splineinverse string
|
||||
struct struct-array struct-array-mixture
|
||||
struct-err struct-init-copy struct-layers
|
||||
struct-return struct-with-array
|
||||
struct-nested struct-nested-assign struct-nested-deep
|
||||
ternary
|
||||
testshade-expr
|
||||
texture-alpha texture-blur texture-derivs
|
||||
texture-firstchannel texture-interp
|
||||
texture-missingcolor texture-simple
|
||||
texture-smallderivs texture-swirl
|
||||
texture-width texture-withderivs texture-wrap
|
||||
trailing-commas transform transformc trig typecast
|
||||
unknown-instruction
|
||||
vararray-connect vararray-default
|
||||
vararray-deserialize vararray-param
|
||||
vecctr vector
|
||||
wavelength_color xml )
|
||||
|
||||
# Only run field3d-related tests if the local OIIO was built with f3d support.
|
||||
EXECUTE_PROCESS ( COMMAND ${OPENIMAGEIO_BIN}/oiiotool --help
|
||||
OUTPUT_VARIABLE oiiotool_help )
|
||||
if (oiiotool_help MATCHES "field3d")
|
||||
TESTSUITE ( texture-field3d )
|
||||
# install pkgconfig files
|
||||
if ( NOT MSVC )
|
||||
configure_file(src/build-scripts/oslexec.pc.in "${CMAKE_BINARY_DIR}/oslexec.pc" @ONLY)
|
||||
configure_file(src/build-scripts/oslcomp.pc.in "${CMAKE_BINARY_DIR}/oslcomp.pc" @ONLY)
|
||||
configure_file(src/build-scripts/oslquery.pc.in "${CMAKE_BINARY_DIR}/oslquery.pc" @ONLY)
|
||||
install (FILES "${CMAKE_BINARY_DIR}/oslexec.pc"
|
||||
"${CMAKE_BINARY_DIR}/oslcomp.pc"
|
||||
"${CMAKE_BINARY_DIR}/oslquery.pc"
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
||||
COMPONENT developer)
|
||||
endif()
|
||||
|
||||
# Only run pointcloud tests if Partio is found
|
||||
if (PARTIO_FOUND)
|
||||
TESTSUITE ( pointcloud pointcloud-fold )
|
||||
endif ()
|
||||
|
||||
endif (OSL_BUILD_TESTS)
|
||||
|
||||
|
||||
|
||||
#########################################################################
|
||||
# Packaging
|
||||
set (CPACK_PACKAGE_VERSION_MAJOR ${OSL_LIBRARY_VERSION_MAJOR})
|
||||
set (CPACK_PACKAGE_VERSION_MINOR ${OSL_LIBRARY_VERSION_MINOR})
|
||||
set (CPACK_PACKAGE_VERSION_PATCH ${OSL_LIBRARY_VERSION_PATCH})
|
||||
# "Vendor" is only used in copyright notices, so we use the same thing that
|
||||
# the rest of the copyright notices say.
|
||||
set (CPACK_PACKAGE_VENDOR "Sony Pictures Imageworks")
|
||||
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenShadingLanguage is...")
|
||||
set (CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/src/doc/Description.txt")
|
||||
set (CPACK_PACKAGE_FILE_NAME OSL-${OSL_LIBRARY_VERSION_MAJOR}.${OSL_LIBRARY_VERSION_MINOR}.${OSL_LIBRARY_VERSION_PATCH}-${platform})
|
||||
file (COPY "${PROJECT_SOURCE_DIR}/LICENSE" DESTINATION "${CMAKE_BINARY_DIR}")
|
||||
file (RENAME "${CMAKE_BINARY_DIR}/LICENSE" "${CMAKE_BINARY_DIR}/License.txt")
|
||||
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/License.txt")
|
||||
file (COPY "${PROJECT_SOURCE_DIR}/README.md" DESTINATION "${CMAKE_BINARY_DIR}")
|
||||
file (RENAME "${CMAKE_BINARY_DIR}/README.md" "${CMAKE_BINARY_DIR}/Readme.txt")
|
||||
set (CPACK_RESOURCE_FILE_README "${CMAKE_BINARY_DIR}/Readme.txt")
|
||||
set (CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/src/doc/Welcome.txt")
|
||||
#set (CPACK_PACKAGE_EXECUTABLES I'm not sure what this is for)
|
||||
#set (CPACK_STRIP_FILES Do we need this?)
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
set (CPACK_GENERATOR "TGZ;STGZ;RPM;DEB")
|
||||
set (CPACK_SOURCE_GENERATOR "TGZ")
|
||||
# Export the configuration files. There are also library-specific config
|
||||
# exports in the CMakeLists.txt of libOpenImageIO.
|
||||
include (CMakePackageConfigHelpers)
|
||||
|
||||
# the file containing the exported targets
|
||||
set (OSL_TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets.cmake")
|
||||
# the version file
|
||||
set (OSL_VERSION_CONFIG "${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
|
||||
# the config file that is actually looked for by find_package
|
||||
set (OSL_PROJECT_CONFIG "${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake")
|
||||
# where all these files will be installed
|
||||
set (OSL_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
|
||||
|
||||
# first generate the version file in the binary dir
|
||||
write_basic_package_version_file (
|
||||
${OSL_VERSION_CONFIG}
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
# generate the Targets file in the binary dir using the targets collected in
|
||||
# OSL_EXPORTED_TARGETS each target is added to OSL_EXPORTED_TARGETS through
|
||||
# the macro install_target().
|
||||
export (EXPORT OSL_EXPORTED_TARGETS FILE "${CMAKE_BINARY_DIR}/${OSL_TARGETS_EXPORT_NAME}")
|
||||
|
||||
# generate the config file from the template in the binary dir
|
||||
configure_package_config_file ("${PROJECT_SOURCE_DIR}/src/cmake/Config.cmake.in"
|
||||
"${OSL_PROJECT_CONFIG}"
|
||||
INSTALL_DESTINATION "${OSL_CONFIG_INSTALL_DIR}")
|
||||
|
||||
# generate the config file from the template in the binary dir
|
||||
install (FILES "${OSL_PROJECT_CONFIG}" "${OSL_VERSION_CONFIG}"
|
||||
DESTINATION "${OSL_CONFIG_INSTALL_DIR}")
|
||||
|
||||
# install targets files
|
||||
install (EXPORT OSL_EXPORTED_TARGETS
|
||||
DESTINATION ${OSL_CONFIG_INSTALL_DIR}
|
||||
FILE ${OSL_TARGETS_EXPORT_NAME}
|
||||
NAMESPACE ${PROJECT_NAME}::)
|
||||
|
||||
if (${PROJECT_NAME}_BUILD_TESTS AND PROJECT_IS_TOP_LEVEL)
|
||||
osl_add_all_tests()
|
||||
endif ()
|
||||
if (APPLE)
|
||||
set (CPACK_GENERATOR "TGZ;STGZ;PackageMaker")
|
||||
set (CPACK_SOURCE_GENERATOR "TGZ")
|
||||
|
||||
if (PROJECT_IS_TOP_LEVEL)
|
||||
include (packaging)
|
||||
endif ()
|
||||
set (CPACK_SOURCE_PACKAGE_FILE_NAME OSL-${OSL_LIBRARY_VERSION_MAJOR}.${OSL_LIBRARY_VERSION_MINOR}.${OSL_LIBRARY_VERSION_PATCH}-source)
|
||||
#set (CPACK_SOURCE_STRIP_FILES ...FIXME...)
|
||||
set (CPACK_SOURCE_IGNORE_FILES ".*~")
|
||||
include (CPack)
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Code of Conduct
|
||||
|
||||
The Open Shading Language project abides by Linux Foundation's code of
|
||||
conduct, which you can read in full
|
||||
[here](https://lfprojects.org/policies/code-of-conduct).
|
||||
|
||||
To report incidents or to appeal reports of incidents, send email to
|
||||
the Manager of LF Projects at manager@lfprojects.org.
|
||||
@@ -0,0 +1,354 @@
|
||||
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
||||
<!-- Copyright Contributors to the Open Shading Language Project. -->
|
||||
|
||||
|
||||
Contributing to OSL
|
||||
===========================
|
||||
|
||||
Code contributions to OSL are always welcome. That's a big part of
|
||||
why it's an open source project. Please review this document to get a
|
||||
briefing on our process.
|
||||
|
||||
|
||||
Mail List and Slack
|
||||
-------------------
|
||||
|
||||
Contributors should be reading the osl-dev mail list:
|
||||
|
||||
* [osl-dev](https://lists.aswf.io/g/osl-dev)
|
||||
|
||||
You can sign up for the mail list on your own using the link above.
|
||||
|
||||
We also have an `openshadinglanguage` channel on the
|
||||
[ASWF Slack](https://slack.aswf.io/). But note that the Slack channel is
|
||||
not archived, so while it's ok for fleeting comments, it is unreliable as
|
||||
a permanent repository of useful information. Serious discussions that are
|
||||
we would want to refer to over time should be sent to the mail list instead.
|
||||
|
||||
|
||||
Bug Reports and Issue Tracking
|
||||
------------------------------
|
||||
|
||||
We use GitHub's issue tracking system for reporting bugs and requesting
|
||||
enhancements:
|
||||
https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues
|
||||
|
||||
**If you are merely asking a question ("how do I...")**, please do not file an
|
||||
issue, but instead ask the question on the [OSL developer mail
|
||||
list](https://lists.aswf.io/g/osl-dev).
|
||||
|
||||
If you are submitting a bug report, please be sure to note which version of
|
||||
OSL you are using, on what platform (OS/version, which compiler you used,
|
||||
and any special build flags or other unusual environmental issues). Please
|
||||
give an account of
|
||||
|
||||
* what you tried
|
||||
* what happened
|
||||
* what you expected to happen instead
|
||||
|
||||
with enough detail that others can reproduce the problem.
|
||||
|
||||
|
||||
Contributor License Agreement (CLA) and Intellectual Property
|
||||
-------------------------------------------------------------
|
||||
|
||||
To protect the project -- and the contributors! -- we do require a
|
||||
Contributor License Agreement (CLA) for anybody submitting changes.
|
||||
|
||||
* [Corporate CLA](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/ASWF/OSL-CLA-corporate.md)
|
||||
If you are writing the code as part of your job, or if there is any
|
||||
possibility that your employers might think they own any intellectual
|
||||
property you create. This needs to be executed by someone who has
|
||||
signatory power for the company.
|
||||
|
||||
* [Individual]((https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/ASWF/OSL-CLA-individual.md)).
|
||||
If you are an individual writing the code on your own time and you're SURE
|
||||
you are the sole owner of any intellectual property you contribute.
|
||||
|
||||
The easiest way to sign CLAs is digitally [using EasyCLA](https://corporate.v1.easycla.lfx.linuxfoundation.org).
|
||||
Companies who prefer not to use the online tools may sign, scan, and email
|
||||
the executed copy to manager@lfprojects.org.
|
||||
|
||||
The CLA allows a company to name a "CLA Manager" (who does not need
|
||||
signatory power) who has the ability to use the online system to add or
|
||||
delete individual employees of the company who are authorized to submit pull
|
||||
requests, without needing to get an executive to amend and sign the
|
||||
agreement each time.
|
||||
|
||||
Please note that these CLAs are based on the Apache 2.0 CLAs, and differ
|
||||
minimally, only as much as was required to correctly describe the EasyCLA
|
||||
process and our use of a CLA manager.
|
||||
|
||||
|
||||
** Contribution sign off
|
||||
|
||||
ASWF requires the use of the [Developer’s Certificate of Origin 1.1
|
||||
(DCO)](https://developercertificate.org/), which is the same mechanism that
|
||||
the [Linux®
|
||||
Kernel](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst#n416)
|
||||
and many other communities use to manage code contributions. The DCO is
|
||||
considered one of the simplest tools for sign offs from contributors as the
|
||||
representations are meant to be easy to read and indicating signoff is done
|
||||
as a part of the commit message.
|
||||
|
||||
Here is an example Signed-off-by line, which indicates that the submitter
|
||||
accepts the DCO:
|
||||
|
||||
`Signed-off-by: John Doe <john.doe@example.com>`
|
||||
|
||||
You can include this automatically when you commit a change to your local
|
||||
git repository using <code>git commit -s</code>. You might also want to
|
||||
leverage this [command line tool](https://github.com/coderanger/dco) for
|
||||
automatically adding the signoff message on commits.
|
||||
|
||||
|
||||
Pull Requests and Code Review
|
||||
-----------------------------
|
||||
|
||||
The best way to submit changes is via GitHub Pull Request. GitHub has a
|
||||
[Pull Request Howto](https://help.github.com/articles/using-pull-requests/).
|
||||
|
||||
All code must be formally reviewed before being merged into the official
|
||||
repository. The protocol is like this:
|
||||
|
||||
1. Get a GitHub account, fork AcademySoftwareFoundation/OpenShadingLanguage to create your
|
||||
own repository on GitHub, and then clone it to get a repository on your
|
||||
local machine.
|
||||
|
||||
2. Edit, compile, and test your changes.
|
||||
|
||||
3. Push your changes to your fork (each unrelated pull request to a separate
|
||||
"topic branch", please).
|
||||
|
||||
4. Make a "pull request" on GitHub for your patch.
|
||||
|
||||
5. If your patch will induce a major compatibility break, or has a design
|
||||
component that deserves extended discussion or debate among the wider OSL
|
||||
community, then it may be prudent to email osl-dev pointing everybody to
|
||||
the pull request URL and discussing any issues you think are important.
|
||||
|
||||
6. The reviewer will look over the code and critique on the "comments" area,
|
||||
or discuss in email. Reviewers may ask for changes, explain problems they
|
||||
found, congratulate the author on a clever solution, etc. But until somebody
|
||||
says "LGTM" (looks good to me), the code should not be committed. Sometimes
|
||||
this takes a few rounds of give and take. Please don't take it hard if your
|
||||
first try is not accepted. It happens to all of us.
|
||||
|
||||
7. After approval, one of the senior developers (with commit approval to the
|
||||
official main repository) will merge your fixes into the master branch.
|
||||
|
||||
|
||||
Coding Style
|
||||
------------
|
||||
|
||||
There are two overarching rules:
|
||||
|
||||
1. When making changes, conform to the style and conventions of the surrounding code.
|
||||
|
||||
2. Strive for clarity, even if that means occasionally breaking the
|
||||
guidelines. Use your head and ask for advice if your common sense seems to
|
||||
disagree with the conventions.
|
||||
|
||||
Below we try to enumerate the guidelines embodied in the code.
|
||||
|
||||
#### File conventions
|
||||
|
||||
C++ implementation should be named `*.cpp`. Headers should be named `.h`.
|
||||
All headers should contain
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
All source files should begin with the copyright and license, which can be
|
||||
found in the [LICENSE](LICENSE) file (or cut and pasted from any other other source
|
||||
file). Two notes on this:
|
||||
|
||||
* For NEW source files, please change the copyright year to the present. DO
|
||||
NOT edit existing files only to update the copyright year, it just creates
|
||||
pointless deltas and offers no increased protection.
|
||||
|
||||
* Occasionally a file contains substantial code from another project
|
||||
and will also list its copyright. Do NOT copy that notice to any new files,
|
||||
it really only applies to the particular file in which it appears.
|
||||
|
||||
#### Formatting
|
||||
|
||||
NEVER alter somebody else's code to reformat just because you found
|
||||
something that violates the rules. Let the group/author/leader know, and
|
||||
resist the temptation to change it yourself.
|
||||
|
||||
Each line of text in your code should be at most 80 characters long.
|
||||
Exceptions are allowed for those rare cases where letting a line be longer
|
||||
(and wrapping on an 80-character window) is actually a better and clearer
|
||||
alternative than trying to split it into two lines. Sometimes this happens,
|
||||
but it's extremely rare.
|
||||
|
||||
Indent 4 spaces at a time, and use actual spaces, not tabs. For files that
|
||||
must use tabs for some reason, tabs should always be on 8's. Most editors
|
||||
have a setting that forces indentations to be spaces. With emacs, you can do
|
||||
this:
|
||||
|
||||
(setq c-default-style "bsd")
|
||||
(setq-default indent-tabs-mode nil)
|
||||
|
||||
Opening brace on the same line as the condition or loop.
|
||||
|
||||
One statement per line, except in rare cases where violating this rule makes
|
||||
the code more clear.
|
||||
|
||||
Three (3) consecutive empty lines between function or class method
|
||||
implementations, one blank line between method declarations within a class
|
||||
definition. Put a single blank line within a function if it helps to
|
||||
visually separate different sequential tasks. Don't put multiple blank lines
|
||||
in a row within a function, or blank lines right after an opening brace or
|
||||
right before a closing brace. The goal is to use just enough white space to
|
||||
help developers visually parse the code (for example, spotting at a glance
|
||||
where new functions begin), but not so much as to spread it out or be
|
||||
confusing.
|
||||
|
||||
For if, for, while, etc., put a space before the paren, but NOT inside the parens. For example:
|
||||
|
||||
if (foo) // Yes
|
||||
|
||||
if(foo) // No
|
||||
if ( foo ) // No
|
||||
|
||||
Function calls should have a space between the function name and the opening
|
||||
parenthesis, NO space inside the parenthesis, except for a single blank
|
||||
space between each argument. For example:
|
||||
|
||||
x = foo (a, b); // Yes, this is always ok
|
||||
|
||||
x = foo ( a, b ); // No
|
||||
x = foo (a,b); // No
|
||||
x = foo(a, b); // No
|
||||
x = foo(a); // Occasionally, this just looks better, when the function name is short,
|
||||
// and there's just one very short argument. What can I say, I do it too.
|
||||
|
||||
Function declarations: function names should begin at column 0 for a full
|
||||
function definition. (It's ok to violate this rule for very short inline
|
||||
functions within class definitions.)
|
||||
|
||||
|
||||
Here is a short code fragment that shows some of these rules in action:
|
||||
|
||||
static int
|
||||
function (int a, int b)
|
||||
{
|
||||
int x = a + b;
|
||||
if (a == 0 || b == 0) {
|
||||
x += 1;
|
||||
x *= 4;
|
||||
} else {
|
||||
x -= 3;
|
||||
}
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
x += a * i;
|
||||
x *= foo (i); // function call
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
Don't ever reformat, re-indent, change whitespace, or make any other such
|
||||
changes to working code. If you're adding just a few lines or fixing a bug
|
||||
in existing code, stick to the style of the surrounding code. In very rare
|
||||
circumstances, and with consensus of the group, reformatting is sometimes
|
||||
helpful to improve code readability, but it should be done as a separate
|
||||
formatting-only checkin.
|
||||
|
||||
#### Identifiers
|
||||
|
||||
In general, classes and templates should start with upper case and capitalize new words:
|
||||
|
||||
class CustomerList;
|
||||
|
||||
In general, local variables should start with lower case.
|
||||
|
||||
If your class is extremely similar to, or modeled after, something in the
|
||||
standard library, Boost, or something else we interoperate with, it's ok to
|
||||
use their naming conventions. For example, very general utility classes and
|
||||
templates (the kind of thing you would normally find in std or boost) should
|
||||
be lower case with underscores separating words, as they would be if they
|
||||
were standards.
|
||||
|
||||
template <class T> shared_ptr;
|
||||
class scoped_mutex;
|
||||
|
||||
Macros should be ALL_CAPS, if used at all.
|
||||
|
||||
Names of data should generally be nouns. Functions/methods are trickier: a
|
||||
the name of a function that returns a value but has no side effects should
|
||||
be a noun, but a procedure that performs an action should be a verb.
|
||||
|
||||
#### Class structure
|
||||
|
||||
Try to avoid public data members, although there are some classes that serve
|
||||
a role similar to a simple C struct -- a very straightforward collection of
|
||||
data members. In these, it's fine to make the data members public and have
|
||||
clients set and get them directly.
|
||||
|
||||
Private member data should be named m_foo (alternately, it's ok to use the
|
||||
common practice of member data foo_, but don't mix the conventions within a
|
||||
class).
|
||||
|
||||
Private member data that needs public accessors should use the convention:
|
||||
|
||||
void foo (const T& newfoo) { m_foo = newfoo; }
|
||||
const T& foo () const { return m_foo; }
|
||||
|
||||
Avoid multiple inheritance.
|
||||
|
||||
Namespaces: yes, use them!
|
||||
|
||||
#### Third-party libraries
|
||||
|
||||
Prefer C++11 `std` rather than Boost or other third party libraries, where
|
||||
both can do the same task.
|
||||
|
||||
If you see a third party library already used as a dependency (such as OIIO,
|
||||
Boost, Ilmbase, or LLVM), feel free to any of its public features in OSL
|
||||
internals (provided those features are present in the minimum version of
|
||||
that library that we support).
|
||||
|
||||
Please do not add any NEW dependencies without debate on osl-dev and
|
||||
approval of the project leader.
|
||||
|
||||
Use these libraries for OSL internals, but please DO NOT let them infect any
|
||||
of our public APIs unless it's been thoroughly discussed and approved by the
|
||||
group. (Exceptions: it's ok to use OIIO and Imath classes in our public
|
||||
APIs.)
|
||||
|
||||
#### Comments and Doxygen
|
||||
|
||||
Comment philosophy: try to be clear, try to help teach the reader what's
|
||||
going on in your code.
|
||||
|
||||
Prefer C++ comments (starting line with `//`) rather than C comments (`/* ... */`).
|
||||
|
||||
For any function that may be used by other programmers (e.g., public or
|
||||
protected members of classes), please use Doxygen-style comments. They looks
|
||||
like this:
|
||||
|
||||
/// Explanation of a class. Note THREE slashes!
|
||||
/// Also, you need at least two lines like this. If you don't have enough
|
||||
/// for two lines, make one line blank like this:
|
||||
///
|
||||
class myclass {
|
||||
....
|
||||
float foo; ///< Doxygen comments on same line look like this
|
||||
}
|
||||
|
||||
If you know Doxygen well, please feel free to use the various other markups.
|
||||
But don't go so crazy with Doxygen markups that the comment itself, in an
|
||||
ordinary editor, is not as readable as possible. The Doxygen-generated pages
|
||||
are nice, but the place that needs to be most readable is in the code.
|
||||
|
||||
#### Miscellaneous
|
||||
|
||||
Macros should be used only rarely -- prefer inline functions, templates,
|
||||
enums, or "const" values wherever possible.
|
||||
|
||||
#### Bottom Line
|
||||
|
||||
When in doubt, look elsewhere in the code base for examples of similar
|
||||
structures and try to format your code in the same manner.
|
||||
@@ -0,0 +1,209 @@
|
||||
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
||||
<!-- Copyright Contributors to the Open Shading Language Project. -->
|
||||
|
||||
# OSL Project Governance
|
||||
|
||||
OSL is a project of the Academy Software Foundation and relies on the ASWF
|
||||
governance policies, supported by the Linux Foundation.
|
||||
|
||||
There are three primary project roles: Contributors submit code to the
|
||||
project; Committers approve code to be included into the project; and the
|
||||
Technical Steering Committee (TSC) provides overall high-level project
|
||||
guidance.
|
||||
|
||||
* [Contributors](#Contributors)
|
||||
* [Committers](#Committers)
|
||||
* [Technical Steering Committee](#Technical-Steering-Committee)
|
||||
|
||||
## Contributors
|
||||
|
||||
The OSL project grows and thrives from assistance from Contributors.
|
||||
Contributors include anyone in the community who contributes code,
|
||||
documentation, or other technical artifacts that have been incorporated into
|
||||
the projects repository.
|
||||
|
||||
Anyone can be a Contributor. You need no formal approval from the project,
|
||||
beyond the legal forms.
|
||||
|
||||
### How to Become a Contributor
|
||||
|
||||
* Review the coding standards to ensure your contribution is in line
|
||||
with the project's coding and styling guidelines.
|
||||
|
||||
* Sign the Individual CLA, or if you are employed by an organization that
|
||||
might have any claim to IP you create, have your organization sign the
|
||||
Corporate CLA.
|
||||
|
||||
* Submit your code as a PR with the appropriate DCO sign-off.
|
||||
|
||||
## Committers
|
||||
|
||||
Project Committers have merge access on the OSL GitHub repository
|
||||
and are responsible for approving submissions by Contributors.
|
||||
|
||||
### Committer Responsibilities
|
||||
|
||||
Typical activities of a Committer include:
|
||||
|
||||
* Helping users and novice contributors.
|
||||
|
||||
* Ensuring a response to questions posted to the
|
||||
[osl-dev developer mail list](https://lists.aswf.io/g/osl-dev)
|
||||
|
||||
* Contributing code and documentation changes that improve the project.
|
||||
|
||||
* Reviewing and commenting on issues and pull requests.
|
||||
|
||||
* Ensuring that changes and new code meet acceptable standards and are in
|
||||
the long-term interest of the project.
|
||||
|
||||
* Participation in working groups.
|
||||
|
||||
* Merging pull requests.
|
||||
|
||||
### How to Become a Committer
|
||||
|
||||
Any member of the OSL community (though typically an existing Committer or
|
||||
TSC member) may nominate an individual making significant and valuable
|
||||
contributions to the OSL project to become a new Committer. To nominate a
|
||||
new Committer, open an issue in the OSL repository, send mail to the TSC
|
||||
mail list, or raise the issue at a TSC meeting.
|
||||
|
||||
The TSC may periodically review the Committer list to identify inactive
|
||||
Committers. Past Committers are typically given Emeritus status. Emeriti may
|
||||
request that the TSC restore them to active Committer status.
|
||||
|
||||
## Technical Steering Committee
|
||||
|
||||
The Technical Steering Committee (TSC) has final authority over this
|
||||
project. As defined in the project charter, TSC responsibilities include,
|
||||
but are not limited to:
|
||||
|
||||
* Coordinating technical direction of the Project.
|
||||
|
||||
* Project governance and contribution policy.
|
||||
|
||||
* GitHub repository administration.
|
||||
|
||||
* Maintaining the list of additional Committers
|
||||
|
||||
* Appointing representatives to work with other open source or open
|
||||
standards communities.
|
||||
|
||||
* Discussions, seeking consensus, and where necessary, voting on technical
|
||||
matters relating to the code base that affect multiple projects.
|
||||
|
||||
* Coordinating any marketing, events, or communications regarding the
|
||||
project.
|
||||
|
||||
Within the TSC are two elected leadership roles to be held by its members
|
||||
and voted on annually. Any TSC member can express interest in serving in a
|
||||
role, or nominate another member to serve. There are no term limits, and one
|
||||
person may hold multiple roles simultaneously. Should a TSC member resign
|
||||
from a leadership role before their term is complete, a successor shall be
|
||||
elected through the standard nomination and voting process to complete the
|
||||
remainder of the term. The leadership roles are:
|
||||
|
||||
* **Chair**: This position acts as the project manager, organizing meetings
|
||||
and providing oversight to project administration.
|
||||
|
||||
* **Chief Architect**: This position makes all the final calls on design and
|
||||
technical decisions, and is responsible for avoiding "design by committee"
|
||||
pitfalls.
|
||||
|
||||
The chair role is assumed to rotate annually (though there are no term
|
||||
limits, so the TSC may reelect an existing chair). The chief architect
|
||||
position should be a source of stability and coherent design vision, so the
|
||||
TSC is encouraged to choose an architect who can serve for many years and
|
||||
only change architects when it is necessary for the health of the project
|
||||
and its community.
|
||||
|
||||
At the time of election, the TSC will also agree upon which of these two
|
||||
leaders will serve as the OSL ASWF (Academy Software Foundation) TAC
|
||||
(Technical Advisory Council) representative for the term. This member
|
||||
represents the project at all ASWF TAC meetings.
|
||||
|
||||
### TSC Members
|
||||
|
||||
Current voting members of the TSC are:
|
||||
|
||||
* **Chair and TAC representative**: Chris Kulla - Epic Games
|
||||
* **Chief Architect**: Larry Gritz - Sony Pictures Imageworks
|
||||
|
||||
* Luke Emrose - Animal Logic
|
||||
* Eric Enderton - NVIDIA
|
||||
* Stephen Friedman - Pixar
|
||||
* Nicolas Guiard - Isotropix
|
||||
* Derek Haase - DNEG
|
||||
* Adrien Herubel - Autodesk
|
||||
* Lee Kerley - Sony Pictures Imageworks
|
||||
* Mitch Prater - Laika
|
||||
* Brecht Van Lommel - Blender
|
||||
|
||||
### TSC Nomination and Succession
|
||||
|
||||
Any proposal for additional members of the TSC may be submitted by
|
||||
Committers, TSC members, or other major stakeholders of the OSL community by
|
||||
opening an issue outlining their case or raising the issue at a TSC meeting.
|
||||
New TSC members are accepted or rejected by majority vote of the TSC.
|
||||
|
||||
If a TSC member is for an extended period not regularly participating or
|
||||
performing the responsibilities expected of TSC members, the TSC may by
|
||||
majority vote request an alternate TSC member be submitted by that
|
||||
organization, or remove the inactive member from the TSC.
|
||||
|
||||
A voting member of the TSC may nominate a successor in the event that such
|
||||
voting member decides to leave the TSC, and the TSC, including the departing
|
||||
member, shall confirm or reject such nomination by a vote. In the event that
|
||||
the departing member's nomination for successor is rejected by vote of the
|
||||
TSC, the departing member shall be entitled to continue nominating
|
||||
successors until one such successor is confirmed by vote of the TSC. If the
|
||||
departing member fails or is unable to nominate a successor, the TSC may
|
||||
nominate one on the departing member's behalf.
|
||||
|
||||
TSC membership is presumed to be retained by the individual even if they
|
||||
change employers. The TSC may take action to ensure that organizational
|
||||
stakeholder representation not become severely disproportionate, for example
|
||||
by urging an organization that loses its sole TSC representative to nominate
|
||||
a new member, or to limit the total number of voting members from any one
|
||||
organization if too many members all move to the same organization.
|
||||
|
||||
### TSC Meetings
|
||||
|
||||
Any meetings of the TSC are intended to be open to the public, except where
|
||||
there is a reasonable need for privacy. The TSC meets regularly in a voice
|
||||
conference call, at a cadence deemed appropriate by the TSC. The TSC Chair
|
||||
moderates the meeting, or appoints another TSC member to moderate in his or
|
||||
her absence. Meetings may also be streamed online where appropriate;
|
||||
connection details will be posted to the osl-dev mail list in advance of the
|
||||
scheduled meeting.
|
||||
|
||||
Items are added to the TSC agenda which are considered contentious or are
|
||||
modifications of governance, contribution policy, TSC membership, or release
|
||||
process, in addition to topics involving the high-level technical direction
|
||||
of the project.
|
||||
|
||||
The intention of the agenda is not to approve or review all patches. That
|
||||
should happen continuously on GitHub and be handled by the larger group of
|
||||
Committers.
|
||||
|
||||
Any community member or Contributor can ask that something be reviewed by
|
||||
the TSC at the meeting by logging a GitHub issue. Any Committer, TSC member,
|
||||
or the meeting chair can bring the issue to the TSC's attention by applying
|
||||
the `TSC` label.
|
||||
|
||||
Prior to each TSC meeting, the meeting chair will share the agenda with
|
||||
members of the TSC. TSC members can also add items to the agenda at the
|
||||
beginning of each meeting. The meeting chair and the TSC cannot veto or
|
||||
remove items.
|
||||
|
||||
The TSC may invite additional persons to participate in a non-voting
|
||||
capacity.
|
||||
|
||||
The meeting chair is responsible for ensuring that minutes are taken and
|
||||
archived in the project repository.
|
||||
|
||||
Due to the challenges of scheduling a global meeting with participants in
|
||||
several time zones, the TSC will seek to resolve as many agenda items as
|
||||
possible outside of meetings on the public mailing list.
|
||||
|
||||
@@ -1,42 +1,91 @@
|
||||
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
||||
<!-- Copyright Contributors to the Open Shading Language Project. -->
|
||||
|
||||
Building OSL
|
||||
============
|
||||
|
||||
OSL currently compiles and runs cleanly on Linux and Mac OS X. We have
|
||||
not yet compiled it for Windows, but we believe we it should be very
|
||||
portable (we have done almost nothing platform-specific).
|
||||
OSL currently compiles and runs cleanly on Linux, Mac OS X, and Windows.
|
||||
|
||||
OSL makes very heavy use of the OpenImageIO project
|
||||
(http://openimageio.org), both for its texture mapping functionality as
|
||||
well as numerous utility classes. If you are integrating OSL into an
|
||||
existing renderer, you may use your own favorite texturing system rather
|
||||
than OpenImageIO with a little minor surgery. There are only a few
|
||||
places where OIIO (OpenImageIO) texturing calls are made, and they could
|
||||
easily be bypassed. But it is probably not possible to remove OIIO
|
||||
completely as a dependency, since we so heavily rely on a number of
|
||||
other utility classes that it provides (for which there was no point
|
||||
reinventing redundantly for OSL).
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
OSL requires the following dependencies or tools.
|
||||
NEW or CHANGED dependencies since the last major release are **bold**.
|
||||
|
||||
* Build system: [CMake](https://cmake.org/) 3.12 or newer (tested through 3.21)
|
||||
|
||||
* A suitable C++11 compiler to build OSL itself, which may be any of:
|
||||
- GCC 4.8.5 or newer (tested through gcc 11.2)
|
||||
- Clang 3.4 or newer (tested through clang 13)
|
||||
- Microsoft Visual Studio 2015 or newer
|
||||
- Intel C++ compiler icc version 13 (?) or newer
|
||||
|
||||
OSL should compile also properly with C++14 or C++17, but they are not
|
||||
required (unless you are using LLVM >= 10, in which case at least C++14
|
||||
is needed).
|
||||
|
||||
* **[OpenImageIO](http://openimageio.org) 2.0 or newer** (tested through 2.3)
|
||||
|
||||
OSL uses OIIO both for its texture mapping functionality as well as
|
||||
numerous utility classes. If you are integrating OSL into an existing
|
||||
renderer, you may use your own favorite texturing system rather than
|
||||
OpenImageIO with a little minor surgery. There are only a few places
|
||||
where OIIO texturing calls are made, and they could easily be bypassed.
|
||||
But it is probably not possible to remove OIIO completely as a
|
||||
dependency, since we so heavily rely on a number of other utility classes
|
||||
that it provides (for which there was no point reinventing redundantly
|
||||
for OSL).
|
||||
|
||||
After building OpenImageIO, if you don't have it installed in a
|
||||
"standard" place (like /usr/include), you should set the environment
|
||||
variable $OPENIMAGEIOHOME to point to the compiled distribution, as
|
||||
well as for $OPENIMAGEIOHOME/lib to be in your LD_LIBRARY_PATH (or
|
||||
DYLD_LIBRARY_PATH on OS X) and then OSL's build scripts will be able
|
||||
to find it.
|
||||
|
||||
* **[LLVM](http://www.llvm.org) 7, 8, 9, 10, 11, 12, or 13**, including clang
|
||||
libraries.
|
||||
|
||||
Note that LLVM 10+ is not compatible with C++11, and requires C++14 or
|
||||
later. If you *must* build OSL with C++11, you need to use an LLVM that
|
||||
is LLVM 9 or earlier.
|
||||
|
||||
* [Boost](https://www.boost.org) 1.55 or newer (tested through boost 1.76)
|
||||
* [Ilmbase or Imath](http://openexr.com/downloads.html) 2.0 or newer (tested through 3.1)
|
||||
* [Flex](https://github.com/westes/flex) 2.5.35 or newer and
|
||||
[GNU Bison](https://www.gnu.org/software/bison/) 2.7 or newer.
|
||||
Note that on some MacOS/xcode releases, the system-installed Bison is too
|
||||
old, and it's better to install a newer Bison (via Homebrew is one way to
|
||||
do this easily).
|
||||
* [PugiXML](http://pugixml.org/)
|
||||
* (optional) [Partio](https://www.disneyanimation.com/technology/partio.html)
|
||||
If it is not found at build time, the OSL `pointcloud` functions will not
|
||||
be operative.
|
||||
* (optional) Python: If you are building the Python bindings or running the
|
||||
testsuite:
|
||||
* Python >= 2.7 (tested against 2.7, 3.6, 3.7, 3.8, 3.9)
|
||||
* pybind11 >= 2.4.2 (Tested through 2.7).
|
||||
* NumPy
|
||||
* (optional) Qt >= 5.6 (tested through 5.15). If not found at build time,
|
||||
the `osltoy` application will be disabled.
|
||||
|
||||
|
||||
|
||||
Build process
|
||||
-------------
|
||||
|
||||
Here are the steps to check out, build, and test the OSL distribution:
|
||||
|
||||
0. Install and build dependencies. You will need Boost (www.boost.org),
|
||||
Imath (http://openexr.com/downloads.html), and OpenImageIO
|
||||
(http://openimageio.org).
|
||||
|
||||
After building OpenImageIO, if you don't have it installed in a
|
||||
"standard" place (like /usr/include), you should set the environment
|
||||
variable $OPENIMAGEIOHOME to point to the compiled distribution, as
|
||||
well as for $OPENIMAGEIOHOME/lib to be in your LD_LIBRARY_PATH (or
|
||||
DYLD_LIBRARY_PATH on OS X) and then OSL's build scripts will be able
|
||||
to find it.
|
||||
0. Install and build dependencies.
|
||||
|
||||
1. Check out a copy of the source code from the Git repository:
|
||||
|
||||
git clone https://github.com/imageworks/OpenShadingLanguage.git osl
|
||||
git clone https://github.com/AcademySoftwareFoundation/OpenShadingLanguage.git osl
|
||||
|
||||
2. Change to the distribution directory and 'make'
|
||||
|
||||
cd osl
|
||||
make
|
||||
cd osl
|
||||
make
|
||||
|
||||
Note: OSL uses 'CMake' for its cross-platform build system. But for
|
||||
simplicity, we have made a "make wrapper" around it, so that by just
|
||||
@@ -44,6 +93,11 @@ Here are the steps to check out, build, and test the OSL distribution:
|
||||
options, and note that 'make nuke' will blow everything away for the
|
||||
freshest possible compile.
|
||||
|
||||
NOTE: If the build breaks due to compiler warnings which have been
|
||||
elevated to errors, you can try "make clean" followed by
|
||||
"make STOP_ON_WARNING=0", that create a build that will only stop for
|
||||
full errors, not warnings.
|
||||
|
||||
3. After compilation, you'll end up with a full OSL distribution in
|
||||
dist/ARCH, where ARCH is the architecture you are building on, one of
|
||||
"linux", "linux64", "macosx", "windows", or "windows64".
|
||||
@@ -57,13 +111,14 @@ Here are the steps to check out, build, and test the OSL distribution:
|
||||
of those files to appropriate directories. Public include files
|
||||
(those needed when building applications that incorporate OSL)
|
||||
can be found in "dist/ARCH/include", and documentation can be found
|
||||
in "dist/ARCH/doc".
|
||||
in "dist/ARCH/share/doc".
|
||||
|
||||
5. After building (and setting your library path), you can run the
|
||||
test suite with:
|
||||
|
||||
make test
|
||||
make test
|
||||
|
||||
Troubleshooting
|
||||
----------------
|
||||
|
||||
(Note: currently all tests pass on OS X but a few tests fail on Linux
|
||||
strictly for floating point precision reasons, not because anything
|
||||
is really broken. We're working on a fix for this.)
|
||||
- [Build issues on macOS Catalina (fatal error: 'wchar.h' file not found)](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues/1055#issuecomment-581920327)
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
Copyright (c) 2009-2016 Sony Pictures Imageworks Inc., et al.
|
||||
All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Sony Pictures Imageworks nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,27 @@
|
||||
Copyright (c) 2009-present Contributors to the Open Shading Language project.
|
||||
All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -1,8 +1,14 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
#########################################################################
|
||||
#
|
||||
# This is the master makefile.
|
||||
# Here we put all the top-level make targets, platform-independent
|
||||
# rules, etc.
|
||||
# rules, etc. This is just a fancy wrapper around cmake, but for many
|
||||
# people, it's a lot simpler to just type "make" and have everything
|
||||
# happen automatically.
|
||||
#
|
||||
# Run 'make help' to list helpful targets.
|
||||
#
|
||||
@@ -12,7 +18,6 @@
|
||||
.PHONY: all debug profile clean realclean nuke
|
||||
|
||||
working_dir := ${shell pwd}
|
||||
INSTALLDIR =${working_dir}
|
||||
|
||||
# Figure out which architecture we're on
|
||||
include ${working_dir}/src/make/detectplatform.mk
|
||||
@@ -28,30 +33,26 @@ endif
|
||||
|
||||
MY_MAKE_FLAGS ?=
|
||||
MY_NINJA_FLAGS ?=
|
||||
MY_CMAKE_FLAGS ?=
|
||||
#-g3
|
||||
#-DSELF_CONTAINED_INSTALL_TREE:BOOL=TRUE
|
||||
MY_CMAKE_FLAGS ?=
|
||||
BUILDSENTINEL ?= Makefile
|
||||
NINJA ?= ninja
|
||||
CMAKE ?= cmake
|
||||
CMAKE_BUILD_TYPE ?= Release
|
||||
|
||||
# Site-specific build instructions
|
||||
ifndef OSL_SITE
|
||||
OSL_SITE := ${shell uname -n}
|
||||
endif
|
||||
ifneq (${shell echo ${OSL_SITE} | grep imageworks},)
|
||||
OSL_SITE ?= ${shell uname -n}
|
||||
ifneq (${shell echo ${OSL_SITE} | grep imageworks.com},)
|
||||
include ${working_dir}/site/spi/Makefile-bits
|
||||
endif
|
||||
ifneq (${shell echo ${OSL_SITE} | grep pixar},)
|
||||
include ${working_dir}/site/pixar/Makefile-bits
|
||||
endif
|
||||
|
||||
# Set up variables holding the names of platform-dependent directories --
|
||||
# set these after evaluating site-specific instructions
|
||||
top_build_dir := build
|
||||
build_dir := ${top_build_dir}/${platform}${variant}
|
||||
top_dist_dir := dist
|
||||
dist_dir := ${top_dist_dir}/${platform}${variant}
|
||||
top_build_dir ?= build
|
||||
build_dir ?= ${top_build_dir}/${platform}${variant}
|
||||
top_dist_dir ?= dist
|
||||
dist_dir ?= ${top_dist_dir}/${platform}${variant}
|
||||
|
||||
INSTALL_PREFIX ?= ${working_dir}/${dist_dir}
|
||||
|
||||
VERBOSE ?= ${SHOWCOMMANDS}
|
||||
ifneq (${VERBOSE},)
|
||||
@@ -63,11 +64,16 @@ ifneq (${VERBOSE},0)
|
||||
endif
|
||||
$(info OSL_SITE = ${OSL_SITE})
|
||||
$(info dist_dir = ${dist_dir})
|
||||
$(info INSTALLDIR = ${INSTALLDIR})
|
||||
$(info INSTALL_PREFIX = ${INSTALL_PREFIX})
|
||||
endif
|
||||
|
||||
ifneq (${NAMESPACE},)
|
||||
MY_CMAKE_FLAGS += -DOSL_NAMESPACE:STRING=${NAMESPACE}
|
||||
endif
|
||||
|
||||
ifneq (${LLVM_DIRECTORY},)
|
||||
MY_CMAKE_FLAGS += -DLLVM_DIRECTORY:STRING=${LLVM_DIRECTORY}
|
||||
MY_CMAKE_FLAGS += -DLLVM_ROOT:STRING=${LLVM_DIRECTORY}
|
||||
endif
|
||||
|
||||
ifneq (${LLVM_VERSION},)
|
||||
@@ -86,64 +92,52 @@ ifneq (${USE_LLVM_BITCODE},)
|
||||
MY_CMAKE_FLAGS += -DUSE_LLVM_BITCODE:BOOL=${USE_LLVM_BITCODE}
|
||||
endif
|
||||
|
||||
ifneq (${NAMESPACE},)
|
||||
MY_CMAKE_FLAGS += -DOSL_NAMESPACE:STRING=${NAMESPACE}
|
||||
endif
|
||||
|
||||
ifneq (${HIDE_SYMBOLS},)
|
||||
MY_CMAKE_FLAGS += -DHIDE_SYMBOLS:BOOL=${HIDE_SYMBOLS}
|
||||
endif
|
||||
|
||||
ifneq (${USE_FAST_MATH},)
|
||||
MY_CMAKE_FLAGS += -DUSE_FAST_MATH:BOOL=${USE_FAST_MATH}
|
||||
endif
|
||||
|
||||
ifneq (${OPENEXR_HOME},)
|
||||
MY_CMAKE_FLAGS += -DOPENEXR_HOME:STRING=${OPENEXR_HOME}
|
||||
endif
|
||||
|
||||
ifneq (${ILMBASE_HOME},)
|
||||
MY_CMAKE_FLAGS += -DILMBASE_HOME:STRING=${ILMBASE_HOME}
|
||||
endif
|
||||
|
||||
ifneq (${USE_PARTIO},)
|
||||
MY_CMAKE_FLAGS += -DUSE_PARTIO:BOOL=${USE_PARTIO}
|
||||
endif
|
||||
|
||||
ifneq (${PARTIO_HOME},)
|
||||
MY_CMAKE_FLAGS += -DPARTIO_HOME:BOOL=${PARTIO_HOME} -DUSE_PARTIO:BOOL=1
|
||||
endif
|
||||
|
||||
ifneq (${BOOST_HOME},)
|
||||
MY_CMAKE_FLAGS += -DBOOST_ROOT:STRING=${BOOST_HOME}
|
||||
endif
|
||||
|
||||
ifneq (${STOP_ON_WARNING},)
|
||||
MY_CMAKE_FLAGS += -DSTOP_ON_WARNING:BOOL=${STOP_ON_WARNING}
|
||||
endif
|
||||
|
||||
ifneq (${BUILDSTATIC},)
|
||||
MY_CMAKE_FLAGS += -DBUILDSTATIC:BOOL=${BUILDSTATIC}
|
||||
ifneq (${BUILD_SHARED_LIBS},)
|
||||
MY_CMAKE_FLAGS += -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
|
||||
endif
|
||||
|
||||
ifneq (${LINKSTATIC},)
|
||||
MY_CMAKE_FLAGS += -DLINKSTATIC:BOOL=${LINKSTATIC}
|
||||
endif
|
||||
|
||||
ifneq (${SOVERSION},)
|
||||
MY_CMAKE_FLAGS += -DSOVERSION:STRING=${SOVERSION}
|
||||
endif
|
||||
|
||||
ifneq (${OSL_LIBNAME_SUFFIX},)
|
||||
MY_CMAKE_FLAGS += -DOSL_LIBNAME_SUFFIX:STRING=${OSL_LIBNAME_SUFFIX}
|
||||
endif
|
||||
|
||||
ifneq (${OIIO_LIBNAME_SUFFIX},)
|
||||
MY_CMAKE_FLAGS += -DOIIO_LIBNAME_SUFFIX:STRING=${OIIO_LIBNAME_SUFFIX}
|
||||
endif
|
||||
|
||||
ifneq (${OSL_BUILD_TESTS},)
|
||||
MY_CMAKE_FLAGS += -DOSL_BUILD_TESTS:BOOL=${OSL_BUILD_TESTS}
|
||||
endif
|
||||
|
||||
ifneq (${USE_EXTERNAL_PUGIXML},)
|
||||
MY_CMAKE_FLAGS += -DUSE_EXTERNAL_PUGIXML:BOOL=${USE_EXTERNAL_PUGIXML} -DPUGIXML_HOME=${PUGIXML_HOME}
|
||||
ifneq (${OSL_BUILD_SHADERS},)
|
||||
MY_CMAKE_FLAGS += -DOSL_BUILD_SHADERS:BOOL=${OSL_BUILD_SHADERS}
|
||||
endif
|
||||
|
||||
ifneq (${OSL_BUILD_MATERIALX},)
|
||||
MY_CMAKE_FLAGS += -DOSL_BUILD_MATERIALX:BOOL=${OSL_BUILD_MATERIALX}
|
||||
endif
|
||||
|
||||
ifdef DEBUG
|
||||
MY_CMAKE_FLAGS += -DCMAKE_BUILD_TYPE:STRING=Debug
|
||||
CMAKE_BUILD_TYPE=Debug
|
||||
endif
|
||||
|
||||
ifdef PROFILE
|
||||
MY_CMAKE_FLAGS += -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
|
||||
CMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
endif
|
||||
|
||||
ifneq (${MYCC},)
|
||||
@@ -153,18 +147,22 @@ ifneq (${MYCXX},)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_CXX_COMPILER:STRING="${MYCXX}"
|
||||
endif
|
||||
|
||||
ifneq (${USE_CPP11},)
|
||||
MY_CMAKE_FLAGS += -DUSE_CPP11:BOOL=${USE_CPP11}
|
||||
ifneq (${USE_CPP},)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_CXX_STANDARD=${USE_CPP}
|
||||
endif
|
||||
|
||||
ifneq (${USE_CPP14},)
|
||||
MY_CMAKE_FLAGS += -DUSE_CPP14:BOOL=${USE_CPP14}
|
||||
ifneq (${CMAKE_CXX_STANDARD},)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
|
||||
endif
|
||||
|
||||
ifneq (${USE_LIBCPLUSPLUS},)
|
||||
MY_CMAKE_FLAGS += -DUSE_LIBCPLUSPLUS:BOOL=${USE_LIBCPLUSPLUS}
|
||||
endif
|
||||
|
||||
ifneq (${GLIBCXX_USE_CXX11_ABI},)
|
||||
MY_CMAKE_FLAGS += -DGLIBCXX_USE_CXX11_ABI=${GLIBCXX_USE_CXX11_ABI}
|
||||
endif
|
||||
|
||||
ifneq (${EXTRA_CPP_ARGS},)
|
||||
MY_CMAKE_FLAGS += -DEXTRA_CPP_ARGS:STRING="${EXTRA_CPP_ARGS}"
|
||||
endif
|
||||
@@ -186,10 +184,62 @@ MY_CMAKE_FLAGS += -G Ninja
|
||||
BUILDSENTINEL := build.ninja
|
||||
endif
|
||||
|
||||
ifneq (${CODECOV},)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_BUILD_TYPE:STRING=Debug -DCODECOV:BOOL=${CODECOV}
|
||||
ifeq (${CODECOV},1)
|
||||
CMAKE_BUILD_TYPE=Debug
|
||||
MY_CMAKE_FLAGS += -DCODECOV:BOOL=${CODECOV}
|
||||
endif
|
||||
|
||||
ifneq (${SANITIZE},)
|
||||
MY_CMAKE_FLAGS += -DSANITIZE=${SANITIZE}
|
||||
endif
|
||||
|
||||
ifneq (${CLANG_TIDY},)
|
||||
MY_CMAKE_FLAGS += -DCLANG_TIDY:BOOL=1
|
||||
endif
|
||||
ifneq (${CLANG_TIDY_CHECKS},)
|
||||
MY_CMAKE_FLAGS += -DCLANG_TIDY_CHECKS:STRING=${CLANG_TIDY_CHECKS}
|
||||
endif
|
||||
ifneq (${CLANG_TIDY_ARGS},)
|
||||
MY_CMAKE_FLAGS += -DCLANG_TIDY_ARGS:STRING=${CLANG_TIDY_ARGS}
|
||||
endif
|
||||
ifneq (${CLANG_TIDY_FIX},)
|
||||
MY_CMAKE_FLAGS += -DCLANG_TIDY_FIX:BOOL=${CLANG_TIDY_FIX}
|
||||
MY_NINJA_FLAGS += -j 1
|
||||
# N.B. when fixing, you don't want parallel jobs!
|
||||
endif
|
||||
|
||||
ifneq (${CLANG_FORMAT_INCLUDES},)
|
||||
MY_CMAKE_FLAGS += -DCLANG_FORMAT_INCLUDES:STRING=${CLANG_FORMAT_INCLUDES}
|
||||
endif
|
||||
ifneq (${CLANG_FORMAT_EXCLUDES},)
|
||||
MY_CMAKE_FLAGS += -DCLANG_FORMAT_EXCLUDES:STRING=${CLANG_FORMAT_EXCLUDES}
|
||||
endif
|
||||
|
||||
ifneq (${BUILD_MISSING_DEPS},)
|
||||
MY_CMAKE_FLAGS += -DBUILD_MISSING_DEPS:BOOL=${BUILD_MISSING_DEPS}
|
||||
endif
|
||||
|
||||
ifneq (${USE_OPTIX},)
|
||||
MY_CMAKE_FLAGS += -DUSE_OPTIX:BOOL=${USE_OPTIX}
|
||||
endif
|
||||
|
||||
ifneq (${USE_PYTHON},)
|
||||
MY_CMAKE_FLAGS += -DUSE_PYTHON:BOOL=${USE_PYTHON}
|
||||
endif
|
||||
|
||||
ifneq (${PYTHON_VERSION},)
|
||||
MY_CMAKE_FLAGS += -DPYTHON_VERSION:STRING=${PYTHON_VERSION}
|
||||
endif
|
||||
|
||||
ifneq (${PYLIB_LIB_PREFIX},)
|
||||
MY_CMAKE_FLAGS += -DPYLIB_LIB_PREFIX:BOOL=${PYLIB_LIB_PREFIX}
|
||||
endif
|
||||
|
||||
ifneq (${PYLIB_INCLUDE_SONAME},)
|
||||
MY_CMAKE_FLAGS += -DPYLIB_INCLUDE_SONAME:BOOL=${PYLIB_INCLUDE_SONAME}
|
||||
endif
|
||||
|
||||
|
||||
#$(info MY_CMAKE_FLAGS = ${MY_CMAKE_FLAGS})
|
||||
#$(info MY_MAKE_FLAGS = ${MY_MAKE_FLAGS})
|
||||
|
||||
@@ -211,86 +261,78 @@ debug:
|
||||
profile:
|
||||
${MAKE} PROFILE=1 --no-print-directory
|
||||
|
||||
# 'make cmakesetup' constructs the build directory and runs 'cmake' there,
|
||||
# 'make config' constructs the build directory and runs 'cmake' there,
|
||||
# generating makefiles to build the project. For speed, it only does this when
|
||||
# ${build_dir}/Makefile doesn't already exist, in which case we rely on the
|
||||
# cmake generated makefiles to regenerate themselves when necessary.
|
||||
cmakesetup:
|
||||
config:
|
||||
@ (if [ ! -e ${build_dir}/${BUILDSENTINEL} ] ; then \
|
||||
${CMAKE} -E make_directory ${build_dir} ; \
|
||||
cd ${build_dir} ; \
|
||||
${CMAKE} -DCMAKE_INSTALL_PREFIX=${INSTALLDIR}/${dist_dir} \
|
||||
${MY_CMAKE_FLAGS} -DBOOST_ROOT=${BOOST_HOME} \
|
||||
../.. ; \
|
||||
${CMAKE} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} \
|
||||
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
|
||||
${MY_CMAKE_FLAGS} ../.. ; \
|
||||
fi)
|
||||
|
||||
ifeq (${USE_NINJA},1)
|
||||
|
||||
# 'make cmake' does a basic build (after first setting it up)
|
||||
cmake: cmakesetup
|
||||
@ ( cd ${build_dir} ; ${NINJA} ${MY_NINJA_FLAGS} )
|
||||
# 'make build' does a basic build (after first setting it up)
|
||||
build: config
|
||||
@ ( cd ${build_dir} ; \
|
||||
${CMAKE} --build . --config ${CMAKE_BUILD_TYPE} \
|
||||
)
|
||||
|
||||
# 'make cmakeinstall' builds everthing and installs it in 'dist'.
|
||||
# 'make install' builds everthing and installs it in 'dist'.
|
||||
# Suppress pointless output from docs installation.
|
||||
cmakeinstall: cmake
|
||||
@ ( cd ${build_dir} ; ${NINJA} ${MY_NINJA_FLAGS} install | grep -v '^-- \(Installing\|Up-to-date\|Set runtime path\)' )
|
||||
install: build
|
||||
@ ( cd ${build_dir} ; \
|
||||
${CMAKE} --build . --target install --config ${CMAKE_BUILD_TYPE} | grep -v '^-- \(Installing\|Up-to-date\|Set runtime path\)' \
|
||||
)
|
||||
|
||||
# 'make package' builds everything and then makes an installable package
|
||||
# (platform dependent -- may be .tar.gz, .sh, .dmg, .rpm, .deb. .exe)
|
||||
package: cmakeinstall
|
||||
@ ( cd ${build_dir} ; ${NINJA} ${MY_NINJA_FLAGS} package )
|
||||
package: install
|
||||
@ ( cd ${build_dir} ; \
|
||||
${CMAKE} --build . --target package --config ${CMAKE_BUILD_TYPE} \
|
||||
)
|
||||
|
||||
# 'make package_source' makes an installable source package
|
||||
# (platform dependent -- may be .tar.gz, .sh, .dmg, .rpm, .deb. .exe)
|
||||
package_source: cmakeinstall
|
||||
@ ( cd ${build_dir} ; ${NINJA} ${MY_NINJA_FLAGS} package_source )
|
||||
package_source: install
|
||||
@ ( cd ${build_dir} ; \
|
||||
${CMAKE} --build . --target package_source --config ${CMAKE_BUILD_TYPE} \
|
||||
)
|
||||
|
||||
else
|
||||
# 'make clang-format' runs clang-format on all source files (if it's installed)
|
||||
clang-format: config
|
||||
@ ( cd ${build_dir} ; \
|
||||
${CMAKE} --build . --target clang-format --config ${CMAKE_BUILD_TYPE} \
|
||||
)
|
||||
|
||||
# 'make cmake' does a basic build (after first setting it up)
|
||||
cmake: cmakesetup
|
||||
@ ( cd ${build_dir} ; ${MAKE} ${MY_MAKE_FLAGS} )
|
||||
|
||||
# 'make cmakeinstall' builds everthing and installs it in 'dist'.
|
||||
# Suppress pointless output from docs installation.
|
||||
cmakeinstall: cmake
|
||||
@ ( cd ${build_dir} ; ${MAKE} ${MY_MAKE_FLAGS} install | grep -v '^-- \(Installing\|Up-to-date\|Set runtime path\)' )
|
||||
|
||||
# 'make package' builds everything and then makes an installable package
|
||||
# (platform dependent -- may be .tar.gz, .sh, .dmg, .rpm, .deb. .exe)
|
||||
package: cmakeinstall
|
||||
@ ( cd ${build_dir} ; ${MAKE} ${MY_MAKE_FLAGS} package )
|
||||
|
||||
# 'make package_source' makes an installable source package
|
||||
# (platform dependent -- may be .tar.gz, .sh, .dmg, .rpm, .deb. .exe)
|
||||
package_source: cmakeinstall
|
||||
@ ( cd ${build_dir} ; ${MAKE} ${MY_MAKE_FLAGS} package_source )
|
||||
|
||||
endif
|
||||
|
||||
# 'make dist' is just a synonym for 'make cmakeinstall'
|
||||
dist : cmakeinstall
|
||||
# 'make dist' is just a synonym for 'make install'
|
||||
dist : install
|
||||
|
||||
TEST_FLAGS += --force-new-ctest-process --output-on-failure
|
||||
|
||||
# 'make test' does a full build and then runs all tests
|
||||
test: cmake
|
||||
test: build
|
||||
@ ${CMAKE} -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests ${TEST_FLAGS}..."
|
||||
@ # if [ "${CODECOV}" == "1" ] ; then lcov -b ${build_dir} -d ${build_dir} -z ; rm -rf ${build_dir}/cov ; fi
|
||||
@ ( cd ${build_dir} ; PYTHONPATH=${PWD}/${build_dir}/src/python ctest -E broken ${TEST_FLAGS} )
|
||||
@ ( if [ "${CODECOV}" == "1" ] ; then \
|
||||
@ ( cd ${build_dir} ; \
|
||||
OSL_ROOT_DIR=${INSTALL_PREFIX} \
|
||||
OSL_ROOT=${INSTALL_PREFIX} \
|
||||
LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH} \
|
||||
DYLD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:${DYLD_LIBRARY_PATH} \
|
||||
OIIO_LIBRARY_PATH=${INSTALL_PREFIX}/lib:${OIIO_LIBRARY_PATH} \
|
||||
PYTHONPATH=${working_dir}/${build_dir}/lib/python/site-packages:${PYTHONPATH} \
|
||||
ctest -E broken ${TEST_FLAGS} \
|
||||
)
|
||||
@ ( if [[ "${CODECOV}" == "1" ]] ; then \
|
||||
cd ${build_dir} ; \
|
||||
lcov -b . -d . -c -o cov.info ; \
|
||||
lcov --remove cov.info "/usr*" -o cov.info ; \
|
||||
genhtml -o ./cov -t "OSL test coverage" --num-spaces 4 cov.info ; \
|
||||
genhtml -o ./cov -t "Test coverage" --num-spaces 4 cov.info ; \
|
||||
fi )
|
||||
|
||||
# 'make testall' does a full build and then runs all tests (even the ones
|
||||
# that are expected to fail on some platforms)
|
||||
testall: cmake
|
||||
${CMAKE} -E cmake_echo_color --switch=$(COLOR) --cyan "Running all tests ${TEST_FLAGS}..."
|
||||
( cd ${build_dir} ; PYTHONPATH=${PWD}/${build_dir}/src/python ctest ${TEST_FLAGS} )
|
||||
|
||||
# 'make clean' clears out the build directory for this platform
|
||||
clean:
|
||||
${CMAKE} -E remove_directory ${build_dir}
|
||||
@@ -311,17 +353,18 @@ nuke:
|
||||
# 'make help' prints important make targets
|
||||
help:
|
||||
@echo "Targets:"
|
||||
@echo " make Build optimized binaries and libraries in ${dist_dir},"
|
||||
@echo " temporary build files in ${build_dir}"
|
||||
@echo " make debug Build unoptimized with symbols in ${dist_dir}.debug,"
|
||||
@echo " temporary build files in ${build_dir}.debug"
|
||||
@echo " make profile Build for profiling in ${dist_dir}.profile,"
|
||||
@echo " temporary build files in ${build_dir}.profile"
|
||||
@echo " make Build and install optimized binaries and libraries"
|
||||
@echo " make install Build and install optimized binaries and libraries"
|
||||
@echo " make build Build only (no install) optimized binaries and libraries"
|
||||
@echo " make config Just configure cmake, don't build"
|
||||
@echo " make debug Build and install unoptimized with symbols"
|
||||
@echo " make profile Build and install for profiling"
|
||||
@echo " make clean Remove the temporary files in ${build_dir}"
|
||||
@echo " make realclean Remove both ${build_dir} AND ${dist_dir}"
|
||||
@echo " make nuke Remove ALL of build and dist (not just ${platform})"
|
||||
@echo " make test Run tests"
|
||||
@echo " make testall Run all tests, even broken ones"
|
||||
@echo " make clang-format Run clang-format on all the source files"
|
||||
@echo ""
|
||||
@echo "Helpful modifiers:"
|
||||
@echo " C++ compiler and build process:"
|
||||
@@ -329,36 +372,45 @@ help:
|
||||
@echo " STOP_ON_WARNING=0 Do not stop building if compiler warns"
|
||||
@echo " OSL_SITE=xx Use custom site build mods"
|
||||
@echo " MYCC=xx MYCXX=yy Use custom compilers"
|
||||
@echo " USE_CPP11=0 Compile in C++11 mode (=0 means use CPP03!)"
|
||||
@echo " USE_CPP14=1 Compile in C++14 mode"
|
||||
@echo " USE_LIBCPLUSPLUS=1 Use clang libc++"
|
||||
@echo " CMAKE_CXX_STANDARD=14 Compile in C++14 mode (default is C++11)"
|
||||
@echo " USE_LIBCPLUSPLUS=1 For clang, use libc++"
|
||||
@echo " GLIBCXX_USE_CXX11_ABI=1 For gcc, use the new string ABI"
|
||||
@echo " EXTRA_CPP_ARGS= Additional args to the C++ command"
|
||||
@echo " USE_NINJA=1 Set up Ninja build (instead of make)"
|
||||
@echo " USE_CCACHE=0 Disable ccache (even if available)"
|
||||
@echo " CODECOV=1 Enable code coverage tests"
|
||||
@echo " SANITIZE=name1,... Enable sanitizers (address, leak, thread)"
|
||||
@echo " CLANG_TIDY=1 Run clang-tidy on all source (can be modified"
|
||||
@echo " by CLANG_TIDY_ARGS=... and CLANG_TIDY_FIX=1"
|
||||
@echo " CLANG_FORMAT_INCLUDES=... CLANG_FORMAT_EXCLUDES=..."
|
||||
@echo " Customize files for 'make clang-format'"
|
||||
@echo " Linking and libraries:"
|
||||
@echo " HIDE_SYMBOLS=1 Hide symbols not in the public API"
|
||||
@echo " BUILDSTATIC=1 Build static library instead of shared"
|
||||
@echo " BUILD_SHARED_LIBS=0 Build static library instead of shared"
|
||||
@echo " LINKSTATIC=1 Link with static external libs when possible"
|
||||
@echo " Dependency hints:"
|
||||
@echo " For each dependeny Foo, defining ENABLE_Foo=0 disables it, even"
|
||||
@echo " if found. And you can hint where to find it with Foo_ROOT=path"
|
||||
@echo " Note that it is case sensitive!"
|
||||
@echo " Finding and Using Dependencies:"
|
||||
@echo " BOOST_HOME=path Custom Boost installation"
|
||||
@echo " OPENEXR_HOME=path Custom OpenEXR installation"
|
||||
@echo " ILMBASE_HOME=path Custom Ilmbase installation"
|
||||
@echo " PARTIO_HOME= Use Partio from the given location"
|
||||
@echo " USE_EXTERNAL_PUGIXML=1 Use the system PugiXML, not the one in OIIO"
|
||||
@echo " BOOST_ROOT=path Custom Boost installation"
|
||||
@echo " USE_QT=0 Skip anything that needs Qt"
|
||||
@echo " LLVM-related options:"
|
||||
@echo " LLVM_VERSION=3.4 Specify which LLVM version to use"
|
||||
@echo " LLVM_VERSION=7.0 Specify which LLVM version to use"
|
||||
@echo " LLVM_DIRECTORY=xx Specify where LLVM lives"
|
||||
@echo " LLVM_NAMESPACE=xx Specify custom LLVM namespace"
|
||||
@echo " LLVM_STATIC=1 Use static LLVM libraries"
|
||||
@echo " USE_LLVM_BITCODE=0 Don't generate embedded LLVM bitcode"
|
||||
@echo " OSL build-time options:"
|
||||
@echo " NAMESPACE=name Wrap OSL APIs in another namespace"
|
||||
@echo " INSTALL_PREFIX=path Set installation prefix (default: ${INSTALL_PREFIX})"
|
||||
@echo " NAMESPACE=name Override namespace base name (default: OSL)"
|
||||
@echo " USE_FAST_MATH=1 Use faster, but less accurate math (set to 0 for libm defaults)"
|
||||
@echo " OSL_BUILD_TESTS=0 Skip building the unit tests, testshade, testrender"
|
||||
@echo " USE_SIMD=arch Build with SIMD support (choices: 0, sse2, sse3,"
|
||||
@echo " ssse3, sse4.1, sse4.2, f16c,"
|
||||
@echo " comma-separated ok)"
|
||||
@echo " OSL_BUILD_TESTS=0 Don't build unit tests, testshade, testrender"
|
||||
@echo " OSL_BUILD_SHADERS=0 Don't build any shaders"
|
||||
@echo " OSL_BUILD_MATERIALX=1 Build MaterialX shaders"
|
||||
@echo " USE_SIMD=arch Build with SIMD support (comma-separated choices:"
|
||||
@echo " 0, sse2, sse3, ssse3, sse4.1, sse4.2, f16c,"
|
||||
@echo " avx, avx2, avx512f)"
|
||||
@echo " USE_OPTIX=1 Build the OptiX test renderer"
|
||||
@echo " make test, extra options:"
|
||||
@echo " TEST=regex Run only tests matching the regex"
|
||||
@echo ""
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
README for Open Shading Language
|
||||
================================
|
||||
<div align="center">
|
||||
<img src="https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/src/doc/Figures/osl-short.png" width=256 height=128>
|
||||
|
||||
Build status:
|
||||
<H1>Open Shading Language</H1>
|
||||
</div>
|
||||
|
||||
[](https://travis-ci.org/imageworks/OpenShadingLanguage)
|
||||
[](https://www.youtube.com/watch?v=nmwMz1YnGPA "Open Shading Language Reel 2020")
|
||||
|
||||
Table of contents
|
||||
------------------
|
||||
[](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/actions)
|
||||
[](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/LICENSE.md)
|
||||
[](https://bestpractices.coreinfrastructure.org/projects/3061)
|
||||
|
||||
* [Introduction](#introduction)
|
||||
* [How OSL is different](#how-osl-is-different)
|
||||
* [What OSL consists of](#what-osl-consists-of)
|
||||
* [Building OSL](#building-osl)
|
||||
* [Current state of the project and road map](#current-state-of-the-project-and-road-map)
|
||||
* [Contacts](#contacts)
|
||||
* [Credits](#credits)
|
||||
|
||||
|
||||
Introduction
|
||||
@@ -26,27 +21,28 @@ Open Shading Language (OSL) is a small but rich language for
|
||||
programmable shading in advanced renderers and other applications, ideal
|
||||
for describing materials, lights, displacement, and pattern generation.
|
||||
|
||||
OSL was developed by Sony Pictures Imageworks for use in its in-house
|
||||
renderer used for feature film animation and visual effects. The
|
||||
language specification was developed with input by other visual effects
|
||||
and animation studios who also wish to use it.
|
||||
OSL was originally developed by Sony Pictures Imageworks for use in its in-
|
||||
house renderer used for feature film animation and visual effects, released
|
||||
as open source so it could be used by other visual effects and animation
|
||||
studios and rendering software vendors. Now it's the de facto standard
|
||||
shading language for VFX and animated features, used across the industry in
|
||||
many commercial and studio- proprietary renderers. Because of this, the work
|
||||
on OSL received an Academy Award for Technical Achievement in 2017.
|
||||
|
||||
OSL is robust and production-proven, and was the exclusive shading
|
||||
system for work on big VFX films such as "Men in Black 3", "The Amazing
|
||||
Spider-Man," "Oz the Great and Powerful," and "Edge of Tomorrow," as
|
||||
well as animated features such as "Hotel Transylvania" and "Cloudy With
|
||||
a Chance of Meatballs 2", and many other films completed or currently in
|
||||
production.
|
||||
OSL is robust and production-proven, and has been used in films as diverse
|
||||
as "The Amazing Spider-Man," "Hotel Transylvania," "Edge of Tomorrow", "Ant
|
||||
Man", "Finding Dory," and many more. OSL support is in most leading
|
||||
renderers used for high-end VFX and animation work. For a full list of films
|
||||
and products, see the [filmography](#where-osl-has-been-used).
|
||||
|
||||
The OSL code is distributed under the "New BSD" license (see the
|
||||
"LICENSE" file that comes with the distribution), and the documentation
|
||||
under the Creative Commons Attribution 3.0 Unported License
|
||||
(http://creativecommons.org/licenses/by/3.0/). In short, you are free
|
||||
to use OSL in your own applications, whether they are free or
|
||||
The OSL code is distributed under the
|
||||
["New/3-clause BSD" license](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/LICENSE.md),
|
||||
and the documentation under the [Creative Commons Attribution 4.0 International
|
||||
License](https://creativecommons.org/licenses/by/4.0/). In short, you are
|
||||
free to use OSL in your own applications, whether they are free or
|
||||
commercial, open or proprietary, as well as to modify the OSL code and
|
||||
documentation as you desire, provided that you retain the original
|
||||
copyright notices as described in the license.
|
||||
|
||||
documentation as you desire, provided that you retain the original copyright
|
||||
notices as described in the license.
|
||||
|
||||
|
||||
How OSL is different
|
||||
@@ -215,147 +211,300 @@ The OSL open source distribution consists of the following components:
|
||||
|
||||
|
||||
|
||||
Building OSL
|
||||
Where OSL has been used
|
||||
-----------------------
|
||||
|
||||
*This list only contains films or products whose OSL use is stated or can be
|
||||
inferred from public sources, or that we've been told is ok to list here. If
|
||||
an OSL-using project is missing and it's not a secret, just email the OSL
|
||||
project leader or submit a PR with edits to this file.*
|
||||
|
||||
Renderers and other tools with OSL support (in approximate order of
|
||||
adding OSL support):
|
||||
* Sony Pictures Imageworks: in-house "Arnold" renderer
|
||||
* [Blender/Cycles](https://docs.blender.org/manual/en/dev/render/shader_nodes/osl.html)
|
||||
* [Chaos Group: V-Ray](https://www.chaosgroup.com/)
|
||||
* [Pixar: PhotoRealistic RenderMan RIS](https://renderman.pixar.com)
|
||||
* [Isotropix: Clarisse](http://www.isotropix.com/clarisse)
|
||||
* [Isotropix: Angie](http://www.isotropix.com/angie)
|
||||
* [Autodesk Beast](http://www.autodesk.com/products/beast/overview)
|
||||
* [Appleseed](http://appleseedhq.net)
|
||||
* [Animal Logic: Glimpse renderer](https://www.fxguide.com/featured/a-glimpse-at-animal-logic/)
|
||||
* [Image Engine: Gaffer](http://www.gafferhq.org/) (for expressions and deformers)
|
||||
* [DNA Research: 3Delight](http://www.3delight.com/)
|
||||
* Ubisoft motion picture group's proprietary renderer
|
||||
* [Autodesk/SolidAngle: Arnold](https://www.solidangle.com/arnold/)
|
||||
* [Autodesk: 3DS Max 2019](https://help.autodesk.com/view/3DSMAX/2019/ENU/?guid=__developer_3ds_max_sdk_features_rendering_osl_html)
|
||||
|
||||
Films using OSL (grouped by year of release date):
|
||||
* **(2012)**
|
||||
Men in Black 3, The Amazing Spider-Man, Hotel Transylvania
|
||||
* **(2013)**
|
||||
Oz the Great and Powerful, Smurfs 2, Cloudy With a Chance of Meatballs 2
|
||||
* **(2014)**
|
||||
The Amazing Spider-Man 2, Blended, Edge of Tomorrow, 22 Jump Street,
|
||||
Guardians of the Galaxy, Fury,
|
||||
The Hunger Games: Mockingjay - Part 1, Exodus: Gods and Kings,
|
||||
The Interview
|
||||
* **(2015)**
|
||||
American Sniper,
|
||||
Insurgent,
|
||||
Avengers Age of Ultron,
|
||||
Ant Man,
|
||||
Pixels,
|
||||
Mission Impossible: Rogue Nation,
|
||||
Hotel Transylvania 2,
|
||||
Bridge of Spies,
|
||||
James Bond: Spectre,
|
||||
The Hunger Games: Mockingjay - Part 2,
|
||||
Concussion
|
||||
* **(2016)**
|
||||
Allegiant,
|
||||
Batman vs Superman: Dawn of Justice,
|
||||
The Huntsman,
|
||||
Angry Birds Movie,
|
||||
Alice Through the Looking Glass,
|
||||
Captain America: Civil War,
|
||||
Finding Dory,
|
||||
Piper,
|
||||
Independence Day: Resurgence,
|
||||
Ghostbusters,
|
||||
Star Trek Beyond,
|
||||
Suicide Squad,
|
||||
Kingsglaive: Final Fantasy XV,
|
||||
Storks,
|
||||
Miss Peregrine's Home for Peculiar Children,
|
||||
Fantastic Beasts and Where to Find Them,
|
||||
Assassin's Creed
|
||||
* **(2017)**
|
||||
Lego Batman,
|
||||
The Great Wall,
|
||||
A Cure for Wellness,
|
||||
Logan,
|
||||
Power Rangers,
|
||||
Life,
|
||||
Smurfs: The Lost Village,
|
||||
The Fate of the Furious,
|
||||
Alien Covenant,
|
||||
Guardians of the Galaxy 2,
|
||||
The Mummy,
|
||||
Wonder Woman,
|
||||
Cars 3,
|
||||
Baby Driver,
|
||||
Spider-Man: Homecoming,
|
||||
Dunkirk,
|
||||
The Emoji Movie,
|
||||
Detroit,
|
||||
Kingsman: The Golden Circle,
|
||||
Lego Ninjago Movie,
|
||||
Blade Runner 2049,
|
||||
Geostorm,
|
||||
Coco,
|
||||
Justice League,
|
||||
Thor: Ragnarok
|
||||
* **(2018)**
|
||||
Peter Rabbit,
|
||||
Black Panther,
|
||||
Annnihilation,
|
||||
Red Sparrow,
|
||||
Pacific Rim Uprising,
|
||||
Avengers Infinity War,
|
||||
Deadpool 2,
|
||||
Incredibles 2,
|
||||
Jurassic World: Fallen Kingdom,
|
||||
Hotel Transylvania 3: Summer Vacation,
|
||||
Ant Man and the Wasp,
|
||||
Skyscraper,
|
||||
Mission Impossible: Fallout,
|
||||
The Meg,
|
||||
Kin,
|
||||
Smallfoot,
|
||||
Alpha,
|
||||
Venom,
|
||||
First Man,
|
||||
Bad Times at the El Royale,
|
||||
Fantastic Beasts: The Crimes of Grindelwald,
|
||||
Bohemian Rhapsody,
|
||||
Holmes and Watson,
|
||||
Spider-Man: Into the Spider-Verse
|
||||
* **(2019)**
|
||||
The Kid Who Would Be King,
|
||||
Alita: Battle Angel,
|
||||
Lego Movie 2,
|
||||
Lucky 13 (Love, Death, and Robots),
|
||||
Captain Marvel,
|
||||
Triple Frontier,
|
||||
Avengers: Endgame,
|
||||
Pokémon Detective Pikachu,
|
||||
Godzilla: King of Monsters,
|
||||
Rim of the World,
|
||||
John Wick 3 Parabellum,
|
||||
Men in Black International,
|
||||
Toy Story 4,
|
||||
Spider-Man: Far From Home,
|
||||
Hobbs & Shaw,
|
||||
Angry Birds 2,
|
||||
The Art of Racing in the Rain,
|
||||
Secret Life of Pets,
|
||||
The Mandalorian (S1),
|
||||
The Dark Crystal: Age of Resistance,
|
||||
The King,
|
||||
Jumanji: The Next Level,
|
||||
Richard Jewell,
|
||||
Game of Thrones (S8),
|
||||
Lost in Space (S1),
|
||||
Togo
|
||||
* **(2020)**
|
||||
Underwater,
|
||||
Birds of Prey,
|
||||
Onward,
|
||||
Bloodshot,
|
||||
Greyhound,
|
||||
The Old Guard,
|
||||
Mulan,
|
||||
Tenet,
|
||||
The New Mutants,
|
||||
Artemis Fowl,
|
||||
The Eight Hundred,
|
||||
Over the Moon,
|
||||
Wonder Woman 1984,
|
||||
Soul,
|
||||
The Mandalorian (S2)
|
||||
* **(2021)**
|
||||
Chaos Walking,
|
||||
Peter Rabbit 2: The Runaway,
|
||||
The Falcon and the Winder Soldier,
|
||||
Secret Magic Control Agency,
|
||||
Zack Snyder's Justice League,
|
||||
The Mitchells vs the Machines,
|
||||
Jupiter's Legacy,
|
||||
Luca,
|
||||
F9,
|
||||
Vivo,
|
||||
Jungle Cruise,
|
||||
Dune,
|
||||
No Time To Die,
|
||||
Ron's Gone Wrong,
|
||||
Venom: Let There Be Carnage,
|
||||
Last Night in Soho,
|
||||
Ghostbusters: Afterlife,
|
||||
Spider-Man 3: No Way Home,
|
||||
Matrix Resurrections
|
||||
* **(2022 / upcoming)**
|
||||
Hotel Transylvania 4: Transformania,
|
||||
...
|
||||
|
||||
|
||||
Building and Installation
|
||||
-------------------------
|
||||
|
||||
Please read the [INSTALL.md](INSTALL.md) file for detailed instructions on
|
||||
how to build and install OSL.
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
The OSL language specification can be found at
|
||||
[src/doc/osl-languagespec.pdf](src/doc/osl-languagespec.pdf) (in a source
|
||||
distribution) or in the share/doc/OSL/osl-languagespec.pdf file of an
|
||||
installed binary distribution.
|
||||
|
||||
|
||||
Contact & reporting problems
|
||||
----------------------------
|
||||
|
||||
Simple "how do I...", "I'm having trouble", or "is this a bug" questions are
|
||||
best asked on the [osl-dev developer mail
|
||||
list](https://lists.aswf.io/g/osl-dev).
|
||||
That's where the most people will see it and potentially be able to answer
|
||||
your question quickly (more so than a GH "issue").
|
||||
|
||||
Bugs, build problems, and discovered vulnerabilities that you are relatively
|
||||
certain is a legit problem in the code, and for which you can give clear
|
||||
instructions for how to reproduce, should be [reported as
|
||||
issues](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues).
|
||||
|
||||
If confidentiality precludes a public question or issue, you may contact the
|
||||
project administrator privately at [lg@imageworks.com](lg@imageworks.com),
|
||||
including for security-related issues.
|
||||
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
Please see the "INSTALL" file in the OSL distribution for instructions
|
||||
for building the OSL source code.
|
||||
OSL welcomes code contributions, and nearly 50 people have done so over the
|
||||
years. We take code contributions via the usual GitHub pull request (PR)
|
||||
mechanism. Please see [CONTRIBUTING](CONTRIBUTING.md) for detailed
|
||||
instructions.
|
||||
|
||||
|
||||
Contacts, Links, and References
|
||||
-------------------------------
|
||||
|
||||
Current state of the project and road map
|
||||
-----------------------------------------
|
||||
[OSL GitHub page](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage)
|
||||
|
||||
At Sony Pictures Imageworks, we are exclusively using OSL in our
|
||||
proprietary renderer, "Arnold." Completed productions that used OSL for
|
||||
shading have included:
|
||||
[Read or subscribe to the OSL development mail list](https://lists.aswf.io/g/osl-dev)
|
||||
|
||||
Men in Black 3
|
||||
The Amazing Spider-Man
|
||||
Hotel Transylvania
|
||||
Oz the Great and Powerful
|
||||
Smurfs 2
|
||||
Cloudy With a Chance of Meatballs 2
|
||||
Amazing Spider-Man 2
|
||||
Edge of Tomorrow
|
||||
Blended
|
||||
22 Jump Street
|
||||
Guardians of the Galaxy
|
||||
The Interview
|
||||
Fury
|
||||
American Sniper
|
||||
Pixels
|
||||
Hotel Transylvania 2
|
||||
Concussion
|
||||
Alice in Wonderland: Through the Looking Glass
|
||||
|
||||
And more are currently in production. Our shader-writing team works
|
||||
entirely in OSL, all productions use OSL, and we've even removed all the
|
||||
code from the renderer that allows people to write the old-style "C"
|
||||
shaders. At the time we removed the old shader facility, the OSL
|
||||
shaders were consistently outperforming their equivalent old compiled C
|
||||
shaders in the old system.
|
||||
|
||||
In the longer term, there are a number of projects we hope to get to
|
||||
leading to a 2.x or 3.x cut of the language and library. Among our
|
||||
long-term goals:
|
||||
|
||||
* More documentation, in particular the "Integration Guide" that
|
||||
documents all the public APIs of the OSL libraries that you use when
|
||||
integrating into a renderer. Currently, the source code to
|
||||
"testrender" is the best/only example of how to integrate OSL into a
|
||||
renderer.
|
||||
|
||||
* Our set of sample shaders is quite anemic. We will eventually have a
|
||||
more extensive set of useful, production-quality shaders and utility
|
||||
functions you can call from your shaders.
|
||||
|
||||
* Currently "closure primitives" are implemented in C++ in the OSL
|
||||
library or in the renderer, but we would like a future spec of the
|
||||
language to allow new closure primitives to be implemented in OSL
|
||||
itself.
|
||||
|
||||
* Similarly, integrators are now implemented in the renderer, but we
|
||||
want a future OSL release to allow new integrators to be implemented
|
||||
in OSL itself.
|
||||
|
||||
* We would like to implement alternate "back ends" that would allow
|
||||
translation of OSL shaders (and shader networks) into code that can
|
||||
run on GPUs or other exotic hardware (at least for the biggest subset
|
||||
of OSL that can be expressed on such hardware). This would, for
|
||||
example, allow you to view close approximations to your OSL shaders in
|
||||
realtime preview windows in a modeling system or lighting tool.
|
||||
|
||||
We (the renderer development team at Sony Pictures Imageworks) probably
|
||||
can't do these all right away (in fact, probably can't do ALL of them in
|
||||
any time range). But we hope that as an open source project, other
|
||||
users and developers will step up to help us explore more future
|
||||
development avenues for OSL than we would be able to do alone.
|
||||
|
||||
|
||||
|
||||
Contacts
|
||||
--------
|
||||
|
||||
[OSL GitHub page](https://github.com/imageworks/OpenShadingLanguage)
|
||||
|
||||
[Read or subscribe to the OSL development mail list](http://groups.google.com/group/osl-dev)
|
||||
|
||||
Email the lead architect: lg AT imageworks DOT com
|
||||
|
||||
[Most recent PDF of the OSL language specification](https://github.com/imageworks/OpenShadingLanguage/blob/master/src/doc/osl-languagespec.pdf
|
||||
[Most recent PDF of the OSL language specification](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/src/doc/osl-languagespec.pdf
|
||||
)
|
||||
|
||||
[OSL home page at SPI](http://opensource.imageworks.com/?p=osl)
|
||||
[OSL home page](http://openshadinglanguage.org)
|
||||
|
||||
[Sony Pictures Imageworks main open source page](http://opensource.imageworks.com)
|
||||
|
||||
If you want to contribute code back to the project, you'll need to
|
||||
sign [a Contributor License Agreement](http://opensource.imageworks.com/cla/).
|
||||
|
||||
|
||||
Credits
|
||||
-------
|
||||
|
||||
The original designer and open source administrator of OSL is Larry Gritz.
|
||||
The current project leadership is documented in the
|
||||
[Governance](GOVERNANCE.md) file.
|
||||
|
||||
The main/early developers of OSL are (in order of joining the project):
|
||||
Larry Gritz, Cliff Stein, Chris Kulla, Alejandro Conty, Jay Reynolds,
|
||||
Solomon Boulos, Adam Martinez, Brecht Van Lommel.
|
||||
|
||||
Additionally, many others have contributed features, bug fixes, and other
|
||||
small changes: Steve Agland, Shane Ambler, Martijn Berger, Nicholas Bishop,
|
||||
Matthaus G. Chajdas, Thomas Dinges, Henri Fousse, Syoyo Fujita, Derek Haase,
|
||||
Sven-Hendrik Haase, John Haddon, Daniel Heckenberg, Ronan Keryell, Max
|
||||
Liani, Bastien Montagne, Erich Ocean, Mikko Ohtamaa, Alex Schworer, Sergey
|
||||
Sharybin, Stephan Steinbach, Esteban Tovagliari, Alexander von Knorring.
|
||||
(Listed alphabetically; if we've left anybody out, please let us know.)
|
||||
Many people have contributed features, bug fixes, and other changes to OSL
|
||||
over the years: Steve Agland, Shane Ambler, Martijn Berger, Farchad
|
||||
Bidgolirad, Nicholas Bishop, Solomon Boulos, Stefan Bruens, Stefan Büttner,
|
||||
Matthaus G. Chajdas, Clark Chen, Alejandro Conty, Thomas Dinges, Mads
|
||||
Drøschler, Luke Emrose, Louis Feng, Mark Final, Henri Fousse, Syoyo Fujita,
|
||||
Tim Grant, Larry Gritz, Nicolas Guiard, Euan Haahr, Derek Haase, Sven-Hendrik
|
||||
Haase, John Haddon, Niklas Harrysson, Daniel Heckenberg, Thiago Ize, Matt
|
||||
Johnson, Ronan Keryell, Chris Kulla, Elvic Liang, Max Liani, Adam Martinez,
|
||||
John Mertic, Bastien Montagne, Steena Monteiro, Alexis Oblet, Erich Ocean,
|
||||
Mikko Ohtamaa, Jino Park, Alexei Pawlow, Jay Reynolds, Benoit Ruiz, Declan
|
||||
Russell, Patrick Scheibe, Alex Schworer, Jonathan Scruggs, Sergey Sharybin,
|
||||
Sandip Shukla, Cliff Stein, Stephan Steinbach, Luya Tshimbalanga, Esteban
|
||||
Tovagliari, Brecht Van Lommel, Alexander von Knorring, Alex Wells, Roman
|
||||
Zulak. (Listed alphabetically; if we've left anybody out, it is inadvertent,
|
||||
please let us know.)
|
||||
|
||||
We cannot possibly express sufficient gratitude to the managers at Sony
|
||||
Pictures Imageworks who allowed this project to proceed, supported it
|
||||
wholeheartedly, and permitted us to release the source, especially Rob
|
||||
Bredow, Brian Keeney, Barbara Ford, Rene Limberger, and Erik Strauss.
|
||||
Bredow, Brian Keeney, Barbara Ford, Rene Limberger, Erik Strauss, and Mike
|
||||
Ford.
|
||||
|
||||
Huge thanks also go to the crack shading team at SPI, and the brave
|
||||
lookdev TDs and CG supes willing to use OSL on their shows. They served
|
||||
as our guinea pigs, inspiration, testers, and a fantastic source of
|
||||
feedback. Thank you, and we hope we've been responsive to your needs.
|
||||
Huge thanks also go to the crack shading team at SPI, and the brave lookdev
|
||||
TDs and CG supes willing to use OSL on their shows. They served as our
|
||||
guinea pigs, inspiration, testers, and a fantastic source of feedback. And
|
||||
of course, the many engineers, TDs, and artists elsewhere who incorporated
|
||||
OSL into their products and pipelines, especially the early risk-takers at
|
||||
Chaos Group, Double Negative, Pixar, DNA, Isotropix, and Animal Logic. Thank
|
||||
you, and we hope we've been responsive to your needs.
|
||||
|
||||
OSL was not developed in isolation. We owe a debt to the individuals
|
||||
and studios who patiently read early drafts of the language
|
||||
specification and gave us very helpful feedback and additional ideas.
|
||||
(I hope to mention them by name after we get permission of the people
|
||||
and studios involved.)
|
||||
specification and gave us very helpful feedback and additional ideas,
|
||||
as well as to the continuing contributions and feedback of its current
|
||||
developers and users at other VFX and animation studios.
|
||||
|
||||
The OSL implementation incorporates or depends upon several other open
|
||||
source packages:
|
||||
|
||||
[OpenImageIO (c) Larry Gritz, et al](http://www.openimageio.org)
|
||||
|
||||
[Boost - various authors](http://www.boost.org)
|
||||
|
||||
[IlmBase (c) Industrial Light & Magic](http://www.openexr.com)
|
||||
|
||||
[LLVM Compiler Infrastructure](http://llvm.org)
|
||||
The OSL implementation depends upon several other open source packages,
|
||||
all with compatible licenses:
|
||||
|
||||
* [OpenImageIO](http://www.openimageio.org)
|
||||
* [Boost](http://www.boost.org)
|
||||
* [IlmBase](http://www.openexr.com)
|
||||
* [LLVM Compiler Infrastructure](http://llvm.org)
|
||||
|
||||
OSL's documentation incorporates parts of [Markdeep](https://casual-effects.com/markdeep/)
|
||||
(c) 2015-2016, Morgan McGuire, and [highlight.js](https://highlightjs.org/)
|
||||
(c) 2006, Ivan Sagalaev, both distributed under BSD licenses.
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
See [LICENSE.md](LICENSE.md) for the main open source license of original
|
||||
code written for the Open Shading Language project.
|
||||
|
||||
The remainder of this file reproduces the open source licensing details
|
||||
of other projects that have been imported, incorporated into, or derived
|
||||
into parts of OSL.
|
||||
|
||||
In no particular order:
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
BSD 3-Clause License
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
* OpenImageIO Copyright (c) Larry Gritz, et al.
|
||||
https://github.com/OpenImageIO/oiio
|
||||
|
||||
Many bits of code flow back and forth between OIIO and OSL, especially
|
||||
parts of the CMake build system.
|
||||
|
||||
* OpenEXR, Copyright (c) Contributors to the OpenEXR Project.
|
||||
https://github.com/AcademySoftwareFoundation/OpenEXR
|
||||
|
||||
OSL replicates and modifies several files from the "Imath" portion of
|
||||
OpenEXR. These are all found in src/include/OSL/Imathx.
|
||||
|
||||
* Qt, Copyright (c) The Qt Company Ltd.
|
||||
http://doc.qt.io/
|
||||
|
||||
Some widget code in src/osltoy is copied and/or derived from example code
|
||||
for Qt.
|
||||
|
||||
* Highlight.js
|
||||
https://github.com/highlightjs/highlight.js/
|
||||
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
|
||||
SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
* Markdeep
|
||||
https://casual-effects.com/markdeep
|
||||
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Public domain
|
||||
|
||||
* The simplex noise implementation is Copyright (c) Stefan Gustavson.
|
||||
It bears the following notice:
|
||||
|
||||
This library is public domain software, released by the author
|
||||
into the public domain in February 2011. You may do anything
|
||||
you like with it. You may even remove all attributions,
|
||||
but of course I'd appreciate it if you kept my name somewhere.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
If we have left anything out, it is unintentional. Please let us know.
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# Pixar-specific settings
|
||||
|
||||
ifneq (${VERBOSE},)
|
||||
$(info Including pixar/Makefile-bits)
|
||||
endif
|
||||
|
||||
MY_CMAKE_FLAGS += -DUSE_fPIC:BOOL=1
|
||||
MY_CMAKE_FLAGS += -DENABLERTTI:BOOL=1
|
||||
MY_CMAKE_FLAGS += -DSTOP_ON_WARNING:BOOL=0
|
||||
MY_CMAKE_FLAGS += -DHIDE_SYMBOLS:BOOL=1
|
||||
MY_CMAKE_FLAGS += -DBUILDSTATIC:BOOL=1
|
||||
MY_CMAKE_FLAGS += -DLINKSTATIC:BOOL=1
|
||||
MY_CMAKE_FLAGS += -DUSE_FAST_MATH:BOOL=1
|
||||
MY_CMAKE_FLAGS += -DOPENEXR_CUSTOM_LIB_DIR:STRING=${ILMBASE_HOME}/lib/linux-ix86-64/gcc4.1
|
||||
MY_CMAKE_FLAGS += -DOPENEXR_CUSTOM_LIB_SUFFIX:STRING="-fPIC"
|
||||
|
||||
# Don't build testshade or testrender (mostly because they require the
|
||||
# image-handling parts of OIIO, which Pixar doesn't build)
|
||||
MY_CMAKE_FLAGS += -DOSL_BUILD_TESTS:BOOL=0
|
||||
|
||||
# Don't let OSL create a default OIIO::TextureSystem. If the renderer
|
||||
# doesn't pass in whatever proxy it wants, it will assert.
|
||||
MY_CMAKE_FLAGS += -DOSL_NO_DEFAULT_TEXTURESYSTEM:BOOL=1
|
||||
|
||||
ifneq (${VERBOSE},)
|
||||
$(info MY_CMAKE_FLAGS: $(MY_CMAKE_FLAGS))
|
||||
endif
|
||||
@@ -1,204 +1,516 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# SPI-specific settings
|
||||
|
||||
OSL_NAMESPACE ?= 'OSL_Arnold'
|
||||
OPENIMAGEIO_NAMESPACE ?= 'OpenImageIO_Arnold'
|
||||
|
||||
MY_CMAKE_FLAGS += -DEXTRA_CPP_ARGS="-DOSL_SPI=1"
|
||||
|
||||
## Generic OSX machines (including LG's laptop)
|
||||
ifeq (${platform}, macosx)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_BUILD_WITH_INSTALL_RPATH=1 \
|
||||
-DCMAKE_INSTALL_NAME_DIR="${working_dir}/dist/${platform}${variant}/lib"
|
||||
ifeq (${COMPILER}, clang)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=clang \
|
||||
-DCMAKE_CXX_COMPILER=clang++
|
||||
endif
|
||||
# All our Mac laptops seem to be at least SSE 4.2
|
||||
USE_SIMD = sse4.2
|
||||
ifneq (${VERBOSE},)
|
||||
$(info Including spi/Makefile-bits)
|
||||
endif
|
||||
|
||||
# For SpComp2 builds, do:
|
||||
#
|
||||
# make OSL_SPCOMP2=1 spcomp2_install
|
||||
# or
|
||||
# make OSL_SPCOMP2=1 SPCOMP2_LOCAL_PATH=/test/path spcomp2_install_local
|
||||
#
|
||||
# For Arnold builds, do:
|
||||
#
|
||||
# make OSL_ARNOLD=1
|
||||
#
|
||||
# For a Rez-bound build, do:
|
||||
#
|
||||
# make OSL_SPIREZ=1
|
||||
#
|
||||
# (Options: OSL_REZ_NAME=blah REZ_PACKAGE_ROOT=path)
|
||||
#
|
||||
# Otherwise a default 'make' will make a fully generic OSL build.
|
||||
|
||||
## Spinux (current)
|
||||
ifeq ($(SP_OS), spinux1)
|
||||
platform=spinux1
|
||||
USE_CPP11 ?= 0
|
||||
USE_NINJA := 1
|
||||
NINJA := /net/soft_scratch/apps/arnold/tools/spinux1/bin/ninja
|
||||
CMAKE := /net/soft_scratch/apps/arnold/tools/spinux1/bin/cmake
|
||||
MY_CMAKE_FLAGS += -DCMAKE_MAKE_PROGRAM=${NINJA}
|
||||
OSL_SPCOMP2 ?= 0
|
||||
OSL_ARNOLD ?= 0
|
||||
OSL_SPIREZ ?= 0
|
||||
OSL_REZ_NAME ?= OSL
|
||||
OSL_VERS = $(shell grep "OSL VERSION" CMakeLists.txt | egrep -o "[0-9.]+")
|
||||
ONEVERS = $(shell site/spi/format_version.py ${OSL_VERS})
|
||||
OSL_SPCOMP2_VERSION ?= ${ONEVERS}
|
||||
|
||||
## If not overridden, here is our preferred LLVM installation
|
||||
## (may be changed as new versions are rolled out to the facility)
|
||||
ifeq (${LLVM_DIRECTORY},)
|
||||
LLVM_DIRECTORY := /shots/spi/home/lib/arnold/spinux1/llvm_3.4.2
|
||||
endif
|
||||
ifeq (${OSL_SPCOMP2},1)
|
||||
$(info Building for SpComp2)
|
||||
OSL_ARNOLD := 0
|
||||
NAMESPACE ?= 'OSL_SpComp2'
|
||||
SOVERSION ?= ${OSL_SPCOMP2_VERSION}
|
||||
PYLIB_LIB_PREFIX ?= 1
|
||||
PYLIB_INCLUDE_SONAME ?= 1
|
||||
OPENIMAGEIO_SPCOMP2_VERSION ?= 20103
|
||||
OPENEXR_VERSION ?= 2.2.0
|
||||
else ifeq (${OSL_ARNOLD},1)
|
||||
$(info Building for Arnold)
|
||||
NAMESPACE ?= 'OSL_Arnold'
|
||||
PYLIB_LIB_PREFIX ?= 0
|
||||
PYLIB_INCLUDE_SONAME ?= 0
|
||||
OPENEXR_VERSION ?= 2.4.0
|
||||
else ifeq (${OSL_SPIREZ},1)
|
||||
$(info Building for Rez distribution)
|
||||
NAMESPACE ?= 'OSL'
|
||||
PYLIB_LIB_PREFIX ?= 0
|
||||
PYLIB_INCLUDE_SONAME ?= 0
|
||||
MY_CMAKE_FLAGS += -DOSL_SPIREZ=1 -DOSL_REZ_PACKAGE_NAME=${OSL_REZ_NAME}
|
||||
MY_CMAKE_FLAGS += -DCMAKE_DEBUG_POSTFIX=_d
|
||||
OPENIMAGEIO_VERSION ?= 2.2.0.0
|
||||
OPENEXR_VERSION ?= 2.4.0
|
||||
$(info Building against OpenImageIO ${OPENIMAGEIO_VERSION})
|
||||
else
|
||||
$(info Building generic OSL)
|
||||
NAMESPACE ?= 'OSL'
|
||||
PYLIB_LIB_PREFIX ?= 0
|
||||
PYLIB_INCLUDE_SONAME ?= 0
|
||||
endif
|
||||
#$(info MAKECMDGOALS = $(MAKECMDGOALS))
|
||||
|
||||
# default compiler is clang, taken from the LLVM directory
|
||||
ifeq (${COMPILER},)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
endif
|
||||
|
||||
# requesting 'clang' or 'gcc' (no version) means the first clang or
|
||||
# gcc in your path
|
||||
ifeq (${COMPILER},clang)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
||||
endif
|
||||
ifeq (${COMPILER},gcc)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
|
||||
## Detect which SPI platform and set $platform, $COMPILER, $SPCOMP2_COMPILER,
|
||||
## and PYTHON_VERSION. Lots of other decisions are based on these.
|
||||
ifeq (${SP_OS}, rhel7)
|
||||
# Rhel7 (current)
|
||||
platform := rhel7
|
||||
SPI_COMPILER_PLATFORM ?= gcc-6.3
|
||||
ifeq (${SPI_COMPILER_PLATFORM},gcc-4.8)
|
||||
SPCOMP2_COMPILER ?= gcc48m64
|
||||
CMAKE_CXX_STANDARD ?= 11
|
||||
else
|
||||
SPCOMP2_COMPILER ?= gcc63
|
||||
CMAKE_CXX_STANDARD ?= 14
|
||||
endif
|
||||
SP_PLATFORM ?= linux
|
||||
SP_PROC ?= x86_64
|
||||
SP_REZ_OS ?= CentOS-7
|
||||
else ifeq (${platform}, macosx)
|
||||
# Generic OSX machines (including LG's laptop)
|
||||
COMPILER ?= clang
|
||||
SPCOMP2_COMPILER ?= clang
|
||||
SP_OS ?= macosx
|
||||
SP_PLATFORM ?= macosx
|
||||
SP_PROC ?= x86_64
|
||||
SP_REZ_OS ?= MacOS
|
||||
else
|
||||
$(error Unknown SP_OS=${SP_OS} platform=${platform})
|
||||
endif # endif ${SP_OS}
|
||||
|
||||
# A variety of tags can be used to try specific versions of gcc or
|
||||
# clang from the site-specific places we have installed them.
|
||||
ifeq (${COMPILER}, clang341)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/shots/spi/home/lib/arnold/spinux1/llvm_3.4.1/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=/shots/spi/home/lib/arnold/spinux1/llvm_3.4.1/bin/clang++
|
||||
endif
|
||||
ifeq (${COMPILER}, clang342)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/shots/spi/home/lib/arnold/spinux1/llvm_3.4.2/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=/shots/spi/home/lib/arnold/spinux1/llvm_3.4.2/bin/clang++
|
||||
endif
|
||||
ifeq (${COMPILER}, gcc463)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/net/soft_scratch/apps/arnold/tools/gcc-4.6.3-test/bin/gcc \
|
||||
-DCMAKE_CXX_COMPILER=/net/soft_scratch/apps/arnold/tools/gcc-4.6.3-test/bin/g++
|
||||
endif
|
||||
ifeq (${COMPILER}, gcc470)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/net/soft_scratch/apps/arnold/tools/gcc-4.7.0-test/bin/gcc \
|
||||
-DCMAKE_CXX_COMPILER=/net/soft_scratch/apps/arnold/tools/gcc-4.7.0-test/bin/g++
|
||||
endif
|
||||
ifeq (${COMPILER}, gcc472)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/net/soft_scratch/apps/arnold/tools/gcc-4.7.2-test/bin/gcc \
|
||||
-DCMAKE_CXX_COMPILER=/net/soft_scratch/apps/arnold/tools/gcc-4.7.2-test/bin/g++
|
||||
endif
|
||||
ifeq (${COMPILER}, gcc490)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/net/soft_scratch/apps/arnold/tools/gcc-4.9-20130512-test/bin/gcc \
|
||||
-DCMAKE_CXX_COMPILER=/net/soft_scratch/apps/arnold/tools/gcc-4.9-20130512-test/bin/g++
|
||||
endif
|
||||
MY_CMAKE_FLAGS += -DSP_OS=${SP_OS} -DSP_PLATFORM=${SP_PLATFORM}
|
||||
MY_CMAKE_FLAGS += -DSP_PROC=${SP_PROC} -DSP_REZ_OS=${SP_REZ_OS}
|
||||
MY_CMAKE_FLAGS += -DSPI_COMPILER_PLATFORM=${SPI_COMPILER_PLATFORM}
|
||||
MY_CMAKE_FLAGS += -DEXTRA_CPP_ARGS:STRING="-DOSL_SPI=1" -DOSL_SITE:STRING=spi
|
||||
MY_CMAKE_FLAGS += -DSPI_TESTS=1
|
||||
MY_CMAKE_FLAGS += -DOSL_NAMESPACE_INCLUDE_PATCH=1
|
||||
REZ_PACKAGE_ROOT ?= /shots/spi/home/software/packages
|
||||
SPCOMP2_ROOT ?= /shots/spi/home/lib/SpComp2
|
||||
|
||||
# Our minimal architecture for workstations and farm supports SSE 4.1
|
||||
USE_SIMD = sse4.1
|
||||
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DOPENEXR_CUSTOM_INCLUDE_DIR=/usr/include/OpenEXR2 \
|
||||
-DOPENEXR_CUSTOM_LIB_DIR=/usr/lib64/OpenEXR2 \
|
||||
-DEXTRA_OSLEXEC_LIBRARIES="/usr/lib64/libpthread.so" \
|
||||
-DEXTRA_OSLEXEC_LIBRARIES="/usr/lib64/libcurses.so" \
|
||||
-DLLVM_CUSTOM=1 \
|
||||
-DLLVM_STATIC=1 \
|
||||
-DLLVM_VERSION=${LLVM_VERSION} \
|
||||
-DLLVM_DIRECTORY=${LLVM_DIRECTORY}
|
||||
|
||||
ifneq (${SPCOMP2_USE_BOOSTVERS}, 1)
|
||||
BOOSTVERS=1.51
|
||||
endif
|
||||
BOOSTVERS_SUFFIX = -${shell echo ${BOOSTVERS} | sed "s/\\./_/"}
|
||||
CONSTRUCTED_BOOSTVERS = ${shell echo ${BOOSTVERS} | sed "s/\\./0/"}00
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DBOOST_CUSTOM=1 \
|
||||
-DBoost_VERSION=${CONSTRUCTED_BOOSTVERS} \
|
||||
-DBoost_INCLUDE_DIRS=/usr/include/boost_${BOOSTVERS} \
|
||||
-DBoost_LIBRARY_DIRS=/usr/lib64/boost_${BOOSTVERS} \
|
||||
-DBoost_LIBRARIES:STRING="/usr/lib64/boost_${BOOSTVERS}/libboost_filesystem-gcc44-mt${BOOSTVERS_SUFFIX}.so;/usr/lib64/boost_${BOOSTVERS}/libboost_filesystem-gcc44-mt${BOOSTVERS_SUFFIX}.so;/usr/lib64/boost_${BOOSTVERS}/libboost_regex-gcc44-mt${BOOSTVERS_SUFFIX}.so;/usr/lib64/boost_${BOOSTVERS}/libboost_system-gcc44-mt${BOOSTVERS_SUFFIX}.so;/usr/lib64/boost_${BOOSTVERS}/libboost_thread-gcc44-mt${BOOSTVERS_SUFFIX}.so;/usr/lib64/boost_${BOOSTVERS}/libboost_wave-gcc44-mt${BOOSTVERS_SUFFIX}.so"
|
||||
|
||||
endif # endif spinux1
|
||||
|
||||
## Rhel7 (current)
|
||||
ifeq ($(SP_OS), rhel7)
|
||||
platform=rhel7
|
||||
USE_CPP11 ?= 1
|
||||
USE_NINJA := 1
|
||||
NINJA := /net/soft_scratch/apps/arnold/tools/spinux1/bin/ninja
|
||||
CMAKE := /net/soft_scratch/apps/arnold/tools/spinux1/bin/cmake
|
||||
MY_CMAKE_FLAGS += -DCMAKE_MAKE_PROGRAM=${NINJA}
|
||||
|
||||
## If not overridden, here is our preferred LLVM installation
|
||||
## (may be changed as new versions are rolled out to the facility)
|
||||
ifeq (${LLVM_DIRECTORY},)
|
||||
LLVM_DIRECTORY := /shots/spi/home/lib/arnold/spinux1/llvm_3.4.2
|
||||
ifeq (${SP_OS}, rhel7)
|
||||
PYTHON_VERSION ?= 2.7
|
||||
USE_SIMD ?= sse4.1,aes
|
||||
CMAKE ?= cmake
|
||||
USE_NINJA ?= 1
|
||||
NINJA ?= ninja
|
||||
ifeq ($(USE_NINJA),1)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_MAKE_PROGRAM=${NINJA}
|
||||
endif
|
||||
export CCACHE_CPP2 ?= 1
|
||||
# Override lib64 and use SPI convention of lib
|
||||
MY_CMAKE_FLAGS += -DCMAKE_INSTALL_LIBDIR="${INSTALL_PREFIX}/lib"
|
||||
ifeq (${OSL_SPCOMP2},1)
|
||||
MY_CMAKE_FLAGS += -DPYTHON_SITE_DIR="${INSTALL_PREFIX}/python"
|
||||
else ifeq (${OSL_SPIREZ},1)
|
||||
MY_CMAKE_FLAGS += -DPYTHON_SITE_DIR="${INSTALL_PREFIX}/python"
|
||||
else ifeq (${OSL_ARNOLD},1)
|
||||
OIIO_LIBNAME_SUFFIX ?= _Arnold
|
||||
OSL_LIBNAME_SUFFIX ?= _Arnold
|
||||
endif
|
||||
|
||||
# default compiler is clang, taken from the LLVM directory
|
||||
ifeq (${COMPILER},)
|
||||
#
|
||||
# Compilers:
|
||||
#
|
||||
# A variety of tags can be used to try specific versions of gcc or
|
||||
# clang from the site-specific places we have installed them.
|
||||
LLVM_DIRECTORY ?= /shots/spi/home/lib/arnold/rhel7/llvm_8.0.0
|
||||
ifeq (${COMPILER},clang6)
|
||||
LLVM_DIRECTORY := /shots/spi/home/lib/arnold/rhel7/llvm_6.0.1
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
else ifeq (${COMPILER},clang7)
|
||||
LLVM_DIRECTORY := /shots/spi/home/lib/arnold/rhel7/llvm_7.0.1
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
else ifeq (${COMPILER},clang8)
|
||||
LLVM_DIRECTORY := /shots/spi/home/lib/arnold/rhel7/llvm_8.0.0
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
else ifeq (${COMPILER},clang9)
|
||||
LLVM_DIRECTORY := /shots/spi/home/software/packages/llvm/9.0.1-1/${SPI_COMPILER_PLATFORM}
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
else ifeq (${COMPILER},clang10)
|
||||
LLVM_DIRECTORY := /shots/spi/home/software/packages/llvm/10.0.0-1/${SPI_COMPILER_PLATFORM}
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
else ifeq (${COMPILER},clang11)
|
||||
LLVM_DIRECTORY := /shots/spi/home/software/packages/llvm/11.0.0-rc1/${SPI_COMPILER_PLATFORM}
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
else ifeq (${COMPILER},clang)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
||||
else ifeq (${COMPILER}, gcc6)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/opt/rh/devtoolset-6/root/usr/bin/gcc \
|
||||
-DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-6/root/usr/bin/g++
|
||||
else ifeq (${COMPILER},gcc)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
|
||||
else ifeq (${COMPILER},)
|
||||
# default compiler is clang, taken from the LLVM directory
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
endif
|
||||
|
||||
# requesting 'clang' or 'gcc' (no version) means the first clang or
|
||||
# gcc in your path
|
||||
ifeq (${COMPILER},clang)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
||||
endif
|
||||
ifeq (${COMPILER},gcc)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
|
||||
ifeq (${SPI_COMPILER_PLATFORM},gcc-4.8)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" \
|
||||
-DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr" \
|
||||
-DTOOLCHAIN_FLAGS="--gcc-toolchain=/usr"
|
||||
endif
|
||||
|
||||
# A variety of tags can be used to try specific versions of gcc or
|
||||
# clang from the site-specific places we have installed them.
|
||||
ifeq (${COMPILER}, clang342)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/shots/spi/home/lib/arnold/spinux1/llvm_3.4.2/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=/shots/spi/home/lib/arnold/spinux1/llvm_3.4.2/bin/clang++
|
||||
endif
|
||||
ifeq (${COMPILER}, gcc472)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/net/soft_scratch/apps/arnold/tools/gcc-4.7.2-test/bin/gcc \
|
||||
-DCMAKE_CXX_COMPILER=/net/soft_scratch/apps/arnold/tools/gcc-4.7.2-test/bin/g++
|
||||
endif
|
||||
ifeq (${COMPILER}, gcc490)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/net/soft_scratch/apps/arnold/tools/gcc-4.9-20130512-test/bin/gcc \
|
||||
-DCMAKE_CXX_COMPILER=/net/soft_scratch/apps/arnold/tools/gcc-4.9-20130512-test/bin/g++
|
||||
endif
|
||||
|
||||
# Our minimal architecture for workstations and farm supports SSE 4.1
|
||||
USE_SIMD = sse4.1
|
||||
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DOPENEXR_CUSTOM_INCLUDE_DIR=/usr/include/OpenEXR2 \
|
||||
-DOPENEXR_CUSTOM_LIB_DIR=/usr/lib64/OpenEXR2 \
|
||||
-DEXTRA_OSLEXEC_LIBRARIES="/usr/lib64/libpthread.so" \
|
||||
-DEXTRA_OSLEXEC_LIBRARIES="/usr/lib64/libcurses.so" \
|
||||
-DLLVM_CUSTOM=1 \
|
||||
-DLLVM_STATIC=1 \
|
||||
MY_CMAKE_FLAGS +=
|
||||
-DLLVM_STATIC=1 \
|
||||
-DLLVM_VERSION=${LLVM_VERSION} \
|
||||
-DLLVM_DIRECTORY=${LLVM_DIRECTORY}
|
||||
|
||||
ifneq (${SPCOMP2_USE_BOOSTVERS}, 1)
|
||||
BOOSTVERS=1.55
|
||||
#
|
||||
# Boost
|
||||
#
|
||||
BOOSTVERS ?= 1.70
|
||||
BOOSTSPSUFFIX ?=
|
||||
BOOSTVERSSP=${BOOSTVERS}${BOOSTSPSUFFIX}
|
||||
MY_CMAKE_FLAGS += -DBOOST_VERS_SP=${BOOSTVERSSP}
|
||||
# $(info BOOSTVERSSP ${BOOSTVERSSP})
|
||||
ifeq (${BOOSTVERS},1.55)
|
||||
SPBOOST_INC_DIR ?= /usr/include/boost_${BOOSTVERSSP}
|
||||
SPBOOST_LIB_DIR ?= /usr/lib64/boost_${BOOSTVERSSP}
|
||||
ifeq (${BOOSTSPSUFFIX}, sp)
|
||||
SPBOOST_LIBNAMESTART ?= lib${BOOSTSPSUFFIX}boost_${shell echo ${BOOSTVERS} | sed "s/\\./_/"}_0
|
||||
else
|
||||
SPBOOST_LIBNAMESTART ?= lib${BOOSTSPSUFFIX}boost
|
||||
endif
|
||||
SPBOOST_LIBNAMEEND ?= -gcc48-mt-${shell echo ${BOOSTVERS} | sed "s/\\./_/"}
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DBOOST_CUSTOM=1 \
|
||||
-DBoost_VERSION=${BOOSTVERS} \
|
||||
-DBoost_INCLUDE_DIRS=${SPBOOST_INC_DIR} \
|
||||
-DBoost_LIBRARY_DIRS=${SPBOOST_LIB_DIR} \
|
||||
-DBoost_LIBRARIES:STRING="${SPBOOST_LIB_DIR}/${SPBOOST_LIBNAMESTART}_filesystem${SPBOOST_LIBNAMEEND}.so;${SPBOOST_LIB_DIR}/${SPBOOST_LIBNAMESTART}_regex${SPBOOST_LIBNAMEEND}.so;${SPBOOST_LIB_DIR}/${SPBOOST_LIBNAMESTART}_system${SPBOOST_LIBNAMEEND}.so;${SPBOOST_LIB_DIR}/${SPBOOST_LIBNAMESTART}_thread${SPBOOST_LIBNAMEEND}.so"
|
||||
else
|
||||
# Our Boost >= 1.61 setup is MUCH simpler and more standard
|
||||
SPBOOST_INC_DIR := /usr/include/boostroot/boost${BOOSTVERSSP}.0
|
||||
SPBOOST_LIB_DIR := /usr/lib64/boostroot/boost${BOOSTVERSSP}.0
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DBOOST_INCLUDEDIR=${SPBOOST_INC_DIR} \
|
||||
-DBOOST_LIBRARYDIR=${SPBOOST_LIB_DIR}
|
||||
endif
|
||||
|
||||
#
|
||||
# Python
|
||||
#
|
||||
Python_INCLUDE_DIR ?= /usr/include/python${PYTHON_VERSION}
|
||||
PYTHON_LIBRARY_DIR ?= /usr/lib64
|
||||
Python_LIBRARY ?= ${PYTHON_LIBRARY_DIR}/libpython${PYTHON_VERSION}.so
|
||||
ifeq (${PYTHON_VERSION},3.6)
|
||||
# Special sauce for Python 3.6
|
||||
Python_INCLUDE_DIR := /usr/include/python${PYTHON_VERSION}m
|
||||
Python_LIBRARY := ${PYTHON_LIBRARY_DIR}/libpython${PYTHON_VERSION}m.so
|
||||
else ifeq (${PYTHON_VERSION},3.7)
|
||||
# Special sauce for Python 3.7
|
||||
Python_INCLUDE_DIR := /usr/include/python${PYTHON_VERSION}m
|
||||
Python_LIBRARY := ${PYTHON_LIBRARY_DIR}/libpython${PYTHON_VERSION}m.so
|
||||
else ifeq (${PYTHON_VERSION},2.7)
|
||||
# Special sauce for Python 2.7
|
||||
Python_INCLUDE_DIR := /usr/include/python${PYTHON_VERSION}
|
||||
Python_LIBRARY := ${PYTHON_LIBRARY_DIR}/libpython${PYTHON_VERSION}.so
|
||||
endif
|
||||
BOOSTVERSSP=${BOOSTVERS}sp
|
||||
BOOSTVERS_SUFFIX = -${shell echo ${BOOSTVERS} | sed "s/\\./_/"}
|
||||
BOOSTVERS_PREFIX = ${shell echo ${BOOSTVERS} | sed "s/\\./_/"}_0
|
||||
CONSTRUCTED_BOOSTVERS = ${shell echo ${BOOSTVERS} | sed "s/\\./0/"}00
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DBOOST_CUSTOM=1 \
|
||||
-DBoost_VERSION=${CONSTRUCTED_BOOSTVERS} \
|
||||
-DBoost_INCLUDE_DIRS=/usr/include/boost_${BOOSTVERSSP} \
|
||||
-DBoost_LIBRARY_DIRS=/usr/lib64/boost_${BOOSTVERS} \
|
||||
-DBoost_LIBRARIES:STRING="/usr/lib64/boost_${BOOSTVERSSP}/libspboost_${BOOSTVERS_PREFIX}_filesystem-gcc48-mt${BOOSTVERS_SUFFIX}.so;/usr/lib64/boost_${BOOSTVERSSP}/libspboost_${BOOSTVERS_PREFIX}_filesystem-gcc48-mt${BOOSTVERS_SUFFIX}.so;/usr/lib64/boost_${BOOSTVERSSP}/libspboost_${BOOSTVERS_PREFIX}_regex-gcc48-mt${BOOSTVERS_SUFFIX}.so;/usr/lib64/boost_${BOOSTVERSSP}/libspboost_${BOOSTVERS_PREFIX}_system-gcc48-mt${BOOSTVERS_SUFFIX}.so;/usr/lib64/boost_${BOOSTVERSSP}/libspboost_${BOOSTVERS_PREFIX}_thread-gcc48-mt${BOOSTVERS_SUFFIX}.so;/usr/lib64/boost_${BOOSTVERSSP}/libspboost_${BOOSTVERS_PREFIX}_wave-gcc48-mt${BOOSTVERS_SUFFIX}.so"
|
||||
-DPython_INCLUDE_DIR:STRING=${Python_INCLUDE_DIR} \
|
||||
-DPython_LIBRARY:STRING=${Python_LIBRARY} \
|
||||
-Dpybind11_ROOT:STRING=${REZ_PACKAGE_ROOT}/pybind11/2.4.3/python-${PYTHON_VERSION}
|
||||
|
||||
endif # endif rhel7
|
||||
|
||||
# set up OpenImageIO distribution environment
|
||||
ifeq (${OPENIMAGEIOHOME},)
|
||||
MY_CMAKE_FLAGS += -DOPENIMAGEIOHOME:STRING=${working_dir}/../OpenImageIO_local/dist/${platform}${variant}/ \
|
||||
-DOSL_NAMESPACE:STRING=${OSL_NAMESPACE}
|
||||
# Set our preferred OpenEXR path, but allow env variable to override
|
||||
# with custom/test version.
|
||||
ifneq (${OPENEXR_VERSION},)
|
||||
# If OPENEXR_VERSION is set, grab from the rez area
|
||||
OpenEXR_ROOT ?= ${REZ_PACKAGE_ROOT}/OpenEXR/${OPENEXR_VERSION}/${SPI_COMPILER_PLATFORM}/python-${PYTHON_VERSION}
|
||||
MY_CMAKE_FLAGS += -DOpenEXR_ROOT=${OpenEXR_ROOT}
|
||||
else ifeq (${OpenEXR_ROOT},)
|
||||
# If not getting from rez, get from the system install
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DOPENEXR_INCLUDE_DIR=/usr/include/OpenEXR2 \
|
||||
-DOPENEXR_LIBRARY_DIR=/usr/lib64/OpenEXR2
|
||||
endif
|
||||
|
||||
Partio_VERSION ?= 1.10.6
|
||||
partio_ROOT ?= ${REZ_PACKAGE_ROOT}/partio/${Partio_VERSION}/${SPI_COMPILER_PLATFORM}/python-${PYTHON_VERSION}/boost-${BOOSTVERSSP}
|
||||
MY_CMAKE_FLAGS += -Dpartio_ROOT="${partio_ROOT}"
|
||||
|
||||
pugixml_VERSION ?= 1.10.0
|
||||
pugixml_ROOT ?= ${REZ_PACKAGE_ROOT}/pugixml/${pugixml_VERSION}/${SPI_COMPILER_PLATFORM}
|
||||
MY_CMAKE_FLAGS += -Dpugixml_ROOT="${pugixml_ROOT}"
|
||||
|
||||
# set up OSL distribution environment
|
||||
SPARCH=${SP_OS}-$(SPCOMP2_COMPILER)$(CPPSTDSUFFIX)-boost$(subst .,,$(BOOSTVERSSP))
|
||||
|
||||
ifeq (${OSL_SPIREZ},1)
|
||||
OpenImageIO_ROOT := ${REZ_PACKAGE_ROOT}/OpenImageIO/${OPENIMAGEIO_VERSION}/${SPI_COMPILER_PLATFORM}/python-${PYTHON_VERSION}/boost-${BOOSTVERSSP}
|
||||
$(info OpenImageIO_ROOT ${OpenImageIO_ROOT})
|
||||
|
||||
|
||||
else ifeq (${OSL_SPCOMP2},1)
|
||||
OpenImageIO_ROOT := $(SPCOMP2_ROOT)/OpenImageIO/$(SPARCH)/v$(OPENIMAGEIO_SPCOMP2_VERSION)
|
||||
else ifeq (${OSL_ARNOLD},1)
|
||||
OpenImageIO_ROOT ?= ${working_dir}/../OpenImageIO_local/dist/${platform}${variant}/
|
||||
else ifneq (${OpenImageIO_ROOT},)
|
||||
# User supplied something
|
||||
endif
|
||||
ifneq ($(OpenImageIO_ROOT),)
|
||||
MY_CMAKE_FLAGS += -DOpenImageIO_ROOT=${OpenImageIO_ROOT}
|
||||
endif
|
||||
|
||||
# Cuda/OptiX
|
||||
USE_OPTIX ?= 1
|
||||
CUDA_VERSION ?= 11.0.1
|
||||
OPTIX_VERSION ?= 7.1.0
|
||||
# CUDA_TOOLKIT_ROOT_DIR = $(shell rez-env -b cuda-${CUDA_VERSION} ${SPI_COMPILER_PLATFORM} -c "echo '$CUDA_TOOLKIT_ROOT'")
|
||||
CUDA_TOOLKIT_ROOT_DIR ?= /shots/spi/home/lib/arnold/rhel7/cuda_${CUDA_VERSION}
|
||||
CUDA_EXTRA_LIBS ?= ${CUDA_TOOLKIT_ROOT_DIR}/lib64/libnvrtc.so
|
||||
OptiX_ROOT ?= /shots/spi/home/lib/arnold/rhel7/optix_${OPTIX_VERSION}
|
||||
OPTIXHOME = ${OptiX_ROOT}
|
||||
MY_CMAKE_FLAGS += -DUSE_OPTIX=${USE_OPTIX} \
|
||||
-DCUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT_DIR} \
|
||||
-DCUDA_EXTRA_LIBS=${CUDA_EXTRA_LIBS} \
|
||||
-DOPTIXHOME=${OPTIXHOME} -DOPTIX_EXTRA_LIBS=lzma
|
||||
|
||||
# end rhel7
|
||||
|
||||
## Generic OSX machines (including LG's laptop)
|
||||
else ifeq (${platform}, macosx)
|
||||
CMAKE_CXX_STANDARD ?= 14
|
||||
USE_SIMD ?= sse4.2
|
||||
MY_CMAKE_FLAGS += -DCMAKE_BUILD_WITH_INSTALL_RPATH=1
|
||||
MY_CMAKE_FLAGS += -DCMAKE_INSTALL_NAME_DIR="${working_dir}/dist/${platform}${variant}/lib"
|
||||
|
||||
BOOSTVERSSP=${BOOSTVERS}${BOOSTSPSUFFIX}
|
||||
LLVM_DIRECTORY ?= /usr/local/opt/llvm
|
||||
|
||||
# A variety of tags can be used to try specific versions of gcc or
|
||||
# clang from the site-specific places we have installed them.
|
||||
ifeq (${COMPILER}, gcc48)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=gcc-4.8 -DCMAKE_CXX_COMPILER=g++-4.8
|
||||
USE_LIBCPLUSPLUS := 0
|
||||
else ifeq (${COMPILER}, gcc5)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=gcc-5 -DCMAKE_CXX_COMPILER=g++-5
|
||||
USE_LIBCPLUSPLUS := 0
|
||||
else ifeq (${COMPILER}, gcc6)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=gcc-6 -DCMAKE_CXX_COMPILER=g++-6
|
||||
USE_LIBCPLUSPLUS := 0
|
||||
else ifeq (${COMPILER}, gcc8)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8
|
||||
USE_LIBCPLUSPLUS := 0
|
||||
else ifeq (${COMPILER}, gcc9)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=gcc-9 -DCMAKE_CXX_COMPILER=g++-9
|
||||
USE_LIBCPLUSPLUS := 0
|
||||
else ifeq (${COMPILER},clang6)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@6/6.0.1_2/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm@6/6.0.1_2/bin/clang++
|
||||
else ifeq (${COMPILER},clang7)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@7/7.0.1_1/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm@7/7.0.1_1/bin/clang++
|
||||
else ifeq (${COMPILER},clang8)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@8/8.0.1_1/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm/8.0.1/bin/clang++
|
||||
else ifeq (${COMPILER},clang9)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@9/9.0.1/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm@9/9.0.1/bin/clang++
|
||||
else ifeq (${COMPILER},clang10)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/usr/local/Cellar/llvm/10.0.0/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm/10.0.0/bin/clang++
|
||||
else ifeq (${COMPILER},clang)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
||||
else ifeq (${COMPILER},gcc)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
|
||||
else ifeq (${COMPILER},)
|
||||
# default compiler is clang, taken from the LLVM directory
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
else ifeq (${COMPILER},llvm)
|
||||
# "llvm" means "use the clang from our llvm"
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
endif
|
||||
|
||||
# end generic OSX
|
||||
|
||||
else
|
||||
MY_CMAKE_FLAGS += -DOPENIMAGEIOHOME:STRING=${IMAGEIOHOME} \
|
||||
-DOSL_NAMESPACE:STRING=${OSL_NAMESPACE}
|
||||
$(error Unknown SP_OS=${SP_OS} platform=${platform})
|
||||
endif # endif ${SP_OS}
|
||||
|
||||
|
||||
|
||||
ifeq (${OSL_SPIREZ},1)
|
||||
# Rpath touch-ups
|
||||
# NOTE: This MUST match the order and naming of the Rez variants
|
||||
# set in rez/package.py.in
|
||||
REZ_INSTALL_PATH := ${REZ_PACKAGE_ROOT}/${OSL_REZ_NAME}/${OSL_VERS}/${SPI_COMPILER_PLATFORM}/python-${PYTHON_VERSION}/boost-${BOOSTVERSSP}/cuda-${CUDA_VERSION}/optix-${OPTIX_VERSION}
|
||||
MY_CMAKE_FLAGS += -DOSL_REZ_INSTALL_PATH=${REZ_INSTALL_PATH}
|
||||
MY_CMAKE_FLAGS += -DCMAKE_INSTALL_RPATH="${REZ_INSTALL_PATH}/lib;@executable_path/../lib;${OpenImageIO_ROOT}/lib"
|
||||
INSTALL_PREFIX := ${working_dir}/dist/${platform}
|
||||
endif
|
||||
|
||||
|
||||
ifneq (${VERBOSE},)
|
||||
$(info MY_CMAKE_FLAGS: $(MY_CMAKE_FLAGS))
|
||||
$(info MY_CMAKE_FLAGS: $(MY_CMAKE_FLAGS))
|
||||
endif
|
||||
|
||||
|
||||
|
||||
############################################################################
|
||||
# SpComp2 magic incantations follow. Here be dragons.
|
||||
############################################################################
|
||||
|
||||
|
||||
CPPSTDSUFFIX=
|
||||
SPCOMP2_INSTALL_ROOT ?= $(SPCOMP2_ROOT)
|
||||
BOOSTVERSSP?=${BOOSTVERS}${BOOSTSPSUFFIX}
|
||||
SPARCH=${SP_OS}-$(SPCOMP2_COMPILER)$(CPPSTDSUFFIX)-boost$(subst .,,$(BOOSTVERSSP))
|
||||
OIIO_SPCOMP2_PATH := ${SPCOMP2_INSTALL_ROOT}/OpenImageIO/${SPARCH}/v${OPENIMAGEIO_SPCOMP2_VERSION}
|
||||
# $(info New rhel7 OIIO_SPCOMP2_PATH is ${OIIO_SPCOMP2_PATH})
|
||||
|
||||
PYVERNOSPACE=${shell echo ${PYTHON_VERSION} | sed "s/\\.//"}
|
||||
SPPYARCH=$(SPARCH)-py$(PYVERNOSPACE)
|
||||
|
||||
|
||||
|
||||
all: dist
|
||||
|
||||
local: dist
|
||||
|
||||
.PHONY: spcomp2_install spcomp2_install_local clean all
|
||||
|
||||
spi: MY_CMAKE_FLAGS += -DCMAKE_DEBUG_POSTFIX=_d
|
||||
spi: debug dist
|
||||
|
||||
|
||||
|
||||
spcomp2_install_local: SPCOMP2_INSTALL_ROOT = $(SPCOMP2_LOCAL_PATH)
|
||||
spcomp2_install_local: spcomp2_install
|
||||
|
||||
comma:= ,
|
||||
empty:=
|
||||
space:= $(empty) $(empty)
|
||||
|
||||
#OSL_SPCOMP2_PATH := ${SPCOMP2_INSTALL_ROOT}/OSL/${SP_OS}-${SPCOMP2_COMPILER}$(CPPSTDSUFFIX)-boost${SPCOMP2_BOOSTVERS_SUFFIX}/v${OSL_SPCOMP2_VERSION}
|
||||
#$(info New rhel7 OSL_SPCOMP2_PATH is ${OSL_SPCOMP2_PATH})
|
||||
|
||||
#INSTALL_SPCOMP2_CURRENT = $(SPCOMP2_INSTALL_ROOT)/OSL/$(SPARCH)/v$(OSL_SPCOMP2_VERSION)
|
||||
#INSTALL_BIN_LOCATION = $(INSTALL_SPCOMP2_CURRENT)/bin
|
||||
|
||||
SPCOMP2_RPATH_OPT ?= ${OpenImageIO_ROOT}/lib:${partio_ROOT}/lib
|
||||
SPCOMP2_RPATH_DEBUG ?= ${OpenImageIO_ROOT}/lib:${partio_ROOT}/lib/debug
|
||||
#PYSPCOMP2_RPATH_OPT ?= ${SPCOMP2_RPATH_OPT}:${OSL_SPCOMP2_PATH}/lib:${PYTHON_LIBRARY_DIR}
|
||||
#PYSPCOMP2_RPATH_DEBUG ?= ${SPCOMP2_RPATH_DEBUG}:${OSL_SPCOMP2_PATH}/lib/debug:${PYTHON_LIBRARY_DIR}
|
||||
|
||||
|
||||
|
||||
spcomp2: MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_SKIP_BUILD_RPATH:BOOL=ON \
|
||||
-DCMAKE_INSTALL_RPATH=$(SPCOMP2_INSTALL_ROOT)/OSL/$(SPARCH)/v$(OSL_SPCOMP2_VERSION)/lib \
|
||||
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON \
|
||||
-DPYLIB_INCLUDE_SONAME:BOOL=ON \
|
||||
-DPYLIB_LIB_PREFIX:BOOL=ON \
|
||||
-DPYMODULE_SUFFIX="V${OSL_SPCOMP2_VERSION}"
|
||||
|
||||
spcomp2: dist
|
||||
|
||||
spcomp2_debug: MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_SKIP_BUILD_RPATH:BOOL=ON \
|
||||
-DCMAKE_INSTALL_RPATH=$(SPCOMP2_INSTALL_ROOT)/OSL/$(SPARCH)/v$(OSL_SPCOMP2_VERSION)/lib \
|
||||
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON \
|
||||
-DPYLIB_INCLUDE_SONAME:BOOL=ON \
|
||||
-DPYLIB_LIB_PREFIX:BOOL=ON \
|
||||
-DPYMODULE_SUFFIX="V${OSL_SPCOMP2_VERSION}"
|
||||
|
||||
spcomp2_debug: debug
|
||||
|
||||
spcomp2_install_fixup_rhel7: spcomp2 spcomp2_debug
|
||||
echo $(SPCOMP2_INSTALL_ROOT)
|
||||
patchelf --set-rpath ${SPCOMP2_RPATH_OPT} ${dist_dir}/lib/liboslexec${OSL_LIBNAME_SUFFIX}.so
|
||||
patchelf --set-rpath ${SPCOMP2_RPATH_DEBUG} ${dist_dir}.debug/lib/liboslexec.so
|
||||
patchelf --set-rpath ${SPCOMP2_RPATH_OPT} ${dist_dir}/lib/liboslcomp${OSL_LIBNAME_SUFFIX}.so
|
||||
patchelf --set-rpath ${SPCOMP2_RPATH_DEBUG} ${dist_dir}.debug/lib/liboslcomp.so
|
||||
patchelf --set-rpath ${SPCOMP2_RPATH_OPT} ${dist_dir}/lib/liboslquery${OSL_LIBNAME_SUFFIX}.so
|
||||
patchelf --set-rpath ${SPCOMP2_RPATH_DEBUG} ${dist_dir}.debug/lib/liboslquery.so
|
||||
# patchelf --set-rpath ${PYSPCOMP2_RPATH_OPT} ${dist_dir}/python/libPyOSL.so
|
||||
# patchelf --set-rpath ${PYSPCOMP2_RPATH_DEBUG} ${dist_dir}.debug/python/libPyOSL.so
|
||||
|
||||
# This goal can't start with 'install' because something elsewhere picks
|
||||
# it up and starts doing bad things
|
||||
spcomp2_install: spcomp2_install_fixup_${SP_OS}
|
||||
perl -I/usr/local/spi/lib/make /usr/local/spi/bin/spcomp_install.pl -m installhost \
|
||||
--project=oslexec \
|
||||
--version=$(OSL_SPCOMP2_VERSION) \
|
||||
--root=$(SPCOMP2_INSTALL_ROOT) \
|
||||
--arch=$(SPARCH) \
|
||||
--headers=$(subst $(space),$(comma),$(wildcard ${dist_dir}/include/OSL/*)) \
|
||||
--cflags= --static_lflags="$(LINK_BOOST) $(LINK_OPENEXR) -lpthread" \
|
||||
--namespace=${NAMESPACE} \
|
||||
--srcdir=${dist_dir}/lib \
|
||||
--builddir_o=${dist_dir}/lib \
|
||||
--builddir_d=${dist_dir}.debug/lib
|
||||
perl -I/usr/local/spi/lib/make /usr/local/spi/bin/spcomp_install.pl -m installhost \
|
||||
--project=oslquery \
|
||||
--version=$(OSL_SPCOMP2_VERSION) \
|
||||
--root=$(SPCOMP2_INSTALL_ROOT) \
|
||||
--arch=$(SPARCH) \
|
||||
--headers=$(subst $(space),$(comma),$(wildcard ${dist_dir}/include/OSL/*)) \
|
||||
--cflags= --static_lflags="$(LINK_BOOST) $(LINK_OPENEXR) -lpthread" \
|
||||
--namespace=${NAMESPACE} \
|
||||
--srcdir=${dist_dir}/lib \
|
||||
--builddir_o=${dist_dir}/lib \
|
||||
--builddir_d=${dist_dir}.debug/lib
|
||||
#perl -I/usr/local/spi/lib/make /usr/local/spi/bin/spcomp_install.pl -m installhost \
|
||||
# --project=oslcomp \
|
||||
# --version=$(OSL_SPCOMP2_VERSION) \
|
||||
# --root=$(SPCOMP2_INSTALL_ROOT) \
|
||||
# --arch=$(SPARCH) \
|
||||
# --headers=$(subst $(space),$(comma),$(wildcard ${dist_dir}/include/OSL/*)) \
|
||||
# --cflags= --static_lflags="$(LINK_BOOST) $(LINK_OPENEXR) -lpthread" \
|
||||
# --namespace=${NAMESPACE} \
|
||||
# --srcdir=${dist_dir}/lib \
|
||||
# --builddir_o=${dist_dir}/lib \
|
||||
# --builddir_d=${dist_dir}.debug/lib
|
||||
#perl -I/usr/local/spi/lib/make /usr/local/spi/bin/spcomp_install.pl -m installhost \
|
||||
# --project=PyOSL \
|
||||
# --version=$(OSL_SPCOMP2_VERSION) \
|
||||
# --root=$(SPCOMP2_INSTALL_ROOT) \
|
||||
# --arch=$(SPPYARCH) \
|
||||
# --cflags= --static_lflags="$(LINK_BOOST) $(LINK_OPENEXR) -lpthread"\
|
||||
# --namespace=${NAMESPACE} \
|
||||
# --srcdir=${dist_dir}/python \
|
||||
# --builddir_o=${dist_dir}/python \
|
||||
# --builddir_d=${dist_dir}.debug/python
|
||||
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
||||
<!-- Copyright Contributors to the Open Shading Language Project. -->
|
||||
|
||||
Build a variant for Rez/general use
|
||||
-----------------------------------
|
||||
|
||||
Skip this section if you are instead building for SpComp2.
|
||||
|
||||
Note: For testing or to make your own local rez package, you can customize
|
||||
either the rez package name, or the rez install location name, with make
|
||||
flags `OSL_REZ_NAME=blah REZ_PACKAGE_ROOT=/path/to/my/rez/pkgs` appended
|
||||
to the `make` commands of any of the variants listed below. For example,
|
||||
|
||||
make OSL_SPIREZ=1 OSL_REZ_NAME=oiio_test REZ_PACKAGE_ROOT=/path/to/my/rez/pkgs
|
||||
|
||||
|
||||
Variants:
|
||||
|
||||
# C++11/gcc4.8 compat, Python 2.7, Boost 1.55, OptiX 6, Cuda 10.1
|
||||
# OIIO 2.2.0.0, OpenEXR 2.2
|
||||
make nuke
|
||||
make spi OSL_SPIREZ=1 BOOSTVERS=1.55 USE_OPTIX=1 CUDA_VERSION=10.1 OPTIX_VERSION=6.0.0 OPENIMAGEIO_VERSION=2.2.0.0 OPENEXR_VERSION=2.2.0 PYTHON_VERSION=2.7
|
||||
|
||||
# C++11/gcc6.3 compat, Python 2.7, Boost 1.70, OptiX 6, Cuda 10.1
|
||||
# OIIO 2.2.0.0, OpenEXR 2.4
|
||||
make nuke
|
||||
make spi OSL_SPIREZ=1 SPI_COMPILER_PLATFORM=gcc-6.3 BOOSTVERS=1.70 USE_OPTIX=1 CUDA_VERSION=10.1 OPTIX_VERSION=6.0.0 OPENIMAGEIO_VERSION=2.2.0.0 OPENEXR_VERSION=2.4.0 PYTHON_VERSION=2.7
|
||||
|
||||
|
||||
|
||||
You can do any of these on your local machine.
|
||||
|
||||
|
||||
Rez/general release (do for each variant)
|
||||
-----------------------------------------
|
||||
|
||||
This must be done from compile42 (for correct write permissions on certain
|
||||
shared directories), even if you did the build itself locally.
|
||||
|
||||
For any of the variants that you built above:
|
||||
|
||||
( cd dist/rhel7 ; rez release --skip-repo-errors )
|
||||
|
||||
That command will release the dist to the studio.
|
||||
|
||||
|
||||
Appwrapper binary releases
|
||||
--------------------------
|
||||
|
||||
We don't currently do this.
|
||||
|
||||
<!---
|
||||
This step is for the ONE general/rez variant that we believe is the
|
||||
canonical source of command line oslc and oslinfo. After building and
|
||||
releasing as above,
|
||||
|
||||
cp dist/rhel7/OSL_*.xml /shots/spi/home/lib/app_cfg/OSL
|
||||
|
||||
That will make appcfg aware of the release.
|
||||
|
||||
To also make this release the new facility default:
|
||||
|
||||
db-any spi/home/OSL.bin highest /shots/spi/home/lib/app_cfg/OSL/OSL_A.B.C.D.xml
|
||||
|
||||
where A.B.C.D is the version.
|
||||
--->
|
||||
|
||||
|
||||
SpComp2 build and release
|
||||
-------------------------
|
||||
|
||||
Phasing out support for this.
|
||||
@@ -0,0 +1,6 @@
|
||||
<cfg>
|
||||
<version>@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.@PROJECT_VERSION_TWEAK@</version>
|
||||
<appdir architecture="@SP_OS@">@OSL_REZ_INSTALL_PATH@</appdir>
|
||||
<launchprogram></launchprogram>
|
||||
<setup></setup>
|
||||
</cfg>
|
||||
@@ -0,0 +1,20 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
option (${PROJ_NAME}_SPIREZ "Enable extra bits for building for SPI Rez install" OFF)
|
||||
set (${PROJ_NAME}_REZ_PACKAGE_NAME CACHE STRING "${PROJECT_NAME}")
|
||||
|
||||
if (${PROJ_NAME}_SPIREZ)
|
||||
message (STATUS "Creating package.py from package.py.in")
|
||||
configure_file ("${PROJECT_SOURCE_DIR}/site/spi/rez/package.py.in" "${CMAKE_BINARY_DIR}/package.py")
|
||||
|
||||
set (appcfg_filename "${CMAKE_BINARY_DIR}/${PROJECT_NAME}_${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.${PROJECT_VERSION_TWEAK}.xml")
|
||||
configure_file ("${PROJECT_SOURCE_DIR}/site/spi/appcfg.xml.in" "${appcfg_filename}")
|
||||
|
||||
install (FILES ${CMAKE_BINARY_DIR}/package.py
|
||||
"${PROJECT_SOURCE_DIR}/site/spi/rez/CMakeLists.txt"
|
||||
${appcfg_filename}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}
|
||||
COMPONENT developer)
|
||||
endif ()
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# This helper script takes a major.minor.patch semantic version string
|
||||
# ("2.1.1") and reformats it into the dot-less zero-padded version like
|
||||
# "20101". This is necessary to turn external release designations into
|
||||
# integer SpComp2 version numbers.
|
||||
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
|
||||
if len(sys.argv) != 2 :
|
||||
print('Need 1 argument: version number with dots')
|
||||
exit(1)
|
||||
|
||||
vers = sys.argv[1]
|
||||
parts = vers.split('.')
|
||||
print ('{:d}{:02d}{:02d}'.format(int(parts[0]), int(parts[1]), int(parts[2])))
|
||||
@@ -0,0 +1,31 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
project(OSL)
|
||||
|
||||
include(RezBuild)
|
||||
|
||||
rez_install_dirs(
|
||||
include lib share
|
||||
# python
|
||||
DESTINATION .
|
||||
)
|
||||
|
||||
# Bin specified separately so it can be marked as EXECUTABLE, otherwise it
|
||||
# installs with only read permissions.
|
||||
rez_install_dirs(
|
||||
bin
|
||||
DESTINATION .
|
||||
EXECUTABLE
|
||||
)
|
||||
|
||||
rez_install_cmake(
|
||||
DESTINATION .
|
||||
INCLUDE_DIRS include
|
||||
LIBRARY_DIRS lib
|
||||
LIBRARIES oslexec oslcomp oslquery
|
||||
oslexec_d oslcomp_d oslquery_d
|
||||
)
|
||||
@@ -0,0 +1,59 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
#
|
||||
# Documentation on packages and available attributes can be found at:
|
||||
# https://github.com/nerdvegas/rez/wiki/Package-Definition-Guide
|
||||
|
||||
|
||||
name = '@OSL_REZ_PACKAGE_NAME@'
|
||||
|
||||
version = '@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.@PROJECT_VERSION_TWEAK@'
|
||||
|
||||
description = \
|
||||
"""
|
||||
Rez package of Open Shading Language (OSL)
|
||||
"""
|
||||
|
||||
authors = ['Larry Gritz <lg@imageworks.com>']
|
||||
|
||||
# Add dependencies to other Rez packages here
|
||||
requires = [
|
||||
'platform-@SP_PLATFORM@', 'arch-@SP_PROC@', 'os-@SP_REZ_OS@',
|
||||
'OpenImageIO-@OPENIMAGEIO_VERSION_MAJOR@.@OPENIMAGEIO_VERSION_MINOR@.@OPENIMAGEIO_VERSION_PATCH@'
|
||||
]
|
||||
|
||||
#build_command = 'python {root}/build.py'
|
||||
|
||||
# Rez has a limitation where it is not possible to add variants to a package that
|
||||
# does not have any: https://github.com/nerdvegas/rez/wiki/Variants#single-variants.
|
||||
# Unless you are 100% certain that your package will NEVER require any variants,
|
||||
# you should define your package with at least one variant.
|
||||
variants = [
|
||||
[
|
||||
'@SPI_COMPILER_PLATFORM@',
|
||||
'python-@PYTHON_VERSION_MAJOR@.@PYTHON_VERSION_MINOR@',
|
||||
'boost-@BOOST_VERS_SP@',
|
||||
'cuda-@CUDA_VERSION@',
|
||||
'optix-@OPTIX_VERSION@'
|
||||
],
|
||||
]
|
||||
|
||||
def commands():
|
||||
# Add import statements here, not at the top of the file!
|
||||
|
||||
# Uncomment if you have executables under bin/
|
||||
env.PATH.append("{root}/bin")
|
||||
env.LD_LIBRARY_PATH.append("{root}/lib")
|
||||
|
||||
# Uncomment if you have Python code under python/
|
||||
env.PYTHONPATH.append("{root}/python")
|
||||
|
||||
# For SpImport.Packages, append the python directory
|
||||
#env.SPIMPORT_PACKAGES.append("{root}/python")
|
||||
|
||||
if building:
|
||||
env.CMAKE_MODULE_PATH.append('{root}')
|
||||
# Add env vars or custom code you want executed only at build time
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Utility script to download and build cmake
|
||||
#
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
echo "Building cmake"
|
||||
uname
|
||||
|
||||
CMAKE_VERSION=${CMAKE_VERSION:=3.12.4}
|
||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||
CMAKE_INSTALL_DIR=${CMAKE_INSTALL_DIR:=${LOCAL_DEPS_DIR}/cmake}
|
||||
|
||||
if [[ `uname` == "Linux" && `uname -m` == "x86_64" ]] ; then
|
||||
mkdir -p ${CMAKE_INSTALL_DIR} || true
|
||||
curl --location "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh" -o "cmake.sh"
|
||||
sh cmake.sh --skip-license --prefix=${CMAKE_INSTALL_DIR}
|
||||
export PATH=${CMAKE_INSTALL_DIR}/bin:$PATH
|
||||
fi
|
||||
|
||||
if [[ `uname` == "Linux" && `uname -m` == "aarch64" ]] ; then
|
||||
mkdir -p ${CMAKE_INSTALL_DIR} || true
|
||||
curl --location https://anaconda.org/conda-forge/cmake/3.17.0/download/linux-aarch64/cmake-3.17.0-h28c56e5_0.tar.bz2 -o cmake-3.17.0-h28c56e5_0.tar.bz2
|
||||
tar -xjf cmake-3.17.0-h28c56e5_0.tar.bz2 -C ${CMAKE_INSTALL_DIR}
|
||||
export PATH=${CMAKE_INSTALL_DIR}/bin:$PATH
|
||||
|
||||
# In case we ever need to build from scratch:
|
||||
# curl --location "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz" -o cmake.tar.gz
|
||||
# tar xzf cmake.tar.gz
|
||||
# pushd cmake-${CMAKE_VERSION}
|
||||
# CXX="ccache $CXX" ./bootstrap --parallel=${PARALLEL:=4} --enable-ccache
|
||||
# CXX="ccache $CXX" timeout 2100 time make ${PAR_MAKEFAGS} || true
|
||||
# export PATH=${CMAKE_INSTALL_DIR}/bin:$PWD/bin:$PATH
|
||||
# popd
|
||||
fi
|
||||
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Utility script to download and build LLVM & clang
|
||||
#
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
echo "Building LLVM"
|
||||
uname
|
||||
|
||||
|
||||
if [[ `uname` == "Linux" ]] ; then
|
||||
LLVM_VERSION=${LLVM_VERSION:=8.0.0}
|
||||
LLVM_INSTALL_DIR=${LLVM_INSTALL_DIR:=${PWD}/llvm-install}
|
||||
if [[ "$GITHUB_WORKFLOW" != "" ]] ; then
|
||||
LLVM_DISTRO_NAME=${LLVM_DISTRO_NAME:=ubuntu-18.04}
|
||||
elif [[ "$TRAVIS_DIST" == "trusty" ]] ; then
|
||||
LLVM_DISTRO_NAME=${LLVM_DISTRO_NAME:=ubuntu-14.04}
|
||||
elif [[ "$TRAVIS_DIST" == "xenial" ]] ; then
|
||||
LLVM_DISTRO_NAME=${LLVM_DISTRO_NAME:=ubuntu-16.04}
|
||||
elif [[ "$TRAVIS_DIST" == "bionic" ]] ; then
|
||||
LLVM_DISTRO_NAME=${LLVM_DISTRO_NAME:=ubuntu-18.04}
|
||||
else
|
||||
LLVM_DISTRO_NAME=${LLVM_DISTRO_NAME:=error}
|
||||
fi
|
||||
LLVMTAR=clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-${LLVM_DISTRO_NAME}.tar.xz
|
||||
echo LLVMTAR = $LLVMTAR
|
||||
if [[ "$LLVM_VERSION" == "10.0.0" ]] || [[ "$LLVM_VERSION" == "11.0.0" ]] || [[ "$LLVM_VERSION" == "11.1.0" ]] || [[ "$LLVM_VERSION" == "12.0.0" ]] ; then
|
||||
# new
|
||||
curl --location https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/${LLVMTAR} -o $LLVMTAR
|
||||
else
|
||||
curl --location http://releases.llvm.org/${LLVM_VERSION}/${LLVMTAR} -o $LLVMTAR
|
||||
fi
|
||||
ls -l $LLVMTAR
|
||||
tar xf $LLVMTAR
|
||||
rm -f $LLVMTAR
|
||||
echo "Installed ${LLVM_VERSION} in ${LLVM_INSTALL_DIR}"
|
||||
mkdir -p $LLVM_INSTALL_DIR && true
|
||||
mv clang+llvm*/* $LLVM_INSTALL_DIR
|
||||
export LLVM_DIRECTORY=$LLVM_INSTALL_DIR
|
||||
export PATH=${LLVM_INSTALL_DIR}/bin:$PATH
|
||||
# ls -a $LLVM_DIRECTORY
|
||||
fi
|
||||
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Utility script to download and build OpenColorIO
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
# Which OCIO to retrieve, how to build it
|
||||
OPENCOLORIO_REPO=${OPENCOLORIO_REPO:=https://github.com/AcademySoftwareFoundation/OpenColorIO.git}
|
||||
OPENCOLORIO_VERSION=${OPENCOLORIO_VERSION:=v1.1.1}
|
||||
|
||||
# Where to install the final results
|
||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||
OPENCOLORIO_SOURCE_DIR=${OPENCOLORIO_BUILD_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO}
|
||||
OPENCOLORIO_BUILD_DIR=${OPENCOLORIO_BUILD_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO-build}
|
||||
OPENCOLORIO_INSTALL_DIR=${OPENCOLORIO_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
|
||||
OPENCOLORIO_CXX_FLAGS=${OPENCOLORIO_CXX_FLAGS:="-Wno-unused-function -Wno-deprecated-declarations -Wno-cast-qual -Wno-write-strings"}
|
||||
# Just need libs:
|
||||
OPENCOLORIO_BUILDOPTS="-DOCIO_BUILD_APPS=OFF -DOCIO_BUILD_NUKE=OFF \
|
||||
-DOCIO_BUILD_DOCS=OFF -DOCIO_BUILD_TESTS=OFF \
|
||||
-DOCIO_BUILD_GPU_TESTS=OFF \
|
||||
-DOCIO_BUILD_PYTHON=OFF -DOCIO_BUILD_PYGLUE=OFF \
|
||||
-DOCIO_BUILD_JAVA=OFF \
|
||||
-DOCIO_BUILD_STATIC=${OCIO_BUILD_STATIC:=OFF}"
|
||||
BASEDIR=`pwd`
|
||||
pwd
|
||||
echo "OpenColorIO install dir will be: ${OPENCOLORIO_INSTALL_DIR}"
|
||||
|
||||
mkdir -p ${LOCAL_DEPS_DIR}
|
||||
pushd ${LOCAL_DEPS_DIR}
|
||||
|
||||
# Clone OpenColorIO project from GitHub and build
|
||||
if [[ ! -e OpenColorIO ]] ; then
|
||||
echo "git clone ${OPENCOLORIO_REPO} OpenColorIO"
|
||||
git clone ${OPENCOLORIO_REPO} OpenColorIO
|
||||
fi
|
||||
cd OpenColorIO
|
||||
|
||||
echo "git checkout ${OPENCOLORIO_VERSION} --force"
|
||||
git checkout ${OPENCOLORIO_VERSION} --force
|
||||
mkdir -p build
|
||||
cd build
|
||||
time cmake -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${OPENCOLORIO_INSTALL_DIR} \
|
||||
-DCMAKE_CXX_FLAGS="${OPENCOLORIO_CXX_FLAGS}" \
|
||||
${OPENCOLORIO_BUILDOPTS} ..
|
||||
time cmake --build . --config Release --target install
|
||||
popd
|
||||
|
||||
# ls -R ${OPENCOLORIO_INSTALL_DIR}
|
||||
|
||||
#echo "listing .."
|
||||
#ls ..
|
||||
|
||||
# Set up paths. These will only affect the caller if this script is
|
||||
# run with 'source' rather than in a separate shell.
|
||||
export OpenColorIO_ROOT=$OPENCOLORIO_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OPENCOLORIO_INSTALL_DIR}/lib
|
||||
|
||||
@@ -1,48 +1,116 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# The Linux VM used by Travis has OpenEXR 1.x. We really want 2.x.
|
||||
# Utility script to download and build OpenEXR & IlmBase
|
||||
#
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
# Which OpenEXR to retrieve, how to build it
|
||||
OPENEXR_REPO=${OPENEXR_REPO:=https://github.com/openexr/openexr.git}
|
||||
OPENEXR_VERSION=${OPENEXR_VERSION:=v2.4.1}
|
||||
|
||||
# Where to install the final results
|
||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||
OPENEXR_SOURCE_DIR=${OPENEXR_SOURCE_DIR:=${LOCAL_DEPS_DIR}/openexr}
|
||||
OPENEXR_BUILD_DIR=${OPENEXR_BUILD_DIR:=${LOCAL_DEPS_DIR}/openexr-build}
|
||||
OPENEXR_INSTALL_DIR=${OPENEXR_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
|
||||
OPENEXR_BUILD_TYPE=${OPENEXR_BUILD_TYPE:=Release}
|
||||
CMAKE_GENERATOR=${CMAKE_GENERATOR:="Unix Makefiles"}
|
||||
OPENEXR_CMAKE_FLAGS=${OPENEXR_CMAKE_FLAGS:=""}
|
||||
OPENEXR_CXX_FLAGS=${OPENEXR_CXX_FLAGS:=""}
|
||||
BASEDIR=$PWD
|
||||
|
||||
EXRINSTALLDIR=${EXRINSTALLDIR:=${PWD}/openexr-install}
|
||||
EXRVERSION=${EXRVERSION:=2.2.0}
|
||||
BASEDIR=`pwd`
|
||||
pwd
|
||||
echo "EXR install dir will be: ${EXRINSTALLDIR}"
|
||||
echo "Building OpenEXR ${OPENEXR_VERSION}"
|
||||
echo "OpenEXR build dir will be: ${OPENEXR_BUILD_DIR}"
|
||||
echo "OpenEXR install dir will be: ${OPENEXR_INSTALL_DIR}"
|
||||
echo "CMAKE_PREFIX_PATH is ${CMAKE_PREFIX_PATH}"
|
||||
echo "OpenEXR Build type is ${OPENEXR_BUILD_TYPE}"
|
||||
|
||||
if [ ! -e ${EXRINSTALLDIR} ] ; then
|
||||
mkdir ${EXRINSTALLDIR}
|
||||
if [[ "$CMAKE_GENERATOR" == "" ]] ; then
|
||||
OPENEXR_GENERATOR_CMD="-G \"$CMAKE_GENERATOR\""
|
||||
fi
|
||||
|
||||
# Clone OpenEXR project (including IlmBase) from GitHub and build
|
||||
if [ ! -e ./openexr ] ; then
|
||||
git clone -b v${EXRVERSION} https://github.com/openexr/openexr.git ./openexr
|
||||
if [[ ! -e ${OPENEXR_SOURCE_DIR} ]] ; then
|
||||
echo "git clone ${OPENEXR_REPO} ${OPENEXR_SOURCE_DIR}"
|
||||
git clone ${OPENEXR_REPO} ${OPENEXR_SOURCE_DIR}
|
||||
fi
|
||||
|
||||
flags=
|
||||
mkdir -p ${OPENEXR_INSTALL_DIR} && true
|
||||
mkdir -p ${OPENEXR_BUILD_DIR} && true
|
||||
|
||||
if [ ${LINKSTATIC:=0} == 1 ] ; then
|
||||
flags=${flags} --enable-static --enable-shared=no --with-pic
|
||||
pushd ${OPENEXR_SOURCE_DIR}
|
||||
git checkout ${OPENEXR_VERSION} --force
|
||||
|
||||
if [[ ${OPENEXR_VERSION} == "v2.2.0" ]] || [[ ${OPENEXR_VERSION} == "v2.2.1" ]] \
|
||||
|| [[ ${OPENEXR_VERSION} == "v2.2.2" ]] ; then
|
||||
mkdir -p ${OPENEXR_BUILD_DIR}/IlmBase && true
|
||||
mkdir -p ${OPENEXR_BUILD_DIR}/OpenEXR && true
|
||||
cd ${OPENEXR_BUILD_DIR}/IlmBase
|
||||
cmake -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} ${OPENEXR_GENERATOR_CMD} \
|
||||
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
||||
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
|
||||
-DCMAKE_CXX_STANDARD=11 \
|
||||
${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR}/IlmBase
|
||||
time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE}
|
||||
cd ${OPENEXR_BUILD_DIR}/OpenEXR
|
||||
cmake -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} ${OPENEXR_GENERATOR_CMD} \
|
||||
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}\;${OPENEXR_INSTALL_DIR}" \
|
||||
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
||||
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
||||
-DBUILD_UTILS=0 -DBUILD_TESTS=0 \
|
||||
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
|
||||
${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR}/OpenEXR
|
||||
time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE}
|
||||
elif [[ ${OPENEXR_VERSION} == "v2.3.0" ]] ; then
|
||||
# Simplified setup for 2.3+
|
||||
cd ${OPENEXR_BUILD_DIR}
|
||||
cmake -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} -G "$CMAKE_GENERATOR" \
|
||||
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
||||
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
|
||||
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
||||
-DOPENEXR_BUILD_UTILS=0 \
|
||||
-DOPENEXR_BUILD_TESTS=0 \
|
||||
-DOPENEXR_BUILD_PYTHON_LIBS=0 \
|
||||
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
|
||||
${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR}
|
||||
time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE}
|
||||
else
|
||||
# Simplified setup for 2.4+
|
||||
cd ${OPENEXR_BUILD_DIR}
|
||||
cmake -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} -G "$CMAKE_GENERATOR" \
|
||||
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
||||
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
|
||||
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
||||
-DOPENEXR_BUILD_UTILS=0 \
|
||||
-DBUILD_TESTING=0 \
|
||||
-DPYILMBASE_ENABLE=0 \
|
||||
-DOPENEXR_VIEWERS_ENABLE=0 \
|
||||
-DINSTALL_OPENEXR_EXAMPLES=0 \
|
||||
-DOPENEXR_INSTALL_EXAMPLES=0 \
|
||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
|
||||
${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR}
|
||||
time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE}
|
||||
fi
|
||||
|
||||
pushd ./openexr
|
||||
git checkout v${EXRVERSION} --force
|
||||
cd IlmBase
|
||||
mkdir build
|
||||
cd build
|
||||
cmake --config Release -DCMAKE_INSTALL_PREFIX=${EXRINSTALLDIR} .. && make clean && make -j 4 && make install
|
||||
cd ..
|
||||
cd ../OpenEXR
|
||||
cp ${BASEDIR}/src/build-scripts/OpenEXR-CMakeLists.txt CMakeLists.txt
|
||||
cp ${BASEDIR}/src/build-scripts/OpenEXR-IlmImf-CMakeLists.txt IlmImf/CMakeLists.txt
|
||||
mkdir build
|
||||
mkdir build/IlmImf
|
||||
cd build
|
||||
unzip -d IlmImf ${BASEDIR}/src/build-scripts/b44ExpLogTable.h.zip
|
||||
unzip -d IlmImf ${BASEDIR}/src/build-scripts/dwaLookups.h.zip
|
||||
cmake --config Release -DCMAKE_INSTALL_PREFIX=${EXRINSTALLDIR} -DILMBASE_PACKAGE_PREFIX=${EXRINSTALLDIR} -DBUILD_UTILS=0 -DBUILD_TESTS=0 .. && make clean && make -j 4 && make install
|
||||
popd
|
||||
|
||||
ls -R ${EXRINSTALLDIR}
|
||||
#ls -R ${OPENEXR_INSTALL_DIR}
|
||||
|
||||
#echo "listing .."
|
||||
#ls ..
|
||||
# Set up paths. These will only affect the caller if this script is
|
||||
# run with 'source' rather than in a separate shell.
|
||||
export ILMBASE_ROOT=$OPENEXR_INSTALL_DIR
|
||||
export OPENEXR_ROOT=$OPENEXR_INSTALL_DIR
|
||||
export ILMBASE_LIBRARY_DIR=$OPENEXR_INSTALL_DIR/lib
|
||||
export OPENEXR_LIBRARY_DIR=$OPENEXR_INSTALL_DIR/lib
|
||||
export LD_LIBRARY_PATH=$OPENEXR_ROOT/lib:$LD_LIBRARY_PATH
|
||||
|
||||
export ILMBASE_ROOT_DIR=$OPENEXR_INSTALL_DIR
|
||||
export OPENEXR_ROOT_DIR=$OPENEXR_INSTALL_DIR
|
||||
|
||||
@@ -1,17 +1,67 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Install OpenImageIO
|
||||
|
||||
OIIOBRANCH=${OIIOBRANCH:=master}
|
||||
OIIOINSTALLDIR=${OIIOINSTALLDIR:=${PWD}/OpenImageIO}
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
if [ ! -e $OIIOINSTALLDIR ] ; then
|
||||
git clone https://github.com/OpenImageIO/oiio.git $OIIOINSTALLDIR
|
||||
OPENIMAGEIO_REPO=${OPENIMAGEIO_REPO:=OpenImageIO/oiio}
|
||||
OPENIMAGEIO_VERSION=${OPENIMAGEIO_VERSION:=master}
|
||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||
OPENIMAGEIO_SRCDIR=${OPENIMAGEIO_SRCDIR:=${LOCAL_DEPS_DIR}/OpenImageIO}
|
||||
OPENIMAGEIO_BUILD_DIR=${OPENIMAGEIO_BUILD_DIR:=${OPENIMAGEIO_SRCDIR}/build/$PLATFORM}
|
||||
OPENIMAGEIO_INSTALLDIR=${OPENIMAGEIO_INSTALLDIR:=${LOCAL_DEPS_DIR}/dist}
|
||||
OPENIMAGEIO_CMAKE_FLAGS=${OPENIMAGEIO_CMAKE_FLAGS:=""}
|
||||
OPENIMAGEIO_BUILD_TYPE=${OPENIMAGEIO_BUILD_TYPE:=Release}
|
||||
OPENIMAGEIO_CXXFLAGS=${OPENIMAGEIO_CXXFLAGS:=""}
|
||||
BASEDIR=$PWD
|
||||
CMAKE_GENERATOR=${CMAKE_GENERATOR:="Unix Makefiles"}
|
||||
|
||||
if [ ! -e $OPENIMAGEIO_SRCDIR ] ; then
|
||||
git clone https://github.com/${OPENIMAGEIO_REPO} $OPENIMAGEIO_SRCDIR
|
||||
fi
|
||||
|
||||
( cd $OIIOINSTALLDIR ; git fetch --all -p && git checkout $OIIOBRANCH --force ; make nuke )
|
||||
( cd $OIIOINSTALLDIR ; make ${OIIOMAKEFLAGS} VERBOSE=1 cmakesetup )
|
||||
( cd $OIIOINSTALLDIR ; make ${OIIOMAKEFLAGS} )
|
||||
|
||||
echo "OIIOINSTALLDIR $OIIOINSTALLDIR"
|
||||
ls -R $OIIOINSTALLDIR/dist
|
||||
mkdir -p ${OPENIMAGEIO_INSTALLDIR} && true
|
||||
mkdir -p ${OPENIMAGEIO_BUILD_DIR} && true
|
||||
|
||||
pushd $OPENIMAGEIO_SRCDIR
|
||||
git fetch --all -p
|
||||
git checkout $OPENIMAGEIO_VERSION --force
|
||||
|
||||
if [[ "$USE_SIMD" != "" ]] ; then
|
||||
OPENIMAGEIO_CMAKE_FLAGS="$OPENIMAGEIO_CMAKE_FLAGS -DUSE_SIMD=$USE_SIMD"
|
||||
fi
|
||||
if [[ "$DEBUG" == "1" ]] ; then
|
||||
OPENIMAGEIO_CMAKE_FLAGS="$OPENIMAGEIO_CMAKE_FLAGS -DCMAKE_BUILD_TYPE=Debug"
|
||||
fi
|
||||
|
||||
# if [[ "$ARCH" == "windows64" ]] ; then
|
||||
pushd ${OPENIMAGEIO_BUILD_DIR}
|
||||
cmake ../.. -G "$CMAKE_GENERATOR" \
|
||||
-DCMAKE_BUILD_TYPE="$OPENIMAGEIO_BUILD_TYPE" \
|
||||
-DCMAKE_INSTALL_PREFIX="$OPENIMAGEIO_INSTALLDIR" \
|
||||
-DPYTHON_VERSION="$PYTHON_VERSION" \
|
||||
-DCMAKE_INSTALL_LIBDIR="$OPENIMAGEIO_INSTALLDIR/lib" \
|
||||
-DCMAKE_CXX_STANDARD="$CMAKE_CXX_STANDARD" \
|
||||
$OPENIMAGEIO_CMAKE_FLAGS -DVERBOSE=1
|
||||
echo "Parallel build $CMAKE_BUILD_PARALLEL_LEVEL"
|
||||
time cmake --build . --target install --config ${OPENIMAGEIO_BUILD_TYPE}
|
||||
popd
|
||||
|
||||
popd
|
||||
|
||||
export OpenImageIO_ROOT=$OPENIMAGEIO_INSTALLDIR
|
||||
export PATH=$OpenImageIO_ROOT/bin:$PATH
|
||||
export DYLD_LIBRARY_PATH=$OpenImageIO_ROOT/lib:$DYLD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=$OpenImageIO_ROOT/lib:$LD_LIBRARY_PATH
|
||||
export PYTHONPATH=$OpenImageIO_ROOT/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
|
||||
|
||||
echo "DYLD_LIBRARY_PATH = $DYLD_LIBRARY_PATH"
|
||||
echo "LD_LIBRARY_PATH = $LD_LIBRARY_PATH"
|
||||
echo "OpenImageIO_ROOT $OpenImageIO_ROOT"
|
||||
# ls -R $OpenImageIO_ROOT
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Utility script to download and build pugixml
|
||||
#
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
# Repo and branch/tag/commit of pugixml to download if we don't have it yet
|
||||
PUGIXML_REPO=${PUGIXML_REPO:=https://github.com/zeux/pugixml.git}
|
||||
PUGIXML_VERSION=${PUGIXML_VERSION:=v1.10}
|
||||
|
||||
# Where to put pugixml repo source (default to the ext area)
|
||||
PUGIXML_SRC_DIR=${PUGIXML_SRC_DIR:=${PWD}/ext/pugixml}
|
||||
# Temp build area (default to a build/ subdir under source)
|
||||
PUGIXML_BUILD_DIR=${PUGIXML_BUILD_DIR:=${PUGIXML_SRC_DIR}/build}
|
||||
# Install area for pugixml (default to ext/dist)
|
||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||
PUGIXML_INSTALL_DIR=${PUGIXML_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
|
||||
#PUGIXML_BUILD_OPTS=${PUGIXML_BUILD_OPTS:=}
|
||||
|
||||
pwd
|
||||
echo "pugixml install dir will be: ${PUGIXML_INSTALL_DIR}"
|
||||
|
||||
mkdir -p ./ext
|
||||
pushd ./ext
|
||||
|
||||
# Clone pugixml project from GitHub and build
|
||||
if [[ ! -e ${PUGIXML_SRC_DIR} ]] ; then
|
||||
echo "git clone ${PUGIXML_REPO} ${PUGIXML_SRC_DIR}"
|
||||
git clone ${PUGIXML_REPO} ${PUGIXML_SRC_DIR}
|
||||
fi
|
||||
cd ${PUGIXML_SRC_DIR}
|
||||
echo "git checkout ${PUGIXML_VERSION} --force"
|
||||
git checkout ${PUGIXML_VERSION} --force
|
||||
|
||||
mkdir -p ${PUGIXML_BUILD_DIR}
|
||||
cd ${PUGIXML_BUILD_DIR}
|
||||
time cmake -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${PUGIXML_INSTALL_DIR} \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_TESTS=OFF \
|
||||
${PUGIXML_BUILD_OPTS} ..
|
||||
time cmake --build . --config Release --target install
|
||||
|
||||
# ls -R ${PUGIXML_INSTALL_DIR}
|
||||
popd
|
||||
|
||||
#echo "listing .."
|
||||
#ls ..
|
||||
|
||||
# Set up paths. These will only affect the caller if this script is
|
||||
# run with 'source' rather than in a separate shell.
|
||||
export pugixml_ROOT=$PUGIXML_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$pugixml_ROOT/lib:$pugixml_ROOT/lib64:$LD_LIBRARY_PATH
|
||||
@@ -0,0 +1,61 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Utility script to download and build pybind11
|
||||
#
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
# Repo and branch/tag/commit of pybind11 to download if we don't have it yet
|
||||
PYBIND11_REPO=${PYBIND11_REPO:=https://github.com/pybind/pybind11.git}
|
||||
PYBIND11_VERSION=${PYBIND11_VERSION:=v2.4.3}
|
||||
|
||||
# Where to put pybind11 repo source (default to the ext area)
|
||||
PYBIND11_SRC_DIR=${PYBIND11_SRC_DIR:=${PWD}/ext/pybind11}
|
||||
# Temp build area (default to a build/ subdir under source)
|
||||
PYBIND11_BUILD_DIR=${PYBIND11_BUILD_DIR:=${PYBIND11_SRC_DIR}/build}
|
||||
# Install area for pybind11 (default to ext/dist)
|
||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||
PYBIND11_INSTALL_DIR=${PYBIND11_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
|
||||
PYBIND11_BUILD_OPTS=${PYBIND11_BUILD_OPTS:=}
|
||||
|
||||
if [[ "${PYTHON_VERSION}" != "" ]] ; then
|
||||
PYBIND11_BUILD_OPTS+=" -DPYBIND11_PYTHON_VERSION=${PYTHON_VERSION}"
|
||||
fi
|
||||
|
||||
pwd
|
||||
echo "pybind11 install dir will be: ${PYBIND11_INSTALL_DIR}"
|
||||
|
||||
mkdir -p ./ext
|
||||
pushd ./ext
|
||||
|
||||
# Clone pybind11 project from GitHub and build
|
||||
if [[ ! -e ${PYBIND11_SRC_DIR} ]] ; then
|
||||
echo "git clone ${PYBIND11_REPO} ${PYBIND11_SRC_DIR}"
|
||||
git clone ${PYBIND11_REPO} ${PYBIND11_SRC_DIR}
|
||||
fi
|
||||
cd ${PYBIND11_SRC_DIR}
|
||||
echo "git checkout ${PYBIND11_VERSION} --force"
|
||||
git checkout ${PYBIND11_VERSION} --force
|
||||
|
||||
mkdir -p ${PYBIND11_BUILD_DIR}
|
||||
cd ${PYBIND11_BUILD_DIR}
|
||||
time cmake -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${PYBIND11_INSTALL_DIR} \
|
||||
-DPYBIND11_TEST=OFF \
|
||||
${PYBIND11_BUILD_OPTS} ..
|
||||
time cmake --build . --config Release --target install
|
||||
|
||||
# ls -R ${PYBIND11_INSTALL_DIR}
|
||||
popd
|
||||
|
||||
#echo "listing .."
|
||||
#ls ..
|
||||
|
||||
# Set up paths. These will only affect the caller if this script is
|
||||
# run with 'source' rather than in a separate shell.
|
||||
export pybind11_ROOT=$PYBIND11_INSTALL_DIR
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Important: set -ex causes this whole script to terminate with error if
|
||||
# any command in it fails. This is crucial for CI tests.
|
||||
set -ex
|
||||
|
||||
if [[ "$USE_SIMD" != "" ]] ; then
|
||||
OSL_CMAKE_FLAGS="$OSL_CMAKE_FLAGS -DUSE_SIMD=$USE_SIMD"
|
||||
fi
|
||||
|
||||
pushd build/$PLATFORM
|
||||
cmake ../.. -G "$CMAKE_GENERATOR" \
|
||||
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
|
||||
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
|
||||
-DCMAKE_INSTALL_PREFIX="$OSL_ROOT" \
|
||||
-DUSE_PYTHON="${USE_PYTHON:=1}" \
|
||||
-DPYTHON_VERSION="$PYTHON_VERSION" \
|
||||
-DCMAKE_INSTALL_LIBDIR="$OSL_ROOT/lib" \
|
||||
-DCMAKE_CXX_STANDARD="$CMAKE_CXX_STANDARD" \
|
||||
$OSL_CMAKE_FLAGS -DVERBOSE=1
|
||||
time cmake --build . --target ${BUILDTARGET:=install} --config ${CMAKE_BUILD_TYPE}
|
||||
popd
|
||||
|
||||
if [[ "${DEBUG_CI:=0}" != "0" ]] ; then
|
||||
echo "PATH=$PATH"
|
||||
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
|
||||
echo "PYTHONPATH=$PYTHONPATH"
|
||||
echo "ldd testshade"
|
||||
ldd $OSL_ROOT/bin/testshade
|
||||
fi
|
||||
|
||||
if [[ "$BUILDTARGET" == clang-format ]] ; then
|
||||
git diff --color
|
||||
THEDIFF=`git diff`
|
||||
if [[ "$THEDIFF" != "" ]] ; then
|
||||
echo "git diff was not empty. Failing clang-format or clang-tidy check."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1,97 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# This script is run when CI system first starts up.
|
||||
# Since it sets many env variables needed by the caller, it should be run
|
||||
# with 'source', not in a separate shell.
|
||||
|
||||
# Figure out the platform
|
||||
if [[ $RUNNER_OS == macOS ]] ; then
|
||||
export ARCH=macosx
|
||||
elif [[ $RUNNER_OS == Linux ]] ; then
|
||||
export ARCH=linux64
|
||||
elif [[ $RUNNER_OS == Windows ]] ; then
|
||||
export ARCH=windows64
|
||||
elif [[ `uname -m` == aarch64 ]] ; then
|
||||
export ARCH=aarch64
|
||||
else
|
||||
export ARCH=unknown
|
||||
exit -1
|
||||
fi
|
||||
export PLATFORM=$ARCH
|
||||
|
||||
if [[ "${DEBUG:=0}" != "0" ]] ; then
|
||||
export PLATFORM=${PLATFORM}.debug
|
||||
fi
|
||||
|
||||
echo "Architecture is $ARCH"
|
||||
echo "Build platform name is $PLATFORM"
|
||||
|
||||
# Environment variables we always need
|
||||
export PATH=/usr/local/bin/_ccache:/usr/lib/ccache:$PATH
|
||||
export USE_CCACHE=${USE_CCACHE:=1}
|
||||
export CCACHE_CPP2=1
|
||||
export CCACHE_DIR=/tmp/ccache
|
||||
if [[ "${RUNNER_OS}" == "macOS" ]] ; then
|
||||
export CCACHE_DIR=$HOME/.ccache
|
||||
fi
|
||||
mkdir -p $CCACHE_DIR
|
||||
|
||||
export OSL_ROOT=$PWD/dist/$PLATFORM
|
||||
export DYLD_LIBRARY_PATH=$OSL_ROOT/lib:$DYLD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=$OSL_ROOT/lib:$LD_LIBRARY_PATH
|
||||
export OIIO_LIBRARY_PATH=$OSL_ROOT/lib:${OIIO_LIBRARY_PATH}
|
||||
export LSAN_OPTIONS=suppressions=$PWD/src/build-scripts/nosanitize.txt
|
||||
export ASAN_OPTIONS=print_suppressions=0
|
||||
|
||||
export USE_PYTHON=${USE_PYTHON:=1}
|
||||
export PYTHON_VERSION=${PYTHON_VERSION:="2.7"}
|
||||
export PYTHONPATH=/usr/local/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
|
||||
export PYTHONPATH=/usr/local/lib64/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
|
||||
export PYTHONPATH=$OSL_ROOT/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
|
||||
export BUILD_MISSING_DEPS=${BUILD_MISSING_DEPS:=1}
|
||||
export COMPILER=${COMPILER:=gcc}
|
||||
export CXX=${CXX:=g++}
|
||||
export OSL_CI=true
|
||||
export USE_NINJA=${USE_NINJA:=1}
|
||||
export CMAKE_GENERATOR=${CMAKE_GENERATOR:=Ninja}
|
||||
export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:=Release}
|
||||
export CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD:=11}
|
||||
|
||||
export PARALLEL=${PARALLEL:=4}
|
||||
export PAR_MAKEFLAGS=-j${PARALLEL}
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:=${PARALLEL}}
|
||||
export CTEST_PARALLEL_LEVEL=${CTEST_PARALLEL_LEVEL:=${PARALLEL}}
|
||||
|
||||
export LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=$HOME/ext}
|
||||
export CMAKE_PREFIX_PATH=${LOCAL_DEPS_DIR}/dist:${CMAKE_PREFIX_PATH}
|
||||
export LD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib64:$LD_LIBRARY_PATH
|
||||
export DYLD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib:$DYLD_LIBRARY_PATH
|
||||
|
||||
export TESTSUITE_CLEANUP_ON_SUCCESS=${TESTSUITE_CLEANUP_ON_SUCCESS:=1}
|
||||
|
||||
mkdir -p build/$PLATFORM dist/$PLATFORM
|
||||
|
||||
echo "HOME = $HOME"
|
||||
echo "PWD = $PWD"
|
||||
echo "LOCAL_DEPS_DIR = $LOCAL_DEPS_DIR"
|
||||
echo "uname -a: " `uname -a`
|
||||
echo "uname -m: " `uname -m`
|
||||
echo "uname -s: " `uname -s`
|
||||
echo "uname -n: " `uname -n`
|
||||
pwd
|
||||
ls
|
||||
env | sort
|
||||
|
||||
if [[ `uname -s` == "Linux" ]] ; then
|
||||
head -40 /proc/cpuinfo
|
||||
elif [[ $ARCH == macosx ]] ; then
|
||||
sysctl machdep.cpu.features
|
||||
fi
|
||||
|
||||
# Save the env for use by other stages
|
||||
src/build-scripts/save-env.bash
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Important: set -ex causes this whole script to terminate with error if
|
||||
# any command in it fails. This is crucial for CI tests.
|
||||
set -ex
|
||||
|
||||
$OSL_ROOT/bin/testshade --help
|
||||
|
||||
echo "Parallel test " ${CTEST_PARALLEL_LEVEL}
|
||||
pushd build/$PLATFORM
|
||||
time ctest -C ${CMAKE_BUILD_TYPE} -E broken --force-new-ctest-process \
|
||||
--output-on-failure --timeout ${CTEST_TEST_TIMEOUT:=180} ${CTEST_ARGS}
|
||||
popd
|
||||
|
||||
|
||||
# if [[ "$CODECOV" == 1 ]] ; then
|
||||
# bash <(curl -s https://codecov.io/bash)
|
||||
# fi
|
||||
@@ -0,0 +1,442 @@
|
||||
#!/usr/bin/env python
|
||||
from __future__ import print_function, absolute_import
|
||||
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# To generate docdeep for docdeep, run this:
|
||||
# python3 docdeep.py -d docdeep docdeep.py > docdeep.md.html
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
|
||||
### <doc docdeep>
|
||||
###
|
||||
### **docdeep**
|
||||
###
|
||||
### Introduction
|
||||
### ============
|
||||
###
|
||||
### `docdeep` is a utility that extracts documentation from source code and
|
||||
### turns them into beautiful Markdeep documents.
|
||||
###
|
||||
### [Markdeep](https://casual-effects.com/markdeep) is a package by Morgan
|
||||
### McGuire, an extension of Markdown with a whole bunch of nice features
|
||||
### that make it extra nice for code, math, and diagrams. Read the Markdeep
|
||||
### web page and look at the examples for details.
|
||||
###
|
||||
### `docdeep` is a little like `Doxygen`. A poor person's Doxygen. A very
|
||||
### poor person. But without Doxygen's awkward syntax -- you just write
|
||||
### the comments in Markdeep. And the output is very aesthetically pleasing.
|
||||
### But it doesn't have any bells and whistles, like cross-referencing.
|
||||
###
|
||||
###
|
||||
###
|
||||
### Markup controls
|
||||
### ===============
|
||||
###
|
||||
### ## Documentation lines.
|
||||
###
|
||||
### A line whose first three non-whitespace characters are either `///` or
|
||||
### `###` is called a *doc-line*. Any other line is a *non-doc-line*.
|
||||
###
|
||||
### The `///` or `###` is the *doc-symbol*. Generally speaking, the `///`
|
||||
### doc-symbol is used when doc-marking C or C++, and `###` when doc-marking
|
||||
### Python, shell scripts, or other programs in languages where `#` is the
|
||||
### comment character. For simplicity, in the rest of this document, we will
|
||||
### always use `///` in our examples.
|
||||
###
|
||||
### ## Doc regions
|
||||
###
|
||||
### Doc-lines by themeslves don't do much, unless they are within a
|
||||
### *doc-region*. The beginning of a doc-region is denoted by a doc-line
|
||||
### whose first characters after the doc-symbol is
|
||||
###
|
||||
### <code>
|
||||
### /// <doc region-name>
|
||||
### </code>
|
||||
###
|
||||
### A doc region is ended one of three ways:
|
||||
###
|
||||
### 1. `</doc>` ends the active region.
|
||||
### 2. `<doc newname>` setting a new region name.
|
||||
### 3. The end of the source file.
|
||||
###
|
||||
### When there is an active named region, any other doc lines will be
|
||||
### appended (after stripping off the doc symbol itself) to the current
|
||||
### doc region text.
|
||||
###
|
||||
### You can have multiple regions with the same name, in entirely separate
|
||||
### parts of your source code. They will just be concatenated.
|
||||
###
|
||||
### Only one main doc region will be output by the `docdeep` program,
|
||||
### specified with the `-d` command line argument. Any other doc-regions
|
||||
### will not be included in the documention output of that run.
|
||||
###
|
||||
### However, one doc-region may *include* the text of another doc-region
|
||||
### as follows:
|
||||
###
|
||||
### <code>
|
||||
### /// <inc region-name>
|
||||
### </code>
|
||||
###
|
||||
### ## Doc continuations and code regions
|
||||
###
|
||||
### If three dots follow the `doc` directive, like this:
|
||||
###
|
||||
### <code>
|
||||
### /// <doc... region-name>
|
||||
### </code>
|
||||
###
|
||||
### This causes *all* lines (until the end of the doc region) to be
|
||||
### interpreted as Markdeep documentation, even it if doesn't start with
|
||||
### the doc-symbol.
|
||||
###
|
||||
### Furthermore, denoting any region thusly:
|
||||
### <code>
|
||||
### /// <code>
|
||||
### ...
|
||||
### /// </code>
|
||||
### </code>
|
||||
###
|
||||
### will designate the contents not only as a doc continuation, but also
|
||||
### to be formatted as source code (mono space, syntax highlighted).
|
||||
###
|
||||
### ## API Explanations
|
||||
###
|
||||
### There is a special syntax for a common case: call-by-call explanations
|
||||
### of API methods and their explanations. Of course, this may constitute
|
||||
### the bulk of your auto-generated documentation. The two cases we are
|
||||
### concerned about is *pre-code comments* and *post-code comments*.
|
||||
###
|
||||
### For pre-code comments, the contiguous comment region associated with
|
||||
### a declaration immediately precedes the declaration. Such a comment
|
||||
### set has its first line start with `///>`. For post-code comments,
|
||||
### the documentaiton comments follows the code declaration, and this is
|
||||
### designated by having its first line start with `///<`. I like to
|
||||
### just remember that the `<` or `>` points in the direction of the code
|
||||
### declaration that the comment applies to.
|
||||
###
|
||||
### This is perhaps best explained by example:
|
||||
###
|
||||
### <code>
|
||||
### ///> Do the foo operation. Everybody knows what this is. You can write
|
||||
### /// any comment you want, with full markdeep formatting! It applies
|
||||
### /// to the declaration that will immediately follow this comment.
|
||||
### float foo (float x, float y);
|
||||
###
|
||||
### void bar (int n);
|
||||
### ///< The bar procedure. Note that with post-comments, you explain the
|
||||
### /// function or method *after* the declaration itself.
|
||||
### </code>
|
||||
###
|
||||
### This will generate the following output:
|
||||
###
|
||||
### <code>
|
||||
### float foo (float x, float y);
|
||||
### </code>
|
||||
### Do the foo operation. Everybody knows what this is. You can write
|
||||
### any comment you want, with full markdeep formatting! It applies
|
||||
### to the declaration that will immediately follow this comment.
|
||||
###
|
||||
### <code>
|
||||
### void bar (int n);
|
||||
### </code>
|
||||
### The bar procedure. Note that with post-comments, you explain the
|
||||
### function or method *after* the declaration itself.
|
||||
###
|
||||
### -----------------------
|
||||
###
|
||||
### It is important to keep in mind that **this API explanation is extremely
|
||||
### stupid**. The comment documentation is just a series of doc-lines with
|
||||
### no break between them, whose *first* line starts with `///>' or `///>`
|
||||
### (for pre-code and post-code docs, respectively). And the code that it
|
||||
### documents is just the immediately preceding or following set of non-doc
|
||||
### lines that contain *no* whitespace-only lines. There is no syntax
|
||||
### parsing going on here -- it just takes those non-blank, non-doc lines,
|
||||
### strips off any semicolons and any characters following the semicolon
|
||||
### from each line in the block, and deletes anything in the whole block
|
||||
### at or after the first opening brace (`{`) found in the block. Strangely
|
||||
### enough, this is almost exactly what I want to document.
|
||||
###
|
||||
###
|
||||
### Command line arguments
|
||||
### ======================
|
||||
###
|
||||
### Run from the command line as follows:
|
||||
###
|
||||
### `$ python docdeep.py -d` *region* `-s` *style.css* `input1.h input2.cpp [...] > output.md.html`
|
||||
###
|
||||
### Arguments:
|
||||
###
|
||||
### `-d` *region*
|
||||
### : Specifies the name of the doc-region to generate output for. This is
|
||||
### required.
|
||||
### `-s` *stylesheet*
|
||||
### : This optional argument will specify which CSS style sheet to include a
|
||||
### reference to.
|
||||
###
|
||||
### Any number of filenames may be specified. They will be processed in the
|
||||
### order that they appear on the command line.
|
||||
###
|
||||
|
||||
import sys
|
||||
import re
|
||||
import argparse
|
||||
|
||||
# pattern for beginning of special comment
|
||||
docline_pattern = re.compile ('(^[ \t]*)((///)|(###))[<>]?([ \t]|$)(.*)')
|
||||
doc_begin_pattern = re.compile ('(^[ \t]*)((///)|(###))[ ]*<doc(\.\.\.)?[ ]*(\w*)[ ]*>')
|
||||
docendpattern = re.compile ('(^[ \t]*)((///)|(###))[ ]*</doc>')
|
||||
api_precomment_pattern = re.compile ('(^[ \t]*)((///)|(###))>( )+( )?(.*)')
|
||||
api_postcomment_pattern = re.compile ('(^[ \t]*)((///)|(###))<( )+( )?(.*)')
|
||||
inc_pattern = re.compile ('(^[ \t]*)<inc[ ]+([^>]+)>')
|
||||
code_pattern = re.compile ('(^[ \t]*)((///)|(###))[ ]*<code>')
|
||||
codeend_pattern = re.compile ('(^[ \t]*)((///)|(###))[ ]*</code>')
|
||||
trimbrace_pattern = re.compile ("([^{]*)")
|
||||
trimsemi_pattern = re.compile ("([^;]*)")
|
||||
blankline_pattern = re.compile ("^[ \t]*$")
|
||||
|
||||
region_name = '_'
|
||||
alldocs = { '_' : '' }
|
||||
DEBUG = False
|
||||
|
||||
|
||||
# Utility: blob is a string (possibly containing many "lines" separated by
|
||||
# '\n'). For each line of text in the blob, shave off the first `indent`
|
||||
# characters. Then reassemble and return.
|
||||
def shave_each_line (blob, indent) :
|
||||
r = ''
|
||||
lines = blob.split ('\n')
|
||||
for line in lines :
|
||||
r += line[indent:] + '\n'
|
||||
# strip trailing newline unless the original blob had a trailing newline
|
||||
if len(r) and r[-1] == '\n' and blob[-1] != '\n':
|
||||
r = r[:-1]
|
||||
return r
|
||||
|
||||
# Enumerated type for the state machine.
|
||||
class LineType :
|
||||
BLANK = 0
|
||||
DOC = 2
|
||||
NONDOC = 3
|
||||
|
||||
# Append this doc blob to the current region, and clear the blob
|
||||
def flush_doc_blob (doc_blob) :
|
||||
global alldocs, region_name
|
||||
if len(doc_blob) :
|
||||
alldocs[region_name] += doc_blob + '\n'
|
||||
doc_blob = ''
|
||||
|
||||
def read_input (filename, file) :
|
||||
global region_name, alldocs
|
||||
doc_cont_mode = False
|
||||
post_api_mode = False
|
||||
pre_api_mode = False
|
||||
indent = 0 # Amount of indentation we saw on the liast doc line
|
||||
lines = file.read().splitlines()
|
||||
code_blob = '' # Running set of contiguous non-doc, non-blank lines
|
||||
doc_blob = '' # Running set of contiguous doc lines
|
||||
|
||||
# state machine
|
||||
line_type = LineType.BLANK
|
||||
last_line_type = LineType.BLANK
|
||||
|
||||
for line in lines :
|
||||
|
||||
# Figure out what type of line we're on, and remember what type
|
||||
# of line we saw last.
|
||||
last_line_type = line_type
|
||||
if blankline_pattern.match(line) :
|
||||
line_type = LineType.BLANK
|
||||
elif docline_pattern.match(line) :
|
||||
line_type = LineType.DOC
|
||||
else :
|
||||
line_type = LineType.NONDOC
|
||||
|
||||
# print ('<!-- LINE----- ', line_type, line, ' -->\n')
|
||||
|
||||
# Not a doc line, but we're in "continuation mode": append
|
||||
# (unindented) to the doc blob.
|
||||
if line_type != LineType.DOC and doc_cont_mode :
|
||||
doc_blob += line[indent:] + '\n'
|
||||
if DEBUG :
|
||||
alldocs[region_name] += '<!-- CONT ' + line[:35] + ' -->\n'
|
||||
continue
|
||||
|
||||
# Blank line, not in continuation mode
|
||||
if line_type == LineType.BLANK :
|
||||
if DEBUG and last_line_type != LineType.BLANK :
|
||||
alldocs[region_name] += '<!-- BLANK -->\n'
|
||||
|
||||
# FIXME: does this end a post-declaration API doc?
|
||||
if pre_api_mode : # this blank ends a pre-api comment
|
||||
continue # ...keep reading
|
||||
|
||||
# If this line ends a post-api comment, output the code blob
|
||||
if post_api_mode :
|
||||
if DEBUG :
|
||||
alldocs[region_name] += ' <!-- blank ended post-api -->\n'
|
||||
# Trim everything past the first ; or { from the code blob
|
||||
alllines = code_blob.split('\n')
|
||||
# code_blob = ''
|
||||
new_code_blob = ''
|
||||
for oneline in alllines :
|
||||
m = trimsemi_pattern.search (oneline)
|
||||
oneline = m.group(1)
|
||||
new_code_blob += oneline + '\n'
|
||||
new_code_blob = new_code_blob.rstrip(' \n\r')
|
||||
m = trimbrace_pattern.match(new_code_blob)
|
||||
alldocs[region_name] += ('~~~C\n' +
|
||||
shave_each_line(m.group(1),indent) +
|
||||
'\n~~~\n')
|
||||
post_api_mode = False
|
||||
|
||||
# If this line ends a doc blob, output it
|
||||
if len(doc_blob) :
|
||||
alldocs[region_name] += doc_blob + '\n'
|
||||
doc_blob = ''
|
||||
# Blank lines clear the code blob
|
||||
code_blob = ''
|
||||
continue
|
||||
|
||||
# Non-blank, non-doc line: append to code blob and move on.
|
||||
if line_type == LineType.NONDOC :
|
||||
if DEBUG :
|
||||
alldocs[region_name] += '<!-- NONDOC ' + line[:35] + ' -->\n'
|
||||
code_blob += line + '\n'
|
||||
continue
|
||||
|
||||
# Remaining cases are all doc lines!
|
||||
|
||||
# Any doc line resets the pre-doc-symbol indentation level
|
||||
m = docline_pattern.match(line)
|
||||
indent = len(m.group(1))
|
||||
|
||||
# Handle <doc> and <doc...> : start of new doc section
|
||||
m = doc_begin_pattern.match(line)
|
||||
if m :
|
||||
flush_doc_blob (doc_blob)
|
||||
doc_blob = ''
|
||||
# If it led with <doc...> it also starts continuation mode
|
||||
doc_cont_mode = (m.group(5) == '...')
|
||||
# The <doc> directive gave the region name.
|
||||
r = m.group(6)
|
||||
r.strip()
|
||||
if r == '' :
|
||||
r = '_'
|
||||
if DEBUG :
|
||||
alldocs[region_name] += '<!-- DOCBEGIN ' + r + ' -->\n'
|
||||
region_name = r
|
||||
if not (region_name in alldocs) :
|
||||
alldocs[region_name] = ''
|
||||
continue
|
||||
#
|
||||
# Handle </doc>
|
||||
m = docendpattern.match(line)
|
||||
if m :
|
||||
if DEBUG :
|
||||
alldocs[region_name] += '<!-- DOCEND ' + region_name + '-->\n'
|
||||
flush_doc_blob (doc_blob)
|
||||
doc_blob = ''
|
||||
doc_cont_mode = False
|
||||
region_name = '_'
|
||||
continue
|
||||
#
|
||||
# Handle start of post-declaration API comment
|
||||
m = api_postcomment_pattern.match(line)
|
||||
if m :
|
||||
if DEBUG :
|
||||
alldocs[region_name] += '<!-- start post-decl api ' + line[:35] + '-->\n'
|
||||
flush_doc_blob (doc_blob)
|
||||
doc_blob = ''
|
||||
# Deduce indentation level
|
||||
indent = len(m.group(1))
|
||||
post_api_mode = True
|
||||
remainder = m.group(7)
|
||||
doc_blob += remainder + '\n'
|
||||
continue
|
||||
#
|
||||
# Handle start of pre-declaration API comment
|
||||
m = api_precomment_pattern.match(line)
|
||||
if m :
|
||||
flush_doc_blob (doc_blob)
|
||||
doc_blob = ''
|
||||
indent = len(m.group(1))
|
||||
post_api_mode = True
|
||||
remainder = m.group(7)
|
||||
doc_blob += remainder + '\n'
|
||||
continue
|
||||
#
|
||||
# Handle code section <code> ... </code>
|
||||
m = code_pattern.match(line)
|
||||
if m :
|
||||
flush_doc_blob (doc_blob)
|
||||
doc_blob = ''
|
||||
if DEBUG :
|
||||
doc_blob += '<!-- start code in '+ region_name+ '-->\n'
|
||||
indent = len(m.group(1))
|
||||
doc_blob += '<script type="preformatted">\n~~~C\n'
|
||||
doc_cont_mode = True
|
||||
continue
|
||||
if codeend_pattern.match(line) :
|
||||
doc_cont_mode = False
|
||||
doc_blob += '~~~\n</script>\n'
|
||||
if DEBUG :
|
||||
doc_blob += '<!-- end code in '+ region_name+ '-->\n'
|
||||
flush_doc_blob (doc_blob)
|
||||
doc_blob = ''
|
||||
continue
|
||||
#
|
||||
# Last case: just a continuing doc line
|
||||
m = docline_pattern.match (line)
|
||||
if m :
|
||||
if DEBUG :
|
||||
alldocs[region_name] += '<!-- doc cont ' + line[:35] + ' -->\n'
|
||||
contents = m.group(6)
|
||||
doc_blob += contents + '\n'
|
||||
continue
|
||||
print ('<!-- REMAINING CASE:', line, '-->\n')
|
||||
flush_doc_blob (doc_blob)
|
||||
region_name = '_'
|
||||
|
||||
|
||||
def output_blob (blob) :
|
||||
for line in blob.splitlines() :
|
||||
m = inc_pattern.match (line)
|
||||
if m and (m.group(2) in alldocs) :
|
||||
# print ('Want to include', m.group(2))
|
||||
output_blob (alldocs[m.group(2)])
|
||||
else :
|
||||
print (line)
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser (prog='docdeep',
|
||||
description='Turn source comments into markdeep document')
|
||||
parser.add_argument ('-d', dest='docname', default='main',
|
||||
help='Name of documentation (default: "main")')
|
||||
parser.add_argument ('-s', dest='stylesheet', default='',
|
||||
help='Name of style sheet (default: "")')
|
||||
parser.add_argument ('--debug', dest='DEBUG', action='store_const',
|
||||
const=True, default=False)
|
||||
parser.add_argument ('filenames', nargs='+')
|
||||
# parser.add_argument ('-o', dest='output_filename', nargs=1,
|
||||
# help='Output filename (default: stdout)')
|
||||
args = parser.parse_args()
|
||||
DEBUG = args.DEBUG
|
||||
|
||||
for filename in args.filenames :
|
||||
with open(filename) as file:
|
||||
read_input (filename, file)
|
||||
|
||||
print ('<meta charset="utf-8">\n')
|
||||
if args.docname in alldocs :
|
||||
output_blob (alldocs[args.docname])
|
||||
else :
|
||||
print ("Ick! could not find docs for", args.docname)
|
||||
|
||||
print ('<!-- Markdeep: --><style class="fallback">body{visibility:hidden;white-space:pre;font-family:monospace}</style><script src="markdeep.min.js"></script><script src="https://casual-effects.com/markdeep/latest/markdeep.min.js?"></script><script>window.alreadyProcessedMarkdeep||(document.body.style.visibility="visible")</script>')
|
||||
if args.stylesheet :
|
||||
print ('<link rel="stylesheet" href="{}">'.format (args.stylesheet))
|
||||
@@ -0,0 +1,116 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
|
||||
set -ex
|
||||
|
||||
|
||||
#
|
||||
# Install system packages when those are acceptable for dependencies.
|
||||
#
|
||||
if [[ "$ASWF_ORG" != "" ]] ; then
|
||||
# Using ASWF CentOS container
|
||||
|
||||
export PATH=/opt/rh/devtoolset-6/root/usr/bin:/usr/local/bin:$PATH
|
||||
|
||||
#ls /etc/yum.repos.d
|
||||
|
||||
sudo yum install -y giflib giflib-devel && true
|
||||
sudo yum install -y opencv opencv-devel && true
|
||||
sudo yum install -y Field3D Field3D-devel && true
|
||||
sudo yum install -y ffmpeg ffmpeg-devel && true
|
||||
|
||||
else
|
||||
# Using native Ubuntu runner
|
||||
|
||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||
time sudo apt-get update
|
||||
|
||||
time sudo apt-get -q install -y \
|
||||
git cmake ninja-build ccache g++ \
|
||||
libboost-dev libboost-thread-dev \
|
||||
libboost-filesystem-dev libboost-regex-dev \
|
||||
libilmbase-dev libopenexr-dev \
|
||||
python-dev python-numpy \
|
||||
libtiff-dev libgif-dev libpng-dev \
|
||||
flex bison libbison-dev \
|
||||
libpugixml-dev \
|
||||
libopencolorio-dev \
|
||||
qt5-default
|
||||
|
||||
export CMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu:$CMAKE_PREFIX_PATH
|
||||
|
||||
if [[ "$CXX" == "g++-4.8" ]] ; then
|
||||
time sudo apt-get install -y g++-4.8
|
||||
elif [[ "$CXX" == "g++-6" ]] ; then
|
||||
time sudo apt-get install -y g++-6
|
||||
elif [[ "$CXX" == "g++-7" ]] ; then
|
||||
time sudo apt-get install -y g++-7
|
||||
elif [[ "$CXX" == "g++-8" ]] ; then
|
||||
time sudo apt-get install -y g++-8
|
||||
elif [[ "$CXX" == "g++-9" ]] ; then
|
||||
time sudo apt-get install -y g++-9
|
||||
elif [[ "$CXX" == "g++-10" ]] ; then
|
||||
time sudo apt-get install -y g++-10
|
||||
elif [[ "$CXX" == "g++-11" ]] ; then
|
||||
time sudo apt-get install -y g++-11
|
||||
fi
|
||||
|
||||
source src/build-scripts/build_llvm.bash
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [[ "$OPTIX_VERSION" != "" ]] ; then
|
||||
echo "Requested OPTIX_VERSION = '${OPTIX_VERSION}'"
|
||||
mkdir -p $LOCAL_DEPS_DIR/dist/include/internal
|
||||
OPTIXLOC=https://developer.download.nvidia.com/redist/optix/v${OPTIX_VERSION}
|
||||
for f in optix.h optix_device.h optix_function_table.h \
|
||||
optix_function_table_definition.h optix_host.h \
|
||||
optix_stack_size.h optix_stubs.h optix_types.h optix_7_device.h \
|
||||
optix_7_host.h optix_7_types.h \
|
||||
internal/optix_7_device_impl.h \
|
||||
internal/optix_7_device_impl_exception.h \
|
||||
internal/optix_7_device_impl_transformations.h
|
||||
do
|
||||
curl --retry 100 -m 120 --connect-timeout 30 \
|
||||
$OPTIXLOC/include/$f > $LOCAL_DEPS_DIR/dist/include/$f
|
||||
done
|
||||
export OptiX_ROOT=$LOCAL_DEPS_DIR/dist
|
||||
fi
|
||||
|
||||
|
||||
source src/build-scripts/build_pybind11.bash
|
||||
|
||||
if [[ "$OPENEXR_VERSION" != "" ]] ; then
|
||||
source src/build-scripts/build_openexr.bash
|
||||
fi
|
||||
|
||||
# if [[ "$PUGIXML_VERSION" != "" ]] ; then
|
||||
source src/build-scripts/build_pugixml.bash
|
||||
export MY_CMAKE_FLAGS+=" -DUSE_EXTERNAL_PUGIXML=1 "
|
||||
# fi
|
||||
|
||||
if [[ "$OPENCOLORIO_VERSION" != "" ]] ; then
|
||||
# Temporary (?) fix: GH ninja having problems, fall back to make
|
||||
CMAKE_GENERATOR="Unix Makefiles" \
|
||||
source src/build-scripts/build_opencolorio.bash
|
||||
fi
|
||||
|
||||
if [[ "$OPENIMAGEIO_VERSION" != "" ]] ; then
|
||||
# There are many parts of OIIO we don't need to build
|
||||
export ENABLE_iinfo=0 ENABLE_iv=0 ENABLE_igrep=0
|
||||
export ENABLE_iconvert=0 ENABLE_testtex=0
|
||||
export ENABLE_BMP=0 ENABLE_cineon=0 ENABLE_DDS=0 ENABLE_DPX=0 ENABLE_FITS=0
|
||||
export ENABLE_ICO=0 ENABLE_iff=0 ENABLE_jpeg2000=0 ENABLE_PNM=0 ENABLE_PSD=0
|
||||
export ENABLE_RLA=0 ENABLE_SGI=0 ENABLE_SOCKET=0 ENABLE_SOFTIMAGE=0
|
||||
export ENABLE_TARGA=0 ENABLE_WEBP=0
|
||||
export OPENIMAGEIO_CMAKE_FLAGS="-DOIIO_BUILD_TESTS=0 -DUSE_OPENGL=0"
|
||||
source src/build-scripts/build_openimageio.bash
|
||||
fi
|
||||
|
||||
# Save the env for use by other stages
|
||||
src/build-scripts/save-env.bash
|
||||
@@ -0,0 +1,157 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# DEP_DIR="$PWD/ext/dist"
|
||||
DEP_DIR="$PWD/dist/$PLATFORM"
|
||||
mkdir -p "$DEP_DIR"
|
||||
INT_DIR="build/$PLATFORM"
|
||||
VCPKG_INSTALLATION_ROOT=/c/vcpkg
|
||||
|
||||
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH:=.}
|
||||
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$DEP_DIR"
|
||||
export BOOST_ROOT=${BOOST_ROOT_1_72_0}
|
||||
|
||||
BOOST_UNIX_PATH=$(echo "/$BOOST_ROOT" | sed -e 's/\\/\//g' -e 's/://')
|
||||
echo "BOOST_UNIX_PATH=$BOOST_UNIX_PATH"
|
||||
|
||||
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$BOOST_ROOT"
|
||||
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$VCPKG_INSTALLATION_ROOT/installed/x64-windows"
|
||||
export PATH="$PATH:$DEP_DIR/bin:$DEP_DIR/lib:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin:/bin"
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DEP_DIR/bin:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin"
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DEP_DIR/lib:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib"
|
||||
|
||||
# export OSL_CMAKE_FLAGS="$OSL_CMAKE_FLAGS -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
|
||||
# export OPENEXR_CMAKE_FLAGS="$OPENEXR_CMAKE_FLAGS -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
|
||||
|
||||
#ls -l "C:/Program Files (x86)/Microsoft Visual Studio/*/Enterprise/VC/Tools/MSVC" && true
|
||||
#ls -l "C:/Program Files (x86)/Microsoft Visual Studio" && true
|
||||
|
||||
|
||||
if [[ "$PYTHON_VERSION" == "3.6" ]] ; then
|
||||
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;/c/hostedtoolcache/windows/Python/3.6.8/x64"
|
||||
else
|
||||
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;/c/hostedtoolcache/windows/Python/3.7.9/x64"
|
||||
export Python_EXECUTABLE="/c/hostedtoolcache/windows/Python/3.7.9/x64/python.exe"
|
||||
export PYTHONPATH=$OpenImageIO_ROOT/lib/python${PYTHON_VERSION}/site-packages
|
||||
fi
|
||||
pip install numpy
|
||||
|
||||
|
||||
########################################################################
|
||||
# Dependency method #1: Use vcpkg (disabled)
|
||||
#
|
||||
# Currently we are not using this, but here it is for reference:
|
||||
#
|
||||
echo "All pre-installed VCPkg installs:"
|
||||
vcpkg list
|
||||
echo "---------------"
|
||||
# vcpkg update
|
||||
#
|
||||
# # vcpkg install zlib:x64-windows
|
||||
vcpkg install tiff:x64-windows
|
||||
vcpkg install libpng:x64-windows
|
||||
#vcpkg install giflib:x64-windows
|
||||
#vcpkg install freetype:x64-windows
|
||||
# vcpkg install openexr:x64-windows
|
||||
# vcpkg install libjpeg-turbo:x64-windows
|
||||
|
||||
# vcpkg install libraw:x64-windows
|
||||
# vcpkg install openjpeg:x64-windows
|
||||
# vcpkg install ffmpeg:x64-windows # takes FOREVER!
|
||||
# vcpkg install webp:x64-windows # No such vcpkg package?a
|
||||
|
||||
# echo "$VCPKG_INSTALLATION_ROOT"
|
||||
# ls "$VCPKG_INSTALLATION_ROOT"
|
||||
# echo "$VCPKG_INSTALLATION_ROOT/installed/x64-windows"
|
||||
# ls "$VCPKG_INSTALLATION_ROOT/installed/x64-windows"
|
||||
# echo "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib"
|
||||
# ls "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib"
|
||||
# echo "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin"
|
||||
# ls "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin"
|
||||
|
||||
echo "All VCPkg installs:"
|
||||
vcpkg list
|
||||
#
|
||||
########################################################################
|
||||
|
||||
|
||||
########################################################################
|
||||
# Dependency method #2: Build from source ourselves
|
||||
#
|
||||
#
|
||||
|
||||
src/build-scripts/build_zlib.bash
|
||||
export ZLIB_ROOT=$PWD/ext/dist
|
||||
|
||||
src/build-scripts/build_libpng.bash
|
||||
export PNG_ROOT=$PWD/ext/dist
|
||||
|
||||
# We're currently getting libtiff from vcpkg
|
||||
#src/build-scripts/build_libtiff.bash
|
||||
#export TIFF_ROOT=$PWD/ext/dist
|
||||
|
||||
# We're currently getting jpeg from vcpkg
|
||||
# LIBJPEGTURBO_CONFIG_OPTS=-DWITH_SIMD=OFF
|
||||
# # ^^ because we're too lazy to build nasm
|
||||
# src/build-scripts/build_libjpeg-turbo.bash
|
||||
# export JPEGTurbo_ROOT=$PWD/ext/dist
|
||||
|
||||
source src/build-scripts/build_pybind11.bash
|
||||
#export pybind11_ROOT=$PWD/ext/dist
|
||||
|
||||
|
||||
# curl --location https://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-4.2.1-win64-dev.zip -o ffmpeg-dev.zip
|
||||
# unzip ffmpeg-dev.zip
|
||||
# FFmpeg_ROOT=$PWD/ffmpeg-4.2.1-win64-dev
|
||||
|
||||
echo "CMAKE_PREFIX_PATH = $CMAKE_PREFIX_PATH"
|
||||
|
||||
|
||||
OPENEXR_CXX_FLAGS=" /W1 /EHsc /DWIN32=1 "
|
||||
#OPENEXR_BUILD_TYPE=$CMAKE_BUILD_TYPE
|
||||
OPENEXR_INSTALL_DIR=$DEP_DIR
|
||||
source src/build-scripts/build_openexr.bash
|
||||
export PATH="$OPENEXR_INSTALL_DIR/bin:$OPENEXR_INSTALL_DIR/lib:$PATH"
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PATH
|
||||
# the above line is admittedly sketchy
|
||||
|
||||
cp $DEP_DIR/lib/*.lib $DEP_DIR/bin
|
||||
cp $DEP_DIR/bin/*.dll $DEP_DIR/lib
|
||||
|
||||
|
||||
#OPENIMAGEIO_BRANCH=lg-cmake312
|
||||
OPENIMAGEIO_INSTALLDIR=$DEP_DIR
|
||||
OPENIMAGEIO_CMAKE_FLAGS+=" -DOIIO_BUILD_TESTS=0 -DOIIO_BUILD_TOOLS=0"
|
||||
OPENIMAGEIO_CMAKE_FLAGS+=" -DUSE_OPENGL=0 -DUSE_GENERATED_EXPORT_HEADER=1"
|
||||
OPENIMAGEIO_CMAKE_FLAGS+=" -DENABLE_DPX=0 -DENABLE_CINEON=0 -DENABLE_DDS=0"
|
||||
OPENIMAGEIO_CMAKE_FLAGS+=" -DENABLE_IFF=0 -DENABLE_ICO=0 -DENABLE_PSD=0"
|
||||
OPENIMAGEIO_CMAKE_FLAGS+=" -DENABLE_PNM=0 -DENABLE_ZFILE=0 -DENABLE_SOFTIMAGE=0"
|
||||
OPENIMAGEIO_CMAKE_FLAGS+=" -DLINKSTATIC=1 -DBUILD_SHARED_LIBS=0"
|
||||
export OPENIMAGEIO_CMAKE_FLAGS
|
||||
source src/build-scripts/build_openimageio.bash
|
||||
|
||||
|
||||
cp $DEP_DIR/lib/*.lib $DEP_DIR/bin
|
||||
cp $DEP_DIR/bin/*.dll $DEP_DIR/lib
|
||||
echo "after OIIO install, DEP_DIR $DEP_DIR :"
|
||||
ls -R -l "$DEP_DIR"
|
||||
|
||||
|
||||
# export PATH="$PATH:$DEP_DIR/bin:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin"
|
||||
export PATH="$DEP_DIR/lib:$DEP_DIR/bin:$PATH:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib"
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib:$DEP_DIR/lib:$DEP_DIR/bin"
|
||||
|
||||
|
||||
# source src/build-scripts/build_openexr.bash
|
||||
# export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$ILMBASE_ROOT;$OPENEXR_ROOT"
|
||||
# source src/build-scripts/build_opencolorio.bash
|
||||
|
||||
|
||||
# For CI on Windows, prefer to pick up static libs where possible
|
||||
OSL_CMAKE_FLAGS="$OSL_CMAKE_FLAGS -DLINKSTATIC=1 -DBUILD_SHARED_LIBS=0"
|
||||
|
||||
# Save the env for use by other stages
|
||||
src/build-scripts/save-env.bash
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
global: *OSL*; test_shade; *osl*imageio*; *osl_input_extensions;
|
||||
local: osl_*; *pvt*; *;
|
||||
};
|
||||
@@ -1,33 +1,66 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# This script, which assumes it is runnign on a Mac OSX with Homebrew
|
||||
# installed, does a "brew install" in all packages reasonably needed by
|
||||
# OIIO.
|
||||
# OSL and its dependencies.
|
||||
|
||||
if [ `uname` != "Darwin" ] ; then
|
||||
if [[ `uname` != "Darwin" ]] ; then
|
||||
echo "Don't run this script unless you are on Mac OSX"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ `which brew` == "" ] ; then
|
||||
if [[ `which brew` == "" ]] ; then
|
||||
echo "You need to install Homebrew before running this script."
|
||||
echo "See http://brew.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
brew update >/dev/null
|
||||
|
||||
#brew update >/dev/null
|
||||
echo ""
|
||||
echo "Before my brew installs:"
|
||||
brew list --versions
|
||||
brew install ccache
|
||||
brew install flex bison
|
||||
brew install ilmbase openexr
|
||||
brew install boost-python
|
||||
brew install opencolorio partio
|
||||
brew install freetype libraw libpng webp
|
||||
brew install llvm34
|
||||
#brew install homebrew/science/hdf5 --with-threadsafe
|
||||
#brew install field3d webp ffmpeg openjpeg opencv
|
||||
|
||||
brew install --display-times -q gcc ccache cmake ninja boost || true
|
||||
brew link --overwrite gcc
|
||||
brew unlink python@2.7 || true
|
||||
brew unlink python@3.9 || true
|
||||
brew unlink python@3.8 || true
|
||||
brew link --overwrite --force python@${PYTHON_VERSION} || true
|
||||
brew upgrade --display-times -q cmake || true
|
||||
brew install --display-times -q libtiff ilmbase openexr
|
||||
brew install --display-times -q libpng giflib webp jpeg-turbo freetype
|
||||
brew install --display-times -q opencolorio partio pugixml
|
||||
brew install --display-times -q pybind11 numpy || true
|
||||
brew install --display-times -q tbb || true
|
||||
brew install --display-times -q flex bison
|
||||
brew install --display-times -q llvm${LLVMBREWVER}
|
||||
brew install --display-times -q qt
|
||||
|
||||
echo ""
|
||||
echo "After brew installs:"
|
||||
brew list --versions
|
||||
|
||||
# Needed on some systems
|
||||
if [[ $PYTHON_VERSION != "2.7" ]] ; then
|
||||
pip3 install numpy
|
||||
else
|
||||
pip install numpy
|
||||
fi
|
||||
|
||||
# Set up paths. These will only affect the caller if this script is
|
||||
# run with 'source' rather than in a separate shell.
|
||||
export PATH=/usr/local/opt/qt5/bin:$PATH
|
||||
export PATH=/usr/local/opt/python/libexec/bin:$PATH
|
||||
export PYTHONPATH=/usr/local/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
|
||||
export PATH=/usr/local/opt/llvm${LLVMBREWVER}/bin:$PATH
|
||||
export LLVM_DIRECTORY=/usr/local/opt/llvm${LLVMBREWVER}
|
||||
export LLVM_ROOT=/usr/local/opt/llvm${LLVMBREWVER}
|
||||
export PATH=/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH
|
||||
|
||||
# Save the env for use by other stages
|
||||
src/build-scripts/save-env.bash
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
leak:Imf_2_2
|
||||
leak:Imf_2_3
|
||||
leak:Imf_2_4
|
||||
leak:libIlmImf
|
||||
leak:oslgram.y
|
||||
@@ -0,0 +1,11 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: oslcomp
|
||||
Description: oslcomp Compile OSL shaders from source
|
||||
URL: https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@
|
||||
Libs: -L${libdir} -loslcomp
|
||||
Cflags: -I${includedir}
|
||||
@@ -0,0 +1,11 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: oslexec
|
||||
Description: oslexec Execute compiled OSL shaders
|
||||
URL: https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@
|
||||
Libs: -L${libdir} -loslexec
|
||||
Cflags: -I${includedir}
|
||||
@@ -0,0 +1,11 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: oslquery
|
||||
Description: oslquery Query parameters of OSL compiled shaders
|
||||
URL: https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@
|
||||
Libs: -L${libdir} -loslquery
|
||||
Cflags: -I${includedir}
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Save the env for use by other stages. Exclude things that we know aren't
|
||||
# needed.
|
||||
printenv \
|
||||
| sort \
|
||||
| grep -v ASWF_ \
|
||||
| grep -v GITHUB_ \
|
||||
| grep -v NVIDIA_ \
|
||||
| grep -v RUNNER_ \
|
||||
| grep -v _= \
|
||||
| fgrep -v "\*" \
|
||||
>> $GITHUB_ENV
|
||||
|
||||
|
||||
echo "save-env: GITHUB_ENV=${GITHUB_ENV}"
|
||||
cat $GITHUB_ENV
|
||||
echo "---------"
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
# add here all the find_dependency() whenever switching to config based dependencies
|
||||
if (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 3.0)
|
||||
find_dependency(Imath @OpenEXR_VERSION@)
|
||||
elseif (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 2.4 AND @FOUND_OPENEXR_WITH_CONFIG@)
|
||||
find_dependency(IlmBase @OpenEXR_VERSION@)
|
||||
find_dependency(OpenEXR @OpenEXR_VERSION@)
|
||||
find_dependency(ZLIB @ZLIB_VERSION@) # Because OpenEXR doesn't do it
|
||||
find_dependency(Threads) # Because OpenEXR doesn't do it
|
||||
endif ()
|
||||
|
||||
|
||||
find_dependency(OpenImageIO @OpenImageIO_VERSION@ REQUIRED)
|
||||
|
||||
set_and_check (@PROJECT_NAME@_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
|
||||
set_and_check (@PROJECT_NAME@_INCLUDES "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
|
||||
set_and_check (@PROJECT_NAME@_LIB_DIR "@CMAKE_INSTALL_FULL_LIBDIR@")
|
||||
|
||||
#...logic to determine installedPrefix from the own location...
|
||||
#set (@PROJECT_NAME@_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@")
|
||||
|
||||
include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
|
||||
|
||||
check_required_components ("@PROJECT_NAME@")
|
||||
@@ -0,0 +1,28 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Is the named package "enabled" via our disabling convention? If either
|
||||
# USE_pkgname (or the all-uppercase USE_PKGNAME, or ENABLE_pkgname, or
|
||||
# ENABLE_PKGNAME) exists as either a CMake or environment variable, is
|
||||
# nonempty by contains a non-true/nonzero value, store false in the
|
||||
# variable named by <enablevar>, otherwise store true.
|
||||
function (check_is_enabled pkgname enablevar)
|
||||
string (TOUPPER ${pkgname} pkgname_upper)
|
||||
set (${enablevar} true PARENT_SCOPE)
|
||||
if (
|
||||
(NOT "${USE_${pkgname}}" STREQUAL "" AND NOT "${USE_${pkgname}}") OR
|
||||
(NOT "${USE_${pkgname_upper}}" STREQUAL "" AND NOT "${USE_${pkgname_upper}}") OR
|
||||
(NOT "$ENV{USE_${pkgname}}" STREQUAL "" AND NOT "$ENV{USE_${pkgname}}") OR
|
||||
(NOT "$ENV{USE_${pkgname_upper}}" STREQUAL "" AND NOT "$ENV{USE_${pkgname_upper}}") OR
|
||||
(NOT "${ENABLE_${pkgname}}" STREQUAL "" AND NOT "${ENABLE_${pkgname}}") OR
|
||||
(NOT "${ENABLE_${pkgname_upper}}" STREQUAL "" AND NOT "${ENABLE_${pkgname_upper}}") OR
|
||||
(NOT "$ENV{ENABLE_${pkgname}}" STREQUAL "" AND NOT "$ENV{ENABLE_${pkgname}}") OR
|
||||
(NOT "$ENV{ENABLE_${pkgname_upper}}" STREQUAL "" AND NOT "$ENV{ENABLE_${pkgname_upper}}") OR
|
||||
(DISABLE_${pkgname} OR DISABLE_${pkgname_upper} OR
|
||||
"$ENV{DISABLE_${pkgname}}" OR "$ENV{DISABLE_${pkgname_upper}}") OR
|
||||
(NOT "${_pkg_ENABLE}" STREQUAL "" AND NOT "${_pkg_ENABLE}")
|
||||
)
|
||||
set (${enablevar} false PARENT_SCOPE)
|
||||
endif ()
|
||||
endfunction ()
|
||||
@@ -0,0 +1,157 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
|
||||
set (REQUIED_DEPS "" CACHE STRING
|
||||
"Additional dependencies to consider required (semicolon-separated list, or ALL)")
|
||||
set (OPTIONAL_DEPS "" CACHE STRING
|
||||
"Additional dependencies to consider optional (semicolon-separated list, or ALL)")
|
||||
|
||||
|
||||
# checked_find_package(Pkgname ...) is a wrapper for find_package, with the
|
||||
# following extra features:
|
||||
# * If either `USE_Pkgname` or the all-uppercase `USE_PKGNAME` (or
|
||||
# `ENABLE_Pkgname` or `ENABLE_PKGNAME`) exists as either a CMake or
|
||||
# environment variable, is nonempty by contains a non-true/nonzero
|
||||
# value, do not search for or use the package. The optional ENABLE <var>
|
||||
# arguments allow you to override the name of the enabling variable. In
|
||||
# other words, support for the dependency is presumed to be ON, unless
|
||||
# turned off explicitly from one of these sources.
|
||||
# * Print a message if the package is enabled but not found. This is based
|
||||
# on ${Pkgname}_FOUND or $PKGNAME_FOUND.
|
||||
# * Optional DEFINITIONS <string> are passed to add_definitions if the
|
||||
# package is found.
|
||||
# * Optional PRINT <list> is a list of variables that will be printed
|
||||
# if the package is found, if VERBOSE is on.
|
||||
# * Optional DEPS <list> is a list of hard dependencies; for each one, if
|
||||
# dep_FOUND is not true, disable this package with an error message.
|
||||
# * Optional ISDEPOF <downstream> names another package for which the
|
||||
# present package is only needed because it's a dependency, and
|
||||
# therefore if <downstream> is disabled, we don't bother with this
|
||||
# package either.
|
||||
# * Optional VERSION_MIN and VERSION_MAX, if supplied, give minimum and
|
||||
# maximum versions that will be accepted. The min is inclusive, the max
|
||||
# is exclusive (i.e., check for min <= version < max). Note that this is
|
||||
# not the same as providing a version number to find_package, which
|
||||
# checks compatibility, not minimum. Sometimes we really do just want to
|
||||
# say a minimum or a range. (N.B. When our minimum CMake >= 3.19, the
|
||||
# built-in way to do this is with version ranges passed to
|
||||
# find_package.)
|
||||
# * Optional RECOMMEND_MIN, if supplied, gives a minimum recommended
|
||||
# version, accepting but warning if it is below this number (even
|
||||
# if above the true minimum version accepted). The warning message
|
||||
# can give an optional explanation, passed as RECOMMEND_MIN_REASON.
|
||||
#
|
||||
# N.B. This needs to be a macro, not a function, because the find modules
|
||||
# will set(blah val PARENT_SCOPE) and we need that to be the global scope,
|
||||
# not merely the scope for this function.
|
||||
macro (checked_find_package pkgname)
|
||||
cmake_parse_arguments(_pkg # prefix
|
||||
# noValueKeywords:
|
||||
"REQUIRED"
|
||||
# singleValueKeywords:
|
||||
"ENABLE;ISDEPOF;VERSION_MIN;VERSION_MAX;RECOMMEND_MIN;RECOMMEND_MIN_REASON"
|
||||
# multiValueKeywords:
|
||||
"DEFINITIONS;PRINT;DEPS"
|
||||
# argsToParse:
|
||||
${ARGN})
|
||||
string (TOLOWER ${pkgname} pkgname_lower)
|
||||
string (TOUPPER ${pkgname} pkgname_upper)
|
||||
if (NOT VERBOSE)
|
||||
set (${pkgname}_FIND_QUIETLY true)
|
||||
set (${pkgname_upper}_FIND_QUIETLY true)
|
||||
endif ()
|
||||
if ("${pkgname}" IN_LIST REQUIRED_DEPS OR "ALL" IN_LIST REQUIRED_DEPS)
|
||||
set (_pkg_REQUIRED 1)
|
||||
endif ()
|
||||
if ("${pkgname}" IN_LIST OPTIONAL_DEPS OR "ALL" IN_LIST OPTIONAL_DEPS)
|
||||
set (_pkg_REQUIRED 0)
|
||||
endif ()
|
||||
set (_quietskip false)
|
||||
check_is_enabled (${pkgname} _enable)
|
||||
set (_disablereason "")
|
||||
foreach (_dep ${_pkg_DEPS})
|
||||
if (_enable AND NOT ${_dep}_FOUND)
|
||||
set (_enable false)
|
||||
set (ENABLE_${pkgname} OFF PARENT_SCOPE)
|
||||
set (_disablereason "(because ${_dep} was not found)")
|
||||
endif ()
|
||||
endforeach ()
|
||||
if (_pkg_ISDEPOF)
|
||||
check_is_enabled (${_pkg_ISDEPOF} _dep_enabled)
|
||||
if (NOT _dep_enabled)
|
||||
set (_enable false)
|
||||
set (_quietskip true)
|
||||
endif ()
|
||||
endif ()
|
||||
if (_enable OR _pkg_REQUIRED)
|
||||
find_package (${pkgname} ${_pkg_UNPARSED_ARGUMENTS})
|
||||
if ((${pkgname}_FOUND OR ${pkgname_upper}_FOUND)
|
||||
AND ${pkgname}_VERSION
|
||||
AND (_pkg_VERSION_MIN OR _pkg_VERSION_MAX))
|
||||
if ((_pkg_VERSION_MIN AND ${pkgname}_VERSION VERSION_LESS _pkg_VERSION_MIN)
|
||||
OR (_pkg_VERSION_MAX AND ${pkgname}_VERSION VERSION_GREATER _pkg_VERSION_MAX))
|
||||
message (STATUS "${ColorRed}${pkgname} ${${pkgname}_VERSION} is outside the required range ${_pkg_VERSION_MIN}...${_pkg_VERSION_MAX} ${ColorReset}")
|
||||
unset (${pkgname}_FOUND)
|
||||
unset (${pkgname}_VERSION)
|
||||
unset (${pkgname_upper}_FOUND)
|
||||
unset (${pkgname_upper}_VERSION)
|
||||
endif ()
|
||||
endif ()
|
||||
if (${pkgname}_FOUND OR ${pkgname_upper}_FOUND)
|
||||
foreach (_vervar ${pkgname_upper}_VERSION ${pkgname}_VERSION_STRING
|
||||
${pkgname_upper}_VERSION_STRING)
|
||||
if (NOT ${pkgname}_VERSION AND ${_vervar})
|
||||
set (${pkgname}_VERSION ${${_vervar}})
|
||||
endif ()
|
||||
endforeach ()
|
||||
message (STATUS "${ColorGreen}Found ${pkgname} ${${pkgname}_VERSION} ${ColorReset}")
|
||||
if (VERBOSE)
|
||||
set (_vars_to_print ${pkgname}_INCLUDES ${pkgname_upper}_INCLUDES
|
||||
${pkgname}_INCLUDE_DIR ${pkgname_upper}_INCLUDE_DIR
|
||||
${pkgname}_INCLUDE_DIRS ${pkgname_upper}_INCLUDE_DIRS
|
||||
${pkgname}_LIBRARIES ${pkgname_upper}_LIBRARIES
|
||||
${_pkg_PRINT})
|
||||
list (REMOVE_DUPLICATES _vars_to_print)
|
||||
foreach (_v IN LISTS _vars_to_print)
|
||||
if (NOT "${${_v}}" STREQUAL "")
|
||||
message (STATUS " ${_v} = ${${_v}}")
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
add_definitions (${_pkg_DEFINITIONS})
|
||||
if (_pkg_RECOMMEND_MIN)
|
||||
if (${${pkgname}_VERSION} VERSION_LESS ${_pkg_RECOMMEND_MIN})
|
||||
message (STATUS "${ColorYellow}Recommend ${pkgname} >= ${_pkg_RECOMMEND_MIN} ${_pkg_RECOMMEND_MIN_REASON} ${ColorReset}")
|
||||
endif ()
|
||||
endif ()
|
||||
else ()
|
||||
message (STATUS "${ColorRed}${pkgname} library not found ${ColorReset}")
|
||||
if (${pkgname}_ROOT)
|
||||
message (STATUS "${ColorRed} ${pkgname}_ROOT was: ${${pkgname}_ROOT} ${ColorReset}")
|
||||
elseif ($ENV{${pkgname}_ROOT})
|
||||
message (STATUS "${ColorRed} ENV ${pkgname}_ROOT was: ${${pkgname}_ROOT} ${ColorReset}")
|
||||
else ()
|
||||
message (STATUS "${ColorRed} Try setting ${pkgname}_ROOT ? ${ColorReset}")
|
||||
endif ()
|
||||
if (EXISTS "${PROJECT_SOURCE_DIR}/src/build-scripts/build_${pkgname}.bash")
|
||||
message (STATUS "${ColorRed} Maybe this will help: src/build-scripts/build_${pkgname}.bash ${ColorReset}")
|
||||
elseif (EXISTS "${PROJECT_SOURCE_DIR}/src/build-scripts/build_${pkgname_upper}.bash")
|
||||
message (STATUS "${ColorRed} Maybe this will help: src/build-scripts/build_${pkgname_upper}.bash ${ColorReset}")
|
||||
elseif (EXISTS "${PROJECT_SOURCE_DIR}/src/build-scripts/build_${pkgname_lower}.bash")
|
||||
message (STATUS "${ColorRed} Maybe this will help: src/build-scripts/build_${pkgname_lower}.bash ${ColorReset}")
|
||||
elseif (EXISTS "${PROJECT_SOURCE_DIR}/src/build-scripts/build_lib${pkgname_lower}.bash")
|
||||
message (STATUS "${ColorRed} Maybe this will help: src/build-scripts/build_lib${pkgname_lower}.bash ${ColorReset}")
|
||||
endif ()
|
||||
if (_pkg_REQUIRED)
|
||||
message (FATAL_ERROR "${ColorRed}${pkgname} is required, aborting.${ColorReset}")
|
||||
endif ()
|
||||
endif()
|
||||
else ()
|
||||
if (NOT _quietskip)
|
||||
message (STATUS "${ColorRed}Not using ${pkgname} -- disabled ${_disablereason} ${ColorReset}")
|
||||
endif ()
|
||||
endif ()
|
||||
endmacro()
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
|
||||
# Define color codes for pretty terminal output
|
||||
string (ASCII 27 ColorEsc)
|
||||
set (ColorReset "${ColorEsc}[m")
|
||||
set (ColorRed "${ColorEsc}[31m")
|
||||
set (ColorGreen "${ColorEsc}[32m")
|
||||
set (ColorYellow "${ColorEsc}[33m")
|
||||
set (ColorBoldWhite "${ColorEsc}[1;37m")
|
||||
@@ -0,0 +1,619 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# This file contains compiler-related detection, options, and actions.
|
||||
#
|
||||
# Each option declaration is kept close to the related logic for that
|
||||
# option.
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Print some basic status about the system and compiler
|
||||
#
|
||||
if (VERBOSE)
|
||||
message (STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}")
|
||||
message (STATUS "CMAKE_SYSTEM_VERSION = ${CMAKE_SYSTEM_VERSION}")
|
||||
message (STATUS "CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
endif ()
|
||||
message (STATUS "CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}")
|
||||
message (STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}")
|
||||
|
||||
|
||||
###########################################################################
|
||||
# C++ language standard
|
||||
#
|
||||
set (CMAKE_CXX_STANDARD 11 CACHE STRING
|
||||
"C++ standard to prefer (11, 14, 17, 20, etc.)")
|
||||
set (CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set (CMAKE_CXX_EXTENSIONS OFF)
|
||||
message (STATUS "Building for C++${CMAKE_CXX_STANDARD}")
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Figure out which compiler we're using
|
||||
#
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
execute_process (COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
|
||||
OUTPUT_VARIABLE GCC_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (VERBOSE)
|
||||
message (STATUS "Using gcc ${GCC_VERSION} as the compiler")
|
||||
endif ()
|
||||
else ()
|
||||
set (GCC_VERSION 0)
|
||||
endif ()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER MATCHES "[Cc]lang")
|
||||
# If using any flavor of clang, set CMAKE_COMPILER_IS_CLANG. If it's
|
||||
# Apple's variety, set CMAKE_COMPILER_IS_APPLECLANG and
|
||||
# APPLECLANG_VERSION_STRING, otherwise for generic clang set
|
||||
# CLANG_VERSION_STRING.
|
||||
set (CMAKE_COMPILER_IS_CLANG 1)
|
||||
EXECUTE_PROCESS( COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE clang_full_version_string )
|
||||
if (clang_full_version_string MATCHES "Apple")
|
||||
set (CMAKE_CXX_COMPILER_ID "AppleClang")
|
||||
set (CMAKE_COMPILER_IS_APPLECLANG 1)
|
||||
string (REGEX REPLACE ".* version ([0-9]+\\.[0-9]+).*" "\\1" APPLECLANG_VERSION_STRING ${clang_full_version_string})
|
||||
if (VERBOSE)
|
||||
message (STATUS "The compiler is Clang: ${CMAKE_CXX_COMPILER_ID} version ${APPLECLANG_VERSION_STRING}")
|
||||
endif ()
|
||||
else ()
|
||||
string (REGEX REPLACE ".* version ([0-9]+\\.[0-9]+).*" "\\1" CLANG_VERSION_STRING ${clang_full_version_string})
|
||||
if (VERBOSE)
|
||||
message (STATUS "The compiler is Clang: ${CMAKE_CXX_COMPILER_ID} version ${CLANG_VERSION_STRING}")
|
||||
endif ()
|
||||
endif ()
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
set (CMAKE_COMPILER_IS_INTEL 1)
|
||||
if (VERBOSE)
|
||||
message (STATUS "Using Intel as the compiler")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Turn on more detailed warnings and optionally consider warnings as errors
|
||||
#
|
||||
if (${PROJECT_NAME}_SUPPORTED_RELEASE)
|
||||
option (STOP_ON_WARNING "Stop building if there are any compiler warnings" OFF)
|
||||
else ()
|
||||
option (STOP_ON_WARNING "Stop building if there are any compiler warnings" ON)
|
||||
endif()
|
||||
option (EXTRA_WARNINGS "Enable lots of extra pedantic warnings" OFF)
|
||||
if (NOT MSVC)
|
||||
add_compile_options ("-Wall")
|
||||
if (EXTRA_WARNINGS)
|
||||
add_compile_options ("-Wextra")
|
||||
endif ()
|
||||
if (STOP_ON_WARNING OR DEFINED ENV{${PROJECT_NAME}_CI})
|
||||
add_compile_options ("-Werror")
|
||||
# N.B. Force CI builds to use -Werror, even if STOP_ON_WARNING has
|
||||
# been switched off by default, which we may do in release branches.
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Control symbol visibility
|
||||
#
|
||||
# We try hard to make default symbol visibility be "hidden", except for
|
||||
# symbols that are part of the public API, which should be marked in the
|
||||
# source code with a special decorator, OSL_API.
|
||||
#
|
||||
# Additionally, there is a hidesymbols.map file that on some platforms may
|
||||
# give more fine-grained control for hiding symbols, because sometimes
|
||||
# dependent libraries may not be well behaved and need extra hiding.
|
||||
#
|
||||
set (CXX_VISIBILITY_PRESET "hidden" CACHE STRING "Symbol visibility (hidden or default")
|
||||
option (VISIBILITY_INLINES_HIDDEN "Hide symbol visibility of inline functions" ON)
|
||||
set (VISIBILITY_MAP_FILE "${PROJECT_SOURCE_DIR}/src/build-scripts/hidesymbols.map" CACHE FILEPATH "Visibility map file")
|
||||
set (C_VISIBILITY_PRESET ${CXX_VISIBILITY_PRESET})
|
||||
if (${CXX_VISIBILITY_PRESET} STREQUAL "hidden" AND
|
||||
(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) AND
|
||||
(CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU"))
|
||||
# Linux/FreeBSD/Hurd: also hide all the symbols of dependent libraries
|
||||
# to prevent clashes if an app using this project is linked against
|
||||
# other versions of our dependencies.
|
||||
set (VISIBILITY_MAP_COMMAND "-Wl,--version-script=${VISIBILITY_MAP_FILE}")
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Compiler-specific and platform-specific options.
|
||||
#
|
||||
# Here is where we add a whole bunch of options for specific compilers or
|
||||
# platforms. Usually this is to suppress false-positive compiler warnings.
|
||||
#
|
||||
if (CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_APPLECLANG)
|
||||
# Clang-specific options
|
||||
add_compile_options ("-Wno-unused-function")
|
||||
add_compile_options ("-Wno-overloaded-virtual")
|
||||
add_compile_options ("-Wno-unneeded-internal-declaration")
|
||||
add_compile_options ("-Wno-unused-private-field")
|
||||
add_compile_options ("-Wno-tautological-compare")
|
||||
add_compile_options ("-Wno-unknown-pragmas")
|
||||
# disable warning about unused command line arguments
|
||||
add_compile_options ("-Qunused-arguments")
|
||||
# Don't warn if we ask it not to warn about warnings it doesn't know
|
||||
add_compile_options ("-Wunknown-warning-option")
|
||||
if (CLANG_VERSION_STRING VERSION_GREATER_EQUAL 3.6 OR
|
||||
APPLECLANG_VERSION_STRING VERSION_GREATER 6.1)
|
||||
add_compile_options ("-Wno-unused-local-typedefs")
|
||||
endif ()
|
||||
if (CLANG_VERSION_STRING VERSION_GREATER_EQUAL 3.9)
|
||||
# Don't warn about using unknown preprocessor symbols in #if'set
|
||||
add_compile_options ("-Wno-expansion-to-defined")
|
||||
endif ()
|
||||
# disable warning in flex-generated code
|
||||
add_compile_options ("-Wno-null-conversion")
|
||||
add_compile_options ("-Wno-error=strict-overflow")
|
||||
if ($<CONFIG:Debug>)
|
||||
add_compile_options ("-Wno-unused-function -Wno-unused-variable")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC AND NOT (CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_APPLECLANG))
|
||||
add_compile_options ("-Wno-error=strict-overflow")
|
||||
add_compile_options ("-Wno-unused-local-typedefs")
|
||||
add_compile_options ("-Wno-unused-result")
|
||||
if (NOT ${GCC_VERSION} VERSION_LESS 6.0)
|
||||
add_compile_options ("-Wno-error=misleading-indentation")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
|
||||
# Options common to gcc and clang
|
||||
|
||||
# Ensure this macro is set for stdint.h
|
||||
add_definitions ("-D__STDC_LIMIT_MACROS")
|
||||
add_definitions ("-D__STDC_CONSTANT_MACROS")
|
||||
# this allows native instructions to be used for sqrtf instead of a function call
|
||||
add_compile_options ("-fno-math-errno")
|
||||
endif ()
|
||||
|
||||
if (MSVC)
|
||||
# Microsoft specific options
|
||||
add_compile_options (/W1)
|
||||
add_definitions (-D_CRT_SECURE_NO_DEPRECATE)
|
||||
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
|
||||
add_definitions (-D_CRT_NONSTDC_NO_WARNINGS)
|
||||
add_definitions (-D_SCL_SECURE_NO_WARNINGS)
|
||||
add_definitions (-DJAS_WIN_MSVC_BUILD)
|
||||
endif (MSVC)
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"
|
||||
AND ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
|
||||
# For FreeBSD, minimum arch of i586 is needed for atomic cpu instructions
|
||||
add_compile_options (-march=i586)
|
||||
endif ()
|
||||
|
||||
|
||||
set (CSTD_FLAGS "")
|
||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_INTEL)
|
||||
set (CSTD_FLAGS "-std=c++${CMAKE_CXX_STANDARD}")
|
||||
endif ()
|
||||
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Use ccache if found
|
||||
#
|
||||
# This can really speed up compilation by caching object files that have
|
||||
# been compiled previously with identical arguments and inputs. Putting this
|
||||
# logic here makes it work even if the user is unaware of ccache. If it's
|
||||
# not found on the system, it will simply be silently not used.
|
||||
option (USE_CCACHE "Use ccache if found" ON)
|
||||
find_program (CCACHE_FOUND ccache)
|
||||
if (CCACHE_FOUND AND USE_CCACHE)
|
||||
if (CMAKE_COMPILER_IS_CLANG AND USE_QT AND (NOT DEFINED ENV{CCACHE_CPP2}))
|
||||
message (STATUS "Ignoring ccache because clang + Qt + env CCACHE_CPP2 is not set")
|
||||
else ()
|
||||
set (MY_RULE_LAUNCH ccache)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Build time debugging aid: time all compile & link commands
|
||||
#
|
||||
# Note, though, that this is not especially helpful when doing a parallel
|
||||
# build. If you wish to time individual compile commands, it's best to also
|
||||
# set `-j 1` or CMAKE_BUILD_PARALLEL_LEVEL to 1.
|
||||
option (TIME_COMMANDS "Time each compile and link command" OFF)
|
||||
if (TIME_COMMANDS)
|
||||
set (MY_RULE_LAUNCH "${CMAKE_COMMAND} -E time ${MY_RULE_LAUNCH}")
|
||||
endif ()
|
||||
|
||||
|
||||
# Note: This must be after any option that alters MY_RULE_LAUNCH
|
||||
if (MY_RULE_LAUNCH)
|
||||
set_property (GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${MY_RULE_LAUNCH})
|
||||
set_property (GLOBAL PROPERTY RULE_LAUNCH_LINK ${MY_RULE_LAUNCH})
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Option to force use of libc++ (the LLVM project's alternate C++ standard
|
||||
# library). Currently this only has an effect if using clang as the
|
||||
# compiler. Maybe it would also work for g++? Investigate.
|
||||
option (USE_LIBCPLUSPLUS "Compile with clang libc++" OFF)
|
||||
if (USE_LIBCPLUSPLUS AND CMAKE_COMPILER_IS_CLANG)
|
||||
message (STATUS "Using libc++")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# For gcc >= 5, allow an option to force which version of the C++ ABI to
|
||||
# use (mostly this affects the implementation of std::string).
|
||||
#
|
||||
# FIXME: In theory, this should also be needed for clang, if compiling with
|
||||
# the gcc libstdc++ toolchain. In practice, I could not get things to build
|
||||
# with clang properly when using this option, and I haven't yet seen a case
|
||||
# where it's needed. We can return to this and fix for clang if it becomes a
|
||||
# legit problem later.
|
||||
#
|
||||
set (GLIBCXX_USE_CXX11_ABI "" CACHE STRING "For gcc, use the new C++11 library ABI (0|1)")
|
||||
if (CMAKE_COMPILER_IS_GNUCC AND ${GCC_VERSION} VERSION_GREATER_EQUAL 5.0)
|
||||
if (NOT ${GLIBCXX_USE_CXX11_ABI} STREQUAL "")
|
||||
add_definitions ("-D_GLIBCXX_USE_CXX11_ABI=${GLIBCXX_USE_CXX11_ABI}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# SIMD and machine architecture options.
|
||||
#
|
||||
# The USE_SIMD option may be set to a comma-separated list of machine /
|
||||
# instruction set options, such as "avx3,f16c". The list will be parsed and
|
||||
# the proper compiler directives added to generate code for those ISA
|
||||
# capabilities.
|
||||
#
|
||||
set (USE_SIMD "" CACHE STRING "Use SIMD directives (0, sse2, sse3, ssse3, sse4.1, sse4.2, avx, avx2, avx512f, f16c, aes)")
|
||||
set (SIMD_COMPILE_FLAGS "")
|
||||
if (NOT USE_SIMD STREQUAL "")
|
||||
message (STATUS "Compiling with SIMD level ${USE_SIMD}")
|
||||
if (USE_SIMD STREQUAL "0")
|
||||
set (SIMD_COMPILE_FLAGS ${SIMD_COMPILE_FLAGS} "-DOIIO_NO_SSE=1")
|
||||
else ()
|
||||
string (REPLACE "," ";" SIMD_FEATURE_LIST ${USE_SIMD})
|
||||
foreach (feature ${SIMD_FEATURE_LIST})
|
||||
if (VERBOSE)
|
||||
message (STATUS "SIMD feature: ${feature}")
|
||||
endif ()
|
||||
if (MSVC OR CMAKE_COMPILER_IS_INTEL)
|
||||
set (SIMD_COMPILE_FLAGS ${SIMD_COMPILE_FLAGS} "/arch:${feature}")
|
||||
else ()
|
||||
set (SIMD_COMPILE_FLAGS ${SIMD_COMPILE_FLAGS} "-m${feature}")
|
||||
endif ()
|
||||
if (feature STREQUAL "fma" AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG))
|
||||
# If fma is requested, for numerical accuracy sake, turn it
|
||||
# off by default except when we explicitly use madd. At some
|
||||
# future time, we should look at this again carefully and
|
||||
# see if we want to use it more widely by ffp-contract=fast.
|
||||
add_compile_options ("-ffp-contract=off")
|
||||
endif ()
|
||||
endforeach()
|
||||
endif ()
|
||||
add_compile_options (${SIMD_COMPILE_FLAGS})
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Preparation to test for compiler/language features
|
||||
if (NOT VERBOSE)
|
||||
set (CMAKE_REQUIRED_QUIET 1)
|
||||
endif ()
|
||||
include (CMakePushCheckState)
|
||||
include (CheckCXXSourceRuns)
|
||||
|
||||
###########################################################################
|
||||
# Find out if it's safe for us to use std::regex or if we need boost.regex.
|
||||
# This is primarily about gcc 4.8 having a broken regex implementation.
|
||||
# This will be obsolete once our minimum supported gcc is >= 4.9.
|
||||
#
|
||||
cmake_push_check_state ()
|
||||
check_cxx_source_runs("
|
||||
#include <regex>
|
||||
int main() {
|
||||
std::string r = std::regex_replace(std::string(\"abc\"), std::regex(\"b\"), \" \");
|
||||
return r == \"a c\" ? 0 : -1;
|
||||
}"
|
||||
USE_STD_REGEX)
|
||||
cmake_pop_check_state ()
|
||||
if (USE_STD_REGEX)
|
||||
add_definitions (-DUSE_STD_REGEX)
|
||||
else ()
|
||||
add_definitions (-DUSE_BOOST_REGEX)
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Code coverage options
|
||||
#
|
||||
option (CODECOV "Build code coverage tests" OFF)
|
||||
if (CODECOV AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG))
|
||||
message (STATUS "Compiling for code coverage analysis")
|
||||
add_compile_options ("-ftest-coverage -fprofile-arcs -O0")
|
||||
add_definitions ("-D${PROJ_NAME}_CODE_COVERAGE=1")
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ftest-coverage -fprofile-arcs")
|
||||
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -ftest-coverage -fprofile-arcs")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -ftest-coverage -fprofile-arcs")
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Sanitizer options
|
||||
#
|
||||
set (SANITIZE "" CACHE STRING "Build code using sanitizer (address, thread)")
|
||||
if (SANITIZE AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG))
|
||||
message (STATUS "Compiling for sanitizer=${SANITIZE}")
|
||||
string (REPLACE "," ";" SANITIZE_FEATURE_LIST ${SANITIZE})
|
||||
foreach (feature ${SANITIZE_FEATURE_LIST})
|
||||
message (STATUS " sanitize feature: ${feature}")
|
||||
add_compile_options (-fsanitize=${feature})
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${feature}")
|
||||
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=${feature}")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=${feature}")
|
||||
endforeach()
|
||||
add_compile_options (-g -fno-omit-frame-pointer)
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
set (SANITIZE_ON_LINUX 1)
|
||||
endif ()
|
||||
if (CMAKE_COMPILER_IS_GNUCC AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
add_compile_options ("-fuse-ld=gold")
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fuse-ld=gold")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold")
|
||||
set (SANITIZE_LIBRARIES "asan;pthread")
|
||||
# set (SANITIZE_LIBRARIES "asan" "ubsan")
|
||||
endif()
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
# turn on glibcxx extra annotations to find vector writes past end
|
||||
add_definitions ("-D_GLIBCXX_SANITIZE_VECTOR=1")
|
||||
endif ()
|
||||
add_definitions ("-D${PROJECT_NAME}_SANITIZE=1")
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# clang-tidy options
|
||||
#
|
||||
# clang-tidy is a static analyzer that is part of the LLVM tools. It has a
|
||||
# variety of the usual bug and security tests, linting, and also tests for
|
||||
# things like finding (and correcting!) use of older language constructs.
|
||||
#
|
||||
# If clang-tidy is found and enabled, a "clang-tidy" build target will be
|
||||
# enabled. The set of tests can be customized both here and through
|
||||
# the .clang-tidy file that is part of this project.
|
||||
#
|
||||
option (CLANG_TIDY "Enable clang-tidy" OFF)
|
||||
set (CLANG_TIDY_CHECKS "-*" CACHE STRING "clang-tidy checks to perform (none='-*')")
|
||||
set (CLANG_TIDY_ARGS "" CACHE STRING "clang-tidy args")
|
||||
option (CLANG_TIDY_FIX "Have clang-tidy fix source" OFF)
|
||||
if (CLANG_TIDY)
|
||||
find_program(CLANG_TIDY_EXE NAMES "clang-tidy"
|
||||
DOC "Path to clang-tidy executable")
|
||||
message (STATUS "CLANG_TIDY_EXE ${CLANG_TIDY_EXE}")
|
||||
if (CLANG_TIDY_EXE AND NOT ${CMAKE_VERSION} VERSION_LESS 3.6)
|
||||
set (CMAKE_CXX_CLANG_TIDY
|
||||
"${CLANG_TIDY_EXE}"
|
||||
)
|
||||
if (CLANG_TIDY_ARGS)
|
||||
list (APPEND CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_ARGS})
|
||||
endif ()
|
||||
if (CLANG_TIDY_CHECKS)
|
||||
list (APPEND CMAKE_CXX_CLANG_TIDY -checks="${CLANG_TIDY_CHECKS}")
|
||||
endif ()
|
||||
set (CMAKE_CXX_CLANG_TIDY "-header-filter=(${PROJECT_NAME})|(${PROJ_NAME})|(${PROJ_NAME_LOWER})|(_pvt.h)")
|
||||
execute_process (COMMAND ${CMAKE_CXX_CLANG_TIDY} -list-checks
|
||||
OUTPUT_VARIABLE tidy_checks
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (CLANG_TIDY_FIX)
|
||||
list (APPEND CMAKE_CXX_CLANG_TIDY "-fix")
|
||||
endif ()
|
||||
message (STATUS "clang-tidy command line is: ${CMAKE_CXX_CLANG_TIDY}")
|
||||
message (STATUS "${tidy_checks}")
|
||||
else ()
|
||||
message (STATUS "Cannot run clang-tidy as requested")
|
||||
endif ()
|
||||
# Hint: run with CLANG_TIDY_ARGS=-list-checks to list all the checks
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# clang-format options
|
||||
#
|
||||
# clang-format is a source code reformatter that is part of the LLVM tools.
|
||||
# It can be used to check adherence to project code formatting rules and
|
||||
# correct any deviations. If clang-format is found on the system, a
|
||||
# "clang-format" build target will trigger a reformatting.
|
||||
#
|
||||
# Note: skip all of this checking, setup, and cmake-format target if this
|
||||
# is being built as a subproject.
|
||||
if (PROJECT_IS_TOP_LEVEL)
|
||||
set (CLANG_FORMAT_EXE_HINT "" CACHE PATH "clang-format executable's directory (will search if not specified")
|
||||
set (CLANG_FORMAT_INCLUDES # "src/*.h" "src/*.cpp"
|
||||
"src/include/*.h"
|
||||
"src/liboslcomp/*.cpp"
|
||||
"src/liboslcomp/*.h"
|
||||
"src/liboslquery/*.cpp"
|
||||
"src/liboslquery/*.h"
|
||||
"src/oslinfo/*.cpp"
|
||||
"src/oslc/*.cpp"
|
||||
"src/osl.imageio/*.cpp"
|
||||
"src/osltoy/*.cpp"
|
||||
"src/osltoy/*.h"
|
||||
"testsuite/*.cpp"
|
||||
CACHE STRING "Glob patterns to include for clang-format")
|
||||
set (CLANG_FORMAT_EXCLUDES
|
||||
# Files "imported and modified" that we don't want to reformat, so
|
||||
# they continue to match their upstream versions.
|
||||
"src/include/OSL/Imathx/*"
|
||||
"src/include/OSL/matrix22.h"
|
||||
# Files that are currently being modified with the SIMD batch
|
||||
# shading -- we'll reformat those only after that project work is
|
||||
# completed, to avoid nasty merge conflicts.
|
||||
"src/include/OSL/rendererservices.h"
|
||||
"src/include/OSL/*llvm*"
|
||||
"src/liboslexec/*llvm*"
|
||||
"src/liboslexec/oslexec_pvt.h"
|
||||
# Files that are currently being modified with the OptiX work --
|
||||
# we'll reformat those only after that project work is completed, to
|
||||
# avoid nasty merge conflicts.
|
||||
"src/include/OSL/device_string.h"
|
||||
"src/include/OSL/oslexec.h"
|
||||
"src/testrender/cuda/*"
|
||||
# Header files in testsuite are almost certainly osl headers, not C++
|
||||
"testsuite/*.h"
|
||||
""
|
||||
CACHE STRING "Glob patterns to exclude for clang-format")
|
||||
find_program (CLANG_FORMAT_EXE
|
||||
NAMES clang-format bin/clang-format
|
||||
HINTS ${CLANG_FORMAT_EXE_HINT} ENV CLANG_FORMAT_EXE_HINT
|
||||
ENV LLVM_DIRECTORY
|
||||
NO_DEFAULT_PATH
|
||||
DOC "Path to clang-format executable")
|
||||
find_program (CLANG_FORMAT_EXE NAMES clang-format bin/clang-format)
|
||||
if (CLANG_FORMAT_EXE)
|
||||
message (STATUS "clang-format found: ${CLANG_FORMAT_EXE}")
|
||||
# Start with the list of files to include when formatting...
|
||||
file (GLOB_RECURSE FILES_TO_FORMAT ${CLANG_FORMAT_INCLUDES})
|
||||
# ... then process any list of excludes we are given
|
||||
foreach (_pat ${CLANG_FORMAT_EXCLUDES})
|
||||
file (GLOB_RECURSE _excl ${_pat})
|
||||
list (REMOVE_ITEM FILES_TO_FORMAT ${_excl})
|
||||
endforeach ()
|
||||
# message (STATUS "clang-format file list: ${FILES_TO_FORMAT}")
|
||||
file (COPY ${CMAKE_CURRENT_SOURCE_DIR}/.clang-format
|
||||
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
add_custom_target (clang-format
|
||||
COMMAND "${CLANG_FORMAT_EXE}" -i -style=file ${FILES_TO_FORMAT} )
|
||||
else ()
|
||||
message (STATUS "clang-format not found.")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Another way to sneak in custom compiler and DSO linking flags.
|
||||
#
|
||||
set (EXTRA_CPP_ARGS "" CACHE STRING "Extra C++ command line definitions")
|
||||
if (EXTRA_CPP_ARGS)
|
||||
message (STATUS "Extra C++ args: ${EXTRA_CPP_ARGS}")
|
||||
add_compile_options ("${EXTRA_CPP_ARGS}")
|
||||
endif()
|
||||
set (EXTRA_DSO_LINK_ARGS "" CACHE STRING "Extra command line definitions when building DSOs")
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Set the versioning for shared libraries.
|
||||
#
|
||||
if (${PROJECT_NAME}_SUPPORTED_RELEASE)
|
||||
# Supported releases guarantee ABI back-compatibility within the release
|
||||
# family, so SO versioning is major.minor.
|
||||
set (SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
||||
CACHE STRING "Set the SO version for dynamic libraries")
|
||||
else ()
|
||||
# Development master makes no ABI stability guarantee, so we make the
|
||||
# SO naming capture down to the major.minor.patch level.
|
||||
set (SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}
|
||||
CACHE STRING "Set the SO version for dynamic libraries")
|
||||
endif ()
|
||||
if (VERBOSE)
|
||||
message(STATUS "Setting SOVERSION to: ${SOVERSION}")
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# BUILD_SHARED_LIBS, if turned off, will disable building of .so/.dll
|
||||
# dynamic libraries and instead only build static libraries.
|
||||
#
|
||||
option (BUILD_SHARED_LIBS "Build shared libraries (set to OFF to build static libs)" ON)
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
add_definitions (-D${PROJECT_NAME}_STATIC_DEFINE=1)
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# LINKSTATIC, if enabled, will cause us to favor linking static versions
|
||||
# of library dependencies, if they are available.
|
||||
#
|
||||
option (LINKSTATIC "Link with static external libraries when possible" OFF)
|
||||
if (LINKSTATIC)
|
||||
#set (_orig_link_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
message (STATUS "Statically linking external libraries when possible")
|
||||
if (WIN32)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
else ()
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Any extra logic to be run only for CI builds goes here.
|
||||
# We expect our own CI runs to define env variable ${PROJECT_NAME}_CI
|
||||
#
|
||||
if (DEFINED ENV{${PROJECT_NAME}_CI})
|
||||
add_definitions (-D${PROJ_NAME}_CI=1 -DBUILD_CI=1)
|
||||
if (APPLE)
|
||||
# Keep Mono framework from being incorrectly searched for include
|
||||
# files on GitHub Actions CI.
|
||||
set(CMAKE_FIND_FRAMEWORK LAST)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Rpath handling at the install step
|
||||
#
|
||||
set (MACOSX_RPATH ON)
|
||||
if (CMAKE_SKIP_RPATH)
|
||||
# We need to disallow the user from truly setting CMAKE_SKIP_RPATH, since
|
||||
# we want to run the generated executables from the build tree in order to
|
||||
# generate the manual page documentation. However, we make sure the
|
||||
# install rpath is unset so that the install tree is still free of rpaths
|
||||
# for linux packaging purposes.
|
||||
set (CMAKE_SKIP_RPATH FALSE)
|
||||
unset (CMAKE_INSTALL_RPATH)
|
||||
else ()
|
||||
if (NOT CMAKE_INSTALL_RPATH)
|
||||
set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||
endif ()
|
||||
# add the automatically determined parts of the RPATH that
|
||||
# point to directories outside the build tree to the install RPATH
|
||||
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
if (VERBOSE)
|
||||
message (STATUS "CMAKE_INSTALL_RPATH = ${CMAKE_INSTALL_RPATH}")
|
||||
endif ()
|
||||
endif ()
|
||||
# OSL considerations because we run oslc in the course of building:
|
||||
# Use (i.e. don't skip) the full RPATH for the build tree
|
||||
set (CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
# When building, don't use the install RPATH already (but later on when installing)
|
||||
set (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Macro to install targets to the appropriate locations. Use this instead
|
||||
# of the install(TARGETS ...) signature. Note that it adds it to the
|
||||
# export targets list for when we generate config files.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# install_targets (target1 [target2 ...])
|
||||
#
|
||||
macro (install_targets)
|
||||
install (TARGETS ${ARGN}
|
||||
EXPORT ${PROJ_NAME}_EXPORTED_TARGETS
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT user
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT user
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT developer)
|
||||
endmacro()
|
||||
@@ -0,0 +1,133 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Compile a CUDA file to PTX using NVCC
|
||||
function ( NVCC_COMPILE cuda_src ptx_generated extra_nvcc_args )
|
||||
get_filename_component ( cuda_src_we ${cuda_src} NAME_WE )
|
||||
get_filename_component ( cuda_src_dir ${cuda_src} DIRECTORY )
|
||||
set (cuda_ptx "${CMAKE_CURRENT_BINARY_DIR}/${cuda_src_we}.ptx" )
|
||||
set (${ptxlist} ${${ptxlist}} ${cuda_ptx} )
|
||||
set (${ptx_generated} ${cuda_ptx} PARENT_SCOPE)
|
||||
file ( GLOB cuda_headers "${cuda_src_dir}/*.h" )
|
||||
|
||||
list (TRANSFORM IMATH_INCLUDES PREPEND -I
|
||||
OUTPUT_VARIABLE ALL_IMATH_INCLUDES)
|
||||
list (TRANSFORM OPENEXR_INCLUDES PREPEND -I
|
||||
OUTPUT_VARIABLE ALL_OPENEXR_INCLUDES)
|
||||
list (TRANSFORM OpenImageIO_INCLUDES PREPEND -I
|
||||
OUTPUT_VARIABLE ALL_OpenImageIO_INCLUDES)
|
||||
|
||||
add_custom_command ( OUTPUT ${cuda_ptx}
|
||||
COMMAND ${CUDA_NVCC_EXECUTABLE}
|
||||
"-I${OPTIX_INCLUDES}"
|
||||
"-I${CUDA_INCLUDES}"
|
||||
"-I${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
"-I${CMAKE_BINARY_DIR}/include"
|
||||
"-I${PROJECT_SOURCE_DIR}/src/include"
|
||||
"-I${PROJECT_SOURCE_DIR}/src/cuda_common"
|
||||
${ALL_OpenImageIO_INCLUDES}
|
||||
${ALL_IMATH_INCLUDES}
|
||||
${ALL_OPENEXR_INCLUDES}
|
||||
"-I${Boost_INCLUDE_DIRS}"
|
||||
"-DFMT_DEPRECATED=\"\""
|
||||
${LLVM_COMPILE_FLAGS}
|
||||
-DOSL_USE_FAST_MATH=1
|
||||
-m64 -arch ${CUDA_TARGET_ARCH} -ptx
|
||||
--std=c++${CMAKE_CXX_STANDARD} -dc -O3 --use_fast_math --expt-relaxed-constexpr
|
||||
${extra_nvcc_args}
|
||||
${cuda_src} -o ${cuda_ptx}
|
||||
MAIN_DEPENDENCY ${cuda_src}
|
||||
DEPENDS ${cuda_src} ${cuda_headers} oslexec
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )
|
||||
endfunction ()
|
||||
|
||||
# Function to compile a C++ source file to CUDA-compatible LLVM bitcode
|
||||
function ( MAKE_CUDA_BITCODE src suffix generated_bc extra_clang_args )
|
||||
get_filename_component ( src_we ${src} NAME_WE )
|
||||
set (asm_cuda "${CMAKE_CURRENT_BINARY_DIR}/${src_we}${suffix}.s" )
|
||||
set (bc_cuda "${CMAKE_CURRENT_BINARY_DIR}/${src_we}${suffix}.bc" )
|
||||
set (${generated_bc} ${bc_cuda} PARENT_SCOPE )
|
||||
|
||||
# Setup the compile flags
|
||||
get_property (CURRENT_DEFINITIONS DIRECTORY PROPERTY COMPILE_DEFINITIONS)
|
||||
if (VERBOSE)
|
||||
message (STATUS "Current #defines are ${CURRENT_DEFINITIONS}")
|
||||
endif ()
|
||||
foreach (def ${CURRENT_DEFINITIONS})
|
||||
set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} "-D${def}")
|
||||
endforeach()
|
||||
set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} ${SIMD_COMPILE_FLAGS} ${CSTD_FLAGS})
|
||||
|
||||
# Setup the bitcode generator
|
||||
if (NOT LLVM_BC_GENERATOR)
|
||||
FIND_PROGRAM(LLVM_BC_GENERATOR NAMES "clang++" PATHS "${LLVM_DIRECTORY}/bin" NO_DEFAULT_PATH NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH)
|
||||
endif ()
|
||||
# If that didn't work, look anywhere
|
||||
if (NOT LLVM_BC_GENERATOR)
|
||||
# Wasn't in their build, look anywhere
|
||||
FIND_PROGRAM(LLVM_BC_GENERATOR NAMES clang++ llvm-g++)
|
||||
endif ()
|
||||
|
||||
if (NOT LLVM_BC_GENERATOR)
|
||||
message (FATAL_ERROR "You must have a valid llvm bitcode generator (clang++) somewhere.")
|
||||
endif ()
|
||||
if (VERBOSE)
|
||||
message (STATUS "Using LLVM_BC_GENERATOR ${LLVM_BC_GENERATOR} to generate bitcode.")
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
# fix compilation error when using MSVC
|
||||
set (CLANG_MSVC_FIX "-DBOOST_CONFIG_REQUIRES_THREADS_HPP")
|
||||
|
||||
# these are warnings triggered by the dllimport/export attributes not being supported when
|
||||
# compiling for Cuda. When all 3rd parties have their export macro fixed these warnings
|
||||
# can be restored.
|
||||
set (CLANG_MSVC_FIX "${CLANG_MSVC_FIX} -Wno-ignored-attributes -Wno-unknown-attributes")
|
||||
endif ()
|
||||
|
||||
list (TRANSFORM IMATH_INCLUDES PREPEND -I
|
||||
OUTPUT_VARIABLE ALL_IMATH_INCLUDES)
|
||||
list (TRANSFORM OPENEXR_INCLUDES PREPEND -I
|
||||
OUTPUT_VARIABLE ALL_OPENEXR_INCLUDES)
|
||||
list (TRANSFORM OpenImageIO_INCLUDES PREPEND -I
|
||||
OUTPUT_VARIABLE ALL_OpenImageIO_INCLUDES)
|
||||
|
||||
add_custom_command (OUTPUT ${bc_cuda}
|
||||
COMMAND ${LLVM_BC_GENERATOR}
|
||||
"-I${OPTIX_INCLUDES}"
|
||||
"-I${CUDA_INCLUDES}"
|
||||
"-I${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
"-I${CMAKE_BINARY_DIR}/include"
|
||||
"-I${PROJECT_SOURCE_DIR}/src/include"
|
||||
"-I${PROJECT_SOURCE_DIR}/src/cuda_common"
|
||||
${ALL_OpenImageIO_INCLUDES}
|
||||
${ALL_IMATH_INCLUDES}
|
||||
${ALL_OPENEXR_INCLUDES}
|
||||
"-I${Boost_INCLUDE_DIRS}"
|
||||
${LLVM_COMPILE_FLAGS} ${CUDA_LIB_FLAGS}
|
||||
-D__CUDACC__ -DOSL_COMPILING_TO_BITCODE=1 -DNDEBUG -DOIIO_NO_SSE -D__CUDADEVRT_INTERNAL__
|
||||
--language=cuda --cuda-device-only --cuda-gpu-arch=${CUDA_TARGET_ARCH}
|
||||
-Wno-deprecated-register -Wno-format-security
|
||||
-O3 -fno-math-errno -ffast-math -S -emit-llvm ${extra_clang_args}
|
||||
${src} -o ${asm_cuda}
|
||||
COMMAND "${LLVM_DIRECTORY}/bin/llvm-as" -f -o ${bc_cuda} ${asm_cuda}
|
||||
DEPENDS ${exec_headers} ${PROJECT_PUBLIC_HEADERS} ${src}
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )
|
||||
endfunction ()
|
||||
|
||||
# Compile a CUDA source file to LLVM bitcode, and then serialize the bitcode to
|
||||
# a C++ file to be compiled into the target executable.
|
||||
function ( LLVM_COMPILE_CUDA llvm_src headers prefix llvm_bc_cpp_generated extra_clang_args )
|
||||
get_filename_component (llvmsrc_we ${llvm_src} NAME_WE)
|
||||
set (llvm_bc_cpp "${CMAKE_CURRENT_BINARY_DIR}/${llvmsrc_we}.bc.cpp")
|
||||
set (${llvm_bc_cpp_generated} ${llvm_bc_cpp} PARENT_SCOPE)
|
||||
|
||||
MAKE_CUDA_BITCODE (${llvm_src} "" llvm_bc "${extra_clang_args}")
|
||||
|
||||
add_custom_command (OUTPUT ${llvm_bc_cpp}
|
||||
COMMAND python "${CMAKE_SOURCE_DIR}/src/liboslexec/serialize-bc.py" ${llvm_bc} ${llvm_bc_cpp} ${prefix}
|
||||
MAIN_DEPENDENCY ${llvm_src}
|
||||
DEPENDS "${CMAKE_SOURCE_DIR}/src/liboslexec/serialize-bc.py" ${llvm_src} ${headers} ${llvm_bc}
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )
|
||||
endfunction ()
|
||||
@@ -1,120 +1,77 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
###########################################################################
|
||||
# Find external dependencies
|
||||
###########################################################################
|
||||
# Find libraries
|
||||
|
||||
# When not in VERBOSE mode, try to make things as quiet as possible
|
||||
if (NOT VERBOSE)
|
||||
set (Bison_FIND_QUIETLY true)
|
||||
set (Boost_FIND_QUIETLY true)
|
||||
set (Flex_FIND_QUIETLY true)
|
||||
set (LLVM_FIND_QUIETLY true)
|
||||
set (OpenEXR_FIND_QUIETLY true)
|
||||
set (OpenImageIO_FIND_QUIETLY true)
|
||||
set (Partio_FIND_QUIETLY true)
|
||||
set (PkgConfig_FIND_QUIETLY true)
|
||||
set (PugiXML_FIND_QUIETLY TRUE)
|
||||
set (PythonInterp_FIND_QUIETLY true)
|
||||
set (PythonLibs_FIND_QUIETLY true)
|
||||
set (Threads_FIND_QUIETLY true)
|
||||
set (ZLIB_FIND_QUIETLY true)
|
||||
endif ()
|
||||
|
||||
message (STATUS "${ColorBoldWhite}")
|
||||
message (STATUS "* Checking for dependencies...")
|
||||
message (STATUS "* - Missing a dependency 'Package'?")
|
||||
message (STATUS "* Try cmake -DPackage_ROOT=path or set environment var Package_ROOT=path")
|
||||
message (STATUS "* For many dependencies, we supply src/build-scripts/build_Package.bash")
|
||||
message (STATUS "* - To exclude an optional dependency (even if found),")
|
||||
message (STATUS "* -DUSE_Package=OFF or set environment var USE_Package=OFF ")
|
||||
message (STATUS "${ColorReset}")
|
||||
|
||||
setup_path (THIRD_PARTY_TOOLS_HOME
|
||||
"unknown"
|
||||
"Location of third party libraries in the external project")
|
||||
|
||||
# Add all third party tool directories to the include and library paths so
|
||||
# that they'll be correctly found by the various FIND_PACKAGE() invocations.
|
||||
if (THIRD_PARTY_TOOLS_HOME AND EXISTS "${THIRD_PARTY_TOOLS_HOME}")
|
||||
set (CMAKE_INCLUDE_PATH "${THIRD_PARTY_TOOLS_HOME}/include" "${CMAKE_INCLUDE_PATH}")
|
||||
# Detect third party tools which have been successfully built using the
|
||||
# lock files which are placed there by the external project Makefile.
|
||||
file (GLOB _external_dir_lockfiles "${THIRD_PARTY_TOOLS_HOME}/*.d")
|
||||
foreach (_dir_lockfile ${_external_dir_lockfiles})
|
||||
# Grab the tool directory_name.d
|
||||
get_filename_component (_ext_dirname ${_dir_lockfile} NAME)
|
||||
# Strip off the .d extension
|
||||
string (REGEX REPLACE "\\.d$" "" _ext_dirname ${_ext_dirname})
|
||||
set (CMAKE_INCLUDE_PATH "${THIRD_PARTY_TOOLS_HOME}/include/${_ext_dirname}" ${CMAKE_INCLUDE_PATH})
|
||||
set (CMAKE_LIBRARY_PATH "${THIRD_PARTY_TOOLS_HOME}/lib/${_ext_dirname}" ${CMAKE_LIBRARY_PATH})
|
||||
endforeach ()
|
||||
endif ()
|
||||
# Place where locally built (by src/build-scripts/*) dependencies go.
|
||||
# Put it first in the prefix path.
|
||||
set (OSL_LOCAL_DEPS_DIR "${CMAKE_SOURCE_DIR}/ext/dist" CACHE STRING
|
||||
"Local area for dependencies added to CMAKE_PREFIX_PATH")
|
||||
list (INSERT CMAKE_PREFIX_PATH 0 ${OSL_LOCAL_DEPS_DIR})
|
||||
message (STATUS "CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}")
|
||||
|
||||
|
||||
setup_string (SPECIAL_COMPILE_FLAGS ""
|
||||
"Custom compilation flags")
|
||||
if (SPECIAL_COMPILE_FLAGS)
|
||||
add_definitions (${SPECIAL_COMPILE_FLAGS})
|
||||
endif ()
|
||||
include (ExternalProject)
|
||||
|
||||
|
||||
|
||||
###########################################################################
|
||||
# IlmBase setup
|
||||
|
||||
find_package (OpenEXR REQUIRED)
|
||||
#OpenEXR 2.2 still has problems with importing ImathInt64.h unqualified
|
||||
#thus need for ilmbase/OpenEXR
|
||||
include_directories ("${OPENEXR_INCLUDE_DIR}"
|
||||
"${ILMBASE_INCLUDE_DIR}"
|
||||
"${ILMBASE_INCLUDE_DIR}/OpenEXR")
|
||||
if (${OPENEXR_VERSION} VERSION_LESS 2.0.0)
|
||||
# OpenEXR 1.x had weird #include dirctives, this is also necessary:
|
||||
include_directories ("${OPENEXR_INCLUDE_DIR}/OpenEXR")
|
||||
else ()
|
||||
add_definitions (-DUSE_OPENEXR_VERSION2=1)
|
||||
endif ()
|
||||
if (NOT OpenEXR_FIND_QUIETLY)
|
||||
message (STATUS "ILMBASE_INCLUDE_DIR = ${ILMBASE_INCLUDE_DIR}")
|
||||
message (STATUS "ILMBASE_LIBRARIES = ${ILMBASE_LIBRARIES}")
|
||||
endif ()
|
||||
|
||||
# end IlmBase setup
|
||||
###########################################################################
|
||||
option (BUILD_MISSING_DEPS "Try to download and build any missing dependencies" OFF)
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Boost setup
|
||||
|
||||
if (NOT Boost_FIND_QUIETLY)
|
||||
message (STATUS "BOOST_ROOT ${BOOST_ROOT}")
|
||||
endif ()
|
||||
|
||||
if (NOT DEFINED Boost_ADDITIONAL_VERSIONS)
|
||||
set (Boost_ADDITIONAL_VERSIONS "1.60" "1.59" "1.58" "1.57" "1.56"
|
||||
"1.55" "1.54" "1.53" "1.52" "1.51" "1.50"
|
||||
"1.49" "1.48" "1.47" "1.46" "1.45" "1.44"
|
||||
"1.43" "1.43.0" "1.42" "1.42.0")
|
||||
endif ()
|
||||
if (LINKSTATIC)
|
||||
set (Boost_USE_STATIC_LIBS ON)
|
||||
set (Boost_USE_STATIC_LIBS ON)
|
||||
else ()
|
||||
if (MSVC)
|
||||
add_definitions (-DBOOST_ALL_DYN_LINK=1)
|
||||
endif ()
|
||||
endif ()
|
||||
set (Boost_USE_MULTITHREADED ON)
|
||||
if (BOOST_CUSTOM)
|
||||
set (Boost_FOUND true)
|
||||
# N.B. For a custom version, the caller had better set up the variables
|
||||
# Boost_VERSION, Boost_INCLUDE_DIRS, Boost_LIBRARY_DIRS, Boost_LIBRARIES.
|
||||
else ()
|
||||
set (Boost_COMPONENTS filesystem regex system thread wave)
|
||||
find_package (Boost 1.42 REQUIRED
|
||||
COMPONENTS ${Boost_COMPONENTS}
|
||||
)
|
||||
set (Boost_COMPONENTS filesystem system thread)
|
||||
if (NOT USE_STD_REGEX)
|
||||
list (APPEND Boost_COMPONENTS regex)
|
||||
endif ()
|
||||
# The FindBoost.cmake interface is broken if it uses boost's installed
|
||||
# cmake output (e.g. boost 1.70.0, cmake <= 3.14). Specifically it fails
|
||||
# to set the expected variables printed below. So until that's fixed
|
||||
# force FindBoost.cmake to use the original brute force path.
|
||||
set (Boost_NO_BOOST_CMAKE ON)
|
||||
checked_find_package (Boost REQUIRED
|
||||
VERSION_MIN 1.55
|
||||
COMPONENTS ${Boost_COMPONENTS}
|
||||
RECOMMEND_MIN 1.66
|
||||
RECOMMEND_MIN_REASON "Boost 1.66 is the oldest version our CI tests against"
|
||||
PRINT Boost_INCLUDE_DIRS Boost_LIBRARIES
|
||||
)
|
||||
endif ()
|
||||
|
||||
# On Linux, Boost 1.55 and higher seems to need to link against -lrt
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND ${Boost_VERSION} GREATER 105499)
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux"
|
||||
AND ${Boost_VERSION} VERSION_GREATER_EQUAL 105500)
|
||||
list (APPEND Boost_LIBRARIES "rt")
|
||||
endif ()
|
||||
|
||||
if (NOT Boost_FIND_QUIETLY)
|
||||
message (STATUS "BOOST_ROOT ${BOOST_ROOT}")
|
||||
message (STATUS "Boost found ${Boost_FOUND} ")
|
||||
message (STATUS "Boost version ${Boost_VERSION}")
|
||||
message (STATUS "Boost include dirs ${Boost_INCLUDE_DIRS}")
|
||||
message (STATUS "Boost library dirs ${Boost_LIBRARY_DIRS}")
|
||||
message (STATUS "Boost libraries ${Boost_LIBRARIES}")
|
||||
endif ()
|
||||
|
||||
include_directories (SYSTEM "${Boost_INCLUDE_DIRS}")
|
||||
link_directories ("${Boost_LIBRARY_DIRS}")
|
||||
|
||||
@@ -122,145 +79,169 @@ link_directories ("${Boost_LIBRARY_DIRS}")
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Partio
|
||||
checked_find_package (ZLIB REQUIRED) # Needed by several packages
|
||||
|
||||
find_package (ZLIB)
|
||||
if (USE_PARTIO)
|
||||
find_library (PARTIO_LIBRARIES
|
||||
NAMES partio
|
||||
PATHS "${PARTIO_HOME}/lib")
|
||||
find_path (PARTIO_INCLUDE_DIR
|
||||
NAMES Partio.h
|
||||
PATHS "${PARTIO_HOME}/include")
|
||||
if (PARTIO_INCLUDE_DIR AND PARTIO_LIBRARIES)
|
||||
set (PARTIO_FOUND TRUE)
|
||||
add_definitions ("-DUSE_PARTIO=1")
|
||||
include_directories ("${PARTIO_INCLUDE_DIR}")
|
||||
if (NOT Partio_FIND_QUIETLY)
|
||||
message (STATUS "Partio include = ${PARTIO_INCLUDE_DIR}")
|
||||
message (STATUS "Partio library = ${PARTIO_LIBRARIES}")
|
||||
endif ()
|
||||
else ()
|
||||
add_definitions ("-DUSE_PARTIO=0")
|
||||
set (PARTIO_FOUND FALSE)
|
||||
set (PARTIO_LIBRARIES "")
|
||||
message (STATUS "Partio not found")
|
||||
endif ()
|
||||
# IlmBase & OpenEXR
|
||||
checked_find_package (OpenEXR REQUIRED
|
||||
VERSION_MIN 2.0
|
||||
RECOMMEND_MIN 2.2
|
||||
RECOMMEND_MIN_REASON
|
||||
"OpenEXR 2.2 is the oldest version our CI tests against, and the minimum that supports DWA compression"
|
||||
PRINT IMATH_INCLUDES
|
||||
)
|
||||
# Force Imath includes to be before everything else to ensure that we have
|
||||
# the right Imath/OpenEXR version, not some older version in the system
|
||||
# library. This shoudn't be necessary, except for the common case of people
|
||||
# building against Imath/OpenEXR 3.x when there is still a system-level
|
||||
# install version of 2.x.
|
||||
include_directories(BEFORE ${IMATH_INCLUDES})
|
||||
if (CMAKE_COMPILER_IS_CLANG AND OPENEXR_VERSION VERSION_LESS 2.3)
|
||||
# clang C++ >= 11 doesn't like 'register' keyword in old exr headers
|
||||
add_compile_options (-Wno-deprecated-register)
|
||||
endif ()
|
||||
if (MSVC AND NOT LINKSTATIC)
|
||||
add_definitions (-DOPENEXR_DLL) # Is this needed for new versions?
|
||||
endif ()
|
||||
|
||||
if (OPENEXR_VERSION VERSION_GREATER_EQUAL 2.5.99)
|
||||
set (OSL_USING_IMATH 3)
|
||||
else ()
|
||||
set (PARTIO_FOUND FALSE)
|
||||
set (PARTIO_LIBRARIES "")
|
||||
endif (USE_PARTIO)
|
||||
|
||||
# end GL Extension Wrangler library setup
|
||||
###########################################################################
|
||||
set (OSL_USING_IMATH 2)
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Pugixml setup. Normally we just use the version bundled with oiio, but
|
||||
# some linux distros are quite particular about having separate packages so we
|
||||
# allow this to be overridden to use the distro-provided package if desired.
|
||||
if (USE_EXTERNAL_PUGIXML)
|
||||
find_package (PugiXML REQUIRED)
|
||||
# insert include path to pugixml first, to ensure that the external
|
||||
# pugixml is found, and not the one in OIIO's include directory.
|
||||
include_directories (BEFORE "${PUGIXML_INCLUDE_DIR}")
|
||||
endif()
|
||||
# end Pugixml setup
|
||||
###########################################################################
|
||||
# OpenImageIO
|
||||
set (OIIO_LIBNAME_SUFFIX "" CACHE STRING
|
||||
"Optional name appended to OIIO libraries that are built")
|
||||
checked_find_package (OpenImageIO REQUIRED
|
||||
VERSION_MIN 2.0
|
||||
PRINT OIIOTOOL_BIN)
|
||||
if (OPENIMAGEIO_FOUND)
|
||||
include_directories ("${OPENIMAGEIO_INCLUDES}")
|
||||
endif ()
|
||||
|
||||
|
||||
checked_find_package (pugixml REQUIRED
|
||||
VERSION_MIN 1.8)
|
||||
|
||||
|
||||
###########################################################################
|
||||
# LLVM library setup
|
||||
|
||||
# try to find llvm-config, with a specific version if specified
|
||||
if(LLVM_DIRECTORY)
|
||||
FIND_PROGRAM(LLVM_CONFIG llvm-config-${LLVM_VERSION} HINTS "${LLVM_DIRECTORY}/bin" NO_DEFAULT_PATH)
|
||||
if(NOT LLVM_CONFIG)
|
||||
FIND_PROGRAM(LLVM_CONFIG llvm-config HINTS "${LLVM_DIRECTORY}/bin" NO_DEFAULT_PATH)
|
||||
endif()
|
||||
else()
|
||||
FIND_PROGRAM(LLVM_CONFIG llvm-config-${LLVM_VERSION})
|
||||
if(NOT LLVM_CONFIG)
|
||||
FIND_PROGRAM(LLVM_CONFIG llvm-config)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT LLVM_DIRECTORY OR EXISTS ${LLVM_CONFIG})
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --version
|
||||
OUTPUT_VARIABLE LLVM_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --prefix
|
||||
OUTPUT_VARIABLE LLVM_DIRECTORY
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --libdir
|
||||
OUTPUT_VARIABLE LLVM_LIB_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --includedir
|
||||
OUTPUT_VARIABLE LLVM_INCLUDES
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
|
||||
if (LLVM_VERSION VERSION_GREATER 3.4.9 AND (NOT USE_CPP11 AND NOT USE_CPP14))
|
||||
message (FATAL_ERROR "LLVM ${LLVM_VERSION} requires C++11. You must build with USE_CPP11=1 or USE_CPP14=1.")
|
||||
checked_find_package (LLVM REQUIRED
|
||||
VERSION_MIN 7.0
|
||||
PRINT LLVM_SYSTEM_LIBRARIES CLANG_LIBRARIES)
|
||||
# ensure include directory is added (in case of non-standard locations
|
||||
include_directories (BEFORE SYSTEM "${LLVM_INCLUDES}")
|
||||
link_directories ("${LLVM_LIB_DIR}")
|
||||
# Extract and concatenate major & minor, remove wayward patches,
|
||||
# dots, and "svn" or other suffixes.
|
||||
string (REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1\\2" OSL_LLVM_VERSION ${LLVM_VERSION})
|
||||
add_definitions (-DOSL_LLVM_VERSION=${OSL_LLVM_VERSION})
|
||||
add_definitions (-DOSL_LLVM_FULL_VERSION="${LLVM_VERSION}")
|
||||
if (LLVM_NAMESPACE)
|
||||
add_definitions ("-DLLVM_NAMESPACE=${LLVM_NAMESPACE}")
|
||||
endif ()
|
||||
if (LLVM_VERSION VERSION_GREATER_EQUAL 10.0.0 AND
|
||||
CMAKE_CXX_STANDARD VERSION_LESS 14)
|
||||
message (FATAL_ERROR
|
||||
"LLVM 10+ requires C++14 or higher (was ${CMAKE_CXX_STANDARD}). "
|
||||
"To build against this LLVM ${LLVM_VERSION}, you need to set "
|
||||
"build option CMAKE_CXX_STANDARD=14. The minimum requirements "
|
||||
"for that are gcc >= 5.1, clang >= 3.5, Apple clang >= 7, "
|
||||
"icc >= 7, MSVS >= 2017. "
|
||||
"If you must use C++11, you need to build against LLVM 9 or earlier.")
|
||||
endif ()
|
||||
if (APPLE AND LLVM_VERSION VERSION_EQUAL 10.0.1 AND EXISTS "/usr/local/Cellar/llvm")
|
||||
message (WARNING
|
||||
"${ColorYellow}If you are using LLVM 10.0.1 installed by Homebrew, "
|
||||
"please note that a known bug in LLVM may produce a link error where "
|
||||
"it says it can't find libxml2.tbd. If you encounter this, please "
|
||||
"try downgrading to LLVM 9: \n"
|
||||
" brew uninstall llvm \n"
|
||||
" brew install llvm@9 \n"
|
||||
" export LLVM_DIRECTORY=/usr/local/opt/llvm@9 "
|
||||
"${ColorReset}\n")
|
||||
endif ()
|
||||
|
||||
find_library ( LLVM_LIBRARY
|
||||
NAMES LLVM-${LLVM_VERSION}
|
||||
PATHS ${LLVM_LIB_DIR})
|
||||
find_library ( LLVM_MCJIT_LIBRARY
|
||||
NAMES LLVMMCJIT
|
||||
PATHS ${LLVM_LIB_DIR})
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --ldflags
|
||||
OUTPUT_VARIABLE LLVM_LDFLAGS
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
checked_find_package (partio)
|
||||
|
||||
# if (NOT LLVM_LIBRARY)
|
||||
# execute_process (COMMAND ${LLVM_CONFIG} --libfiles engine
|
||||
# OUTPUT_VARIABLE LLVM_LIBRARIES
|
||||
# OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# endif ()
|
||||
|
||||
if (NOT LLVM_FIND_QUIETLY)
|
||||
message (STATUS "LLVM version = ${LLVM_VERSION}")
|
||||
message (STATUS "LLVM dir = ${LLVM_DIRECTORY}")
|
||||
message (STATUS "LLVM includes = ${LLVM_INCLUDES}")
|
||||
message (STATUS "LLVM library = ${LLVM_LIBRARY}")
|
||||
message (STATUS "LLVM MCJIT library = ${LLVM_MCJIT_LIBRARY}")
|
||||
message (STATUS "LLVM lib dir = ${LLVM_LIB_DIR}")
|
||||
message (STATUS "LLVM libraries = ${LLVM_LIBRARIES}")
|
||||
# From pythonutils.cmake
|
||||
find_python ()
|
||||
|
||||
|
||||
# Qt -- used for osltoy
|
||||
set (qt5_modules Core Gui Widgets)
|
||||
if (OPENGL_FOUND)
|
||||
list (APPEND qt5_modules OpenGL)
|
||||
endif ()
|
||||
option (USE_QT "Use Qt if found" ON)
|
||||
checked_find_package (Qt5 COMPONENTS ${qt5_modules})
|
||||
if (USE_QT AND NOT Qt5_FOUND AND APPLE)
|
||||
message (STATUS " If you think you installed qt5 with Homebrew and it still doesn't work,")
|
||||
message (STATUS " try: export PATH=/usr/local/opt/qt5/bin:$PATH")
|
||||
endif ()
|
||||
|
||||
# shared llvm library may not be available, this is not an error if we use LLVM_STATIC.
|
||||
if ((LLVM_LIBRARY OR LLVM_STATIC) AND LLVM_INCLUDES AND LLVM_DIRECTORY AND LLVM_LIB_DIR)
|
||||
# ensure include directory is added (in case of non-standard locations
|
||||
include_directories (BEFORE "${LLVM_INCLUDES}")
|
||||
if (NOT OSL_LLVM_VERSION)
|
||||
# Extract and concatenate major & minor, remove wayward patches,
|
||||
# dots, and "svn" or other suffixes.
|
||||
string (REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1\\2" OSL_LLVM_VERSION ${LLVM_VERSION})
|
||||
endif ()
|
||||
add_definitions ("-DOSL_LLVM_VERSION=${OSL_LLVM_VERSION}")
|
||||
if (LLVM_STATIC)
|
||||
# if static LLVM libraries were requested, use llvm-config to generate
|
||||
# the list of what libraries we need, and substitute that in the right
|
||||
# way for LLVM_LIBRARY.
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --libfiles
|
||||
OUTPUT_VARIABLE LLVM_LIBRARY
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string (REPLACE " " ";" LLVM_LIBRARY ${LLVM_LIBRARY})
|
||||
endif ()
|
||||
if (NOT LLVM_FIND_QUIETLY)
|
||||
message (STATUS "LLVM OSL_LLVM_VERSION = ${OSL_LLVM_VERSION}")
|
||||
message (STATUS "LLVM library = ${LLVM_LIBRARY}")
|
||||
endif ()
|
||||
|
||||
if (NOT LLVM_LIBRARY)
|
||||
message (FATAL_ERROR "LLVM library not found.")
|
||||
endif()
|
||||
# CUDA setup
|
||||
if (USE_CUDA OR USE_OPTIX)
|
||||
if (NOT CUDA_TOOLKIT_ROOT_DIR AND NOT $ENV{CUDA_TOOLKIT_ROOT_DIR} STREQUAL "")
|
||||
set (CUDA_TOOLKIT_ROOT_DIR $ENV{CUDA_TOOLKIT_ROOT_DIR})
|
||||
endif ()
|
||||
|
||||
if (NOT CUDA_FIND_QUIETLY OR NOT OptiX_FIND_QUIETLY)
|
||||
message (STATUS "CUDA_TOOLKIT_ROOT_DIR = ${CUDA_TOOLKIT_ROOT_DIR}")
|
||||
endif ()
|
||||
|
||||
checked_find_package (CUDA REQUIRED
|
||||
VERSION_MIN 8.0
|
||||
PRINT CUDA_INCLUDES)
|
||||
set (CUDA_INCLUDES ${CUDA_TOOLKIT_ROOT_DIR}/include)
|
||||
include_directories (BEFORE "${CUDA_INCLUDES}")
|
||||
|
||||
STRING (FIND ${LLVM_TARGETS} "NVPTX" nvptx_index)
|
||||
if (NOT ${nvptx_index} GREATER -1)
|
||||
message (FATAL_ERROR "NVPTX target is not available in the provided LLVM build")
|
||||
endif()
|
||||
|
||||
if (${CUDA_VERSION} VERSION_GREATER 8 AND ${LLVM_VERSION} VERSION_LESS 6)
|
||||
message (FATAL_ERROR "CUDA ${CUDA_VERSION} requires LLVM 6.0 or greater")
|
||||
endif ()
|
||||
|
||||
set (CUDA_LIB_FLAGS "--cuda-path=${CUDA_TOOLKIT_ROOT_DIR}")
|
||||
|
||||
find_library(cuda_lib NAMES cudart
|
||||
PATHS "${CUDA_TOOLKIT_ROOT_DIR}/lib64" "${CUDA_TOOLKIT_ROOT_DIR}/x64"
|
||||
REQUIRED)
|
||||
set(CUDA_LIBRARIES ${cuda_lib})
|
||||
|
||||
# testrender & testshade need libnvrtc
|
||||
if ("${CUDA_VERSION}" VERSION_GREATER_EQUAL "10.0")
|
||||
find_library(nvrtc_lib NAMES nvrtc
|
||||
PATHS "${CUDA_TOOLKIT_ROOT_DIR}/lib64" "${CUDA_TOOLKIT_ROOT_DIR}/x64"
|
||||
REQUIRED)
|
||||
set(CUDA_LIBRARIES ${CUDA_LIBRARIES} ${nvrtc_lib})
|
||||
|
||||
set(CUDA_EXTRA_LIBS ${CUDA_EXTRA_LIBS} dl)
|
||||
endif()
|
||||
|
||||
# OptiX setup
|
||||
if (USE_OPTIX)
|
||||
checked_find_package (OptiX REQUIRED
|
||||
VERSION_MIN 5.1)
|
||||
include_directories (BEFORE "${OPTIX_INCLUDES}")
|
||||
if (NOT USE_LLVM_BITCODE OR NOT USE_FAST_MATH)
|
||||
message (FATAL_ERROR "Enabling OptiX requires USE_LLVM_BITCODE=1 and USE_FAST_MATH=1")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
function (osl_optix_target TARGET)
|
||||
target_include_directories (${TARGET} BEFORE PRIVATE ${CUDA_INCLUDES} ${OPTIX_INCLUDES})
|
||||
## XXX: Should -DPTX_PATH point to (or include) CMAKE_CURRENT_BINARY_DIR so tests can run before installation ?
|
||||
target_compile_definitions (${TARGET} PRIVATE "-DPTX_PATH=\"${OSL_PTX_INSTALL_DIR}\"")
|
||||
target_link_libraries (${TARGET} PRIVATE ${CUDA_LIBRARIES} ${CUDA_EXTRA_LIBS} ${OPTIX_LIBRARIES} ${OPTIX_EXTRA_LIBS})
|
||||
endfunction()
|
||||
|
||||
else ()
|
||||
message (FATAL_ERROR "LLVM not found.")
|
||||
function (osl_optix_target TARGET)
|
||||
endfunction()
|
||||
endif ()
|
||||
|
||||
# end LLVM library setup
|
||||
###########################################################################
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Macro to add an executable build target. The executable name can be
|
||||
# specified with NAME, otherwise is inferred from the subdirectory name. The
|
||||
# source files of the binary can be specified with SRC, otherwise are
|
||||
# inferred to be all the .cpp files within the subdirectory. Optional
|
||||
# compile DEFINITIONS, private INCLUDE_DIRS, and private LINK_LIBRARIES may
|
||||
# also be specified.
|
||||
#
|
||||
# The executable may be disabled individually using any of the usual
|
||||
# check_is_enabled() conventions (e.g. -DENABLE_<executable>=OFF).
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# fancy_add_executable ([ NAME targetname ... ]
|
||||
# [ SRC source1 ... ]
|
||||
# [ INCLUDE_DIRS include_dir1 ... ]
|
||||
# [ DEFINITIONS -DFOO=bar ... ])
|
||||
# [ LINK_LIBRARIES external_lib1 ... ]
|
||||
#
|
||||
macro (fancy_add_executable)
|
||||
cmake_parse_arguments (_target "" "NAME" "SRC;INCLUDE_DIRS;SYSTEM_INCLUDE_DIRS;LINK_LIBRARIES;DEFINITIONS" ${ARGN})
|
||||
# Arguments: <prefix> <options> <one_value_keywords> <multi_value_keywords> args...
|
||||
if (NOT _target_NAME)
|
||||
# If NAME is not supplied, infer target name (and therefore the
|
||||
# executable name) from the directory name.
|
||||
get_filename_component (_target_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
endif ()
|
||||
if (NOT _target_SRC)
|
||||
# If SRC is not supplied, assume local cpp files are its source.
|
||||
file (GLOB _target_SRC *.cpp)
|
||||
endif ()
|
||||
check_is_enabled (${_target_NAME} _target_NAME_enabled)
|
||||
if (_target_NAME_enabled)
|
||||
add_executable (${_target_NAME} ${_target_SRC})
|
||||
if (_target_INCLUDE_DIRS)
|
||||
target_include_directories (${_target_NAME} PRIVATE ${_target_INCLUDE_DIRS})
|
||||
endif ()
|
||||
if (_target_SYSTEM_INCLUDE_DIRS)
|
||||
target_include_directories (${_target_NAME} SYSTEM PRIVATE ${_target_SYSTEM_INCLUDE_DIRS})
|
||||
endif ()
|
||||
if (_target_DEFINITIONS)
|
||||
target_compile_definitions (${_target_name} PRIVATE ${_target_DEFINITIONS})
|
||||
endif ()
|
||||
if (_target_LINK_LIBRARIES)
|
||||
target_link_libraries (${_target_NAME} PRIVATE ${_target_LINK_LIBRARIES})
|
||||
endif ()
|
||||
set_target_properties (${_target_NAME} PROPERTIES FOLDER "Tools")
|
||||
install_targets (${_target_NAME})
|
||||
else ()
|
||||
message (STATUS "${ColorRed}Disabling ${_target_NAME} ${ColorReset}")
|
||||
endif ()
|
||||
endmacro ()
|
||||
@@ -1,8 +1,11 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# LG's macros for using flex and bison.
|
||||
# Merely including this file will set FLEX_EXECUTABLE and BISON_EXECUTABLE
|
||||
# to the locations of 'flex' and 'bison' on the system, and leave them
|
||||
# undefined if those programs were not found.
|
||||
# If both are found, there will also be a macro defined:
|
||||
# Merely including this file will require flex and bison to be found.
|
||||
#
|
||||
# The main purpose is to define the macro FLEX_BISON:
|
||||
# FLEX_BISON ( flexsrc bisonsrc srclist compiler_headers )
|
||||
# where
|
||||
# flexsrc = the name of the .l file
|
||||
@@ -14,72 +17,48 @@
|
||||
# for the .y and .l files.
|
||||
|
||||
|
||||
IF (NOT FLEX_EXECUTABLE)
|
||||
if (NOT Flex_FIND_QUIETLY)
|
||||
MESSAGE (STATUS "Looking for flex")
|
||||
endif ()
|
||||
FIND_PROGRAM (FLEX_EXECUTABLE flex)
|
||||
IF (FLEX_EXECUTABLE)
|
||||
if (NOT Flex_FIND_QUIETLY)
|
||||
MESSAGE (STATUS "Looking for flex -- ${FLEX_EXECUTABLE}")
|
||||
endif ()
|
||||
ENDIF (FLEX_EXECUTABLE)
|
||||
ENDIF (NOT FLEX_EXECUTABLE)
|
||||
checked_find_package (BISON REQUIRED)
|
||||
checked_find_package (FLEX REQUIRED)
|
||||
|
||||
IF (NOT BISON_EXECUTABLE)
|
||||
if (NOT Bison_FIND_QUIETLY)
|
||||
MESSAGE (STATUS "Looking for bison")
|
||||
endif ()
|
||||
FIND_PROGRAM (BISON_EXECUTABLE bison)
|
||||
IF (BISON_EXECUTABLE)
|
||||
if (NOT Bison_FIND_QUIETLY)
|
||||
MESSAGE (STATUS "Looking for bison -- ${BISON_EXECUTABLE}")
|
||||
endif ()
|
||||
ENDIF (BISON_EXECUTABLE)
|
||||
ENDIF (NOT BISON_EXECUTABLE)
|
||||
|
||||
|
||||
IF ( FLEX_EXECUTABLE AND BISON_EXECUTABLE )
|
||||
MACRO ( FLEX_BISON flexsrc bisonsrc prefix srclist compiler_headers )
|
||||
if ( FLEX_EXECUTABLE AND BISON_EXECUTABLE )
|
||||
macro ( FLEX_BISON flexsrc bisonsrc prefix srclist compiler_headers )
|
||||
if (VERBOSE)
|
||||
MESSAGE (STATUS "FLEX_BISON flex=${flexsrc} bison=${bisonsrc} prefix=${prefix}")
|
||||
message (STATUS "FLEX_BISON flex=${flexsrc} bison=${bisonsrc} prefix=${prefix}")
|
||||
endif ()
|
||||
#MESSAGE (STATUS " src ${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
#MESSAGE (STATUS " bin ${CMAKE_CURRENT_BINARY_DIR}")
|
||||
GET_FILENAME_COMPONENT ( bisonsrc_we ${bisonsrc} NAME_WE )
|
||||
SET ( bisonoutputcxx "${CMAKE_CURRENT_BINARY_DIR}/${bisonsrc_we}.cpp" )
|
||||
SET ( bisonoutputh "${CMAKE_CURRENT_BINARY_DIR}/${bisonsrc_we}.h" )
|
||||
# MESSAGE (STATUS " bison output ${bisonoutputcxx} ${bisonoutputh}")
|
||||
get_filename_component ( bisonsrc_we ${bisonsrc} NAME_WE )
|
||||
set ( bisonoutputcxx "${CMAKE_CURRENT_BINARY_DIR}/${bisonsrc_we}.cpp" )
|
||||
set ( bisonoutputh "${CMAKE_CURRENT_BINARY_DIR}/${bisonsrc_we}.h" )
|
||||
|
||||
GET_FILENAME_COMPONENT ( flexsrc_we ${flexsrc} NAME_WE )
|
||||
SET ( flexoutputcxx "${CMAKE_CURRENT_BINARY_DIR}/${flexsrc_we}.cpp" )
|
||||
# MESSAGE (STATUS " flex output ${flexoutputcxx}")
|
||||
|
||||
SET ( ${srclist} ${${srclist}} ${bisonoutputcxx} ${flexoutputcxx} )
|
||||
# MESSAGE (STATUS " src list now ${${srclist}}")
|
||||
# MESSAGE (STATUS " compiler headers = ${${compiler_headers}}")
|
||||
get_filename_component ( flexsrc_we ${flexsrc} NAME_WE )
|
||||
set ( flexoutputcxx "${CMAKE_CURRENT_BINARY_DIR}/${flexsrc_we}.cpp" )
|
||||
set ( ${srclist} ${${srclist}} ${bisonoutputcxx} ${flexoutputcxx} )
|
||||
|
||||
# Be really sure that we prefer the FlexLexer.h that comes with
|
||||
# the flex binary we're using, not some other one in the system.
|
||||
GET_FILENAME_COMPONENT ( FLEX_UP ${FLEX_EXECUTABLE} PATH )
|
||||
GET_FILENAME_COMPONENT ( FLEX_UP_UP ${FLEX_UP} PATH )
|
||||
SET ( FLEX_INCLUDE_DIR "${FLEX_UP_UP}/include" )
|
||||
get_filename_component ( FLEX_UP ${FLEX_EXECUTABLE} PATH )
|
||||
get_filename_component ( FLEX_UP_UP ${FLEX_UP} PATH )
|
||||
set ( FLEX_INCLUDE_DIR "${FLEX_UP_UP}/include" )
|
||||
if (VERBOSE)
|
||||
MESSAGE (STATUS "Flex include dir = ${FLEX_INCLUDE_DIR}")
|
||||
message (STATUS "Flex include dir = ${FLEX_INCLUDE_DIR}")
|
||||
endif ()
|
||||
INCLUDE_DIRECTORIES ( ${FLEX_INCLUDE_DIR} )
|
||||
include_directories ( ${FLEX_INCLUDE_DIR} )
|
||||
|
||||
INCLUDE_DIRECTORIES ( ${CMAKE_CURRENT_BINARY_DIR} )
|
||||
INCLUDE_DIRECTORIES ( ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
ADD_CUSTOM_COMMAND ( OUTPUT ${bisonoutputcxx}
|
||||
# include_directories ( ${CMAKE_CURRENT_BINARY_DIR} )
|
||||
include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
add_custom_command ( OUTPUT ${bisonoutputcxx}
|
||||
COMMAND ${BISON_EXECUTABLE} -dv -p ${prefix} -o ${bisonoutputcxx} "${CMAKE_CURRENT_SOURCE_DIR}/${bisonsrc}"
|
||||
MAIN_DEPENDENCY ${bisonsrc}
|
||||
DEPENDS ${${compiler_headers}}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
ADD_CUSTOM_COMMAND ( OUTPUT ${flexoutputcxx}
|
||||
COMMAND ${FLEX_EXECUTABLE} -o ${flexoutputcxx} "${CMAKE_CURRENT_SOURCE_DIR}/${flexsrc}"
|
||||
if ( WINDOWS )
|
||||
set ( FB_WINCOMPAT --wincompat )
|
||||
else ()
|
||||
set ( FB_WINCOMPAT )
|
||||
endif ()
|
||||
add_custom_command ( OUTPUT ${flexoutputcxx}
|
||||
COMMAND ${FLEX_EXECUTABLE} ${FB_WINCOMPAT} -o ${flexoutputcxx} "${CMAKE_CURRENT_SOURCE_DIR}/${flexsrc}"
|
||||
MAIN_DEPENDENCY ${flexsrc}
|
||||
DEPENDS ${${compiler_headers}}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
ENDMACRO ()
|
||||
ENDIF ()
|
||||
endmacro ()
|
||||
endif ()
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Module to find LLVM
|
||||
#
|
||||
# This module defines the following variables:
|
||||
# LLVM_FOUND - True if llvm found.
|
||||
# LLVM_VERSION - Full LLVM version
|
||||
# LLVM_INCLUDES - where to find llvm headers
|
||||
# LLVM_LIBRARIES - List of LLVM libraries to link against
|
||||
# LLVM_SYSTEM_LIBRARIES - additional libraries needed by LLVM
|
||||
# LLVM_DIRECTORY - If not already set, the root of the LLVM install
|
||||
# LLVM_LIB_DIR - where to find llvm libs
|
||||
# LLVM_TARGETS - List of available LLVM targets
|
||||
# CLANG_LIBRARIES - list of libraries for clang components (optional,
|
||||
# those may not be found)
|
||||
#
|
||||
# The following input symbols may be used to help guide the search:
|
||||
# LLVM_DIRECTORY - the root of the LLVM installation (if custom)
|
||||
# LLVM_FIND_QUIETLY - if true, will suppress most console output
|
||||
# LLVM_STATIC - if true, will prefer static LLVM libs to dynamic
|
||||
|
||||
# try to find llvm-config, with a specific version if specified
|
||||
if (LLVM_DIRECTORY)
|
||||
set (LLVM_CONFIG_PATH_HINTS "${LLVM_DIRECTORY}/bin")
|
||||
endif ()
|
||||
list (APPEND LLVM_CONFIG_PATH_HINTS
|
||||
"/usr/local/opt/llvm/${LLVM_VERSION}/bin/"
|
||||
"/usr/local/opt/llvm/bin/")
|
||||
find_program (LLVM_CONFIG
|
||||
NAMES llvm-config-${LLVM_VERSION} llvm-config
|
||||
llvm-config-64-${LLVM_VERSION} llvm-config-64
|
||||
HINTS ${LLVM_CONFIG_PATH_HINTS} NO_DEFAULT_PATH)
|
||||
find_program (LLVM_CONFIG
|
||||
NAMES llvm-config-${LLVM_VERSION} llvm-config
|
||||
llvm-config-64-${LLVM_VERSION} llvm-config-64
|
||||
HINTS ${LLVM_CONFIG_PATH_HINTS})
|
||||
if (NOT LLVM_FIND_QUIETLY)
|
||||
message (STATUS "Found llvm-config '${LLVM_CONFIG}'")
|
||||
endif ()
|
||||
|
||||
if (NOT LLVM_DIRECTORY)
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --prefix
|
||||
OUTPUT_VARIABLE LLVM_DIRECTORY
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --version
|
||||
OUTPUT_VARIABLE LLVM_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --libdir
|
||||
OUTPUT_VARIABLE LLVM_LIB_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --includedir
|
||||
OUTPUT_VARIABLE LLVM_INCLUDES
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --targets-built
|
||||
OUTPUT_VARIABLE LLVM_TARGETS
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
############ HACK ##############
|
||||
# On OSX, the Homebrew (and maybe any build) of LLVM 10.0 seems to have a
|
||||
# link conflict with its dependency on the llvm libc++ and the system
|
||||
# libc++, both can end up dynamically linked and lead to very subtle and
|
||||
# frustrating behavior failures (in particular, osl's use of libclang will
|
||||
# botch include file parsing any time LD_LIBRARY_PATH doesn't have the llvm
|
||||
# libc++ first).
|
||||
#
|
||||
# It seems that this is not a problem when linking against the llvm and
|
||||
# libclang libraries statically. So on apple and when LLVM 10+ are involved,
|
||||
# just force that choice. Other than larger executables, it seems harmless,
|
||||
# and in any case a better choice than this beastly bug.
|
||||
#
|
||||
# We can periodically revisit this with new version of LLVM, maybe they will
|
||||
# fix things and we won't require this preemptive static linking.
|
||||
if (APPLE AND LLVM_VERSION VERSION_GREATER_EQUAL 10.0)
|
||||
set (LLVM_STATIC ON)
|
||||
endif ()
|
||||
|
||||
if (LLVM_STATIC)
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --system-libs --link-static
|
||||
OUTPUT_VARIABLE LLVM_SYSTEM_LIBRARIES
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
else ()
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --system-libs
|
||||
OUTPUT_VARIABLE LLVM_SYSTEM_LIBRARIES
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif ()
|
||||
string (REPLACE " " ";" LLVM_SYSTEM_LIBRARIES "${LLVM_SYSTEM_LIBRARIES}")
|
||||
|
||||
find_library ( LLVM_LIBRARY
|
||||
NAMES LLVM-${LLVM_VERSION} LLVM
|
||||
PATHS ${LLVM_LIB_DIR})
|
||||
find_library ( LLVM_MCJIT_LIBRARY
|
||||
NAMES LLVMMCJIT
|
||||
PATHS ${LLVM_LIB_DIR})
|
||||
|
||||
if (NOT LLVM_LIBRARY)
|
||||
# if no single library was found, use llvm-config to generate the list
|
||||
# of what libraries we need, and substitute that in the right way for
|
||||
# LLVM_LIBRARY.
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --libfiles
|
||||
OUTPUT_VARIABLE LLVM_LIBRARIES
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string (REPLACE " " ";" LLVM_LIBRARIES "${LLVM_LIBRARIES}")
|
||||
set (LLVM_LIBRARY "${LLVM_LIBRARIES}")
|
||||
endif ()
|
||||
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --shared-mode
|
||||
OUTPUT_VARIABLE LLVM_SHARED_MODE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (LLVM_VERSION VERSION_GREATER_EQUAL 9.0 AND (LLVM_SHARED_MODE STREQUAL "shared"))
|
||||
find_library ( _CLANG_CPP_LIBRARY
|
||||
NAMES "clang-cpp"
|
||||
PATHS ${LLVM_LIB_DIR})
|
||||
if (_CLANG_CPP_LIBRARY)
|
||||
list (APPEND CLANG_LIBRARIES ${_CLANG_CPP_LIBRARY})
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
foreach (COMPONENT clangFrontend clangDriver clangSerialization
|
||||
clangParse clangSema clangAnalysis clangAST clangBasic
|
||||
clangEdit clangLex)
|
||||
find_library ( _CLANG_${COMPONENT}_LIBRARY
|
||||
NAMES ${COMPONENT}
|
||||
PATHS ${LLVM_LIB_DIR})
|
||||
if (_CLANG_${COMPONENT}_LIBRARY)
|
||||
list (APPEND CLANG_LIBRARIES ${_CLANG_${COMPONENT}_LIBRARY})
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
|
||||
# shared llvm library may not be available, this is not an error if we use LLVM_STATIC.
|
||||
if ((LLVM_LIBRARY OR LLVM_LIBRARIES OR LLVM_STATIC) AND LLVM_INCLUDES AND LLVM_DIRECTORY AND LLVM_LIB_DIR)
|
||||
if (LLVM_STATIC)
|
||||
# if static LLVM libraries were requested, use llvm-config to generate
|
||||
# the list of what libraries we need, and substitute that in the right
|
||||
# way for LLVM_LIBRARY.
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --libfiles --link-static
|
||||
OUTPUT_VARIABLE LLVM_LIBRARIES
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (LLVM_LIBRARIES)
|
||||
string (REPLACE " " ";" LLVM_LIBRARIES "${LLVM_LIBRARIES}")
|
||||
set (LLVM_LIBRARY "")
|
||||
endif ()
|
||||
else ()
|
||||
set (LLVM_LIBRARIES "${LLVM_LIBRARY}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (LLVM
|
||||
REQUIRED_VARS
|
||||
LLVM_INCLUDES
|
||||
LLVM_LIBRARIES
|
||||
VERSION_VAR LLVM_VERSION
|
||||
)
|
||||
@@ -1,21 +1,123 @@
|
||||
# Module to find OpenEXR.
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Module to find OpenEXR and Imath.
|
||||
#
|
||||
# I'm afraid this is a mess, due to needing to support a wide range of
|
||||
# OpenEXR versions.
|
||||
#
|
||||
# For OpenEXR & Imath 3.0, this will establish the following imported
|
||||
# targets:
|
||||
#
|
||||
# Imath::Imath
|
||||
# Imath::Half
|
||||
# OpenEXR::OpenEXR
|
||||
# OpenEXR::Iex
|
||||
# OpenEXR::IlmThread
|
||||
#
|
||||
# For OpenEXR 2.4 & 2.5, it will establish the following imported targets:
|
||||
#
|
||||
# IlmBase::Imath
|
||||
# IlmBase::Half
|
||||
# IlmBase::Iex
|
||||
# IlmBase::IlmThread
|
||||
# OpenEXR::IlmImf
|
||||
#
|
||||
# For all versions -- but for OpenEXR < 2.4 the only thing this sets --
|
||||
# are the following CMake variables:
|
||||
#
|
||||
# This module will set
|
||||
# OPENEXR_FOUND true, if found
|
||||
# OPENEXR_INCLUDE_DIR directory where headers are found
|
||||
# OPENEXR_INCLUDES directory where OpenEXR headers are found
|
||||
# OPENEXR_LIBRARIES libraries for OpenEXR + IlmBase
|
||||
# ILMBASE_LIBRARIES libraries just IlmBase
|
||||
# OPENEXR_VERSION OpenEXR version (accurate for >= 2.0.0,
|
||||
# otherwise will just guess 1.6.1)
|
||||
# IMATH_INCLUDES directory where Imath headers are found
|
||||
# ILMBASE_INCLUDES directory where IlmBase headers are found
|
||||
# ILMBASE_LIBRARIES libraries just IlmBase
|
||||
#
|
||||
# Special inputs:
|
||||
# OPENEXR_CUSTOM_INCLUDE_DIR - custom location of headers
|
||||
# OPENEXR_CUSTOM_LIB_DIR - custom location of libraries
|
||||
# OPENEXR_CUSTOM_LIB_PREFIX - special snowflake library prefix
|
||||
# OPENEXR_CUSTOM_LIB_SUFFIX - special snowflake library suffix
|
||||
#
|
||||
|
||||
# Other standarnd issue macros
|
||||
# First, try to fine just the right config files
|
||||
find_package(Imath CONFIG)
|
||||
if (NOT TARGET Imath::Imath)
|
||||
# Couldn't find Imath::Imath, maybe it's older and has IlmBase?
|
||||
find_package(IlmBase CONFIG)
|
||||
endif ()
|
||||
find_package(OpenEXR CONFIG)
|
||||
|
||||
if (TARGET OpenEXR::OpenEXR AND TARGET Imath::Imath)
|
||||
# OpenEXR 3.x if both of these targets are found
|
||||
set (FOUND_OPENEXR_WITH_CONFIG 1)
|
||||
if (NOT OpenEXR_FIND_QUIETLY)
|
||||
message (STATUS "Found CONFIG for OpenEXR 3 (OPENEXR_VERSION=${OpenEXR_VERSION})")
|
||||
endif ()
|
||||
|
||||
# Mimic old style variables
|
||||
set (OPENEXR_VERSION ${OpenEXR_VERSION})
|
||||
get_target_property(IMATH_INCLUDES Imath::Imath INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(ILMBASE_INCLUDES Imath::Imath INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(ILMBASE_IMATH_LIBRARY Imath::Imath INTERFACE_LINK_LIBRARIES)
|
||||
get_target_property(IMATH_LIBRARY Imath::Imath INTERFACE_LINK_LIBRARIES)
|
||||
get_target_property(OPENEXR_IEX_LIBRARY OpenEXR::Iex INTERFACE_LINK_LIBRARIES)
|
||||
get_target_property(OPENEXR_ILMTHREAD_LIBRARY OpenEXR::IlmThread INTERFACE_LINK_LIBRARIES)
|
||||
set (ILMBASE_LIBRARIES ${ILMBASE_IMATH_LIBRARY})
|
||||
set (ILMBASE_FOUND true)
|
||||
|
||||
get_target_property(OPENEXR_INCLUDES OpenEXR::OpenEXR INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(OPENEXR_ILMIMF_LIBRARY OpenEXR::OpenEXR INTERFACE_LINK_LIBRARIES)
|
||||
set (OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ILMBASE_LIBRARIES})
|
||||
set (OPENEXR_FOUND true)
|
||||
|
||||
# Link with pthreads if required
|
||||
find_package (Threads)
|
||||
if (CMAKE_USE_PTHREADS_INIT)
|
||||
list (APPEND ILMBASE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif ()
|
||||
|
||||
elseif (TARGET OpenEXR::IlmImf AND TARGET IlmBase::Imath AND
|
||||
(OPENEXR_VERSION VERSION_GREATER_EQUAL 2.4 OR OpenEXR_VERSION VERSION_GREATER_EQUAL 2.4))
|
||||
# OpenEXR 2.4 or 2.5 with exported config
|
||||
set (FOUND_OPENEXR_WITH_CONFIG 1)
|
||||
if (NOT OpenEXR_FIND_QUIETLY)
|
||||
message (STATUS "Found CONFIG for OpenEXR 2 (OPENEXR_VERSION=${OpenEXR_VERSION})")
|
||||
endif ()
|
||||
|
||||
# Mimic old style variables
|
||||
get_target_property(ILMBASE_INCLUDES IlmBase::IlmBaseConfig INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(IMATH_INCLUDES IlmBase::IlmBaseConfig INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(ILMBASE_Imath_LIBRARY IlmBase::Imath INTERFACE_LINK_LIBRARIES)
|
||||
get_target_property(ILMBASE_IMATH_LIBRARY IlmBase::Imath INTERFACE_LINK_LIBRARIES)
|
||||
get_target_property(ILMBASE_HALF_LIBRARY IlmBase::Half INTERFACE_LINK_LIBRARIES)
|
||||
get_target_property(OPENEXR_IEX_LIBRARY IlmBase::Iex INTERFACE_LINK_LIBRARIES)
|
||||
get_target_property(OPENEXR_ILMTHREAD_LIBRARY IlmBase::IlmThread INTERFACE_LINK_LIBRARIES)
|
||||
set (ILMBASE_LIBRARIES ${ILMBASE_IMATH_LIBRARY} ${ILMBASE_HALF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY})
|
||||
set (ILMBASE_FOUND true)
|
||||
|
||||
get_target_property(OPENEXR_INCLUDES OpenEXR::IlmImfConfig INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(OPENEXR_ILMIMF_LIBRARY OpenEXR::IlmImf INTERFACE_LINK_LIBRARIES)
|
||||
set (OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${ILMBASE_LIBRARIES})
|
||||
set (OPENEXR_FOUND true)
|
||||
|
||||
# Link with pthreads if required
|
||||
find_package (Threads)
|
||||
if (CMAKE_USE_PTHREADS_INIT)
|
||||
list (APPEND ILMBASE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif ()
|
||||
|
||||
# Correct for how old OpenEXR config exports set the directory one
|
||||
# level lower than we prefer it.
|
||||
string(REGEX REPLACE "include/OpenEXR$" "include" ILMBASE_INCLUDES "${ILMBASE_INCLUDES}")
|
||||
string(REGEX REPLACE "include/OpenEXR$" "include" IMATH_INCLUDES "${IMATH_INCLUDES}")
|
||||
string(REGEX REPLACE "include/OpenEXR$" "include" OPENEXR_INCLUDES "${OPENEXR_INCLUDES}")
|
||||
|
||||
else ()
|
||||
# OpenEXR 2.x older versions without a config or whose configs we don't
|
||||
# trust.
|
||||
|
||||
set (FOUND_OPENEXR_WITH_CONFIG 0)
|
||||
|
||||
# Other standard issue macros
|
||||
include (FindPackageHandleStandardArgs)
|
||||
include (SelectLibraryConfigurations)
|
||||
|
||||
@@ -27,33 +129,50 @@ if (CMAKE_USE_PTHREADS_INIT)
|
||||
set (ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif ()
|
||||
|
||||
# Attempt to find OpenEXR with pkgconfig
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
if (NOT Ilmbase_ROOT AND NOT ILMBASE_ROOT
|
||||
AND NOT DEFINED ENV{Ilmbase_ROOT} AND NOT DEFINED ENV{ILMBASE_ROOT})
|
||||
pkg_check_modules(_ILMBASE QUIET IlmBase>=2.0.0)
|
||||
endif ()
|
||||
if (NOT OpenEXR_ROOT AND NOT OPENEXR_ROOT
|
||||
AND NOT DEFINED ENV{OpenEXR_ROOT} AND NOT DEFINED ENV{OPENEXR_ROOT})
|
||||
pkg_check_modules(_OPENEXR QUIET OpenEXR>=2.0.0)
|
||||
endif ()
|
||||
endif (PKG_CONFIG_FOUND)
|
||||
|
||||
# List of likely places to find the headers -- note priority override of
|
||||
# OPENEXR_CUSTOM_INCLUDE_DIR and ${OPENEXR_HOME}/include.
|
||||
# ${OPENEXR_ROOT}/include.
|
||||
# ILMBASE is needed in case ilmbase an openexr are installed in separate
|
||||
# directories, like NixOS does
|
||||
set (GENERIC_INCLUDE_PATHS
|
||||
${OPENEXR_CUSTOM_INCLUDE_DIR}
|
||||
${OPENEXR_HOME}/include
|
||||
${ILMBASE_HOME}/include
|
||||
${OPENEXR_ROOT}/include
|
||||
$ENV{OPENEXR_ROOT}/include
|
||||
${ILMBASE_ROOT}/include
|
||||
$ENV{ILMBASE_ROOT}/include
|
||||
${_ILMBASE_INCLUDEDIR}
|
||||
${_OPENEXR_INCLUDEDIR}
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/usr/include/${CMAKE_LIBRARY_ARCHITECTURE}
|
||||
/usr/local/include
|
||||
/sw/include
|
||||
/opt/local/include )
|
||||
|
||||
# Find the include file locations. We call find_path twice -- first using
|
||||
# only the custom paths, then if that fails, try the default paths only.
|
||||
# This seems to be the most robust way I can find to not get confused when
|
||||
# both system and custom libraries are present.
|
||||
# Find the include file locations.
|
||||
find_path (ILMBASE_INCLUDE_PATH OpenEXR/IlmBaseConfig.h
|
||||
PATHS ${GENERIC_INCLUDE_PATHS} NO_DEFAULT_PATH)
|
||||
find_path (ILMBASE_INCLUDE_PATH OpenEXR/IlmBaseConfig.h)
|
||||
HINTS ${ILMBASE_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR}
|
||||
${GENERIC_INCLUDE_PATHS} )
|
||||
find_path (OPENEXR_INCLUDE_PATH OpenEXR/OpenEXRConfig.h
|
||||
PATHS ${GENERIC_INCLUDE_PATHS} NO_DEFAULT_PATH)
|
||||
find_path (OPENEXR_INCLUDE_PATH OpenEXR/OpenEXRConfig.h)
|
||||
HINTS ${OPENEXR_INCLUDE_DIR}
|
||||
${GENERIC_INCLUDE_PATHS} )
|
||||
|
||||
# Try to figure out version number
|
||||
if (EXISTS "${OPENEXR_INCLUDE_PATH}/OpenEXR/ImfMultiPartInputFile.h")
|
||||
if (DEFINED _OPENEXR_VERSION AND NOT "${_OPENEXR_VERSION}" STREQUAL "")
|
||||
set (OPENEXR_VERSION "${_OPENEXR_VERSION}")
|
||||
string (REGEX REPLACE "([0-9]+)\\.[0-9\\.]+" "\\1" OPENEXR_VERSION_MAJOR "${_OPENEXR_VERSION}")
|
||||
string (REGEX REPLACE "[0-9]+\\.([0-9]+)(\\.[0-9]+)?" "\\1" OPENEXR_VERSION_MINOR "${_OPENEXR_VERSION}")
|
||||
elseif (EXISTS "${OPENEXR_INCLUDE_PATH}/OpenEXR/ImfMultiPartInputFile.h")
|
||||
# Must be at least 2.0
|
||||
file(STRINGS "${OPENEXR_INCLUDE_PATH}/OpenEXR/OpenEXRConfig.h" TMP REGEX "^#define OPENEXR_VERSION_STRING .*$")
|
||||
string (REGEX MATCHALL "[0-9]+[.0-9]+" OPENEXR_VERSION ${TMP})
|
||||
@@ -70,21 +189,24 @@ endif ()
|
||||
|
||||
|
||||
# List of likely places to find the libraries -- note priority override of
|
||||
# OPENEXR_CUSTOM_LIB_DIR and ${OPENEXR_HOME}/lib.
|
||||
set (GENERIC_LIBRARY_PATHS
|
||||
${OPENEXR_CUSTOM_LIB_DIR}
|
||||
${OPENEXR_HOME}/lib
|
||||
${ILMBASE_HOME}/lib
|
||||
# ${OPENEXR_ROOT}/lib.
|
||||
set (GENERIC_LIBRARY_PATHS
|
||||
${OPENEXR_ROOT}/lib
|
||||
${ILMBASE_ROOT}/lib
|
||||
${OPENEXR_INCLUDE_PATH}/../lib
|
||||
${ILMBASE_INCLUDE_PATH}/../lib
|
||||
/usr/lib
|
||||
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
|
||||
${_ILMBASE_LIBDIR}
|
||||
${_OPENEXR_LIBDIR}
|
||||
/usr/local/lib
|
||||
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
|
||||
/usr/lib
|
||||
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
$ENV{PROGRAM_FILES}/OpenEXR/lib/static )
|
||||
|
||||
# message (STATUS "Generic lib paths: ${GENERIC_LIBRARY_PATHS}")
|
||||
|
||||
# Handle request for static libs by altering CMAKE_FIND_LIBRARY_SUFFIXES.
|
||||
# We will restore it at the end of this file.
|
||||
set (_openexr_orig_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
@@ -96,56 +218,43 @@ if (OpenEXR_USE_STATIC_LIBS)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Look for the libraries themselves, for all the components. Like with the
|
||||
# headers, we do two finds -- first for custom locations, then for default.
|
||||
# Look for the libraries themselves, for all the components.
|
||||
# This is complicated because the OpenEXR libraries may or may not be
|
||||
# built with version numbers embedded.
|
||||
set (_openexr_components IlmThread IlmImf Imath Iex Half)
|
||||
foreach (COMPONENT ${_openexr_components})
|
||||
string (TOUPPER ${COMPONENT} UPPERCOMPONENT)
|
||||
# First try with the version embedded
|
||||
set (FULL_COMPONENT_NAME ${OPENEXR_CUSTOM_LIB_PREFIX}${COMPONENT}-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}${OPENEXR_CUSTOM_LIB_SUFFIX})
|
||||
find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME}
|
||||
PATHS ${GENERIC_LIBRARY_PATHS} NO_DEFAULT_PATH)
|
||||
# Again, with no directory restrictions
|
||||
find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME})
|
||||
# Try again without the version
|
||||
set (FULL_COMPONENT_NAME ${OPENEXR_CUSTOM_LIB_PREFIX}${COMPONENT}${OPENEXR_CUSTOM_LIB_SUFFIX})
|
||||
find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME}
|
||||
PATHS ${GENERIC_LIBRARY_PATHS} NO_DEFAULT_PATH)
|
||||
# One more time, with no restrictions
|
||||
find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME})
|
||||
find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY
|
||||
NAMES ${COMPONENT}-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}
|
||||
${COMPONENT}
|
||||
${COMPONENT}-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}_d
|
||||
${COMPONENT}_d
|
||||
HINTS ${OPENEXR_LIBRARY_DIR} $ENV{OPENEXR_LIBRARY_DIR}
|
||||
${GENERIC_LIBRARY_PATHS} )
|
||||
endforeach ()
|
||||
|
||||
#Half usually has no suffix
|
||||
find_library (OPENEXR_HALF_LIBRARY ${OPENEXR_CUSTOM_LIB_PREFIX}Half
|
||||
PATHS ${GENERIC_LIBRARY_PATHS} NO_DEFAULT_PATH)
|
||||
find_library (OPENEXR_HALF_LIBRARY ${OPENEXR_CUSTOM_LIB_PREFIX}Half)
|
||||
|
||||
# Set the FOUND, INCLUDE_DIR, and LIBRARIES variables.
|
||||
if (ILMBASE_INCLUDE_PATH AND OPENEXR_INCLUDE_PATH AND
|
||||
OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND
|
||||
OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)
|
||||
set (OPENEXR_FOUND TRUE)
|
||||
set (ILMBASE_FOUND TRUE)
|
||||
set (ILMBASE_INCLUDE_DIR ${ILMBASE_INCLUDE_PATH} CACHE STRING "The include paths needed to use IlmBase")
|
||||
set (OPENEXR_INCLUDE_DIR ${OPENEXR_INCLUDE_PATH} CACHE STRING "The include paths needed to use OpenEXR")
|
||||
set (ILMBASE_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ILMBASE_PTHREADS} CACHE STRING "The libraries needed to use IlmBase")
|
||||
set (OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${ILMBASE_LIBRARIES} ${ZLIB_LIBRARIES} CACHE STRING "The libraries needed to use OpenEXR")
|
||||
endif ()
|
||||
|
||||
find_package_handle_standard_args (OpenEXR
|
||||
REQUIRED_VARS ILMBASE_INCLUDE_PATH OPENEXR_INCLUDE_PATH
|
||||
OPENEXR_IMATH_LIBRARY OPENEXR_ILMIMF_LIBRARY
|
||||
OPENEXR_IEX_LIBRARY OPENEXR_HALF_LIBRARY
|
||||
VERSION_VAR OPENEXR_VERSION
|
||||
)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
ILMBASE_INCLUDE_DIR
|
||||
OPENEXR_INCLUDE_DIR
|
||||
ILMBASE_LIBRARIES
|
||||
OPENEXR_LIBRARIES
|
||||
if (OPENEXR_FOUND)
|
||||
set (OpenEXR_VERSION ${OPENEXR_VERSION})
|
||||
set (ILMBASE_FOUND TRUE)
|
||||
set (ILMBASE_INCLUDES ${ILMBASE_INCLUDE_PATH})
|
||||
set (IMATH_INCLUDES ${ILMBASE_INCLUDE_PATH})
|
||||
set (OPENEXR_INCLUDES ${OPENEXR_INCLUDE_PATH})
|
||||
set (ILMBASE_INCLUDE_DIR ${ILMBASE_INCLUDE_PATH})
|
||||
set (IMATH_INCLUDE_DIR ${ILMBASE_INCLUDE_PATH})
|
||||
set (OPENEXR_INCLUDE_DIR ${OPENEXR_INCLUDE_PATH})
|
||||
set (ILMBASE_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ILMBASE_PTHREADS} CACHE STRING "The libraries needed to use IlmBase")
|
||||
set (OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${ILMBASE_LIBRARIES} ${ZLIB_LIBRARIES} CACHE STRING "The libraries needed to use OpenEXR")
|
||||
set (FINDOPENEXR_FALLBACK TRUE)
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(
|
||||
OPENEXR_ILMIMF_LIBRARY
|
||||
OPENEXR_IMATH_LIBRARY
|
||||
OPENEXR_IEX_LIBRARY
|
||||
@@ -154,3 +263,5 @@ MARK_AS_ADVANCED(
|
||||
|
||||
# Restore the original CMAKE_FIND_LIBRARY_SUFFIXES
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES ${_openexr_orig_suffixes})
|
||||
|
||||
endif ()
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
###########################################################################
|
||||
# OpenImageIO https://www.openimageio.org
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
#
|
||||
# For an up-to-date version of this file, see:
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/src/cmake/Modules/FindOpenImageIO.cmake
|
||||
#
|
||||
###########################################################################
|
||||
#
|
||||
# CMake module to find OpenImageIO
|
||||
#
|
||||
# This module will set
|
||||
# OPENIMAGEIO_FOUND True, if found
|
||||
# OPENIMAGEIO_INCLUDES directory where headers are found
|
||||
# OPENIMAGEIO_LIBRARIES libraries for OIIO
|
||||
# OPENIMAGEIO_LIBRARY_DIRS library dirs for OIIO
|
||||
# OPENIMAGEIO_VERSION Version ("major.minor.patch.tweak")
|
||||
# OPENIMAGEIO_VERSION_MAJOR Version major number
|
||||
# OPENIMAGEIO_VERSION_MINOR Version minor number
|
||||
# OPENIMAGEIO_VERSION_PATCH Version minor patch
|
||||
# OPENIMAGEIO_VERSION_TWEAK Version minor tweak
|
||||
# OIIOTOOL_BIN Path to oiiotool executable
|
||||
#
|
||||
# Imported targets:
|
||||
# OpenImageIO::OpenImageIO The libOpenImageIO library.
|
||||
# OpenImageIO::oiiotool The oiiotool executable.
|
||||
#
|
||||
# Special inputs:
|
||||
# OpenImageIO_ROOT - if using CMake >= 3.12, will automatically search
|
||||
# this area for OIIO components.
|
||||
# OPENIMAGEIO_ROOT_DIR - custom "prefix" location of OIIO installation
|
||||
# (expecting bin, lib, include subdirectories)
|
||||
# This is deprecated, but will work for a while.
|
||||
# OpenImageIO_FIND_QUIETLY - if set, print minimal console output
|
||||
# OIIO_LIBNAME_SUFFIX - if set, optional nonstandard library suffix
|
||||
#
|
||||
###########################################################################
|
||||
#
|
||||
# NOTE: This file is deprecated.
|
||||
#
|
||||
# In OIIO 2.1+, we generate OpenImageIOConfig.cmake files that are now the
|
||||
# preferred way for downstream projects to find an installed OIIO. There
|
||||
# should be no need to copy this FindOpenImageIO.cmake file into downstream
|
||||
# projects, *unless* they need to work with a range of OIIO versions that
|
||||
# may include <2.1, which would lack the generated config files.
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
|
||||
# Prefer an OpenImageIO cmake config file if it can be found
|
||||
find_package(OpenImageIO CONFIG)
|
||||
if (TARGET OpenImageIO::OpenImageIO)
|
||||
set (OPENIMAGEIO_VERSION ${OpenImageIO_VERSION})
|
||||
else ()
|
||||
|
||||
# If 'OPENIMAGE_HOME' not set, use the env variable of that name if available
|
||||
if (NOT OPENIMAGEIO_ROOT_DIR AND NOT $ENV{OPENIMAGEIO_ROOT_DIR} STREQUAL "")
|
||||
set (OPENIMAGEIO_ROOT_DIR $ENV{OPENIMAGEIO_ROOT_DIR})
|
||||
endif ()
|
||||
|
||||
|
||||
find_library ( OPENIMAGEIO_LIBRARY
|
||||
NAMES OpenImageIO${OIIO_LIBNAME_SUFFIX}
|
||||
HINTS ${OPENIMAGEIO_ROOT_DIR}
|
||||
PATH_SUFFIXES lib64 lib )
|
||||
find_path ( OPENIMAGEIO_INCLUDE_DIR
|
||||
NAMES OpenImageIO/imageio.h
|
||||
HINTS ${OPENIMAGEIO_ROOT_DIR} )
|
||||
find_program ( OIIOTOOL_BIN
|
||||
NAMES oiiotool
|
||||
HINTS ${OPENIMAGEIO_ROOT_DIR} )
|
||||
|
||||
# Try to figure out version number
|
||||
set (OIIO_VERSION_HEADER "${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO/oiioversion.h")
|
||||
if (EXISTS "${OIIO_VERSION_HEADER}")
|
||||
file (STRINGS "${OIIO_VERSION_HEADER}" TMP REGEX "^#define OIIO_VERSION_MAJOR .*$")
|
||||
string (REGEX MATCHALL "[0-9]+" OPENIMAGEIO_VERSION_MAJOR ${TMP})
|
||||
file (STRINGS "${OIIO_VERSION_HEADER}" TMP REGEX "^#define OIIO_VERSION_MINOR .*$")
|
||||
string (REGEX MATCHALL "[0-9]+" OPENIMAGEIO_VERSION_MINOR ${TMP})
|
||||
file (STRINGS "${OIIO_VERSION_HEADER}" TMP REGEX "^#define OIIO_VERSION_PATCH .*$")
|
||||
string (REGEX MATCHALL "[0-9]+" OPENIMAGEIO_VERSION_PATCH ${TMP})
|
||||
file (STRINGS "${OIIO_VERSION_HEADER}" TMP REGEX "^#define OIIO_VERSION_TWEAK .*$")
|
||||
if (TMP)
|
||||
string (REGEX MATCHALL "[0-9]+" OPENIMAGEIO_VERSION_TWEAK ${TMP})
|
||||
else ()
|
||||
set (OPENIMAGEIO_VERSION_TWEAK 0)
|
||||
endif ()
|
||||
set (OPENIMAGEIO_VERSION "${OPENIMAGEIO_VERSION_MAJOR}.${OPENIMAGEIO_VERSION_MINOR}.${OPENIMAGEIO_VERSION_PATCH}.${OPENIMAGEIO_VERSION_TWEAK}")
|
||||
endif ()
|
||||
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (OpenImageIO
|
||||
FOUND_VAR OPENIMAGEIO_FOUND
|
||||
REQUIRED_VARS OPENIMAGEIO_INCLUDE_DIR OPENIMAGEIO_LIBRARY
|
||||
OPENIMAGEIO_VERSION
|
||||
VERSION_VAR OPENIMAGEIO_VERSION
|
||||
)
|
||||
|
||||
if (OPENIMAGEIO_FOUND)
|
||||
set (OpenImageIO_VERSION ${OPENIMAGEIO_VERSION})
|
||||
set (OPENIMAGEIO_INCLUDES ${OPENIMAGEIO_INCLUDE_DIR})
|
||||
set (OpenImageIO_INCLUDES ${OPENIMAGEIO_INCLUDE_DIR})
|
||||
set (OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARY})
|
||||
get_filename_component (OPENIMAGEIO_LIBRARY_DIRS "${OPENIMAGEIO_LIBRARY}" DIRECTORY)
|
||||
if (NOT OpenImageIO_FIND_QUIETLY)
|
||||
message ( STATUS "OpenImageIO includes = ${OPENIMAGEIO_INCLUDE_DIR}" )
|
||||
message ( STATUS "OpenImageIO libraries = ${OPENIMAGEIO_LIBRARIES}" )
|
||||
message ( STATUS "OpenImageIO library_dirs = ${OPENIMAGEIO_LIBRARY_DIRS}" )
|
||||
message ( STATUS "OpenImageIO oiiotool = ${OIIOTOOL_BIN}" )
|
||||
endif ()
|
||||
|
||||
if (NOT TARGET OpenImageIO::OpenImageIO)
|
||||
add_library(OpenImageIO::OpenImageIO UNKNOWN IMPORTED)
|
||||
set_target_properties(OpenImageIO::OpenImageIO PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OPENIMAGEIO_INCLUDES}")
|
||||
|
||||
set_property(TARGET OpenImageIO::OpenImageIO APPEND PROPERTY
|
||||
IMPORTED_LOCATION "${OPENIMAGEIO_LIBRARIES}")
|
||||
endif ()
|
||||
|
||||
if (NOT TARGET OpenImageIO::oiiotool AND EXISTS "${OIIOTOOL_BIN}")
|
||||
add_executable(OpenImageIO::oiiotool IMPORTED)
|
||||
set_target_properties(OpenImageIO::oiiotool PROPERTIES
|
||||
IMPORTED_LOCATION "${OIIOTOOL_BIN}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
mark_as_advanced (
|
||||
OPENIMAGEIO_INCLUDE_DIR
|
||||
OPENIMAGEIO_LIBRARY
|
||||
)
|
||||
|
||||
endif ()
|
||||
@@ -0,0 +1,98 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
###########################################################################
|
||||
# CMake module to find OptiX
|
||||
#
|
||||
# This module will set
|
||||
# OPTIX_FOUND True, if OptiX is found
|
||||
# OPTIX_INCLUDES directory where OptiX headers are found
|
||||
# OPTIX_LIBRARIES libraries for OptiX
|
||||
#
|
||||
# Special inputs:
|
||||
# OPTIXHOME - custom "prefix" location of OptiX installation
|
||||
# (expecting bin, lib, include subdirectories)
|
||||
|
||||
|
||||
# If 'OPTIXHOME' not set, use the env variable of that name if available
|
||||
if (NOT OPTIXHOME)
|
||||
if (NOT $ENV{OPTIXHOME} STREQUAL "")
|
||||
set (OPTIXHOME $ENV{OPTIXHOME})
|
||||
elseif (NOT $ENV{OPTIX_INSTALL_DIR} STREQUAL "")
|
||||
set (OPTIXHOME $ENV{OPTIX_INSTALL_DIR})
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (NOT OptiX_FIND_QUIETLY)
|
||||
message (STATUS "OPTIXHOME = ${OPTIXHOME}")
|
||||
endif ()
|
||||
|
||||
find_path (OPTIX_INCLUDE_DIR
|
||||
NAMES optix.h
|
||||
HINTS ${OPTIXHOME}/include
|
||||
PATH_SUFFIXES include )
|
||||
|
||||
# Macro adapted from https://github.com/nvpro-samples/optix_advanced_samples
|
||||
macro(OPTIX_find_api_library name version)
|
||||
find_library(${name}_LIBRARY
|
||||
NAMES ${name}.${version} ${name}
|
||||
PATHS "${OPTIXHOME}/lib64"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
find_library(${name}_LIBRARY
|
||||
NAMES ${name}.${version} ${name}
|
||||
)
|
||||
if (${name}_LIBRARY STREQUAL "${name}_LIBRARY-NOTFOUND")
|
||||
if (WIN32)
|
||||
set (${name}_LIBRARY "${OPTIXHOME}/lib64/${name}.${version}.lib")
|
||||
else ()
|
||||
set (${name}_LIBRARY "${OPTIXHOME}/lib64/lib${name}.so")
|
||||
endif ()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
if (OPTIX_INCLUDE_DIR)
|
||||
# Pull out the API version from optix.h
|
||||
file(STRINGS ${OPTIX_INCLUDE_DIR}/optix.h OPTIX_VERSION_LINE LIMIT_COUNT 1 REGEX "define OPTIX_VERSION")
|
||||
string(REGEX MATCH "([0-9]+)" OPTIX_VERSION_STRING "${OPTIX_VERSION_LINE}")
|
||||
math(EXPR OPTIX_VERSION_MAJOR "${OPTIX_VERSION_STRING}/10000")
|
||||
math(EXPR OPTIX_VERSION_MINOR "(${OPTIX_VERSION_STRING}%10000)/100")
|
||||
math(EXPR OPTIX_VERSION_MICRO "${OPTIX_VERSION_STRING}%100")
|
||||
set(OPTIX_VERSION "${OPTIX_VERSION_MAJOR}.${OPTIX_VERSION_MINOR}.${OPTIX_VERSION_MICRO}")
|
||||
endif ()
|
||||
|
||||
# OptiX 7 doesn't link to any libraries
|
||||
if (OPTIX_VERSION VERSION_LESS 7)
|
||||
OPTIX_find_api_library(optix ${OPTIX_VERSION})
|
||||
OPTIX_find_api_library(optixu ${OPTIX_VERSION})
|
||||
OPTIX_find_api_library(optix_prime ${OPTIX_VERSION})
|
||||
set (OPTIX_LIBRARIES ${optix_LIBRARY})
|
||||
endif ()
|
||||
|
||||
mark_as_advanced (
|
||||
OPTIX_INCLUDE_DIR
|
||||
OPTIX_LIBRARIES
|
||||
OPTIX_VERSION
|
||||
)
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
|
||||
|
||||
if (${OPTIX_VERSION_MAJOR} LESS 7)
|
||||
find_package_handle_standard_args (OptiX
|
||||
FOUND_VAR OPTIX_FOUND
|
||||
REQUIRED_VARS OPTIX_INCLUDE_DIR OPTIX_LIBRARIES OPTIX_VERSION
|
||||
VERSION_VAR OPTIX_VERSION
|
||||
)
|
||||
else ()
|
||||
find_package_handle_standard_args (OptiX
|
||||
FOUND_VAR OPTIX_FOUND
|
||||
REQUIRED_VARS OPTIX_INCLUDE_DIR OPTIX_VERSION
|
||||
VERSION_VAR OPTIX_VERSION
|
||||
)
|
||||
endif()
|
||||
|
||||
if (OPTIX_FOUND)
|
||||
set (OPTIX_INCLUDES ${OPTIX_INCLUDE_DIR})
|
||||
endif ()
|
||||
@@ -1,31 +0,0 @@
|
||||
# Find the pugixml XML parsing library.
|
||||
#
|
||||
# Sets the usual variables expected for find_package scripts:
|
||||
#
|
||||
# PUGIXML_INCLUDE_DIR - header location
|
||||
# PUGIXML_LIBRARIES - library to link against
|
||||
# PUGIXML_FOUND - true if pugixml was found.
|
||||
|
||||
find_path (PUGIXML_INCLUDE_DIR
|
||||
NAMES pugixml.hpp
|
||||
PATHS ${PUGIXML_HOME}/include)
|
||||
find_library (PUGIXML_LIBRARY
|
||||
NAMES pugixml
|
||||
PATHS ${PUGIXML_HOME}/lib)
|
||||
|
||||
# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found.
|
||||
include (FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS (PugiXML DEFAULT_MSG PUGIXML_LIBRARY
|
||||
PUGIXML_INCLUDE_DIR)
|
||||
|
||||
if (PUGIXML_FOUND)
|
||||
set (PUGIXML_LIBRARIES ${PUGIXML_LIBRARY})
|
||||
if (NOT PugiXML_FIND_QUIETLY)
|
||||
message (STATUS "PugiXML include = ${PUGIXML_INCLUDE_DIR}")
|
||||
message (STATUS "PugiXML library = ${PUGIXML_LIBRARY}")
|
||||
endif ()
|
||||
else ()
|
||||
message (STATUS "No PugiXML found")
|
||||
endif()
|
||||
|
||||
mark_as_advanced (PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)
|
||||
@@ -0,0 +1,47 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Find the Partio library.
|
||||
#
|
||||
# Sets the usual variables expected for find_package scripts:
|
||||
#
|
||||
# PARTIO_INCLUDE_DIR - header location
|
||||
# PARTIO_LIBRARIES - library to link against
|
||||
# PARTIO_FOUND - true if Partio was found.
|
||||
|
||||
# Hack! perfer a config if it can be found
|
||||
find_package(partio CONFIG)
|
||||
if (PARTIO_FOUND OR partio_FOUND)
|
||||
if (VERBOSE)
|
||||
message (STATUS "partio found via config")
|
||||
endif ()
|
||||
else ()
|
||||
if (VERBOSE)
|
||||
message (STATUS "partio falling back to FindPartio.cmake")
|
||||
endif ()
|
||||
|
||||
|
||||
find_path (PARTIO_INCLUDE_DIR NAMES Partio.h)
|
||||
find_library (PARTIO_LIBRARY NAMES partio)
|
||||
|
||||
|
||||
# Support the REQUIRED and QUIET arguments, and set PARTIO_FOUND if found.
|
||||
include (FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS (partio DEFAULT_MSG PARTIO_LIBRARY
|
||||
PARTIO_INCLUDE_DIR)
|
||||
|
||||
if (PARTIO_FOUND)
|
||||
set (partio_FOUND ${PARTIO_FOUND})
|
||||
set (PARTIO_INCLUDES ${PARTIO_INCLUDE_DIR})
|
||||
set (PARTIO_LIBRARIES ${PARTIO_LIBRARY})
|
||||
if (NOT TARGET partio::partio)
|
||||
add_library (partio::partio UNKNOWN IMPORTED)
|
||||
set_target_properties (partio::partio PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${PARTIO_INCLUDE_DIR}")
|
||||
set_property (TARGET partio::partio APPEND PROPERTY
|
||||
IMPORTED_LOCATION "${PARTIO_LIBRARY}")
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
endif ()
|
||||
@@ -0,0 +1,79 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Find the pugixml XML parsing library.
|
||||
#
|
||||
# Sets the usual variables expected for find_package scripts:
|
||||
#
|
||||
# PUGIXML_INCLUDES - header location
|
||||
# PUGIXML_LIBRARIES - library to link against
|
||||
# PUGIXML_FOUND - true if pugixml was found.
|
||||
|
||||
# First try the config files and hope they're good enough
|
||||
find_package (pugixml CONFIG)
|
||||
|
||||
if (TARGET pugixml::pugixml)
|
||||
# New pugixml (>= 1.11) has nice config files we can rely on and makes a
|
||||
# pugixml::pugixml target.
|
||||
message (STATUS "Found CONFIG for pugixml (>=1.11)")
|
||||
|
||||
set (PUGIXML_FOUND true)
|
||||
set (pugixml_FOUND true)
|
||||
get_target_property(PUGIXML_INCLUDES pugixml::pugixml INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(PUGIXML_LIBRARIES pugixml::pugixml INTERFACE_LINK_LIBRARIES)
|
||||
|
||||
# elseif (TARGET pugixml)
|
||||
# # But older pugixml (<= 1.10) has mediocre config files that are not
|
||||
# # reliable in practice. They also only define a "pugixml" target but
|
||||
# # not "pugixml::pugixml". So just fall through to the "no config" case
|
||||
# # below, and figure everything out by hand.
|
||||
|
||||
else ()
|
||||
# If no config file is found for PugiXML, do it the old fashioned way.
|
||||
find_path (PUGIXML_INCLUDE_DIR
|
||||
NAMES pugixml.hpp
|
||||
#HINTS ${OpenImageIO_INCLUDE_DIR}/detail/pugixml
|
||||
PATH_SUFFIXES pugixml-1.8 pugixml-1.9 pugixml-1.10)
|
||||
set (pugixml_required_vars PUGIXML_INCLUDE_DIR)
|
||||
find_library (PUGIXML_LIBRARY
|
||||
NAMES pugixml
|
||||
PATH_SUFFIXES pugixml-1.8 pugixml-1.9 pugixml-1.10)
|
||||
|
||||
if (PUGIXML_INCLUDE_DIR)
|
||||
file (STRINGS "${PUGIXML_INCLUDE_DIR}/pugixml.hpp" TMP REGEX "define PUGIXML_VERSION .*$")
|
||||
string (REGEX MATCHALL "[0-9]+" PUGIXML_CODED_VERSION ${TMP})
|
||||
if (PUGIXML_CODED_VERSION VERSION_GREATER_EQUAL 1000)
|
||||
math (EXPR PUGIXML_VERSION_MAJOR "${PUGIXML_CODED_VERSION} / 1000")
|
||||
math (EXPR PUGIXML_VERSION_MINOR "(${PUGIXML_CODED_VERSION} % 1000) / 10")
|
||||
else ()
|
||||
math (EXPR PUGIXML_VERSION_MAJOR "${PUGIXML_CODED_VERSION} / 100")
|
||||
math (EXPR PUGIXML_VERSION_MINOR "(${PUGIXML_CODED_VERSION} % 100) / 10")
|
||||
endif ()
|
||||
set (PUGIXML_VERSION ${PUGIXML_VERSION_MAJOR}.${PUGIXML_VERSION_MINOR})
|
||||
endif ()
|
||||
|
||||
# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found.
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (pugixml DEFAULT_MSG
|
||||
#PUGIXML_LIBRARY
|
||||
PUGIXML_INCLUDE_DIR)
|
||||
|
||||
if (PUGIXML_FOUND OR pugixml_FOUND)
|
||||
set (PUGIXML_INCLUDES ${PUGIXML_INCLUDE_DIR})
|
||||
set (PUGIXML_LIBRARIES ${PUGIXML_LIBRARY})
|
||||
|
||||
if (NOT TARGET pugixml::pugixml)
|
||||
add_library(pugixml::pugixml UNKNOWN IMPORTED)
|
||||
set_target_properties(pugixml::pugixml PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${PUGIXML_INCLUDES}")
|
||||
if (PUGIXML_LIBRARIES)
|
||||
set_property(TARGET pugixml::pugixml APPEND PROPERTY
|
||||
IMPORTED_LOCATION "${PUGIXML_LIBRARIES}")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
mark_as_advanced (PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)
|
||||
|
||||
endif()
|
||||
@@ -1,42 +0,0 @@
|
||||
###########################################################################
|
||||
# OpenImageIO
|
||||
|
||||
|
||||
# If 'OPENIMAGEHOME' not set, use the env variable of that name if available
|
||||
if (NOT OPENIMAGEIOHOME)
|
||||
if (NOT $ENV{OPENIMAGEIOHOME} STREQUAL "")
|
||||
set (OPENIMAGEIOHOME $ENV{OPENIMAGEIOHOME})
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
if (NOT OpenImageIO_FIND_QUIETLY)
|
||||
MESSAGE ( STATUS "OPENIMAGEIOHOME = ${OPENIMAGEIOHOME}" )
|
||||
endif ()
|
||||
|
||||
find_library ( OPENIMAGEIO_LIBRARY
|
||||
NAMES OpenImageIO
|
||||
HINTS ${OPENIMAGEIOHOME}
|
||||
PATH_SUFFIXES lib64 lib
|
||||
PATHS "${OPENIMAGEIOHOME}/lib" )
|
||||
find_path ( OPENIMAGEIO_INCLUDES
|
||||
NAMES OpenImageIO/imageio.h
|
||||
HINTS ${OPENIMAGEIOHOME}
|
||||
PATH_SUFFIXES include )
|
||||
find_program ( OPENIMAGEIO_BIN
|
||||
NAMES oiiotool
|
||||
HINTS ${OPENIMAGEIOHOME}
|
||||
PATH_SUFFIXES bin )
|
||||
if (NOT OpenImageIO_FIND_QUIETLY)
|
||||
MESSAGE ( STATUS "OpenImageIO includes = ${OPENIMAGEIO_INCLUDES}" )
|
||||
MESSAGE ( STATUS "OpenImageIO library = ${OPENIMAGEIO_LIBRARY}" )
|
||||
MESSAGE ( STATUS "OpenImageIO bin = ${OPENIMAGEIO_BIN}" )
|
||||
endif ()
|
||||
IF ( OPENIMAGEIO_INCLUDES AND OPENIMAGEIO_LIBRARY )
|
||||
SET ( OPENIMAGEIO_FOUND TRUE )
|
||||
ELSE ()
|
||||
MESSAGE ( FATAL_ERROR "OpenImageIO not found" )
|
||||
ENDIF ()
|
||||
|
||||
# end OpenImageIO setup
|
||||
###########################################################################
|
||||
@@ -0,0 +1,34 @@
|
||||
# Copyright Contributors to the Open Shading Languge project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/
|
||||
|
||||
#########################################################################
|
||||
# Packaging
|
||||
set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
|
||||
set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
|
||||
set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
|
||||
# "Vendor" is only used in copyright notices, so we use the same thing that
|
||||
# the rest of the copyright notices say.
|
||||
set (CPACK_PACKAGE_VENDOR ${PROJECT_AUTHORS})
|
||||
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Shading Language is the de facto standard for shading in modern path tracers used in film VFX and animation")
|
||||
set (CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/src/doc/Description.txt")
|
||||
set (CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-${platform})
|
||||
file (COPY "${PROJECT_SOURCE_DIR}/LICENSE.md" DESTINATION "${CMAKE_BINARY_DIR}")
|
||||
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/LICENSE.md")
|
||||
file (COPY "${PROJECT_SOURCE_DIR}/README.md" DESTINATION "${CMAKE_BINARY_DIR}")
|
||||
set (CPACK_RESOURCE_FILE_README "${CMAKE_BINARY_DIR}/README.md")
|
||||
set (CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/src/doc/Welcome.txt")
|
||||
#set (CPACK_PACKAGE_EXECUTABLES I'm not sure what this is for)
|
||||
#set (CPACK_STRIP_FILES Do we need this?)
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
set (CPACK_GENERATOR "TGZ;STGZ;RPM;DEB")
|
||||
set (CPACK_SOURCE_GENERATOR "TGZ")
|
||||
endif ()
|
||||
if (APPLE)
|
||||
set (CPACK_GENERATOR "TGZ;STGZ;PackageMaker")
|
||||
set (CPACK_SOURCE_GENERATOR "TGZ")
|
||||
endif ()
|
||||
set (CPACK_SOURCE_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-source)
|
||||
#set (CPACK_SOURCE_STRIP_FILES ...FIXME...)
|
||||
set (CPACK_SOURCE_IGNORE_FILES ".*~")
|
||||
include (CPack)
|
||||
@@ -1,54 +0,0 @@
|
||||
###########################################################################
|
||||
# Figure out what platform we're on, and set some variables appropriately
|
||||
|
||||
# CMAKE_SYSTEM_PROCESSOR should not be used because it indicates the platform
|
||||
# we are building on, but when cross compiling or using a chroot this is not
|
||||
# what we want to use
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||
set (SYSTEM_PROCESSOR "x86_64")
|
||||
else()
|
||||
set (SYSTEM_PROCESSOR "i686")
|
||||
endif()
|
||||
|
||||
if (VERBOSE)
|
||||
message (STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}")
|
||||
message (STATUS "CMAKE_SYSTEM_VERSION = ${CMAKE_SYSTEM_VERSION}")
|
||||
message (STATUS "SYSTEM_PROCESSOR = ${SYSTEM_PROCESSOR}")
|
||||
endif ()
|
||||
|
||||
if (UNIX)
|
||||
if (VERBOSE)
|
||||
message (STATUS "Unix! ${CMAKE_SYSTEM_NAME}")
|
||||
endif ()
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
set (platform "linux")
|
||||
set (CXXFLAGS "${CXXFLAGS} -DLINUX")
|
||||
if (${SYSTEM_PROCESSOR} STREQUAL "x86_64")
|
||||
set (platform "linux64")
|
||||
set (CXXFLAGS "${CXXFLAGS} -DLINUX64")
|
||||
endif ()
|
||||
elseif (APPLE)
|
||||
set (platform "macosx")
|
||||
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
set (platform "FreeBSD")
|
||||
set (CXXFLAGS "${CXXFLAGS} -DFREEBSD")
|
||||
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
|
||||
# minimum arch of i586 is needed for atomic cpu instructions
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i586")
|
||||
endif()
|
||||
else ()
|
||||
string (TOLOWER ${CMAKE_SYSTEM_NAME} platform)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (WIN32)
|
||||
set (platform "windows")
|
||||
endif ()
|
||||
|
||||
if (platform)
|
||||
message (STATUS "platform = ${platform}")
|
||||
else ()
|
||||
message (FATAL_ERROR "'platform' not defined")
|
||||
endif ()
|
||||
|
||||
unset(SYSTEM_PROCESSOR)
|
||||
@@ -0,0 +1,128 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
# Python-related options.
|
||||
option (USE_PYTHON "Build the Python bindings" ON)
|
||||
set (PYTHON_VERSION "" CACHE STRING "Target version of python to try to find")
|
||||
option (PYLIB_INCLUDE_SONAME "If ON, soname/soversion will be set for Python module library" OFF)
|
||||
option (PYLIB_LIB_PREFIX "If ON, prefix the Python module with 'lib'" OFF)
|
||||
set (PYMODULE_SUFFIX "" CACHE STRING "Suffix to add to Python module init namespace")
|
||||
|
||||
|
||||
# Find Python. This macro should only be called if python is required. If
|
||||
# Python cannot be found, it will be a fatal error.
|
||||
macro (find_python)
|
||||
if (NOT VERBOSE)
|
||||
set (PythonInterp_FIND_QUIETLY true)
|
||||
set (PythonLibs_FIND_QUIETLY true)
|
||||
endif ()
|
||||
|
||||
# Attempt to find the desired version, but fall back to other
|
||||
# additional versions.
|
||||
unset (_req)
|
||||
if (USE_PYTHON)
|
||||
set (_req REQUIRED)
|
||||
if (PYTHON_VERSION)
|
||||
list (APPEND _req EXACT)
|
||||
endif ()
|
||||
endif ()
|
||||
checked_find_package (Python ${PYTHON_VERSION}
|
||||
${_req}
|
||||
COMPONENTS Interpreter Development
|
||||
PRINT Python_Development_FOUND Python_VERSION
|
||||
Python_EXECUTABLE Python_LIBRARIES
|
||||
Python_Development_FOUND Python_Interpreter_FOUND)
|
||||
|
||||
# The version that was found may not be the default or user
|
||||
# defined one.
|
||||
set (PYTHON_VERSION_FOUND ${Python_VERSION_MAJOR}.${Python_VERSION_MINOR})
|
||||
|
||||
# Give hints to subsequent pybind11 searching to ensure that it finds
|
||||
# exactly the same version that we found.
|
||||
set (PythonInterp_FIND_VERSION PYTHON_VERSION_FOUND)
|
||||
set (PythonInterp_FIND_VERSION_MAJOR ${Python_VERSION_MAJOR})
|
||||
|
||||
if (NOT DEFINED PYTHON_SITE_DIR)
|
||||
set (PYTHON_SITE_DIR "${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_FOUND}/site-packages")
|
||||
endif ()
|
||||
if (VERBOSE)
|
||||
message (STATUS " Python site packages dir ${PYTHON_SITE_DIR}")
|
||||
message (STATUS " Python to include 'lib' prefix: ${PYLIB_LIB_PREFIX}")
|
||||
message (STATUS " Python to include SO version: ${PYLIB_INCLUDE_SONAME}")
|
||||
endif ()
|
||||
endmacro()
|
||||
|
||||
|
||||
|
||||
###########################################################################
|
||||
# pybind11
|
||||
|
||||
macro (setup_python_module)
|
||||
cmake_parse_arguments (lib "" "TARGET;MODULE;LIBS" "SOURCES" ${ARGN})
|
||||
# Arguments: <prefix> <options> <one_value_keywords> <multi_value_keywords> args...
|
||||
|
||||
set (target_name ${lib_TARGET})
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
# Seems to be a problem on some systems, with pybind11 and python headers
|
||||
set_property (SOURCE ${lib_SOURCES} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-macro-redefined ")
|
||||
endif ()
|
||||
|
||||
# Add the library itself
|
||||
add_library (${target_name} MODULE ${lib_SOURCES})
|
||||
|
||||
# Declare the libraries it should link against
|
||||
target_link_libraries (${target_name}
|
||||
PRIVATE
|
||||
pybind11::pybind11
|
||||
Python::Python
|
||||
${lib_LIBS} ${SANITIZE_LIBRARIES})
|
||||
if (APPLE)
|
||||
set_target_properties (${target_name} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
|
||||
endif ()
|
||||
|
||||
# Exclude the 'lib' prefix from the name
|
||||
if (NOT PYLIB_LIB_PREFIX)
|
||||
target_compile_definitions(${target_name}
|
||||
PRIVATE "PYMODULE_NAME=${lib_MODULE}")
|
||||
set_target_properties (${target_name} PROPERTIES
|
||||
OUTPUT_NAME ${lib_MODULE}
|
||||
PREFIX "")
|
||||
else ()
|
||||
target_compile_definitions(${target_name}
|
||||
PRIVATE "PYMODULE_NAME=Py${lib_MODULE}")
|
||||
set_target_properties (${target_name} PROPERTIES
|
||||
OUTPUT_NAME Py${lib_MODULE}
|
||||
PREFIX lib)
|
||||
endif ()
|
||||
|
||||
if (PYLIB_INCLUDE_SONAME)
|
||||
if (VERBOSE)
|
||||
message(STATUS "Setting Py${lib_MODULE} SOVERSION to: ${SOVERSION}")
|
||||
endif ()
|
||||
set_target_properties(${target_name} PROPERTIES
|
||||
VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
||||
SOVERSION ${SOVERSION} )
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
set_target_properties (${target_name} PROPERTIES
|
||||
DEBUG_POSTFIX "_d"
|
||||
SUFFIX ".pyd")
|
||||
endif()
|
||||
|
||||
# In the build area, put it in lib/python so it doesn't clash with the
|
||||
# non-python libraries of the same name (which aren't prefixed by "lib"
|
||||
# on Windows).
|
||||
set_target_properties (${target_name} PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/python/site-packages
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/python/site-packages
|
||||
)
|
||||
|
||||
install (TARGETS ${target_name}
|
||||
RUNTIME DESTINATION ${PYTHON_SITE_DIR} COMPONENT user
|
||||
LIBRARY DESTINATION ${PYTHON_SITE_DIR} COMPONENT user)
|
||||
|
||||
endmacro ()
|
||||
|
||||
@@ -0,0 +1,264 @@
|
||||
# Copyright Contributors to the Open Shading Languge project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/
|
||||
|
||||
include (CTest)
|
||||
|
||||
# Make a build/platform/testsuite directory, and copy the master runtest.py
|
||||
# there. The rest is up to the tests themselves.
|
||||
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testsuite")
|
||||
file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/testsuite/common"
|
||||
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/testsuite")
|
||||
add_custom_command (OUTPUT "${CMAKE_BINARY_DIR}/testsuite/runtest.py"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${CMAKE_SOURCE_DIR}/testsuite/runtest.py"
|
||||
"${CMAKE_BINARY_DIR}/testsuite/runtest.py"
|
||||
MAIN_DEPENDENCY "${CMAKE_SOURCE_DIR}/testsuite/runtest.py")
|
||||
add_custom_target ( CopyFiles ALL DEPENDS "${CMAKE_BINARY_DIR}/testsuite/runtest.py" )
|
||||
|
||||
# add_one_testsuite() - set up one testsuite entry
|
||||
#
|
||||
# Usage:
|
||||
# add_one_testsuite ( testname
|
||||
# testsrcdir - Current test directory in ${CMAKE_SOURCE_DIR}
|
||||
# testdir - Current test sandbox in ${CMAKE_BINARY_DIR}
|
||||
# [ENV env1=val1 env2=val2 ... ] - env vars to set
|
||||
# [COMMAND cmd...] - optional override of launch command
|
||||
# )
|
||||
#
|
||||
macro (add_one_testsuite testname testsrcdir)
|
||||
cmake_parse_arguments (_tst "" "" "ENV;COMMAND" ${ARGN})
|
||||
set (testsuite "${CMAKE_SOURCE_DIR}/testsuite")
|
||||
set (testdir "${CMAKE_BINARY_DIR}/testsuite/${testname}")
|
||||
if (NOT _tst_COMMAND)
|
||||
set (_tst_COMMAND ${Python_EXECUTABLE} "${testsuite}/runtest.py" ${testdir})
|
||||
if (MSVC_IDE)
|
||||
list (APPEND _tst_COMMAND --devenv-config $<CONFIGURATION>
|
||||
--solution-path "${CMAKE_BINARY_DIR}" )
|
||||
endif ()
|
||||
endif ()
|
||||
list (APPEND _tst_ENV
|
||||
OpenImageIO_ROOT=${OpenImageIO_ROOT}
|
||||
OSL_SOURCE_DIR=${CMAKE_SOURCE_DIR}
|
||||
OSL_BUILD_DIR=${CMAKE_BINARY_DIR}
|
||||
OSL_TESTSUITE_ROOT=${testsuite}
|
||||
OSL_TESTSUITE_SRC=${testsrcdir}
|
||||
OSL_TESTSUITE_CUR=${testdir}
|
||||
)
|
||||
file (MAKE_DIRECTORY "${testdir}")
|
||||
add_test ( NAME ${testname} COMMAND ${_tst_COMMAND} )
|
||||
# message ("Test -- env ${_tst_ENV} cmd ${_tst_COMMAND}")
|
||||
set_tests_properties (${testname} PROPERTIES ENVIRONMENT "${_tst_ENV}" )
|
||||
# Certain tests are already internally multi-threaded, so to keep them
|
||||
# from piling up together, allocate a few cores each.
|
||||
if (${testname} MATCHES "^render-")
|
||||
set_tests_properties (${testname} PROPERTIES LABELS render
|
||||
PROCESSORS 4 COST 10)
|
||||
endif ()
|
||||
# Some labeling for fun
|
||||
if (${testname} MATCHES "^texture-")
|
||||
set_tests_properties (${testname} PROPERTIES LABELS texture
|
||||
PROCESSORS 2 COST 4)
|
||||
endif ()
|
||||
if (${testname} MATCHES "noise")
|
||||
set_tests_properties (${testname} PROPERTIES LABELS noise
|
||||
PROCESSORS 2 COST 4)
|
||||
endif ()
|
||||
if (${testname} MATCHES "optix")
|
||||
set_tests_properties (${testname} PROPERTIES LABELS optix)
|
||||
if ("${CUDA_VERSION}" VERSION_GREATER_EQUAL "10.0")
|
||||
# Make sure libnvrtc-builtins.so is reachable
|
||||
set_property (TEST ${testname} APPEND PROPERTY ENVIRONMENT LD_LIBRARY_PATH=${CUDA_TOOLKIT_ROOT_DIR}/lib64)
|
||||
endif()
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
|
||||
macro ( TESTSUITE )
|
||||
cmake_parse_arguments (_ats "" "LABEL;FOUNDVAR;TESTNAME" "" ${ARGN})
|
||||
# If there was a FOUNDVAR param specified and that variable name is
|
||||
# not defined, mark the test as broken.
|
||||
if (_ats_FOUNDVAR AND NOT ${_ats_FOUNDVAR})
|
||||
set (_ats_LABEL "broken")
|
||||
endif ()
|
||||
set (test_all_optix $ENV{TESTSUITE_OPTIX})
|
||||
# Add the tests if all is well.
|
||||
set (ALL_TEST_LIST "")
|
||||
set (_testsuite "${CMAKE_SOURCE_DIR}/testsuite")
|
||||
foreach (_testname ${_ats_UNPARSED_ARGUMENTS})
|
||||
set (_testsrcdir "${_testsuite}/${_testname}")
|
||||
if (_ats_TESTNAME)
|
||||
set (_testname "${_ats_TESTNAME}")
|
||||
endif ()
|
||||
if (_ats_LABEL MATCHES "broken")
|
||||
set (_testname "${_testname}-broken")
|
||||
endif ()
|
||||
|
||||
set (ALL_TEST_LIST "${ALL_TEST_LIST} ${_testname}")
|
||||
|
||||
# Run the test unoptimized, unless it matches a few patterns that
|
||||
# we don't test unoptimized (or has an OPTIMIZEONLY marker file).
|
||||
if (NOT _testname MATCHES "^getattribute-shader" AND
|
||||
NOT _testname MATCHES "optix" AND
|
||||
NOT EXISTS "${_testsrcdir}/OPTIMIZEONLY")
|
||||
add_one_testsuite ("${_testname}" "${_testsrcdir}"
|
||||
ENV TESTSHADE_OPT=0 )
|
||||
endif ()
|
||||
# Run the same test again with aggressive -O2 runtime
|
||||
# optimization, triggered by setting TESTSHADE_OPT env variable.
|
||||
# Skip OptiX-only tests and those with a NOOPTIMIZE marker file.
|
||||
if (NOT _testname MATCHES "optix"
|
||||
AND NOT EXISTS "${_testsrcdir}/NOOPTIMIZE")
|
||||
add_one_testsuite ("${_testname}.opt" "${_testsrcdir}"
|
||||
ENV TESTSHADE_OPT=2 )
|
||||
endif ()
|
||||
# When building for OptiX support, also run it in OptiX mode
|
||||
# if there is an OPTIX marker file in the directory.
|
||||
# If an environment variable $TESTSUITE_OPTIX is nonzero, then
|
||||
# run all tests with OptiX, even if there's no OPTIX marker.
|
||||
if (USE_OPTIX
|
||||
AND (EXISTS "${_testsrcdir}/OPTIX" OR test_all_optix OR _testname MATCHES "optix")
|
||||
AND NOT EXISTS "${_testsrcdir}/NOOPTIX"
|
||||
AND NOT EXISTS "${_testsrcdir}/NOOPTIX-FIXME")
|
||||
# Unoptimized
|
||||
if (NOT EXISTS "${_testsrcdir}/OPTIMIZEONLY")
|
||||
add_one_testsuite ("${_testname}.optix" "${_testsrcdir}"
|
||||
ENV TESTSHADE_OPT=0 TESTSHADE_OPTIX=1 )
|
||||
endif ()
|
||||
# and optimized
|
||||
add_one_testsuite ("${_testname}.optix.opt" "${_testsrcdir}"
|
||||
ENV TESTSHADE_OPT=2 TESTSHADE_OPTIX=1 )
|
||||
endif ()
|
||||
endforeach ()
|
||||
if (VERBOSE)
|
||||
message (STATUS "Added tests: ${ALL_TEST_LIST}")
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
|
||||
macro (osl_add_all_tests)
|
||||
# List all the individual testsuite tests here, except those that need
|
||||
# special installed tests.
|
||||
TESTSUITE ( aastep allowconnect-err and-or-not-synonyms arithmetic
|
||||
array array-derivs array-range array-aassign
|
||||
blackbody blendmath breakcont
|
||||
bug-array-heapoffsets bug-locallifetime bug-outputinit
|
||||
bug-param-duplicate bug-peep bug-return
|
||||
cellnoise closure closure-array color comparison
|
||||
compile-buffer
|
||||
component-range
|
||||
connect-components
|
||||
const-array-params const-array-fill
|
||||
debugnan debug-uninit
|
||||
derivs derivs-muldiv-clobber
|
||||
draw_string
|
||||
error-dupes error-serialized
|
||||
exit exponential
|
||||
fprintf
|
||||
function-earlyreturn function-simple function-outputelem
|
||||
function-overloads function-redef
|
||||
geomath getattribute-camera getattribute-shader
|
||||
getsymbol-nonheap gettextureinfo
|
||||
group-outputs groupstring
|
||||
hash hashnoise hex hyperb
|
||||
ieee_fp if incdec initlist initops intbits isconnected isconstant
|
||||
layers layers-Ciassign layers-entry layers-lazy layers-lazyerror
|
||||
layers-nonlazycopy layers-repeatedoutputs
|
||||
linearstep
|
||||
logic loop matrix message
|
||||
mergeinstances-duplicate-entrylayers
|
||||
mergeinstances-nouserdata mergeinstances-vararray
|
||||
metadata-braces miscmath missing-shader
|
||||
named-components
|
||||
noise noise-cell
|
||||
noise-gabor noise-gabor2d-filter noise-gabor3d-filter
|
||||
noise-perlin noise-simplex
|
||||
pnoise pnoise-cell pnoise-gabor pnoise-perlin
|
||||
operator-overloading
|
||||
opt-warnings
|
||||
oslc-comma oslc-D oslc-M
|
||||
oslc-err-arrayindex oslc-err-assignmenttypes
|
||||
oslc-err-closuremul oslc-err-field
|
||||
oslc-err-format oslc-err-funcoverload
|
||||
oslc-err-intoverflow oslc-err-write-nonoutput
|
||||
oslc-err-noreturn oslc-err-notfunc
|
||||
oslc-err-initlist-args oslc-err-initlist-return
|
||||
oslc-err-named-components
|
||||
oslc-err-outputparamvararray oslc-err-paramdefault
|
||||
oslc-err-struct-array-init oslc-err-struct-ctr
|
||||
oslc-err-struct-dup oslc-err-struct-print
|
||||
oslc-err-unknown-ctr
|
||||
# oslc-pragma-warnerr
|
||||
oslc-warn-commainit
|
||||
oslc-variadic-macro
|
||||
oslc-version
|
||||
oslinfo-arrayparams oslinfo-colorctrfloat
|
||||
oslinfo-metadata oslinfo-noparams
|
||||
osl-imageio
|
||||
paramval-floatpromotion
|
||||
pragma-nowarn
|
||||
printf-whole-array
|
||||
raytype raytype-specialized reparam
|
||||
render-background render-bumptest
|
||||
render-cornell render-furnace-diffuse
|
||||
render-microfacet render-oren-nayar render-veachmis render-ward
|
||||
select shortcircuit spline splineinverse splineinverse-ident
|
||||
spline-boundarybug spline-derivbug
|
||||
string
|
||||
struct struct-array struct-array-mixture
|
||||
struct-err struct-init-copy
|
||||
struct-isomorphic-overload struct-layers
|
||||
struct-operator-overload struct-return struct-with-array
|
||||
struct-nested struct-nested-assign struct-nested-deep
|
||||
ternary
|
||||
testshade-expr
|
||||
texture-alpha texture-alpha-derivs
|
||||
texture-blur texture-connected-options
|
||||
texture-derivs texture-errormsg
|
||||
texture-firstchannel texture-interp
|
||||
texture-missingalpha texture-missingcolor texture-simple
|
||||
texture-smallderivs texture-swirl texture-udim
|
||||
texture-width texture-withderivs texture-wrap
|
||||
trailing-commas
|
||||
transitive-assign
|
||||
transform transformc trig typecast
|
||||
unknown-instruction
|
||||
userdata userdata-passthrough
|
||||
vararray-connect vararray-default
|
||||
vararray-deserialize vararray-param
|
||||
vecctr vector
|
||||
wavelength_color Werror xml )
|
||||
|
||||
if (OPENIMAGEIO_VERSION VERSION_GREATER_EQUAL 2.1)
|
||||
# I'm too lazy to set this test up to work with OIIO versions too
|
||||
# old to have proper exported cmake config files. So just skip it
|
||||
# for OIIO 2.0.
|
||||
TESTSUITE (example-deformer)
|
||||
endif ()
|
||||
|
||||
# Add tests that require the Python bindings if we built them.
|
||||
# We also exclude these tests if this is a sanitizer build on Linux,
|
||||
# because the Python interpreter itself won't be linked with the right asan
|
||||
# libraries to run correctly.
|
||||
if (USE_PYTHON AND NOT SANITIZE_ON_LINUX)
|
||||
TESTSUITE ( python-oslquery )
|
||||
endif ()
|
||||
|
||||
# Only run openvdb-related tests if the local OIIO has openvdb support.
|
||||
execute_process ( COMMAND ${OpenImageIO_LIB_DIR}/../bin/oiiotool --help
|
||||
OUTPUT_VARIABLE oiiotool_help )
|
||||
if (oiiotool_help MATCHES "openvdb")
|
||||
TESTSUITE ( texture3d )
|
||||
endif()
|
||||
|
||||
# Only run pointcloud tests if Partio is found
|
||||
if (PARTIO_FOUND)
|
||||
TESTSUITE ( pointcloud pointcloud-fold )
|
||||
endif ()
|
||||
|
||||
# Only run the OptiX tests if OptiX and CUDA are found
|
||||
if (OPTIX_FOUND AND CUDA_FOUND)
|
||||
TESTSUITE ( testoptix testoptix-noise example-cuda)
|
||||
endif ()
|
||||
|
||||
endmacro()
|
||||
@@ -1,112 +0,0 @@
|
||||
# The PARSE_ARGUMENTS macro will take the arguments of another macro and define
|
||||
# several variables. The first argument to PARSE_ARGUMENTS is a prefix to put
|
||||
# on all variables it creates. The second argument is a list of names, and the
|
||||
# third argument is a list of options. Both of these lists should be quoted.
|
||||
# The rest of the PARSE_ARGUMENTS args are arguments from another macro to be
|
||||
# parsed.
|
||||
#
|
||||
# PARSE_ARGUMENTS(prefix arg_names options arg1 arg2...)
|
||||
#
|
||||
# For each item in options, PARSE_ARGUMENTS will create a variable with that
|
||||
# name, prefixed with prefix_. So, for example, if prefix is MY_MACRO and
|
||||
# options is OPTION1;OPTION2, then PARSE_ARGUMENTS will create the variables
|
||||
# MY_MACRO_OPTION1 and MY_MACRO_OPTION2. These variables will be set to true if
|
||||
# the option exists in the command line or false otherwise.
|
||||
#
|
||||
# For each item in arg_names, PARSE_ARGUMENTS will create a variable with that
|
||||
# name, prefixed with prefix_. Each variable will be filled with the arguments
|
||||
# that occur after the given arg_name is encountered up to the next arg_name or
|
||||
# the end of the arguments. All options are removed from these lists.
|
||||
# PARSE_ARGUMENTS also creates a prefix_DEFAULT_ARGS variable containing the
|
||||
# list of all arguments up to the first arg_name encountered.
|
||||
#
|
||||
# Downloaded from: http://www.itk.org/Wiki/CMakeMacroParseArguments
|
||||
#
|
||||
MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
|
||||
SET(DEFAULT_ARGS)
|
||||
FOREACH(arg_name ${arg_names})
|
||||
SET(${prefix}_${arg_name})
|
||||
ENDFOREACH(arg_name)
|
||||
FOREACH(option ${option_names})
|
||||
SET(${prefix}_${option} FALSE)
|
||||
ENDFOREACH(option)
|
||||
|
||||
SET(current_arg_name DEFAULT_ARGS)
|
||||
SET(current_arg_list)
|
||||
FOREACH(arg ${ARGN})
|
||||
SET(larg_names ${arg_names})
|
||||
LIST(FIND larg_names "${arg}" is_arg_name)
|
||||
IF (is_arg_name GREATER -1)
|
||||
SET(${prefix}_${current_arg_name} ${current_arg_list})
|
||||
SET(current_arg_name ${arg})
|
||||
SET(current_arg_list)
|
||||
ELSE (is_arg_name GREATER -1)
|
||||
SET(loption_names ${option_names})
|
||||
LIST(FIND loption_names "${arg}" is_option)
|
||||
IF (is_option GREATER -1)
|
||||
SET(${prefix}_${arg} TRUE)
|
||||
ELSE (is_option GREATER -1)
|
||||
SET(current_arg_list ${current_arg_list} ${arg})
|
||||
ENDIF (is_option GREATER -1)
|
||||
ENDIF (is_arg_name GREATER -1)
|
||||
ENDFOREACH(arg)
|
||||
SET(${prefix}_${current_arg_name} ${current_arg_list})
|
||||
ENDMACRO(PARSE_ARGUMENTS)
|
||||
|
||||
|
||||
|
||||
# Macro to set a variable with our funny overrides:
|
||||
# If the variable is already set (by -D on the command line), leave it alone.
|
||||
# If an environment variable of the same name is set, use that value
|
||||
# (making it super easy for sites to override external tool locations).
|
||||
# If neither of those, then use the default passed.
|
||||
macro (setup_string name defaultval explanation)
|
||||
# If the named variable already has a value (was set by -D...), leave
|
||||
# it alone. But if it's not yet set...
|
||||
if ("${${name}}" STREQUAL "")
|
||||
# If there's an environment variable of the same name that's
|
||||
# nonempty, use the env variable. Otherwise, use the default.
|
||||
if (NOT $ENV{${name}} STREQUAL "")
|
||||
set (${name} $ENV{${name}})
|
||||
# CACHE STRING ${explanation})
|
||||
else ()
|
||||
set (${name} ${defaultval})
|
||||
# CACHE STRING ${explanation})
|
||||
endif ()
|
||||
endif ()
|
||||
if (VERBOSE)
|
||||
message (STATUS "${name} = ${${name}}")
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
macro (setup_path name defaultval explanation)
|
||||
# If the named variable already has a value (was set by -D...), leave
|
||||
# it alone. But if it's not yet set...
|
||||
if ("${${name}}" STREQUAL "")
|
||||
# If there's an environment variable of the same name that's
|
||||
# nonempty, use the env variable. Otherwise, use the default.
|
||||
if (NOT $ENV{${name}} STREQUAL "")
|
||||
set (${name} $ENV{${name}})
|
||||
# CACHE PATH ${explanation})
|
||||
else ()
|
||||
set (${name} ${defaultval})
|
||||
# CACHE PATH ${explanation})
|
||||
endif ()
|
||||
endif ()
|
||||
if (VERBOSE)
|
||||
message (STATUS "${name} = ${${name}}")
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
|
||||
# Macro to install targets to the appropriate locations. Use this instead of
|
||||
# the install(TARGETS ...) signature.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# install_targets (target1 [target2 ...])
|
||||
#
|
||||
macro (install_targets)
|
||||
install (TARGETS ${ARGN} RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
|
||||
endmacro()
|
||||
@@ -1,10 +1,85 @@
|
||||
set (public_docs osl-languagespec.pdf)
|
||||
# Some day: CLA-INDIVIDUAL CLA-CORPORATE
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
install (FILES ${public_docs} DESTINATION doc COMPONENT documentation)
|
||||
set (public_docs osl-languagespec.pdf
|
||||
testshade.md.html
|
||||
osltoy.md.html
|
||||
markdeep.min.js
|
||||
docs.css
|
||||
)
|
||||
|
||||
install ( FILES "${PROJECT_SOURCE_DIR}/LICENSE"
|
||||
install (FILES ${public_docs} DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT documentation)
|
||||
|
||||
install ( FILES "${PROJECT_SOURCE_DIR}/LICENSE.md"
|
||||
"${PROJECT_SOURCE_DIR}/INSTALL.md"
|
||||
"${PROJECT_SOURCE_DIR}/CHANGES.md"
|
||||
"${PROJECT_SOURCE_DIR}/README.md"
|
||||
DESTINATION . )
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR} )
|
||||
|
||||
|
||||
file (GLOB testshade_figures "Figures/testshade/*.jpg")
|
||||
install (FILES ${testshade_figures}
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR}/Figures/testshade )
|
||||
|
||||
file (GLOB osltoy_figures "Figures/osltoy/*.jpg")
|
||||
install (FILES ${osltoy_figures}
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR}/Figures/osltoy )
|
||||
|
||||
|
||||
|
||||
# Macro to compile a shader with oslc. Syntax is:
|
||||
# docdeep_generate (SOURCE osl_source_file
|
||||
# [ NAME doc_name ]
|
||||
# [ DOC_LIST list_to_append_doc_filename ] )
|
||||
# [ SRC_LIST list_to_append_src_filename ] )
|
||||
macro (docdeep_generate)
|
||||
cmake_parse_arguments (_docdeep "" "NAME;DOC_LIST;SRC_LIST" "SOURCE" ${ARGN})
|
||||
# ^^ syntax: prefix options one-arg-keywords multi-arg-keywords args
|
||||
set (oslfile ${_docdeep_SOURCE})
|
||||
set (mdfile "${_docdeep_NAME}.md.html")
|
||||
if (VERBOSE)
|
||||
message (STATUS "docdeep will make '${mdfile}'")
|
||||
endif ()
|
||||
set (docdeep_program ${CMAKE_SOURCE_DIR}/src/build-scripts/docdeep.py)
|
||||
add_custom_command (OUTPUT ${mdfile}
|
||||
COMMAND ${Python_EXECUTABLE} ${docdeep_program} -d ${_docdeep_NAME} -s docs.css
|
||||
${_docdeep_SOURCE} > "${CMAKE_CURRENT_BINARY_DIR}/${mdfile}"
|
||||
MAIN_DEPENDENCY ${docdeep_program}
|
||||
DEPENDS ${_docdeep_SOURCE}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "docdeep ${_docdeep_NAME}"
|
||||
)
|
||||
if (_docdeep_DOC_LIST)
|
||||
list (APPEND ${_docdeep_DOC_LIST} "${CMAKE_CURRENT_BINARY_DIR}/${mdfile}")
|
||||
endif ()
|
||||
if (_docdeep_SRC_LIST)
|
||||
list (APPEND ${_docdeep_SRC_LIST} ${_docdeep_SOURCE})
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
|
||||
|
||||
set (all_docdeep_docs "")
|
||||
set (all_docdeep_srcs "")
|
||||
docdeep_generate (NAME OSLQuery
|
||||
SOURCE ${PROJECT_SOURCE_DIR}/src/include/OSL/oslquery.h
|
||||
${PROJECT_SOURCE_DIR}/src/oslinfo/oslinfo.cpp
|
||||
DOC_LIST all_docdeep_docs
|
||||
SRC_LIST all_docdeep_srcs)
|
||||
docdeep_generate (NAME docdeep
|
||||
SOURCE ${PROJECT_SOURCE_DIR}/src/build-scripts/docdeep.py
|
||||
DOC_LIST all_docdeep_docs
|
||||
SRC_LIST all_docdeep_srcs)
|
||||
|
||||
add_custom_target (generated_docs ALL
|
||||
DEPENDS ${all_docdeep_docs} ${all_docdeep_srcs}
|
||||
SOURCES ${all_docdeep_srcs}
|
||||
)
|
||||
|
||||
message (STATUS "All docdeep docs = ${all_docdeep_docs}")
|
||||
|
||||
install (FILES ${all_docdeep_docs}
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
||||
COMPONENT documentation
|
||||
)
|
||||
|
||||
|
Before Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 108 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
@@ -1,3 +1,7 @@
|
||||
# Copyright Contributors to the Open Shading Language project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
PDFLATEX_FLAGS = -interaction=errorstopmode ### "--shell-escape"
|
||||
|
||||
|
||||
@@ -6,7 +10,7 @@ all: languagespec.pdf
|
||||
|
||||
|
||||
# document making rule: use pdflatex
|
||||
languagespec.pdf: *.tex languagespec.aux macros.aux Figures/*.pdf Figures/*png
|
||||
languagespec.pdf: *.tex Figures/*.pdf Figures/*png
|
||||
pdflatex ${PDFLATEX_FLAGS} languagespec.tex
|
||||
|
||||
|
||||
@@ -15,8 +19,14 @@ languagespec.pdf: *.tex languagespec.aux macros.aux Figures/*.pdf Figures/*png
|
||||
index: languagespec_index
|
||||
|
||||
languagespec_index:
|
||||
pdflatex ${PDFLATEX_FLAGS} languagespec.tex
|
||||
pdflatex ${PDFLATEX_FLAGS} languagespec.tex
|
||||
makeindex languagespec
|
||||
pdflatex ${PDFLATEX_FLAGS} languagespec.tex
|
||||
pdflatex ${PDFLATEX_FLAGS} languagespec.tex languagespec.aux macros.aux
|
||||
pdflatex ${PDFLATEX_FLAGS} languagespec.tex languagespec.aux macros.aux languagespec.toc
|
||||
|
||||
clean:
|
||||
rm -f languagespec.aux languagespec.idx languagespec.ilg languagespec.ind languagespec.log
|
||||
rm -f languagespec.out languagespec.pdf languagespec.toc macros.aux
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
/* Custom stylesheet.
|
||||
* Bits copied from many sources, including those that come with Markdeep.
|
||||
*/
|
||||
|
||||
/* Custom stylesheet for API documentation by Aras Pranckevičius, http://aras-p.info/
|
||||
and tweaked by Morgan McGuire.
|
||||
Licensed as public domain or BSD 2-clause, whichever is more convenient for you.
|
||||
Originally from https://github.com/aras-p/markdeep-docs-style */
|
||||
|
||||
/* Some modifications by Larry Gritz */
|
||||
|
||||
body {
|
||||
max-width: 50em;
|
||||
/* font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; */
|
||||
text-align: left;
|
||||
margin: 1.5em;
|
||||
padding: 0 1em;
|
||||
}
|
||||
|
||||
/* if screen is wide enough, put table of contents on the right side */
|
||||
@media screen and (min-width: 64em) {
|
||||
.md .longTOC, .md .mediumTOC, .md .shortTOC {
|
||||
position: fixed;
|
||||
max-width: 20em;
|
||||
left: 54em;
|
||||
display:block;
|
||||
}
|
||||
}
|
||||
|
||||
/* for narrow screens or print, hide table of contents */
|
||||
@media screen and (max-width: 64em) {
|
||||
.md .longTOC, .md .mediumTOC, .md .shortTOC { display: none; }
|
||||
}
|
||||
|
||||
@media print {
|
||||
.md .longTOC, .md .mediumTOC, .md .shortTOC { display: none; }
|
||||
body { max-width: 100%; }
|
||||
}
|
||||
|
||||
/* reset heading/link fonts to that of body */
|
||||
.md a,
|
||||
.md div.title, contents, .md .tocHeader,
|
||||
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6,
|
||||
.md .nonumberh1, .md .nonumberh2, .md .nonumberh3, .md .nonumberh4, .md .nonumberh5, .md .nonumberh6,
|
||||
.md .shortTOC, .md .mediumTOC, .md .longTOC {
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.md div.title {
|
||||
/*orig margin: 0.4em 0 0 0; */
|
||||
margin: 0.4em 0 2em 0; /* LG */
|
||||
padding: 0;
|
||||
/*orig text-align: inherit; */
|
||||
text-align: center; /* LG */
|
||||
text-decoration: underline; /* LG */
|
||||
}
|
||||
|
||||
.md div.subtitle {
|
||||
/* orig text-align: inherit; */
|
||||
text-align: center; /* LG */
|
||||
}
|
||||
|
||||
/* faint border below headings */
|
||||
.md h1, .md h2, .md h3, .md h4,
|
||||
.md .nonumberh1, .md .nonumberh2, .md .nonumberh3, .md .nonumberh4 {
|
||||
border-bottom: 1px solid rgba(0,0,0,.1);
|
||||
}
|
||||
/* heading font styles */
|
||||
.md h1, .md .nonumberh1, .md div.title {
|
||||
font-size: 150%;
|
||||
font-weight: 600;
|
||||
color: rgba(0,0,0,.7);
|
||||
}
|
||||
.md h2, .md .nonumberh2 {
|
||||
font-size: 120%;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,.9);
|
||||
}
|
||||
.md h3, .md .nonumberh3 {
|
||||
font-size: 110%;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,.7);
|
||||
}
|
||||
/* no numbering of headings */
|
||||
/*.md h1:before, .md h2:before, .md h3:before, .md h4:before { content: none; }*/
|
||||
|
||||
/* link styling */
|
||||
.md a:link, .md a:visited {
|
||||
color: #3f51b5;
|
||||
}
|
||||
|
||||
/* inline and block code */
|
||||
.md code, .md pre.listing {
|
||||
background-color: rgba(0,0,0,.03);
|
||||
padding: 0.1em 0.2em;
|
||||
border-radius: 0.15em;
|
||||
}
|
||||
.md pre.listing code {
|
||||
background-color: transparent;
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* table of contents styling; make all 3 forms of it look the same */
|
||||
.md .longTOC, .md .mediumTOC, .md .shortTOC {
|
||||
font-size: inherit;
|
||||
line-height: 120%;
|
||||
margin: 1em 0;
|
||||
padding: .4rem;
|
||||
border-left: .1rem solid #3f51b5;
|
||||
}
|
||||
.md .tocHeader {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
font-size: inherit;
|
||||
}
|
||||
.md .tocNumber {
|
||||
display: none;
|
||||
}
|
||||
.md .longTOC .level1, .md .mediumTOC .level1, .md .shortTOC .level1 {
|
||||
font-weight: inherit;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.md .longTOC p, .md .mediumTOC p, .md .shortTOC p {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.md .longTOC center, .md .mediumTOC center, .md .shortTOC center {
|
||||
text-align: left;
|
||||
}
|
||||
.md .longTOC b, .md .mediumTOC b, .md .shortTOC b {
|
||||
font-weight: 400;
|
||||
}
|
||||
.md .longTOC a, .md .mediumTOC a, .md .shortTOC a {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.md .longTOC .level1, .md .mediumTOC .level1, .md .shortTOC .level1,
|
||||
.md .longTOC .level2, .md .mediumTOC .level2, .md .shortTOC .level2,
|
||||
.md .longTOC .level3, .md .mediumTOC .level3, .md .shortTOC .level3 {
|
||||
white-space: nowrap;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
/* tables; use fainter colors than regular markdeep style */
|
||||
.md table.table {
|
||||
font-size: 90%;
|
||||
}
|
||||
.md table.table th {
|
||||
border: none;
|
||||
background-color: #ccc;
|
||||
color: rgba(0,0,0,.6);
|
||||
}
|
||||
.md table.table tr, .md table.table td {
|
||||
border-color: #eee;
|
||||
}
|
||||
.md table.table tr:nth-child(even) {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
% Copyright 2009-present Contributors to the Open Shading Language project.
|
||||
% SPDX-License-Identifier: CC-BY-4.0
|
||||
% SPDX-License-Identifier: BSD-3-Clause
|
||||
% https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
\documentclass[11pt,letterpaper]{book}
|
||||
\setlength{\oddsidemargin}{0.5in}
|
||||
\setlength{\topmargin}{0in}
|
||||
@@ -21,7 +26,7 @@
|
||||
\usepackage{xspace}
|
||||
%\usepackage{multicol}
|
||||
%\usepackage{color}
|
||||
\usepackage{html}
|
||||
\usepackage{hyperref}
|
||||
%\usepackage{version}
|
||||
\usepackage{makeidx}
|
||||
\usepackage[chapter]{algorithm}
|
||||
@@ -43,31 +48,31 @@
|
||||
|
||||
\def\langname{Open Shading Language\xspace}
|
||||
\def\product{{\sffamily Open Shading Language}\xspace}
|
||||
\def\versionnumber{1.7}
|
||||
\def\versionnumber{1.11}
|
||||
\def\productver{\product\ {\sffamily \versionnumber}\xspace}
|
||||
|
||||
|
||||
\title{
|
||||
\title{
|
||||
{\Huge{\bf \product}
|
||||
%\textregistered\
|
||||
{\bf\sffamily \versionnumber} \medskip \\ \huge
|
||||
%\textregistered\
|
||||
{\bf\sffamily \versionnumber} \medskip \\ \huge
|
||||
Language Specification
|
||||
%\\ \large (CONFIDENTIAL --- draft in progress)
|
||||
} \bigskip }
|
||||
\author{
|
||||
\copyright\ Copyright 2009-2016 Sony Pictures Imageworks Inc., et al. All rights reserved.
|
||||
\copyright\ Copyright 2009-present Contributors to the Open Shading Language project. \\
|
||||
All rights reserved.
|
||||
\bigskip \\
|
||||
\vspace{1in} \\
|
||||
Editor: Larry Gritz \\
|
||||
\emph{lg@imageworks.com}
|
||||
}
|
||||
\date{{\large Date: 14 Jan, 2016 \\
|
||||
(with corrections, 5 Jul 2016)
|
||||
\date{{\large Date: 11 Aug 2020 \\
|
||||
(with corrections, 24 Nov 2021)
|
||||
}
|
||||
\bigskip
|
||||
\bigskip
|
||||
\bigskip
|
||||
\bigskip
|
||||
\bigskip
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +108,7 @@ Editor: Larry Gritz \\
|
||||
\def\pnoise{{\cf pnoise()}\xspace}
|
||||
\def\psnoise{{\cf psnoise()}\xspace}
|
||||
\def\cellnoise{{\cf cellnoise()}\xspace}
|
||||
\def\hashnoise{{\cf hashnoise()}\xspace}
|
||||
\def\illuminance{{\cf illuminance}\xspace}
|
||||
\def\illuminate{{\cf illuminate}\xspace}
|
||||
|
||||
@@ -129,8 +135,8 @@ documentation are:
|
||||
|
||||
\vspace*{0.2in}
|
||||
|
||||
Copyright (c) 2009-2016 Sony Pictures Imageworks Inc., et al.
|
||||
All Rights Reserved.
|
||||
Copyright \textcopyright\ 2009-present, Contributors to the Open Shading
|
||||
Language project. All Rights Reserved.
|
||||
|
||||
\vspace{0.5in}
|
||||
|
||||
@@ -149,7 +155,7 @@ met:
|
||||
\item Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
\item Neither the name of Sony Pictures Imageworks nor the names of its
|
||||
\item Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
\end{itemize}
|
||||
@@ -170,12 +176,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
\vspace{0.5in}
|
||||
|
||||
This specification and other text documentation about Open Shading
|
||||
Language is licensed under a the Creative Commons Attribution 3.0
|
||||
Language is licensed under a the Creative Commons Attribution 4.0
|
||||
Unported License. \\
|
||||
|
||||
\smallskip
|
||||
\spc \includegraphics[width=0.85in]{Figures/CC-30BY.png}
|
||||
\spc http://creativecommons.org/licenses/by/3.0/
|
||||
\spc \includegraphics[width=0.85in]{Figures/CC-BY.png}
|
||||
\spc http://creativecommons.org/licenses/by/4.0/
|
||||
\bigskip
|
||||
|
||||
|
||||
@@ -233,7 +239,7 @@ find are different in OSL compared to other languages:
|
||||
\subsubsection*{Surface and volume shaders compute radiance closures, not final colors.}
|
||||
|
||||
OSL's surface and volume shaders compute an explicit symbolic
|
||||
description, called a "closure", of the way a surface or volume
|
||||
description, called a ``closure,'' of the way a surface or volume
|
||||
scatters light, in units of radiance. These radiance closures may be
|
||||
evaluated in particular directions, sampled to find important
|
||||
directions, or saved for later evaluation and re-evaluation.
|
||||
@@ -242,7 +248,7 @@ find are different in OSL compared to other languages:
|
||||
|
||||
In contrast, other shading languages usually compute just a surface
|
||||
color as visible from a particular direction. These old shaders are
|
||||
"black boxes" that a renderer can do little with but execute to for
|
||||
``black boxes'' that a renderer can do little with but execute to for
|
||||
this once piece of information (for example, there is no effective way
|
||||
to discover from them which directions are important to sample).
|
||||
Furthermore, the physical units of lights and surfaces are often
|
||||
@@ -251,17 +257,17 @@ find are different in OSL compared to other languages:
|
||||
|
||||
\subsubsection*{Surface and volume shaders do not loop over lights or shoot rays.}
|
||||
|
||||
There are no "light loops" or explicitly traced rays in OSL surface
|
||||
There are no ``light loops'' or explicitly traced rays in OSL surface
|
||||
shaders. Instead, surface shaders compute a radiance closure
|
||||
describing how the surface scatters light, and a part of the renderer
|
||||
called an "integrator" evaluates the closures for a particular set of
|
||||
called an ``integrator'' evaluates the closures for a particular set of
|
||||
light sources and determines in which directions rays should be
|
||||
traced. Effects that would ordinarily require explicit ray tracing,
|
||||
such as reflection and refraction, are simply part of the radiance
|
||||
closure and look like any other BSDF.
|
||||
|
||||
Advantages of this approach include that integration and sampling may
|
||||
be batched or re-ordered to increase ray coherence; a "ray budget" can
|
||||
be batched or re-ordered to increase ray coherence; a ``ray budget'' can
|
||||
be allocated to optimally sample the BSDF; the closures may be used by
|
||||
for bidirectional ray tracing or Metropolis light transport; and the
|
||||
closures may be rapidly re-evaluated with new lighting without having
|
||||
@@ -284,7 +290,7 @@ find are different in OSL compared to other languages:
|
||||
Sometimes it is desirable to output images containing individual
|
||||
lighting components such as specular, diffuse, reflection, individual
|
||||
lights, etc. In other languages, this is usually accomplished by
|
||||
adding a plethora of "output variables" to the shaders that collect
|
||||
adding a plethora of ``output variables'' to the shaders that collect
|
||||
these individual quantities.
|
||||
|
||||
OSL shaders need not be cluttered with any code or output variables to
|
||||
@@ -303,7 +309,7 @@ find are different in OSL compared to other languages:
|
||||
other nodes within the network. These connections may be done
|
||||
dynamically at render time, and do not affect compilation of
|
||||
individual shader nodes. Furthermore, the individual nodes are
|
||||
evaluated lazily, only their outputs are "pulled" from the later nodes
|
||||
evaluated lazily, only their outputs are ``pulled'' from the later nodes
|
||||
that depend on them (shader writers may remain blissfully unaware of
|
||||
these details, and write shaders as if everything is evaluated
|
||||
normally).
|
||||
@@ -329,7 +335,7 @@ find are different in OSL compared to other languages:
|
||||
|
||||
In the open source OSL implementation, this is possible because
|
||||
derivatives are not computed by finite differences with neighboring
|
||||
points, but rather by "automatic differentiation", computing partial
|
||||
points, but rather by ``automatic differentiation,'' computing partial
|
||||
differentials for the variables that lead to derivatives, without any
|
||||
intervention required by the shader writer.
|
||||
|
||||
@@ -339,27 +345,19 @@ find are different in OSL compared to other languages:
|
||||
|
||||
\section*{Acknowledgments}
|
||||
|
||||
The main developers of OSL are (in order of joining the project):
|
||||
The original designer and project leader of OSL is Larry Gritz. Other early
|
||||
developers of OSL are (in order of joining the project): Cliff Stein, Chris
|
||||
Kulla, Alejandro Conty, Jay Reynolds, Solomon Boulos, Adam Martinez, Brecht
|
||||
Van Lommel.
|
||||
|
||||
\vspace*{0.2in}
|
||||
|
||||
Larry Gritz
|
||||
|
||||
Cliff Stein
|
||||
|
||||
Chris Kulla
|
||||
|
||||
Alejandro Conty
|
||||
|
||||
Jay Reynolds
|
||||
|
||||
Solomon Boulos
|
||||
|
||||
Adam Martinez
|
||||
|
||||
Brecht Van Lommel
|
||||
|
||||
\vspace*{0.2in}
|
||||
Additionally, many others have contributed features, bug fixes, and other
|
||||
changes: Steve Agland, Shane Ambler, Martijn Berger, Farchad Bidgolirad,
|
||||
Nicholas Bishop, Stefan Büttner, Matthaus G. Chajdas, Thomas Dinges, Henri
|
||||
Fousse, Syoyo Fujita, Derek Haase, Sven-Hendrik Haase, John Haddon, Daniel
|
||||
Heckenberg, Ronan Keryell, Elvic Liang, Max Liani, Bastien Montagne, Erich
|
||||
Ocean, Mikko Ohtamaa, Alex Schworer, Sergey Sharybin, Stephan Steinbach,
|
||||
Esteban Tovagliari, Alexander von Knorring, Roman Zulak. (Listed
|
||||
alphabetically; if we've left anybody out, please let us know.)
|
||||
|
||||
We cannot possibly express sufficient gratitude to the managers at Sony
|
||||
Pictures Imageworks who allowed this project to proceed, supported it
|
||||
@@ -373,22 +371,22 @@ feedback. Thank you, and we hope we've been responsive to your needs.
|
||||
|
||||
OSL was not developed in isolation. We owe a debt to the individuals
|
||||
and studios who patiently read early drafts of the language
|
||||
specification and gave us very helpful feedback and additional ideas.
|
||||
(I hope to mention them by name after we get permission of the people
|
||||
and studios involved.)
|
||||
specification and gave us very helpful feedback and additional ideas,
|
||||
and especially to those at other companies who have taken the risk of
|
||||
incorporating OSL into their products and pipelines.
|
||||
|
||||
\bigskip
|
||||
\bigskip
|
||||
The open source OSL implementation incorporates or depends upon several
|
||||
other open source packages:
|
||||
|
||||
\begin{itemize}
|
||||
\item {\cf OpenImageIO} \copyright\ 2008 Larry Gritz et al.
|
||||
{\cf http://openimageio.org}
|
||||
\url{http://openimageio.org}
|
||||
\item Ilmbase \copyright\ 2006, Industrial Light \& Magic.
|
||||
{\cf http://www.openexr.com}
|
||||
\item Boost \copyright\ various authors. {\cf http://www.boost.org}
|
||||
\url{http://www.openexr.com}
|
||||
\item Boost \copyright\ various authors. \url{http://www.boost.org}
|
||||
\item LLVM \copyright\ 2003-2010 University of Illinois at
|
||||
Urbana-Champaign. {\cf http://llvm.org}
|
||||
Urbana-Champaign. \url{http://llvm.org}
|
||||
\end{itemize}
|
||||
|
||||
These other packages are all distributed under licenses that allow them
|
||||
@@ -546,6 +544,8 @@ source code:
|
||||
\item {\cf source} is a {\cf float} or {\cf int} and {\cf dest} is a
|
||||
\emph{triple} (the scalar value will be replicated for all three components
|
||||
of the triple).
|
||||
\item {\cf source} is a single component of an aggregate type (e.g. one
|
||||
channel of a {\cf color}) and {\cf dest} is a {\cf float} (or vice versa).
|
||||
\end{itemize}
|
||||
|
||||
\subsection*{Geometric primitives}
|
||||
@@ -593,13 +593,6 @@ point-by-point basis, and volume shaders that describe how light is
|
||||
scattered within a region of space. A particular renderer may have
|
||||
additional shader types that it supports.
|
||||
|
||||
%\subsection*{Shader types}
|
||||
%
|
||||
%There are several types of shaders: surface, displacement, light,
|
||||
%volume. The type of shader determines what it's allowed to do (for
|
||||
%example, only displacement shaders can alter the surface position).
|
||||
%There is also a generic kind of shader that can be used for any of the
|
||||
%shader uses.
|
||||
|
||||
\subsection*{Shader execution state: parameter binding and global variables}
|
||||
|
||||
@@ -621,7 +614,7 @@ information about the renderer as a whole (rendering options, etc.).
|
||||
|
||||
Surface shaders (and volume shaders) do not by themselves compute the
|
||||
final color of light emanating from the surface (or along a volume).
|
||||
Rather, the compute a \emph{closure}, which is a symbolic representation
|
||||
Rather, they compute a \emph{closure}, which is a symbolic representation
|
||||
describing the appearance of the surface, that may be more fully
|
||||
evaluated later. This is in effect a parameterized formula, in which
|
||||
some inputs have definite numeric values, but others may depend on
|
||||
@@ -722,7 +715,7 @@ So you can write a shader to achieve some effect in real world units,
|
||||
and that shader is totally reusable on another show that used different
|
||||
modeling units.
|
||||
|
||||
It knows all the standard names like \qkw{cm}, \qkw{in}, \qkw{km}",
|
||||
It knows all the standard names like \qkw{cm}, \qkw{in}, \qkw{km},
|
||||
etc., and can convert among any of those, as well as between named
|
||||
coordinate systems. For example,
|
||||
|
||||
@@ -880,9 +873,21 @@ directives, including:
|
||||
#pragma once
|
||||
\end{code}
|
||||
|
||||
\noindent Additionally, the following preprocessor symbols will already be
|
||||
defined by the compiler:
|
||||
|
||||
\smallskip
|
||||
|
||||
\begin{tabular}{p{1.5in} p{3.5in}}
|
||||
{\cf OSL_VERSION_MAJOR} & Major version (e.g., 1) \\[0.5ex]
|
||||
{\cf OSL_VERSION_MINOR} & Minor version (e.g., 9) \\[0.5ex]
|
||||
{\cf OSL_VERSION_PATCH} & Patch version (e.g., 3) \\[0.5ex]
|
||||
{\cf OSL_VERSION} & Combined version number = 10000*major + 100*minor + patch
|
||||
(e.g., 10903 for version 1.9.3)
|
||||
\end{tabular}
|
||||
|
||||
|
||||
\chapter{Gross syntax, shader types, parameters, functions}
|
||||
\chapter{Gross syntax, shader types, parameters}
|
||||
\label{chap:grosssyntax}
|
||||
|
||||
The overall structure of a shader is as follows:
|
||||
@@ -974,7 +979,7 @@ different behaviors or appearances when used on different objects.
|
||||
|
||||
Shader parameters are specified in the shader declaration, in
|
||||
parentheses after the shader's name. This is much like the parameters
|
||||
to a \languagename function (or a function in C or similar languages),
|
||||
to an OSL function (or a function in C or similar languages),
|
||||
except that shader parameters must have an \emph{initializer}, giving a
|
||||
default value for the parameter. Shader parameter default initializers
|
||||
may be expressions (i.e., may be computed rather than restricted to
|
||||
@@ -1239,7 +1244,7 @@ numbers, 0 and 1 are used.
|
||||
\apiitem{"checkBox"}
|
||||
\vspace{12pt}
|
||||
A boolean widget displayed as a checkbox. Works on strings or
|
||||
numbers. With strings, "Yes" and "No" values are used, with numbers,
|
||||
numbers. With strings, ``Yes'' and ``No'' values are used, with numbers,
|
||||
0 and 1 are used.
|
||||
\apiend
|
||||
\vspace{-12pt}
|
||||
@@ -1332,48 +1337,6 @@ if a \qkw{degrees} variable is passed as the argument to {\cf cos}).
|
||||
|
||||
|
||||
\newpage
|
||||
\section{Functions}
|
||||
\label{sec:functions}
|
||||
\index{functions!declarations}
|
||||
|
||||
You may define functions much like in C or C++.
|
||||
|
||||
\begin{quote}
|
||||
\em
|
||||
return-type ~ function-name ~ {\rm\cf (} optional-parameters {\rm\cf )} \\
|
||||
\rm
|
||||
{\cf \{ } \\
|
||||
\em
|
||||
\spc statements
|
||||
|
||||
{\cf \} }
|
||||
\end{quote}
|
||||
|
||||
Parameters to functions are similar to shader parameters, except that
|
||||
they do not permit initializers. A function call must pass values for
|
||||
all formal parameters. Function parameters in \langname are all
|
||||
\emph{passed by reference}, and are read-only within the body of the
|
||||
function unless they are also designated as {\cf output} (in the same
|
||||
manner as output shader parameters).
|
||||
|
||||
Like for shaders, statements inside functions may be actual executions
|
||||
(assignments, function call, etc.), local variable declarations (visible
|
||||
only from within the body of the function), or local function
|
||||
declarations (callable only from within the body of the function).
|
||||
|
||||
The return type may be any simple data type, a {\cf struct}, or a {\cf
|
||||
closure}. Functions may not return arrays. The return type may be
|
||||
{\cf void}, indicating that the function does not return a value (and
|
||||
should not contain a {\cf return} statement). A {\cf return} statement
|
||||
inside the body of the function will halt execution of the function at
|
||||
that point, and designates the value that will be returned (if not a
|
||||
{\cf void} function).
|
||||
|
||||
Functions may be \emph{overloaded}. That is, multiple functions may be
|
||||
defined to have the same name, as long as they have differently-typed
|
||||
parameters, so that when the function is called the list of arguments
|
||||
can disambiguate which version of the function is desired.
|
||||
|
||||
\section{Public methods}
|
||||
\label{sec:publicmethods}
|
||||
\indexapi{public}
|
||||
@@ -1486,7 +1449,7 @@ operation & result & ~ \\
|
||||
{\ce ++} \inttype & \inttype & pre-increment by 1 \\[0.5ex]
|
||||
{\ce --} \inttype & \inttype & pre-decrement by 1 \\[0.5ex]
|
||||
{\cf {\bfseries -} int} & \inttype & unary negation \\[0.5ex]
|
||||
\verb|~| {\cf int} & \inttype & bitwise complement (1 and 0 bits flipped) \\[0.5ex]
|
||||
{\ce \textasciitilde} {\cf int} & \inttype & bitwise complement (1 and 0 bits flipped) \\[0.5ex]
|
||||
{\cf {\bfseries !} int} & \inttype & boolean `not' (1 if operand is zero, otherwise 0) \\[0.5ex]
|
||||
\hline
|
||||
{\cf int {\bfseries *} int} & \inttype & multiplication \\[0.5ex]
|
||||
@@ -1515,7 +1478,7 @@ else 0 \\[0.5ex]
|
||||
\hline
|
||||
{\cf int {\bfseries \&} int} & \inttype & bitwise and \\[0.5ex]
|
||||
\hline
|
||||
{\cf int {\bfseries \verb|^|} int} & \inttype & bitwise exclusive or \\[0.5ex]
|
||||
{\cf int {\bfseries \textasciicircum} int} & \inttype & bitwise exclusive or \\[0.5ex]
|
||||
\hline
|
||||
{\cf int {\bfseries |} int} & \inttype & bitwise or \\[0.5ex]
|
||||
\hline
|
||||
@@ -1663,6 +1626,16 @@ Colors can have their individual components examined and set using the
|
||||
It is an error to access a color component with an index outside the
|
||||
$[0...2]$ range.
|
||||
|
||||
Color variables may also have their components referenced using
|
||||
``named components'' that look like accessing structure fields named
|
||||
{\cf r}, {\cf g}, and {\cf b}, as synonyms for {\cf [0]}, {\cf [1]}, and
|
||||
{\cf [2]}, respectively:
|
||||
|
||||
\begin{code}
|
||||
float green = C.g; // get the green component
|
||||
C.r = 0.5; // set the red component
|
||||
\end{code}
|
||||
|
||||
The following operators may be used with \color values (in order of
|
||||
decreasing precedence, with each box holding operators of the same
|
||||
precedence):
|
||||
@@ -1824,6 +1797,16 @@ the {\cf []} array access notation. For example:
|
||||
It is an error to access a point component with an index outside the
|
||||
$[0...2]$ range.
|
||||
|
||||
Point-like variables may also have their components referenced using
|
||||
``named components'' that look like accessing structure fields named
|
||||
{\cf x}, {\cf y}, and {\cf z}, as synonyms for {\cf [0]}, {\cf [1]}, and
|
||||
{\cf [2]}, respectively:
|
||||
|
||||
\begin{code}
|
||||
float yval = P.y; // get the [1] or y component
|
||||
P.x = 0.5; // set the [0] or x component
|
||||
\end{code}
|
||||
|
||||
The following operators may be used with point-like values (in order of
|
||||
decreasing precedence, with each box holding operators of the same
|
||||
precedence):
|
||||
@@ -1902,8 +1885,8 @@ reference to a named space:
|
||||
\end{code}
|
||||
|
||||
\noindent The first form creates the matrix that transforms points from
|
||||
\commonspace to \shaderspace. Transforming points by this matrix
|
||||
is identical to calling {\cf transform("shader",...)}.
|
||||
\shaderspace to \commonspace. Transforming points by this matrix
|
||||
is identical to calling {\cf transform("shader", "common", ...)}.
|
||||
The second form prepends the current-to-world transformation matrix
|
||||
onto the $4 \times 4$ matrix with components $m_{0,0} ... m_{3,3}$.
|
||||
Note that although we have used {\cf "shader"} and {\cf "world"}
|
||||
@@ -2064,35 +2047,71 @@ using the `dot' operator. The syntax for declaring and using structures
|
||||
is similar to C or C++:
|
||||
|
||||
\begin{code}
|
||||
struct ray { // Define a structure type
|
||||
point pos;
|
||||
vector dir;
|
||||
struct RGBA { // Define a structure type
|
||||
color rgb;
|
||||
float alpha;
|
||||
};
|
||||
|
||||
ray r; // Declare a structure
|
||||
r.pos = point (1, 0, 0); // Assign to one field
|
||||
point p = r.pos; // Read from a structure field
|
||||
RGBA col; // Declare a structure
|
||||
r.rgb = color (1, 0, 0); // Assign to one field
|
||||
color c = r.rgb; // Read from a structure field
|
||||
|
||||
RGBA b = { color(.1,.2,.3), 1 }; // Member-by-member initialization
|
||||
\end{code}
|
||||
|
||||
It is permitted to have a structure field that is an array, as well as
|
||||
to have an array of structures. But it is not permitted for one
|
||||
structure to have a field that is another structure. For example:
|
||||
You can use ``constructor expressions'' for a your struct types much like
|
||||
you can construct built-in types like \color or \point:
|
||||
|
||||
\vspace{10pt}
|
||||
\hspace{0.25in} \emph{struct\_name ( first\_member\_value, ... )}
|
||||
\vspace{10pt}
|
||||
|
||||
\noindent For example,
|
||||
|
||||
\begin{code}
|
||||
RGBA c = RGBA(col,alpha); // Constructor syntax
|
||||
|
||||
RGBA add (RGBA a, RGBA b)
|
||||
{
|
||||
return RGBA (a.rgb+b.rgb, a.a+b.a); // return expression
|
||||
}
|
||||
|
||||
// pass constructor expression as a parameter:
|
||||
RGBA d = add (c, RGBA(color(.3,.4,.5), 0));
|
||||
\end{code}
|
||||
|
||||
You may also use the \emph{compound initializer list} syntax to construct a
|
||||
type when it can be deduced from context which compound type is required.
|
||||
For example, this is equivalent to the preceding example:
|
||||
|
||||
\begin{code}
|
||||
RGBA c = {col,alpha}; // deduce by what is being assigned to
|
||||
|
||||
RGBA add (RGBA a, RGBA b)
|
||||
{
|
||||
return { a.rgb+b.rgb, a.a+b.a }; // deduce by func return type
|
||||
}
|
||||
|
||||
RGBA d = add (c, {{.3,.4,.5}, 0}); // deduce by expected arg type
|
||||
\end{code}
|
||||
|
||||
It is permitted to have a structure field that is an array, as well as to
|
||||
have an array of structures. But it is not currently permitted to ``nest''
|
||||
arrays (that is, to have an array of structs which contain members that are
|
||||
arrays).
|
||||
|
||||
\begin{code}
|
||||
struct A {
|
||||
color a;
|
||||
float b[4]; // struct may contain an array
|
||||
float b[4]; // Ok: struct may contain an array
|
||||
};
|
||||
|
||||
A d[5]; // Array of structures
|
||||
color e = d[0].a; // Field of one element of array of struct
|
||||
d[2].b[4] = 0.25; // Element of a field of a struct in an array
|
||||
RGBA vals[4]; // Ok: Array of structures
|
||||
vals[0].a = 0;
|
||||
|
||||
A d[5]; // NO: Array of structures that contain arrays
|
||||
\end{code}
|
||||
|
||||
%\begin{annotate}
|
||||
%\QUESTION Is this restriction (no ``structure recursion'') acceptable?
|
||||
%It certainly makes the implementation of the language easier.
|
||||
%\end{annotate}
|
||||
|
||||
\index{types|)} % end of chapter
|
||||
|
||||
@@ -2121,7 +2140,7 @@ At present, the only type of \closure supported by \langname is the
|
||||
form a linear combination of \colorclosure's. Additional closure types
|
||||
and operations are reserved for future use.
|
||||
|
||||
Allowable operations on \colorclosure's include:
|
||||
Allowable operations on \colorclosure include:
|
||||
|
||||
\medskip
|
||||
\noindent \begin{tabular}{|p{2.25in}|p{1.25in}|p{1.75in}|}
|
||||
@@ -2364,7 +2383,7 @@ variable, then return the new value.
|
||||
|
||||
\begin{tabbing}
|
||||
\hspace{0.25in} {\cf -} \emph{expr} \hspace{1in} \= (negation) \\
|
||||
\hspace{0.25in} \verb|~| \emph{expr} \> (bitwise complement) \\
|
||||
\hspace{0.25in} {\cf \textasciitilde} \emph{expr} \> (bitwise complement) \\
|
||||
\hspace{0.25in} \emph{expr} {\cf *} \emph{expr} \> (multiplication) \\
|
||||
\hspace{0.25in} \emph{expr} {\cf /} \emph{expr} \> (division) \\
|
||||
\hspace{0.25in} \emph{expr} {\cf +} \emph{expr} \> (addition) \\
|
||||
@@ -2374,7 +2393,7 @@ variable, then return the new value.
|
||||
\hspace{0.25in} \emph{expr} {\cf >>} \emph{expr} \> (integer shift right) \\
|
||||
\hspace{0.25in} \emph{expr} {\cf \&} \emph{expr} \> (bitwise and) \\
|
||||
\hspace{0.25in} \emph{expr} {\cf |} \emph{expr} \> (bitwise or) \\
|
||||
\hspace{0.25in} \emph{expr} \verb|^| \emph{expr} \> (bitwise exclusive or) \\
|
||||
\hspace{0.25in} \emph{expr} {\cf \textasciicircum} \emph{expr} \> (bitwise exclusive or) \\
|
||||
\end{tabbing}
|
||||
|
||||
The operators {\cf +}, {\cf -}, {\cf *}, {\cf /}, and the unary {\cf -}
|
||||
@@ -2387,7 +2406,7 @@ multiplication and matrix multiplication by the inverse of another
|
||||
matrix.
|
||||
|
||||
The integer and bit-wise operators {\cf \%}, {\cf <<}, {\cf >>},
|
||||
{\cf \&}, {\cf |}, {\cf \verb|^|}, and {\cf \verb|~|} may only be
|
||||
{\cf \&}, {\cf |}, {\cf \textasciicircum}, and {\cf \textasciitilde} may only be
|
||||
used with expressions of type \inttype.
|
||||
|
||||
For details on which operators are allowed, please consult the operator
|
||||
@@ -2607,7 +2626,10 @@ altogether, and the {\cf continue} statement skip to the end of the body
|
||||
and proceeds to the next iteration of the loop.
|
||||
|
||||
\section{Functions}
|
||||
\label{sec:syntax:functions}
|
||||
\label{sec:functions}
|
||||
|
||||
\subsection{Function calls}
|
||||
\label{sec:syntax:functioncalls}
|
||||
\index{function calls}
|
||||
|
||||
Function calls are very similar to C and related programming languages:
|
||||
@@ -2626,8 +2648,115 @@ will not be noticeably different from C-style ``pass by value''
|
||||
semantics, except if you pass the same variable as two separate
|
||||
arguments to a function that modifies an argument's value.
|
||||
|
||||
Function definitions are described in detail in Section~\ref{sec:functions}.
|
||||
|
||||
\subsection{Function definitions}
|
||||
\label{sec:syntax:functiondefinitions}
|
||||
\index{functions!definitions}
|
||||
|
||||
You may define functions much like in C or C++.
|
||||
|
||||
\begin{quote}
|
||||
\em
|
||||
return-type ~ function-name ~ {\rm\cf (} optional-parameters {\rm\cf )} \\
|
||||
\rm
|
||||
{\cf \{ } \\
|
||||
\em
|
||||
\spc statements
|
||||
|
||||
{\cf \} }
|
||||
\end{quote}
|
||||
|
||||
Parameters to functions are similar to shader parameters, except that
|
||||
they do not permit initializers. A function call must pass values for
|
||||
all formal parameters. Function parameters in \langname are all
|
||||
\emph{passed by reference}, and are read-only within the body of the
|
||||
function unless they are also designated as {\cf output} (in the same
|
||||
manner as output shader parameters).
|
||||
|
||||
Like for shaders, statements inside functions may be actual executions
|
||||
(assignments, function call, etc.), local variable declarations (visible
|
||||
only from within the body of the function), or local function
|
||||
declarations (callable only from within the body of the function).
|
||||
|
||||
The return type may be any simple data type, a {\cf struct}, or a {\cf
|
||||
closure}. Functions may not return arrays. The return type may be
|
||||
{\cf void}, indicating that the function does not return a value (and
|
||||
should not contain a {\cf return} statement). A {\cf return} statement
|
||||
inside the body of the function will halt execution of the function at
|
||||
that point, and designates the value that will be returned (if not a
|
||||
{\cf void} function).
|
||||
|
||||
Functions may be \emph{overloaded}. That is, multiple functions may be
|
||||
defined to have the same name, as long as they have differently-typed
|
||||
parameters, so that when the function is called the list of arguments can
|
||||
select which version of the function is desired. When there are multiple
|
||||
potential matches, function versions whose argument types match exactly are
|
||||
favored, followed by those that match with type coercion (for example,
|
||||
passing an {\cf int} when the function expects a {\cf float}, or passing a
|
||||
{\cf float} when the function expects a \color), and finally by trying to
|
||||
match the return value to the type of variable the result is assigned to.
|
||||
|
||||
\subsection{Operator overloading}
|
||||
\label{sec:syntax:operatoroverloading}
|
||||
\index{operator overloading}
|
||||
|
||||
OSL permits \emph{operator overloading}, which is the practice of providing
|
||||
a function that will be called when you use an operator like {\cf +} or
|
||||
{\cf *}. This is especially handy when you use {\cf struct} to define
|
||||
mathematical types and wish for the usual math operators to work with them.
|
||||
Here is a typical example, which also shows the special naming convention
|
||||
that allows operator overloading:
|
||||
|
||||
\begin{code}
|
||||
struct vector4 {
|
||||
float x, y, z, w;
|
||||
};
|
||||
|
||||
vector4 __operator__add__ (vector4 a, vector4 b) {
|
||||
return vector4 (a.x+b.x, a.y+b.y, a.z+b.z, a.w+b.w);
|
||||
}
|
||||
|
||||
shader test ()
|
||||
{
|
||||
vector4 a = vector4 (.2, .3, .4, .5);
|
||||
vector4 b = vector4 (1, 2, 3, 4);
|
||||
|
||||
vector4 c = a + b; // Will call __operator__add__(vector4,vector4)
|
||||
printf ("a+b = %g %g %g %g\n", c.x, c.y, c.z, c.w);
|
||||
}
|
||||
\end{code}
|
||||
|
||||
\noindent The full list of these special function names is as follows (in
|
||||
order of decreasing operator precedence):
|
||||
|
||||
\smallskip
|
||||
|
||||
\begin{tabular}{ p{0.5in} p{2in} p{1.75in}}
|
||||
%op & overload function name & ~ \\
|
||||
%\hline
|
||||
{\cf \bfseries -} & {\cf __operator__neg__} & unary negation \\
|
||||
{\cf \bfseries \textasciitilde} & {\cf __operator__compl__} & unary bitwise complement \\
|
||||
{\cf \bfseries !} & {\cf __operator__not__} & unary boolean `not' \\[1.5ex]
|
||||
{\cf \bfseries *} & {\cf __operator__mul__} & \\
|
||||
{\cf \bfseries /} & {\cf __operator__div__} & \\
|
||||
{\cf \bfseries \%} & {\cf __operator__mod__} & \\
|
||||
{\cf \bfseries +} & {\cf __operator__add__} & \\
|
||||
{\cf \bfseries -} & {\cf __operator__sub__} & \\[1.5ex]
|
||||
{\cf \bfseries <<} & {\cf __operator__shl__} & \\
|
||||
{\cf \bfseries >>} & {\cf __operator__shr__} & \\[1.5ex]
|
||||
{\cf \bfseries <} & {\cf __operator__lt__} & \\
|
||||
{\cf \bfseries <=} & {\cf __operator__le__} & \\
|
||||
{\cf \bfseries >} & {\cf __operator__gt__} & \\
|
||||
{\cf \bfseries >=} & {\cf __operator__ge__} & \\
|
||||
{\cf \bfseries ==} & {\cf __operator__eq__} & \\
|
||||
{\cf \bfseries !=} & {\cf __operator__ne__} & \\[1.5ex]
|
||||
{\cf \bfseries \&} & {\cf __operator__bitand__} & \\
|
||||
{\cf \bfseries \textasciicircum} & {\cf __operator__xor__} & \\
|
||||
{\cf \bfseries |} & {\cf __operator__bitor__} & \\
|
||||
%{\cf \bfseries \&\&} & {\cf __operator__and__} & boolean and \\
|
||||
%{\cf \bfseries ||} & {\cf __operator__or__} & boolean or \\
|
||||
%\hline
|
||||
\end{tabular}
|
||||
|
||||
|
||||
\section{Global variables}
|
||||
@@ -2901,6 +3030,11 @@ Returns the exponent of x, as a floating-point number.
|
||||
Computes $\sqrt{x}$ and $1/\sqrt{x}$. Returns 0 if $x<0$.
|
||||
\apiend
|
||||
|
||||
\apiitem{\emph{type} {\ce cbrt} (\emph{type} x)}
|
||||
\indexapi{cbrt()}
|
||||
Computes $\sqrt[3]{x}$. The sign of the return value will match $x$.
|
||||
\apiend
|
||||
|
||||
\apiitem{float {\ce hypot} (float x, float y) \\
|
||||
float {\ce hypot} (float x, float y, float z)}
|
||||
\indexapi{hypot()}
|
||||
@@ -2930,7 +3064,7 @@ Returns 1 if $x>0$, -1 if $x<0$, 0 if $x=0$.
|
||||
\emph{type} {\ce trunc} (\emph{type} x) }
|
||||
\indexapi{floor()} \indexapi{ceil()} \indexapi{round()} \indexapi{trunc()}
|
||||
|
||||
Various rouinding methods: {\cf floor} returns the largest integer less
|
||||
Various rounding methods: {\cf floor} returns the largest integer less
|
||||
than or equal to $x$; {\cf ceil} returns the smallest integer greater than
|
||||
or equal to $x$; {\cf round} returns the closest integer to $x$, in
|
||||
either direction; and {\cf trunc} returns the integral part of $x$
|
||||
@@ -2977,6 +3111,18 @@ The {\cf mix} function returns a linear blending :
|
||||
$ x*(1-\alpha) + y*(\alpha) $
|
||||
\apiend
|
||||
|
||||
\apiitem{\emph{type} {\ce select} (\emph{type} x, \emph{type} y, \emph{type} cond) \\
|
||||
\emph{type} {\ce select} (\emph{type} x, \emph{type} y, float cond) \\
|
||||
\emph{type} {\ce select} (\emph{type} x, \emph{type} y, int cond)}
|
||||
\indexapi{mix()}
|
||||
The {\cf select} function returns {\cf x} if {\cf cond} is zero, or {\cf y}
|
||||
if {\cf cond} is nonzero. This is roughly equivalent to {\cf (cond ? y : x)},
|
||||
except that if {\cf cond} is a component-based type (such as {\cf color}),
|
||||
the selection happens on a component-by-component basis. It is presumed
|
||||
that the underlying implementation is not a true conditional and will not
|
||||
incur any branching penalty.
|
||||
\apiend
|
||||
|
||||
\apiitem{int {\ce isnan} (float x) \\
|
||||
int {\ce isinf} (float x) \\
|
||||
int {\ce isfinite} (float x)}
|
||||
@@ -3130,10 +3276,12 @@ and {\cf eta} is the ratio of refractive index of the medium
|
||||
containing {\cf I} to that on the opposite side of the surface.
|
||||
\apiend
|
||||
|
||||
\apiitem{point {\ce rotate} (point Q, float angle, point P0, point P1)}
|
||||
\apiitem{point {\ce rotate} (point Q, float angle, point P0, point P1) \\
|
||||
point {\ce rotate} (point Q, float angle, vector axis)}
|
||||
\indexapi{rotate()}
|
||||
Returns the point computed by rotating point {\cf Q} by {\cf angle}
|
||||
radians about the axis that passes from point {\cf P0} to {\cf P1}.
|
||||
Returns the point computed by rotating point {\cf Q} by {\cf angle}
|
||||
radians about the axis that passes from point {\cf P0} to {\cf P1},
|
||||
or about the {\cf axis} vector centered on the origin.
|
||||
\apiend
|
||||
|
||||
\apiitem{\emph{ptype} {\ce transform} (string tospace, \emph{ptype} p) \\
|
||||
@@ -3329,23 +3477,33 @@ The \emph{type} may be any of of \float, \color, \point, \vector, or
|
||||
performed component-by-component (separately for $x$, $y$, and $z$).
|
||||
\apiend
|
||||
|
||||
\apiitem{float {\ce linearstep} (float edge0, float edge1, float x)}
|
||||
\apiitem{float {\ce linearstep} (float edge0, float edge1, float x) \\
|
||||
\emph{type} {\ce linearstep} (\emph{type} edge0, \emph{type} edge1, \emph{type} x)}
|
||||
\indexapi{linearstep()}
|
||||
Returns 0 if $x \le {\mathit edge0}$, and 1 if $x \ge {\mathit edge1}$,
|
||||
and performs a linear
|
||||
interpolation between 0 and 1 when ${\mathit edge0} < x < {\mathit edge1}$.
|
||||
This is equivalent to {\cf step(edge0, x)} when {\cf edge0 == edge1}.
|
||||
For \color and \point-like types, the computations are
|
||||
performed component-by-component (separately for $x$, $y$, and $z$).
|
||||
\apiend
|
||||
|
||||
\apiitem{float {\ce smoothstep} (float edge0, float edge1, float x)}
|
||||
\apiitem{float {\ce smoothstep} (float edge0, float edge1, float x) \\
|
||||
\emph{type} {\ce smoothstep} (\emph{type} edge0, \emph{type} edge1, \emph{type} x)}
|
||||
\indexapi{smoothstep()}
|
||||
Returns 0 if $x \le {\mathit edge0}$, and 1 if $x \ge {\mathit edge1}$,
|
||||
and performs a smooth Hermite
|
||||
interpolation between 0 and 1 when ${\mathit edge0} < x < {\mathit edge1}$.
|
||||
This is useful in cases where you would want a thresholding function
|
||||
with a smooth transition.
|
||||
|
||||
The \emph{type} may be any of of \float, \color, \point, \vector, or
|
||||
\normal. For \color and \point-like types, the computations are
|
||||
performed component-by-component.
|
||||
\apiend
|
||||
|
||||
\apiitem{float {\ce smooth_linearstep} (float edge0, float edge1, float x, float eps)}
|
||||
\apiitem{float {\ce smooth_linearstep} (float edge0, float edge1, float x, float eps) \\
|
||||
\emph{type} {\ce smooth_linearstep} (\emph{type} edge0, \emph{type} edge1, \emph{type} x, \emph{type} eps)}
|
||||
\indexapi{smooth_linearstep()}
|
||||
This function is strictly linear between ${\mathit edge0}+{\mathit eps}$ and ${\mathit edge1}-{\mathit eps}$
|
||||
but smoothly ramps to 0 between ${\mathit edge0}-{\mathit eps}$ and ${\mathit edge0}+{\mathit eps}$
|
||||
@@ -3353,6 +3511,8 @@ and smoothly ramps to 1 between ${\mathit edge1}-{\mathit eps}$ and ${\mathit ed
|
||||
It is 0 when $x \le {\mathit edge0}-{\mathit eps}$, and 1 if $x \ge {\mathit edge1}+{\mathit eps}$,
|
||||
and performs a linear
|
||||
interpolation between 0 and 1 when ${\mathit edge0} < x < {\mathit edge1}$.
|
||||
For \color and \point-like types, the computations are
|
||||
performed component-by-component.
|
||||
\apiend
|
||||
|
||||
|
||||
@@ -3404,6 +3564,14 @@ large-scale average is 0.5, and its values are evenly distributed over
|
||||
$[0,1]$.
|
||||
\apiend
|
||||
|
||||
\apiitem{"hash"}
|
||||
\vspace{12pt}
|
||||
A function that returns a different, uncorrelated (but deterministic and
|
||||
repeatable) value at every real input coordinate. The range is $[0,1]$, its
|
||||
large-scale average is 0.5, and its values are evenly distributed over
|
||||
$[0,1]$.
|
||||
\apiend
|
||||
|
||||
\apiitem{"simplex"}
|
||||
\vspace{12pt}
|
||||
A signed simplex noise with an output range of $[-1,1]$,
|
||||
@@ -3544,29 +3712,29 @@ The old {\cf cellnoise(...coords...)} function is equivalent to
|
||||
{\cf noise("cell",...coords...)}.
|
||||
\apiend
|
||||
|
||||
\begin{comment} % couldn't find a use for this
|
||||
\apiitem{\emph{type} {\ce hash} (float u) \\
|
||||
\emph{type} {\ce hash} (float u, float v) \\
|
||||
\emph{type} {\ce hash} (point p) \\
|
||||
\emph{type} {\ce hash} (point p, float t) \\
|
||||
\emph{type} {\ce hash} (int i) \\
|
||||
\emph{type} {\ce hash} (string s)}
|
||||
\indexapi{hash()}
|
||||
\apiitem{\emph{type} {\ce hashnoise} (float u) \\
|
||||
\emph{type} {\ce hashnoise} (float u, float v) \\
|
||||
\emph{type} {\ce hashnoise} (point p) \\
|
||||
\emph{type} {\ce hashnoise} (point p, float t)}
|
||||
\indexapi{hashnoise()}
|
||||
Returns a deterministic, repeatable \emph{hash} of the 1-, 2-, 3-, or
|
||||
4-D coordinates, integer, or string. The return values will be evenly
|
||||
4-D coordinates. The return values will be evenly
|
||||
distributed on $[0,1]$ and be completely repeatable when passed the same
|
||||
coordinates again, yet will be uncorrellated to hashes of any other
|
||||
positions (including nearby points). This is like having a random value
|
||||
indexed spatially, but that will be repeatable from frame to frame of an
|
||||
animation (provided its input is \emph{precisely} identical).
|
||||
|
||||
The return \emph{type} may be any of \float, \color, \point, \vector, or
|
||||
\normal, depending on the type of the variable the result is assigned to
|
||||
(or based on an explicit type cast). For multi-component return types
|
||||
(e.g., \point), each component is an uncorrelated \float\ {\cf hash}
|
||||
function.
|
||||
\apiend
|
||||
\end{comment}
|
||||
|
||||
\apiitem{int {\ce hash} (float u) \\
|
||||
int {\ce hash} (float u, float v) \\
|
||||
int {\ce hash} (point p) \\
|
||||
int {\ce hash} (point p, float t) \\
|
||||
int {\ce hash} (int i)}
|
||||
\indexapi{hash()}
|
||||
Returns a deterministic, repeatable integer \emph{hash} of the 1-, 2-, 3-,
|
||||
or 4-D coordinates.
|
||||
\apiend
|
||||
|
||||
\apiitem{\emph{type} {\ce spline} (string basis, float x, \emph{type} $\mathtt{y}_0$, \emph{type} $\mathtt{y}_1$, ... \emph{type} $\mathtt{y}_{n-1}$)\\
|
||||
\emph{type} {\ce spline} (string basis, float x, \emph{type} y[]) \\
|
||||
@@ -3588,8 +3756,10 @@ The type of interpolation is specified by the \emph{basis} name,
|
||||
\qkw{bezier}, \qkw{bspline}, \qkw{hermite}, \qkw{linear}, or
|
||||
\qkw{constant}. Some basis
|
||||
types require particular numbers of knot values -- Bezier splines
|
||||
require $4n+3$ values, Hermite splines require $4n+2$ values,
|
||||
Catmull-Rom and linear splines may use any number of values $n\ge 4$.
|
||||
require $3n+1$ values, Hermite splines require $2n+2$ values, and all of
|
||||
Catmull-Rom, linear, and constant requires $3+n$, where in all cases,
|
||||
$n \ge 1$ is the number of spline segments.
|
||||
|
||||
To maintain consistency with the other spline types, \qkw{linear} splines will
|
||||
ignore the first and last data value; interpolating piecewise-linearly
|
||||
between $y_1$ and $y_{n-2}$, and \qkw{constant} splines ignore the first
|
||||
@@ -3904,7 +4074,7 @@ Identical to {\cf regex_search}, except that it must match the
|
||||
|
||||
Perform a texture lookup of an image file, indexed by 2D coordinates
|
||||
$(s,t)$, antialiased over a region defined by the differentials
|
||||
\emph{dsdx, dtdx, dsty} and \emph{dtdy} (which are computed
|
||||
\emph{dsdx, dtdx, dsdy} and \emph{dtdy} (which are computed
|
||||
automatically from $s$ and $t$, if not supplied). Whether the results
|
||||
are assigned to a \float or a \color (or type cast to one of those)
|
||||
determines whether the texture lookup is a single channel or three
|
||||
@@ -3992,6 +4162,15 @@ variable specified. This allows for RGBA lookups in a single call to
|
||||
\apiend
|
||||
\vspace{-16pt}
|
||||
|
||||
\apiitem{"errormessage", <stringvariable>}
|
||||
\vspace{12pt}
|
||||
If this option is supplied, any error messages generated by the texture
|
||||
system will be stored in the specified variable rather than issuing error
|
||||
calls to the renderer, thus leaving it up to the shader to handle any
|
||||
errors. The error message stored will be \qkw{} if no error occurred.
|
||||
\apiend
|
||||
\vspace{-16pt}
|
||||
|
||||
\apiitem{"interp", <string>}
|
||||
\vspace{12pt}
|
||||
Overrides the texture interpolation method: \qkw{smartcubic} (the
|
||||
@@ -4068,6 +4247,14 @@ The first channel to look up from the texture map (default: 0).
|
||||
\apiend
|
||||
\vspace{-16pt}
|
||||
|
||||
\apiitem{"subimage", <int> \\
|
||||
"subimage", <string>}
|
||||
\vspace{12pt}
|
||||
Specify the subimage (by numerical index, or name) of the subimage
|
||||
within a multi-image texture file (default: subimage 0).
|
||||
\apiend
|
||||
\vspace{-16pt}
|
||||
|
||||
\apiitem{"fill", <float>}
|
||||
\vspace{12pt}
|
||||
The value to return for any channels that are requested,
|
||||
@@ -4101,6 +4288,15 @@ variable specified. This allows for RGBA lookups in a single call to
|
||||
\apiend
|
||||
\vspace{-16pt}
|
||||
|
||||
\apiitem{"errormessage", <stringvariable>}
|
||||
\vspace{12pt}
|
||||
If this option is supplied, any error messages generated by the texture
|
||||
system will be stored in the specified variable rather than issuing error
|
||||
calls to the renderer, thus leaving it up to the shader to handle any
|
||||
errors. The error message stored will be \qkw{} if no error occurred.
|
||||
\apiend
|
||||
\vspace{-16pt}
|
||||
|
||||
\apiend
|
||||
|
||||
\apiitem{\emph{type} \textbf{environment} (string filename, vector R, \pl) \\
|
||||
@@ -4175,6 +4371,15 @@ variable specified. This allows for RGBA lookups in a single call to
|
||||
\apiend
|
||||
\vspace{-16pt}
|
||||
|
||||
\apiitem{"errormessage", <stringvariable>}
|
||||
\vspace{12pt}
|
||||
If this option is supplied, any error messages generated by the texture
|
||||
system will be stored in the specified variable rather than issuing error
|
||||
calls to the renderer, thus leaving it up to the shader to handle any
|
||||
errors. The error message stored will be \qkw{} if no error occurred.
|
||||
\apiend
|
||||
\vspace{-16pt}
|
||||
|
||||
\apiend
|
||||
|
||||
|
||||
@@ -4304,6 +4509,15 @@ Note that the named point cloud will be created, if it does not yet
|
||||
exist in memory, and that it will be initialized by reading a point
|
||||
cloud from disk, if there is one matching the name.
|
||||
|
||||
Generally, the element type of the data arrays must match exactly the type
|
||||
of the point data attribute, or else you will get a runtime error. But there
|
||||
are two exceptions: (1) ``triple'' types (\color, \point, \vector, \normal)
|
||||
are considered interchangeable; and (2) it is legal to retrieve {\cf float}
|
||||
arrays (e.g., a point cloud attribute that is {\cf float[4]}) into a regular
|
||||
array of {\cf float}, and the results will simply be concatenated into the
|
||||
larger array (which must still be big enough, in total, to hold {\cf
|
||||
maxpoints} of the data type in the file).
|
||||
|
||||
\noindent Example:
|
||||
|
||||
\begin{code}
|
||||
@@ -4337,10 +4551,20 @@ in the following example:
|
||||
int indices[10];
|
||||
int n = pointcloud_search ("particles.ptc", P, r, 10,
|
||||
"index", indices);
|
||||
float temp[10];
|
||||
float temp[10]; // presumed to be "float" attribute
|
||||
float quaternions[40]; // presumed to be "float[4]" attribute
|
||||
int ok = pointcloud_get ("particles.ptc", indices, n,
|
||||
"temperature", temp);
|
||||
"temperature", temp,
|
||||
"quat", quaternions);
|
||||
\end{code}
|
||||
|
||||
As with {\cf pointcloud_search}, the element type of the data array must
|
||||
either be equivalent to the point cloud attribute being retrieved, or else
|
||||
when retrieving {\cf float} arrays (e.g., a point cloud attribute
|
||||
that is {\cf float[4]}) into a regular array of {\cf float}, and the
|
||||
results will simply be concatenated into the larger array (which must
|
||||
still be big enough, in total, to hold {\cf maxpoints} of the data type
|
||||
in the file).
|
||||
\apiend
|
||||
|
||||
|
||||
@@ -4510,7 +4734,7 @@ U, \\ \bigspc\bigspc float xalpha, float yalpha, float eta, int refract)}
|
||||
\indexapi{microfacet()}
|
||||
|
||||
Returns a \colorclosure that represents scattering on the
|
||||
surface using some microfacet distribution such as "beckmann" or "ggx" (as
|
||||
surface using some microfacet distribution such as \qkw{beckmann} or \qkw{ggx} (as
|
||||
described in Walter et al., ``Microfacet Models for Refraction through Rough
|
||||
Surfaces,'' Eurographics Symposium on Rendering, 2007).
|
||||
Both {\cf xalpha} and {\cf yalpha} control how rough the microstructure of the
|
||||
@@ -4526,7 +4750,7 @@ refractive ({\cf 1}) or both at once ({\cf 2}). The implementation must not rely
|
||||
The list of supported distributions will change from renderer to renderer, and
|
||||
also the behavior when an unsupported distribution is requested. It is up to the
|
||||
implementation to issue an error or to default to a supported one. Also it is
|
||||
expected that the alias "default" must work as a distribution in any renderer.
|
||||
expected that the alias \qkw{default} must work as a distribution in any renderer.
|
||||
|
||||
\apiend
|
||||
|
||||
@@ -4763,8 +4987,23 @@ Tables giving ``standardized'' names for different kinds of attributes may
|
||||
be found below. All renderers are expected to use the same names for these
|
||||
attributes, but are free to choose any names for additional attributes they
|
||||
wish to make queryable.
|
||||
|
||||
\apiend
|
||||
|
||||
\begin{table}[htbp]
|
||||
\caption{Names of standard attributes that may be retrieved.}\label{tab:stdattributes}
|
||||
\begin{tabular}{|p{1.8in}|p{0.6in}|p{2.8in}|}
|
||||
\hline
|
||||
{\bf Name} & {\bf Type} & {\bf Description} \\
|
||||
\hline
|
||||
{\cf "osl:version"} & {\cf int} & Major*10000 + Minor*100 + patch. \\
|
||||
{\cf "shader:shadername"} & {\cf string} & Name of the shader master. \\
|
||||
{\cf "shader:layername"} & {\cf string} & Name of the layer instance. \\
|
||||
{\cf "shader:groupname"} & {\cf string} & Name of the shader group. \\
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{table}
|
||||
|
||||
\begin{table}[htbp]
|
||||
\caption{Names of standard camera attributes that may be retrieved.
|
||||
If the {\cf getattribute()} function specifies an {\cf objectname} parameter
|
||||
@@ -4955,7 +5194,7 @@ int {\ce dict_find} (int nodeID, string query)}
|
||||
of a file containing the dictionary. (The system can easily
|
||||
distinguish between them.) XML dictionaries are currently
|
||||
supported, and additional formats may be supported in the future.
|
||||
The query is expressed in "XPath 1.0" syntax (or a reasonable subset
|
||||
The query is expressed in ``XPath 1.0'' syntax (or a reasonable subset
|
||||
therof).
|
||||
|
||||
The return value is a \emph{Node ID}, an opaque integer identifier
|
||||
@@ -5265,6 +5504,7 @@ nothing (empty, no token).
|
||||
\alt <ternary-expression>
|
||||
\alt <typecast-expression>
|
||||
\alt <variable-ref>
|
||||
\alt <compound-initializer>
|
||||
|
||||
<compound-expression> ::= <expression> \{ "," <expression> \}
|
||||
|
||||
@@ -5274,6 +5514,13 @@ nothing (empty, no token).
|
||||
|
||||
<variable-ref> ::= <identifier> <array-deref-opt>
|
||||
|
||||
<array-deref> ::= "[" <expression> "]"
|
||||
|
||||
<component-deref> ::= "[" <expression> "]"
|
||||
\alt "." <component-field>
|
||||
|
||||
<component-field> ::= "x" | "y" | "z" | "r" | "g" | "b"
|
||||
|
||||
<binary-op> ::= "*" | "/" | "\%"
|
||||
\alt "+" | "-"
|
||||
\alt "<<" | ">>"
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
% Please use or modify this at will.
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
% Copyright Contributors to the Open Shading Language project.
|
||||
% SPDX-License-Identifier: BSD-3-Clause
|
||||
% https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
|
||||
|
||||
%
|
||||
% Define typesetting commands for filenames and code
|
||||
%
|
||||
@@ -36,11 +41,11 @@
|
||||
\newenvironment{smallcode}{\small \renewcommand{\baselinestretch}{0.8} \verbatimtab}{\endverbatimtab \renewcommand{\baselinestretch}{1}}
|
||||
\newenvironment{tinycode}{\footnotesize \renewcommand{\baselinestretch}{0.75} \verbatimtab}{\endverbatimtab \renewcommand{\baselinestretch}{1}}
|
||||
|
||||
\begin{htmlonly}
|
||||
\renewenvironment{code}{\begin{verbatim}}{\end{verbatim}}
|
||||
\newenvironment{smallcode}{\begin{verbatim}}{\end{verbatim}}
|
||||
\newenvironment{tinycode}{\begin{verbatim}}{\end{verbatim}}
|
||||
\end{htmlonly}
|
||||
% \begin{htmlonly}
|
||||
% \renewenvironment{code}{\begin{verbatim}}{\end{verbatim}}
|
||||
% \newenvironment{smallcode}{\begin{verbatim}}{\end{verbatim}}
|
||||
% \newenvironment{tinycode}{\begin{verbatim}}{\end{verbatim}}
|
||||
% \end{htmlonly}
|
||||
|
||||
\newcommand{\includedcode}[1]{{\small \verbatimtabinput{#1}}}
|
||||
\newcommand{\smallincludedcode}[1]{{\small \renewcommand{\baselinestretch}{0.8} \verbatimtabinput{#1} \renewcommand{\baselinestretch}{1}}}
|
||||
@@ -76,15 +81,15 @@
|
||||
%end{latexonly}
|
||||
|
||||
|
||||
\begin{htmlonly}
|
||||
\newcommand{\apiitem}[1]{\medskip \noindent {\bf #1} \begin{quote}}
|
||||
\newcommand{\apiend}{\end{quote}}
|
||||
\def\halfspc{\begin{rawhtml} \end{rawhtml}}
|
||||
\def\spc{\halfspc\halfspc}
|
||||
\pagecolor[named]{White}
|
||||
\def\chapwidthbegin{\begin{rawhtml}<p><table cellspacing=1><tr><td width=550>\end{rawhtml}}
|
||||
\def\chapwidthend{\begin{rawhtml}</td></tr></table>\end{rawhtml}}
|
||||
\end{htmlonly}
|
||||
%\begin{htmlonly}
|
||||
%\newcommand{\apiitem}[1]{\medskip \noindent {\bf #1} \begin{quote}}
|
||||
%\newcommand{\apiend}{\end{quote}}
|
||||
%\def\halfspc{\begin{rawhtml} \end{rawhtml}}
|
||||
%\def\spc{\halfspc\halfspc}
|
||||
%\pagecolor[named]{White}
|
||||
%\def\chapwidthbegin{\begin{rawhtml}<p><table cellspacing=1><tr><td width=550>\end{rawhtml}}
|
||||
%\def\chapwidthend{\begin{rawhtml}</td></tr></table>\end{rawhtml}}
|
||||
%\end{htmlonly}
|
||||
|
||||
|
||||
\newcommand{\apibinding}[3]{\apiitem{#1\\[1ex]#2\\[1ex]#3}}
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
||||
<!-- Copyright Contributors to the Open Shading Language Project. -->
|
||||
|
||||
**osltoy**
|
||||
revision date: 30 Nov 2017
|
||||
|
||||
|
||||
|
||||
|
||||
_osltoy_ basics
|
||||
==================================================
|
||||
|
||||
`osltoy` is an interactive editor and realtime visualizer for OSL shaders.
|
||||
It is inspired by [Shadertoy](https://www.shadertoy.com/) by Inigo Quilez.
|
||||
But it uses a real VFX shading language!
|
||||
|
||||

|
||||
|
||||
The basic functionaity of `osltoy` is:
|
||||
|
||||
* Allow you to edit OSL shader source code.
|
||||
* Live and continuous rendering of an "image" that is the result of running
|
||||
your shader on each pixel of the image (pixel color is taken from the
|
||||
shader's parameter `output color Cout`.)
|
||||
|
||||
|
||||
## Command line
|
||||
|
||||
Launch `osltoy` from the command line:
|
||||
|
||||
`osltoy` [*options*]
|
||||
|
||||
Additional command line arguments:
|
||||
|
||||
`--help`
|
||||
: Print command line options and other help.
|
||||
|
||||
`-v`
|
||||
: Verbose mode. (Doesn't really do anything currently.)
|
||||
|
||||
`--res` *xres* *yres*
|
||||
: Specifies the resolution of the render window (default: 512 x 512).
|
||||
|
||||
`--threads` *n*
|
||||
: Specifies the number of simultaneous threads to use for shading. If not
|
||||
specified, it will use all your hardware cores.
|
||||
|
||||
*filename.osl*
|
||||
: If one or more filenames of shader source code are specified, they will
|
||||
be loaded into editor tabs upon startup.
|
||||
|
||||
|
||||
## osltoy Basics
|
||||
|
||||
First, let's launch `osltoy`:
|
||||
|
||||
```
|
||||
$ osltoy
|
||||
```
|
||||
|
||||

|
||||
This will start up a new `osltoy` session.
|
||||
On the right half of the GUI is a code editor window. Below the code editor
|
||||
is an area that will show you any compilation errors. The left half of the
|
||||
GUI will display the results of the shader (a checkerboard if no shader
|
||||
has been compiled yet). Below that is an area that will hold widgets to
|
||||
allow adjustment of shader parameter values.
|
||||
|
||||
At the very bottom of the app window is a status bar showing time, frames
|
||||
per second, and other status messages. At the very top of the app window
|
||||
(or, on MacOS, at the top of the screen) is a menu bar with the usual set of
|
||||
common operations.
|
||||
|
||||
### Loading and saving shaders
|
||||
|
||||
You can load a shader one of three ways:
|
||||
|
||||
1. Specify the filename of an existing shader when you launch the app:
|
||||
```
|
||||
osltoy test.osl
|
||||
```
|
||||
|
||||
2. From a blank window, load an existing shader by selecting the menu
|
||||
bar choice `File` --> `Open`, or hitting the hotkey `Ctrl-O` (on MacOS,
|
||||
⌘`-O`). This will present a file selection dialog.
|
||||
|
||||
3. Just start typing in the editor window.
|
||||
|
||||
You can save the edited shader with the menu bar `File` --> `Save`
|
||||
or the hotkey `Ctrl-S` (⌘`-S` on MacOS). If the file does not yet
|
||||
have a name, you will be presented with a file save dialog (as you will
|
||||
if you use `File` --> `Save As`).
|
||||
|
||||
!!! Note
|
||||
Every time we talk about a `Ctrl-`*key* combination, if you are on MacOS
|
||||
(OSX), that hotkey will be ⌘`-`*key*. This document won't awkwardly
|
||||
repeat this clarification for every command.
|
||||
|
||||
### Compiling shaders
|
||||
|
||||
When you have loaded or edited your OSL source code, you can compile the
|
||||
shader with menu `Tools` --> `Recompile shaders`, or by clicking the
|
||||
`Recompile` button below the source code editor widget, or by using the
|
||||
hotkey `Ctrl-R`.
|
||||
|
||||
!!! Warning
|
||||
`osltoy` won't compile a buffer that doesn't have a filename ending in
|
||||
`.osl`, and if you started with a blank window, it won't have a name at
|
||||
all until you save the first time.
|
||||
|
||||
In the compilation status window below the editor, you will either see
|
||||
an `Ok` message if the compiler succeeded, or the error output from the
|
||||
compiler, as illustrated here:
|
||||
|
||||

|
||||
|
||||
|
||||
!!! Warning
|
||||
`osltoy` appears to let you load or create multiple shaders, appearing
|
||||
in a tabbed editor. We'll get this working eventually (so you can edit
|
||||
whole shader groups and all the shaders that are in them), but currently
|
||||
only the shader in the first tab will be compiled and executed, so don't
|
||||
get confused by the non-functional parts of the interface.
|
||||
|
||||
|
||||
### Executing shaders and interactive changes
|
||||
|
||||
Once you compile the shader successfully, it will execute and display the
|
||||
results of shading a rectangle.
|
||||
|
||||

|
||||
|
||||
As soon as you recompile, the shader will be executed as quickly as possible
|
||||
and displayed as an image on the left, with shader parameter adjustment
|
||||
widgets below it.
|
||||
|
||||
Evey time you change a parameter value through its widget, the shader will
|
||||
automatically recompile and re-execute. If you edit the text of the shader,
|
||||
clicking the `Recompile` button or using the hotkey `Ctrl-R` will recompile
|
||||
and re-execute the shader.
|
||||
|
||||
|
||||
Rules of the game
|
||||
==================
|
||||
|
||||
## Shader inputs and state
|
||||
|
||||
The shader is executed on every pixel of an image (defaulting to a 512x512
|
||||
square, but you can change the resolution via a command line flag).
|
||||
|
||||
The `float u` and `v` global variables vary from 0 to 1 along the rectangle.
|
||||
|
||||
The `point P` global variable will be set to `(x,y,0)`, where `x` is the pixel
|
||||
horizontal coordinate (0 to xres-1 as it goes from left to right) and `y`
|
||||
is the pixel vertical coordinate (0 to yres-1 as it goes from top to bottom
|
||||
of the image).
|
||||
|
||||
The `float time` global variable contains the time (in seconds) since the
|
||||
last time the shader was recompiled. Making your shader change its behavior
|
||||
based on the `time` variable will make an animated shader.
|
||||
|
||||
## Shader outputs
|
||||
|
||||
The color displayed is taken from the shader output parameter that is
|
||||
declared like this:
|
||||
|
||||
```
|
||||
output color Cout = 0
|
||||
```
|
||||
|
||||
Whatever you place in that output will be the color displayed at each pixel
|
||||
of the output image.
|
||||
|
||||
!!! Note
|
||||
Your shader does not need to set `Ci` or deal with closures. The
|
||||
`osltoy` app is just for exploring pattern generation, not illumination.
|
||||
It doesn't actually have any notion of 3D geometry or lights.
|
||||
|
||||
|
||||
## Shader execution
|
||||
|
||||
If your shader does not reference the `time` variable in any way, it will
|
||||
only be executed once each time it recompiles. But if `time` appears in your
|
||||
shader, it will execute repeatedly, as quickly as possible, until you exit
|
||||
or recompile.
|
||||
|
||||
Shader execution will by default use enough threads to keep all your cores
|
||||
busy. The command line option `--threads` can be used to limit the number
|
||||
of cores (or to "over-thread").
|
||||
|
||||
|
||||
Caveats, limitations, and broken stuff
|
||||
========================
|
||||
|
||||
These are current limitations or breakages that we will fix over time.
|
||||
|
||||
* The GUI seems to let you open multiple editor tabs, but currently, the
|
||||
only one that will compile and execute is the *first* (farthest to the left
|
||||
tab that was loaded or saved under a name that ends in `".osl"`.
|
||||
|
||||
* We intend to add "Pause" and "Reset" buttons to control time.
|
||||
|
||||
* I tried to make the parameter adjustment widgets be clever about how
|
||||
quickly to modify the values, depending on their range. But I don't have
|
||||
it quite right. It's still being refined.
|
||||
|
||||
* There isn't yet have a way to get the shader itself to get information about
|
||||
external events such as mouse clicks or key presses, but that would be
|
||||
fun.
|
||||
|
||||
* There isn't yet a way for the shader to have *state* that can be computed,
|
||||
stored, then re-read when the shader executes on the next frame.
|
||||
|
||||
|
||||
Things to try
|
||||
=============
|
||||
|
||||
* Try this:
|
||||
|
||||
` osltoy ` *osl_install_directory*`/shaders/mandelbrot.osl`
|
||||
|
||||
* Use the global `time` variable to make animated patterns.
|
||||
|
||||
* Explore noise functions and other pattern generation interactively.
|
||||
|
||||
* Explore (by keeping an eye on the "FPS" reading at the bottom) what shader
|
||||
operations are fast and what is slow.
|
||||
|
||||
* Don't forget that `texture()` calls work as expected in shadertoy!
|
||||
|
||||
* `osltoy` is a great tool for leaning or *teaching* OSL.
|
||||
|
||||
* The actual "geometry" is just a rectangle, but like with Shadertoy,
|
||||
you can make patterns that *look like* by implementing a simple ray tracer
|
||||
in the shader itself, or using other clever tricks.
|
||||
|
||||
* Look at the many examples on [Shadertoy](https://www.shadertoy.com/)
|
||||
for inspiration!
|
||||
|
||||
* Make crazy stuff and post the shaders to the `osl-dev` mail list!
|
||||
|
||||
|
||||
|
||||
<!-- Markdeep: --><style class="fallback">body{visibility:hidden;white-space:pre;font-family:monospace}</style><script src="markdeep.min.js"></script><script src="https://casual-effects.com/markdeep/latest/markdeep.min.js?"></script><script>window.alreadyProcessedMarkdeep||(document.body.style.visibility="visible")</script>
|
||||
<link rel="stylesheet" href="docs.css?">
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
% SPDX-License-Identifier: CC-BY-4.0
|
||||
% Copyright Contributors to the Open Shading Language Project.
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% Style developed by Larry Gritz for various books and technical
|
||||
% manuals. Please distribute freely, there's nothing special here.
|
||||
|
||||