Re: Compiling OpenShadingLanguage under Windows
Wormszer <worm...@...>
Ok I was able to get
toggle quoted message
Show quoted text
oslquery oslinfo oslcomp oslc all to build. I am still working on oslexec Here is what I had to change to get it to build, see if these changes work for you or match what you figured out. oslquery ============================================================== Add include lib path for tbb lib. I had to change class DLLPUBLIC OSLQuery { to class DLLEXPORT OSLQuery { I was having an issue where the __declspec(dllimport) was not allowing nparams to be called from the OSOReaderQuery class. I think this possibly has something to do with dllimport and inline functions. I have not used dllimport when not importing from a library and from some quick reading i didn't see anything that stuck out as a possible issue other than inlining. oslinfo ============================================================== Add include lib path for tbb lib. oslcomp ============================================================== Add include lib path for tbb lib. I was having an issue with some const operator() calls. Digging in to the code the fix i found was here in ustring.h located in the OIIO includes I had to add a const version of the hash/comparison operator. The non const version could probably be removed. class ustringHash #ifdef _WIN32 : public hash_compare<ustring> #endif { public: size_t operator() (const ustring &s) const { return s.hash(); } #ifdef _WIN32 bool operator() (const ustring &a, const ustring &b) { return strcmp (a.c_str(), b.c_str()) < 0; } bool operator() (const ustring &a, const ustring &b) const { return strcmp (a.c_str(), b.c_str()) < 0; } #endif }; That should allow for oslcomp to build. But there were no symbols being exported from the library, so no lib was being generated. So I changed oslcomp.h to export the OSLCompiler class borrowing the exports.h from the other libraries. And a lib file is now generated. #ifndef OSLCOMP_H #define OSLCOMP_H #include "export.h" #ifdef OSL_NAMESPACE namespace OSL_NAMESPACE { #endif namespace OSL { class DLLEXPORT OSLCompiler { public: oslc ============================================================== export symbols from oslcomp library <unistd> ============================================================== I use the following <unistd> file for the projects that need it. #ifndef __STRICT_ANSI__ #include <io.h> #include <process.h> #define F_OK 0 #define R_OK 4 #define W_OK 2 #define X_OK 1 #endif CMAKE ============================================================== And there were various other CMake tweaks i had to make as well to get it to generate the project correctly and find some of the libraries. I think the only change i was unsure why i had to make was I had to change the libsxxxx projects from LIBRARY to ARCHIVE. I'm not sure why. oslexec ============================================================== I am getting a lot of errors relating to the generated code and a ton of missing math functions it looks like. I will dig into this project next. And then to see if it works after all this. Let me know where you get. Jeremy On Sun, Jan 17, 2010 at 7:18 PM, Wormszer <worm...@...> wrote: Thanks Oleg, |
|