Re: Compiling OpenShadingLanguage under Windows

Chris Foster <chri...@...>

On Mon, Jan 18, 2010 at 2:51 PM, Wormszer <worm...@...> wrote:
My generated code issues were from VS having not rebuilt the files with the
new flex.

So now I am just left with a bunch of missing math functions.
It looks likes visual studios implementation of math. or cmath is missing a
lot of the functions.

Things like
log2f, logbf, truncf, etc
These are all C99 math functions, not available on windows I guess... I had a
look in boost (they implement some of the C99 functions there) but
unfortunately these ones aren't implemented yet :-(

It may be best to implement versions of these in a compatibility header for
platforms which don't have full C99 support yet. (Maybe there is a handy C99
math library under an appropriate license from which the functions can be

and defines like M_E, M_1_PI, M_PI_2 etc.
The M_PI etc constants are nonstandard, but may be obtained on windows by
#defining _USE_MATH_DEFINES before you include math.h.

See if you run into the same thing and then im not sure where to go from

I guess we should get some feedback from others, maybe they are available
somewhere else, or I could be missing something.
When you've got this figured out, it's best to submit a patch and one of the
developers will check it in, possibly after a few improvements have been made.

AFAIK there's no official guide yet for how to submit patches, but I'm going
to take a guess that the procedure won't be too much different from Larry's
other open source project, OIIO, apart from the use of
for code reviews rather than the mailing list:


Join { to automatically receive all group messages.