Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up Windows build in our CI #1860

Open
lgritz opened this issue Sep 7, 2024 · 5 comments
Open

Set up Windows build in our CI #1860

lgritz opened this issue Sep 7, 2024 · 5 comments
Labels
build / testing / port / CI Affecting the build system, tests, platform support, porting, or continuous integration. Dev Days ASWF Dev Days suitable project good first issue Good one-day project for beginners without much knowledge of the code base help wanted A task that is desired, but needs somebody to commit the effort to implement it. windows Problems specific to MS Windows OS

Comments

@lgritz
Copy link
Collaborator

lgritz commented Sep 7, 2024

Our CI doesn't actually build and test on Windows. This causes no end of despair.

How hard can it be? You don't really need to know anything about OSL internals or even C++ programming. It's mainly about wrangling builds and knowing how such things are done on Windows. Maybe it's even a good Dev Days project?

OpenImageIO's build and CI system is basically the same as OSL's, and it has Windows builds in its CI, so that should provide much of the template (and existence proof) for how this can be done. Probably the hardest part is that unlike OIIO, OSL will need LLVM installed as a dependency.

@lgritz lgritz added build / testing / port / CI Affecting the build system, tests, platform support, porting, or continuous integration. good first issue Good one-day project for beginners without much knowledge of the code base windows Problems specific to MS Windows OS Dev Days ASWF Dev Days suitable project labels Sep 7, 2024
@awesomebil
Copy link

Hello I would like to look into tackling this issue, I am a new developer and would just like to request some clarification. If I understand correctly the current build and install does not work on Windows and the goal is to get it working on Windows? Or am I missing something since it seems like according to the documentation building and testing on Windows should be possible as it is listed as supported although I have not actually tried to build the project on a Windows machine.

@lgritz
Copy link
Collaborator Author

lgritz commented Sep 8, 2024

We know that the software can build and run on Windows. But our project's GHA-based CI does not build and test on Windows. That is what we need to fix.

@lgritz lgritz added the help wanted A task that is desired, but needs somebody to commit the effort to implement it. label Sep 10, 2024
@N8icuss
Copy link

N8icuss commented Nov 19, 2024

Hi I'm currently trying to get osl to build and run on a Windows 10 virtual machine using the instructions that lead to installing with the "build_osl.bat release" command. Is that what you are refering to by GHA-based CI? Anyway I can make a check of anything that deviates from/adds to that set of instructions in order to get it to compile and build osl on Windows 10, if that's what you are wanting

@N8icuss
Copy link

N8icuss commented Dec 6, 2024

Hi, been working on this Issue. I updated some of the dependencies that automatically get downloaded by the file build_osl.py, as well as needed to download some additional ones externally (not listed in the ReadMe). I'm at the point where it starts to build OSL in the Madoodia folder. OSL builds oslcomp.dll, oslnoise.dll and oslquery.dll, oslc.exe, but then I run into an error when it tries to build oslexec.dll. This is the error I get:

"Creating library C:/madoodia/sdks/osl_release/build/osl/lib/Release/oslexec.lib and object C:/madoodia/sdks/osl_release/build/osl/lib/Release/oslexec.exp
master.obj : error LNK2019: unresolved external symbol "public: __cdecl OSL_v1_14_3::OSLCompiler::OSLCompiler(class OpenImageIO_v2_6_2::ErrorHandler *)" (??0OSLCompiler@OSL_v1_14_3@@qeaa@PEAVErrorHandler@OpenImageIO_v2_6_2@@@z) referenced in function "public: void __cdecl OSL_v1_14_3::OSLCompiler::`default constructor closure'(void)" (??_FOSLCompiler@OSL_v1_14_3@@QEAAXXZ) [C:\madoodia\sdks\osl_release\build\osl\src\liboslexec\oslexec.vcxproj]
runtimeoptimize.obj : error LNK2001: unresolved external symbol "public: __cdecl OSL_v1_14_3::OSLCompiler::OSLCompiler(class OpenImageIO_v2_6_2::ErrorHandler *)" (??0OSLCompiler@OSL_v1_14_3@@qeaa@PEAVErrorHandler@OpenImageIO_v2_6_2@@@z) [C:\madoodia\sdks\osl_release\build\osl\src\liboslexec\oslexec.vcxproj]
llvm_instance.obj : error LNK2001: unresolved external symbol "public: __cdecl OSL_v1_14_3::OSLCompiler::OSLCompiler(class OpenImageIO_v2_6_2::ErrorHandler *)" (??0OSLCompiler@OSL_v1_14_3@@qeaa@PEAVErrorHandler@OpenImageIO_v2_6_2@@@z) [C:\madoodia\sdks\osl_release\build\osl\src\liboslexec\oslexec.vcxproj]
symtab.obj : error LNK2001: unresolved external symbol "public: __cdecl OSL_v1_14_3::OSLCompiler::OSLCompiler(class OpenImageIO_v2_6_2::ErrorHandler *)" (??0OSLCompiler@OSL_v1_14_3@@qeaa@PEAVErrorHandler@OpenImageIO_v2_6_2@@@z) [C:\madoodia\sdks\osl_release\build\osl\src\liboslexec\oslexec.vcxproj]
C:\madoodia\sdks\osl_release\build\osl\bin\Release\oslexec.dll : fatal error LNK1120: 1 unresolved externals [C:\madoodia\sdks\osl_release\build\osl\src\liboslexec\oslexec.vcxproj]"

