OSL building with static openimageio problem (OSX)

142 views
Skip to first unread message

Dalai Felinto

unread,
Sep 16, 2012, 9:32:02 PM9/16/12
to osl...@googlegroups.com, Jens Verwiebe
Hello there,

As the topic says, I'm trying to build OSL with static oiio.
Although the building goes fine, when it gets to compile the shaders
it fails due to unknown data struct:

"../shaders/stdosl.h:493: error: No matching function call to 'area (unknown)'"

The is related to the symtab. If I run $:oslc -d glass.osl I get:
Symbol table:
P : unknown
I : unknown
N : unknown
Ng : unknown
u : unknown
v : unknown
dPdu : unknown
dPdv : unknown
Ps : unknown
Ci : closure color
time : unknown
dtime : unknown
dPdtime : unknown
(. . .)


While with dynamic linking I get:
Symbol table:
P : point
I : vector
N : normal
Ng : normal
u : float
v : float
dPdu : vector
dPdv : vector
Ps : point
Ci : closure color
time : float
dtime : float
dPdtime : vector
(. . . )



There is a chance the problem is Mac exclusive. I'm trying to use
either osl (with oiio dynamic or static) to compile Blender. While the
osl with dynamic oiio works fine as a standalone (e.g., going through
the test suite files), it fails when used to compile Blender shaders
while building it. The error also seems related to the 'globals', but
it should be easy to address the error outside Blender first.


Thanks,
Dalai


Reference Links/Full error messages:
* output of oslc -d with static oiio:
http://www.pasteall.org/35294

* output of oslc -d with static oiio:
http://www.pasteall.org/35295

* git diff of my osl base code (using a patch from Jens Verwiebe for
the static linking, plus a patch to quite bison warning and other
small things)
http://www.pasteall.org/35301/diff

Dalai Felinto

unread,
Sep 18, 2012, 3:39:57 AM9/18/12
to osl...@googlegroups.com, Jens Verwiebe
Some followup:

If I re-set the values of the Symbols of the global table it builds fine:
http://www.pasteall.org/35356/diff

This is a terrible hack though. And it doesn't solve my real problem that is to link osl with Blender (the problem there seems to also be related to TypeDesc). So I would really appreciate any helps towards finding what may be wrong with the linking in osx.

Thanks,
Dalai

Lukas Tönne

unread,
Oct 6, 2012, 5:35:53 AM10/6/12
to osl...@googlegroups.com, Jens Verwiebe
This seems to be some sort of "static initialization fiasco". Luckily it is quite simple to fix:


The "blender-fixes" branch is used to collect all the little solutions for issues we're coming across during static OSL compile for Blender. I hope these can eventually be merged upstream (will make a proper pull request when everything is sorted out).

Regards,
Lukas

Dalai Felinto

unread,
Oct 6, 2012, 10:05:28 AM10/6/12
to osl...@googlegroups.com, Jens Verwiebe

Hi Lukas,
Did you run into this problem in Linux as well?

For OSX the problem fixed itself when Jens got osl to build static osl with oiio and llvm static as well (and using forceload on CMake).

Cheers,
Dalai

--
You received this message because you are subscribed to the Google Groups "OSL Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/osl-dev/-/PrbPT57AzCIJ.
To post to this group, send email to osl...@googlegroups.com.
To unsubscribe from this group, send email to osl-dev+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/osl-dev?hl=en.

Lukas Tönne

unread,
Oct 6, 2012, 10:43:09 AM10/6/12
to osl...@googlegroups.com
Yes, same issue on linux.

It would probably also work by adding an equivalent to -force_load
(afaik on linux should be --whole-archive), but this solution seems a
bit more elegant (platform independent) and just as valid. Can change
it if there are objections by OSL devs of course.
Reply all
Reply to author
Forward
0 new messages