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

Compiling on Windows #2

Open
varomix opened this issue Aug 19, 2020 · 6 comments
Open

Compiling on Windows #2

varomix opened this issue Aug 19, 2020 · 6 comments
Labels
build Issues around building

Comments

@varomix
Copy link

varomix commented Aug 19, 2020

I made a more general issue cause I this is going to take some time to get working

after a while I got cmake to generate a solution but now I have ton of linking errors, mostly I think are coming from OIIO
my cmake command got really complicated also, maybe I am doing something wrong

cmake -DUSD_ROOT="P:/HDCycles/USD" -DCYCLES_ROOT="P:/HDCycles/cycles" -DCYCLES_LIBRARY_DIR="P:/HDCycles/cycles/build/lib/Release" -DCYCLES_INCLUDE_DIRS="P:/HDCycles/cycles/src" -DBOOST_ROOT="E:/apps/boost_1_65_1/lib64-msvc-14.1" -DBOOST_LIBRARYDIR="E:/apps/boost_1_65_1/lib64-msvc-14.1" -DOPENJPEG_LIBRARY="P:/HDCycles/lib/win64_vc15/openjpeg/lib/openjp2.lib" -DOPENJPEG_INCLUDE_DIR="P:/HDCycles/lib/win64_vc15/openjpeg/include" -DJPEG_LIBRARY="P:/HDCycles/lib/win64_vc15/jpeg/lib/libjpeg.lib" -DJPEG_INCLUDE_DIR="P:/HDCycles/lib/win64_vc15/jpeg/include" -DPNG_LIBRARY="P:/HDCycles/lib/win64_vc15/png/lib/libpng.lib" -DPNG_PNG_INCLUDE_DIR="P:/HDCycles/lib/win64_vc15/png/include" -DTIFF_LIBRARY="P:/HDCycles/lib/win64_vc15/tiff/lib/libtiff.lib" -DTIFF_INCLUDE_DIR="P:/HDCycles/lib/win64_vc15/tiff/include" -DOIIO_BASE_DIR="P:/HDCycles/lib/win64_vc15/OpenImageIO" -DOIIO_INCLUDE_DIRS="P:/HDCycles/lib/win64_vc15/OpenImageIO/include" -DOIIO_LIBRARIES="P:/HDCycles/lib/win64_vc15/OpenImageIO/lib/OpenImageIO.lib" -DOPENVDB_INCLUDE_DIR="P:/HDCycles/lib/win64_vc15/openvdb/include" -DOPENVDB_LIBRARY="P:/HDCycles/lib/win64_vc15/openvdb/lib/openvdb.lib" -DCYCLES_LIBRARIES="P:/HDCycles/cycles/build/lib/Release/cycles_render.lib" ..

after that a solution is generated and I get all this linking errors