I'm still looking into this but this has stumped me for a good bit. I ended up updating OpenImageIO to v2.6.2.0-dev since that is the one where the need for the boost dependency was removed. Because I was having so many issues trying to get a version of boost to work with the previous version of OpenImageIO that was on build_osl.py.

Anyway any help would be appreciated. A lot of this stuff has been pretty new to me coding wise, but I've been trying my best!

@N8icuss
Copy link

N8icuss commented Dec 17, 2024

Hi, I went back figured out how to get boost to build correctly, realized I needed to specify what msvc version I was using. Anyway after doing so I ended up only updating OpenImageIO and OpenEXR to slightly newer versions than what was listed in the original build_osl.py file because OSL was looking for Imath, but couldn't find it in ILMBase. So wanted to use a version of OpenEXR when Imath was seperated from it, and then add the same version of Imath as OpenEXR. I did so and got it to build, but again now with a different OpenImageIO version I still run into this same error:

Creating library C:/madoodia/sdks/osl_release/build/OpenShadingLanguage/lib/Release/oslexec.lib and object C:/madoodia/sdks/osl_release/build/OpenShadingLanguage/lib/Release/oslexec.exp
master.obj : error LNK2019: unresolved external symbol "public: __cdecl OSL_v1_14_3::OSLCompiler::OSLCompiler(class OpenImageIO_v2_5::ErrorHandler *)" (??0OSLCompiler@OSL_v1_14_3@@qeaa@PEAVErrorHandler@OpenImageIO_v2_5@@@z) referenced in function "public: void __cdecl OSL_v1_14_3::OSLCompiler::`default constructor closure'(void)" (??_FOSLCompiler@OSL_v1_14_3@@QEAAXXZ) [C:\madoodia\sdks\osl_release\build\OpenShadingLanguage\src\liboslexec\oslexec.vcxproj]
runtimeoptimize.obj : error LNK2001: unresolved external symbol "public: __cdecl OSL_v1_14_3::OSLCompiler::OSLCompiler(class OpenImageIO_v2_5::ErrorHandler *)" (??0OSLCompiler@OSL_v1_14_3@@qeaa@PEAVErrorHandler@OpenImageIO_v2_5@@@z) [C:\madoodia\sdks\osl_release\build\OpenShadingLanguage\src\liboslexec\oslexec.vcxproj]
llvm_instance.obj : error LNK2001: unresolved external symbol "public: __cdecl OSL_v1_14_3::OSLCompiler::OSLCompiler(class OpenImageIO_v2_5::ErrorHandler *)" (??0OSLCompiler@OSL_v1_14_3@@qeaa@PEAVErrorHandler@OpenImageIO_v2_5@@@z) [C:\madoodia\sdks\osl_release\build\OpenShadingLanguage\src\liboslexec\oslexec.vcxproj]
symtab.obj : error LNK2001: unresolved external symbol "public: __cdecl OSL_v1_14_3::OSLCompiler::OSLCompiler(class OpenImageIO_v2_5::ErrorHandler *)" (??0OSLCompiler@OSL_v1_14_3@@qeaa@PEAVErrorHandler@OpenImageIO_v2_5@@@z) [C:\madoodia\sdks\osl_release\build\OpenShadingLanguage\src\liboslexec\oslexec.vcxproj]
C:\madoodia\sdks\osl_release\build\OpenShadingLanguage\bin\Release\oslexec.dll : fatal error LNK1120: 1 unresolved externals [C:\madoodia\sdks\osl_release\build\OpenShadingLanguage\src\liboslexec\oslexec.vcxproj]

I tried also adding and setting the flags: "-DLINKSTATIC=ON", "-DBUILD_SHARED_LIBS=ON" to OpenImageIO but this didn't make a difference. I don't understand why this error persists. I'm also using OpenImageIO v2_5_11. So I know in the Install file for OSL it says it will work with v2_5, but wanted to check and make sure that if it's at the tail end of it, there wouldn't be issues (I wouldn't believe so, since this is the version that works with Blender currently).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build / testing / port / CI Affecting the build system, tests, platform support, porting, or continuous integration. Dev Days ASWF Dev Days suitable project good first issue Good one-day project for beginners without much knowledge of the code base help wanted A task that is desired, but needs somebody to commit the effort to implement it. windows Problems specific to MS Windows OS
Projects
None yet
Development

No branches or pull requests

3 participants