6>OpenImageIO.lib(exroutput.obj) : error LNK2019: unresolved external symbol "public: static char const * __cdecl Imf_2_4::TypedAttribute<double>::staticTypeName(void)" (?staticTypeName@?$TypedAttribute@N@Imf_2_4@@SAPEBDXZ) referenced in function "public: virtual char const * __cdecl Imf_2_4::TypedAttribute<double>::typeName(void)const " (?typeName@?$TypedAttribute@N@Imf_2_4@@UEBAPEBDXZ) 6>OpenImageIO.lib(exroutput.obj) : error LNK2019: unresolved external symbol "public: __cdecl Imf_2_4::OutputPart::OutputPart(class Imf_2_4::MultiPartOutputFile &,int)" (??0OutputPart@Imf_2_4@@QEAA@AEAVMultiPartOutputFile@1@H@Z) referenced in function "public: virtual bool __cdecl OpenImageIO_v2_1::OpenEXROutput::open(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class OpenImageIO_v2_1::ImageSpec const &,enum OpenImageIO_v2_1::ImageOutput::OpenMode)" (?open@OpenEXROutput@OpenImageIO_v2_1@@UEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVImageSpec@2@W4OpenMode@ImageOutput@2@@Z) 6>OpenImageIO.lib(exroutput.obj) : error LNK2019: unresolved external symbol "public: void __cdecl Imf_2_4::OutputPart::setFrameBuffer(class Imf_2_4::FrameBuffer const &)" (?setFrameBuffer@OutputPart@Imf_2_4@@QEAAXAEBVFrameBuffer@2@@Z) referenced in function "public: virtual bool __cdecl OpenImageIO_v2_1::OpenEXROutput::write_scanline(int,int,struct OpenImageIO_v2_1::TypeDesc,void const *,__int64)" (?write_scanline@OpenEXROutput@OpenImageIO_v2_1@@UEAA_NHHUTypeDesc@2@PEBX_J@Z) 6>OpenImageIO.lib(exroutput.obj) : error LNK2019: unresolved external symbol "public: void __cdecl Imf_2_4::OutputPart::writePixels(int)" (?writePixels@OutputPart@Imf_2_4@@QEAAXH@Z) referenced in function "public: virtual bool __cdecl OpenImageIO_v2_1::OpenEXROutput::write_scanline(int,int,struct OpenImageIO_v2_1::TypeDesc,void const *,__int64)" (?write_scanline@OpenEXROutput@OpenImageIO_v2_1@@UEAA_NHHUTypeDesc@2@PEBX_J@Z) 6>OpenImageIO.lib(exroutput.obj) : error LNK2019: unresolved external symbol "public: static char const * __cdecl Imf_2_4::TypedAttribute<class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >::staticTypeName(void)" (?staticTypeName@?$TypedAttribute@V?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Imf_2_4@@SAPEBDXZ) referenced in function "public: virtual char const * __cdecl Imf_2_4::TypedAttribute<class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >::typeName(void)const " (?typeName@?$TypedAttribute@V?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Imf_2_4@@UEBAPEBDXZ) 6>OpenImageIO.lib(exroutput.obj) : error LNK2001: unresolved external symbol "public: virtual void __cdecl Imf_2_4::TypedAttribute<class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >::writeValueTo(class Imf_2_4::OStream &,int)const " (?writeValueTo@?$TypedAttribute@V?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Imf_2_4@@UEBAXAEAVOStream@2@H@Z) 6>OpenImageIO.lib(exroutput.obj) : error LNK2001: unresolved external symbol "public: virtual void __cdecl Imf_2_4::TypedAttribute<class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >::readValueFrom(class Imf_2_4::IStream &,int,int)" (?readValueFrom@?$TypedAttribute@V?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Imf_2_4@@UEAAXAEAVIStream@2@HH@Z) 6>OpenImageIO.lib(exroutput.obj) : error LNK2019: unresolved external symbol "public: __cdecl Imf_2_4::TiledOutputPart::TiledOutputPart(class Imf_2_4::MultiPartOutputFile &,int)" (??0TiledOutputPart@Imf_2_4@@QEAA@AEAVMultiPartOutputFile@1@H@Z) referenced in function "public: virtual bool __cdecl OpenImageIO_v2_1::OpenEXROutput::open(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class OpenImageIO_v2_1::ImageSpec const &,enum OpenImageIO_v2_1::ImageOutput::OpenMode)" (?open@OpenEXROutput@OpenImageIO_v2_1@@UEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVImageSpec@2@W4OpenMode@ImageOutput@2@@Z) 6>OpenImageIO.lib(exroutput.obj) : error LNK2019: unresolved external symbol "public: void __cdecl Imf_2_4::TiledOutputPart::setFrameBuffer(class Imf_2_4::FrameBuffer const &)" (?setFrameBuffer@TiledOutputPart@Imf_2_4@@QEAAXAEBVFrameBuffer@2@@Z) referenced in function "public: virtual bool __cdecl OpenImageIO_v2_1::OpenEXROutput::write_tiles(int,int,int,int,int,int,struct OpenImageIO_v2_1::TypeDesc,void const *,__int64,__int64,__int64)" (?write_tiles@OpenEXROutput@OpenImageIO_v2_1@@UEAA_NHHHHHHUTypeDesc@2@PEBX_J22@Z) 6>OpenImageIO.lib(exroutput.obj) : error LNK2019: unresolved external symbol "public: void __cdecl Imf_2_4::TiledOutputPart::writeTiles(int,int,int,int,int,int)" (?writeTiles@TiledOutputPart@Imf_2_4@@QEAAXHHHHHH@Z) referenced in function "public: virtual bool __cdecl OpenImageIO_v2_1::OpenEXROutput::write_tiles(int,int,int,int,int,int,struct OpenImageIO_v2_1::TypeDesc,void const *,__int64,__int64,__int64)" (?write_tiles@OpenEXROutput@OpenImageIO_v2_1@@UEAA_NHHHHHHUTypeDesc@2@PEBX_J22@Z) 6>OpenImageIO.lib(imagebufalgo_xform.obj) : error LNK2019: unresolved external symbol "public: virtual __cdecl Iex_2_4::MathExc::~MathExc(void)" (??1MathExc@Iex_2_4@@UEAA@XZ) referenced in function "public: virtual void * __cdecl Iex_2_4::MathExc::scalar deleting destructor'(unsigned int)" (??_GMathExc@Iex_2_4@@UEAAPEAXI@Z)
6>OpenImageIO.lib(texturesys.obj) : error LNK2001: unresolved external symbol "public: virtual __cdecl Iex_2_4::MathExc::~MathExc(void)" (??1MathExc@Iex_2_4@@UEAA@XZ)
6>OpenImageIO.lib(imagebufalgo_xform.obj) : error LNK2019: unresolved external symbol "public: __cdecl Imath_2_4::SingMatrixExc::SingMatrixExc(char const *)" (??0SingMatrixExc@Imath_2_4@@qeaa@PEBD@Z) referenced in function "public: class Imath_2_4::Matrix33 __cdecl Imath_2_4::Matrix33::inverse(bool)const " (?inverse@?$Matrix33@M@Imath_2_4@@qeba?AV12@_N@Z)
6>OpenImageIO.lib(texturesys.obj) : error LNK2001: unresolved external symbol "public: __cdecl Imath_2_4::SingMatrixExc::SingMatrixExc(char const *)" (??0SingMatrixExc@Imath_2_4@@qeaa@PEBD@Z)
6>OpenImageIO.lib(imagebufalgo_xform.obj) : error LNK2019: unresolved external symbol "public: virtual __cdecl Imath_2_4::SingMatrixExc::~SingMatrixExc(void)" (??1SingMatrixExc@Imath_2_4@@UEAA@XZ) referenced in function "public: virtual void * __cdecl Imath_2_4::SingMatrixExc::scalar deleting destructor'(unsigned int)" (??_GSingMatrixExc@Imath_2_4@@UEAAPEAXI@Z) 6>OpenImageIO.lib(texturesys.obj) : error LNK2001: unresolved external symbol "public: virtual __cdecl Imath_2_4::SingMatrixExc::~SingMatrixExc(void)" (??1SingMatrixExc@Imath_2_4@@UEAA@XZ) 6>P:\HDCycles\hdcycles\build\plugin\hdCycles\Release\hdCycles.dll : fatal error LNK1120: 217 unresolved externals 6>Done building project "hdCycles.vcxproj" -- FAILED. 7>------ Build started: Project: ALL_BUILD, Configuration: Release x64 ------ 7>Building Custom Rule P:/HDCycles/hdcycles/CMakeLists.txt ========== Build: 6 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

just a small sample, will add the oiio libs manually in VS but I'm thinking I might be complicating this too much because I never compile stuff on windows

thanks for any pointers 😆 pointers!!

@Vochsel
Copy link
Contributor

Vochsel commented Aug 19, 2020

Will have to take a bit more of a look later, but from a first glance it looks like you're not linking against OpenImageIO_Util.lib at any point. Also, are you building this for standalone usd or for houdini?

Here's a list of specific versions I'm linking against on windows for USD-19.11
python-2
tbb-2017
boost-1.65.1
oiio-1.7.14
openexr-2.4.0
ocio-1.1.0
openvdb-7.0.0
opensubdiv-3.4.3
glew-1.1.0
libpng-1.6.35
libtiff-2017.11.18
openjpeg-2.3
zlib-1.2.11

That might be of some help.

@varomix
Copy link
Author

varomix commented Aug 19, 2020

I did not know I had to build it for standalone or Houdini, I do want to use it in Houdini, that's my goal.
the libraries I am using I think are newer cause I'm using the ones precompiled for Cycles,
I'll try with this specific versions

@Vochsel
Copy link
Contributor

Vochsel commented Aug 19, 2020

Then in that case you'll need some slightly different versions. Because Houdini comes with it's own build of USD, you must link against that specifically.

The only difference in libraries should be to use oiio-1.8.13.
You will need to link against Houdini libraries however. The FindHoudini.cmake file in cmake/modules should point you in the right direction of houdini environment variables.

@trebconnell
Copy link
Contributor

Just an FYI I'm attempting a Windows build as well... I'm trying to get it to work with Usd v20.08 (latest), VS2019, Python3, Windows.

I'm hoping to have hdCycles reference only libraries that are already downloaded by Cycles or Usd.

I don't know yet whether this will be prohibitively difficult to make work... We'll see.

@trebconnell
Copy link
Contributor

I got this working... PR's incoming to fix a few issues I hit. Wasn't terribly hard fortunately.

@bfloch bfloch added the build Issues around building label Aug 21, 2020
@Kif11
Copy link

Kif11 commented Mar 23, 2021

I don't have much knowledge of building from source. Can someone share prebuild binary for Windows, Houdini 18.5?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues around building
Projects
None yet
Development

No branches or pull requests

5 participants