Compiling on Windows

Discussion related to the LuxCore functionality, implementations and API.
gecko
Posts: 31
Joined: Mon Jan 01, 2018 11:10 pm

Re: BlendLuxCore Development

Post by gecko »

Ok, so I'm a little excited to play around with the new LuxCore in spite of the Blender bug. I know enough about coding and rendering to be dangerous, but maybe not enough to be directly useful (we'll see how adventurous I get)... but I can at least test things and provide intelligent feedback :) In the meantime I thought I was all set up to compile the latest version from GitHub, but I seem to have hit a few snags. Forgive me for the noob questions...
  • The WindowsCompile Readme says to use Visual Studio (Express) 2013's "x64 Native Tools Command Prompt". VS Express 2013 only comes in an x86 version and thus doesn't have an x64 native command prompt. The only Community version of Visual Studio 2013 I could find in 64-bit was Visual Studio Team Foundation Server (will this work??). Is there something special about the 2013 version of VS that is required? (see point below)
  • I tried installing VS 2017 which is readily available in 64-bit. When I run cmake-build-x64.bat I get a "Fatal Error: CMake not found". The only things I can think of that might be a little abnormal in my setup are that I'm using VS 2017, and my LuxCoreRender root directory is not on the same physical drive that VS is installed on. The error suggests that I haven't cloned the repositories correctly, but I'm quite certain that part is correct.
  • Once I manage to get this compiled, I should have 2 sets of files - a Blender addon, and a rendering engine right? Is the addon standalone (eg use Blender's "install from file"), or do I overwrite part of my existing LuxBlend installation, or something else entirely?
  • For the rendering engine, does this need to be installed / registered with the Windows file system, or do I just point the Blender addon to the right location and it runs in place?
Thanks in advance, and if this stuff is already answered somewhere just point me in the right direction. I tried to do my homework, but didn't find much documentation yet (understandably).
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: BlendLuxCore Development

Post by Dade »

gecko wrote: Tue Jan 02, 2018 4:06 pm Ok, so I'm a little excited to play around with the new LuxCore in spite of the Blender bug. I know enough about coding and rendering to be dangerous, but maybe not enough to be directly useful (we'll see how adventurous I get)... but I can at least test things and provide intelligent feedback :)
Welcome :D
gecko wrote: Tue Jan 02, 2018 4:06 pm In the meantime I thought I was all set up to compile the latest version from GitHub, but I seem to have hit a few snags. Forgive me for the noob questions...

The WindowsCompile Readme says to use Visual Studio (Express) 2013's "x64 Native Tools Command Prompt". VS Express 2013 only comes in an x86 version and thus doesn't have an x64 native command prompt. The only Community version of Visual Studio 2013 I could find in 64-bit was Visual Studio Team Foundation Server (will this work??). Is there something special about the 2013 version of VS that is required? (see point below)
I have installed VS2013 a lot of time ago but when I did, there were 2 versions, a normal (32bit-only) version and a "VisualStudio C++ 2013 Community Edition: https://www.visualstudio.com/en-us/news ... mmunity-vs

I can not sincerely remember if the 64bit compiler was included only in the Community edition or you had also to install Windows SDK after the VS2013 :?:

May be Neo can offer some additional help as he is more used to Windows.
gecko wrote: Tue Jan 02, 2018 4:06 pm [*]I tried installing VS 2017 which is readily available in 64-bit. When I run cmake-build-x64.bat I get a "Fatal Error: CMake not found". The only things I can think of that might be a little abnormal in my setup are that I'm using VS 2017, and my LuxCoreRender root directory is not on the same physical drive that VS is installed on. The error suggests that I haven't cloned the repositories correctly, but I'm quite certain that part is correct.
VS2017 has never being tested and the compilation procedure is likely to not work with a different version as it has been developed for VS2013.

It may be easier for you to wait for the release of pre-compiled binaries. I have to fill the https://luxcorerender.org/download/ with something for testing.
Support LuxCoreRender project with salts and bounties
gecko
Posts: 31
Joined: Mon Jan 01, 2018 11:10 pm

Re: BlendLuxCore Development

Post by gecko »

Dade wrote: Tue Jan 02, 2018 4:58 pm I have installed VS2013 a lot of time ago but when I did, there were 2 versions, a normal (32bit-only) version and a "VisualStudio C++ 2013 Community Edition: https://www.visualstudio.com/en-us/news ... mmunity-vs
The page you link to above ultimately leads to a Microsoft download page with a whole list of different versions of VS. Almost all of them are 32-bit only. All of the ones called "Community Edition" or "Express" are 32-bit. That said, 32-bit VS can compile 64-bit code, it's just the compiler that doesn't run in 64-bit (thus no "native x64 command prompt"... Anyway I can always just give it a try and see what happens. But right now suffice it to say that the readme on GitHub is a bit confusing.
Dade wrote: Tue Jan 02, 2018 4:58 pm VS2017 has never being tested and the compilation procedure is likely to not work with a different version as it has been developed for VS2013.
Got it, ok. Glad I'm not just doing something stupid at least.
Dade wrote: Tue Jan 02, 2018 4:58 pm It may be easier for you to wait for the release of pre-compiled binaries. I have to fill the https://luxcorerender.org/download/ with something for testing.
Easier of course. But I probably should have learned how to compile Lux a long time ago anyway, and this seemed like a good excuse to finally pick it up :)
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Compiling on Windows

Post by B.Y.O.B. »

Moved from BlendLuxCore development thread.
  • Once I manage to get this compiled, I should have 2 sets of files - a Blender addon, and a rendering engine right? Is the addon standalone (eg use Blender's "install from file"), or do I overwrite part of my existing LuxBlend installation, or something else entirely?
  • For the rendering engine, does this need to be installed / registered with the Windows file system, or do I just point the Blender addon to the right location and it runs in place?
No, you only have a bunch of binaries. You can collect them with the collect script. You have to clone BlendLuxCore and copy the binaries into the bin folder there.

It's explained here: https://github.com/LuxCoreRender/BlendL ... master/bin
Basically you do this:
  • Git clone BlendLuxCore repo
  • copy binaries into the bin folder as explained in the readme there
  • Load the addon into Blender. you can do this in several ways, e.g. you can package the whole BlendLuxCore folder into a zip and use Blender's "install from file". Or you can create a symlink to the BlendLuxCore folder in Blender's addons folder (the best for developers because a simple git pull and any changes done to the code updates the addon in Blender, too).
I recommend to disable the old LuxBlend addon (can sometimes cause conflicts with the new addon).
gecko
Posts: 31
Joined: Mon Jan 01, 2018 11:10 pm

Re: Compiling on Windows

Post by gecko »

Ok, beginning to think I'm actually doing something stupid trying to compile here. I've tried VS2013, VS2015, and VS2017 compilers and get the same error on all three. To be fair, none of the compilers are actually the correct one as specified in the readme (more on that below, <shakes fist at Microsoft>), but the fact that they're all throwing the same error leads me to believe I've set something up wrong. Here are screenshots of one of my compile attempts, and the first levels of my directory structure. Am I missing something?

Image

Image

As for Visual Studio, apparently VS2013 isn't packaged with the 2013 command line - it's packaged with the 2012 command line. And I still haven't found a native x64 version of 2013. I thought maybe VS2015 x64 would be packaged with the 2013 command line, but no it actually has its own 2015 command line. So for whatever reason the VS2013 64-bit compiler is a singularly difficult piece of software to locate these days. Here's hoping the errors I'm getting so far are on my end, and I can ultimately verify that some other versions of VS actually work fine to compile Lux ... that would at least save others the trouble I'm having.
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Compiling on Windows

Post by B.Y.O.B. »

When I search for "VS" on my Windows I find "VS2013 x64 Native Tools Command Prompt".
The shortcut points to "%comspec% /k ""F:\Users\Simon_2\ProgrammeHDD\VisualStudio\VC\vcvarsall.bat"" amd64".
I have installed "Microsoft Visual Studio Community 2013 with Update 4".
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Compiling on Windows

Post by Dade »

gecko wrote: Wed Jan 03, 2018 5:59 pm Ok, beginning to think I'm actually doing something stupid trying to compile here. I've tried VS2013, VS2015, and VS2017 compilers and get the same error on all three. To be fair, none of the compilers are actually the correct one as specified in the readme (more on that below, <shakes fist at Microsoft>), but the fact that they're all throwing the same error leads me to believe I've set something up wrong. Here are screenshots of one of my compile attempts, and the first levels of my directory structure. Am I missing something?
I think to know what is going on, we didn't noticed because we have all cmake installed in our systems, you simply need to install cmake (https://cmake.org/files/v2.8/cmake-2.8.12-win32-x86.exe even the latest version should work but better safe than sorry). You also need to have cmake.exe in your PATH variable (cmake installer should ask you to add cmake.exe to PATH system variable).

In the past, we had cmake.exe included in WindowsCompileDeps repository so no one noticed you have now to install cmake too.
Support LuxCoreRender project with salts and bounties
gecko
Posts: 31
Joined: Mon Jan 01, 2018 11:10 pm

Re: Compiling on Windows

Post by gecko »

Good news! Installing CMake was the problem. I guess I saw the /cmake directory and assumed that's what it was looking for, never thought that it might be looking for an additional piece of software. With that out of the way, I can confirm that:
- VS 2015 x64 can compile LuxCoreRender successfully.
- VS 2017 x64 can compile LuxCoreRender successfully.
- VS 2013 x64 is not currently available from MS.

Given the above I would suggest updating the compile readme to recommend:
- installing CMake :)
- using VS 2017 x64 (as this is currently the latest and most readily available version, and it works, so why not)
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Compiling on Windows

Post by Dade »

gecko wrote: Thu Jan 11, 2018 2:49 am Given the above I would suggest updating the compile readme to recommend:
- installing CMake :)
Done.
gecko wrote: Thu Jan 11, 2018 2:49 am - using VS 2017 x64 (as this is currently the latest and most readily available version, and it works, so why not)
I added a note suggesting that it should work with VS2015 and VS2017 too.

We had a lot of problems with newer VS versions in the past due to compiler bugs. They are likely to have been fixed but I will still stick to VS2013 for this release than upgrade.
Support LuxCoreRender project with salts and bounties
acasta69
Developer
Developer
Posts: 472
Joined: Tue Jan 09, 2018 3:45 pm
Location: Italy

Re: Compiling on Windows

Post by acasta69 »

gecko wrote: Thu Jan 11, 2018 2:49 am With that out of the way, I can confirm that:
- VS 2015 x64 can compile LuxCoreRender successfully.
- VS 2017 x64 can compile LuxCoreRender successfully.
Dade wrote: Thu Jan 11, 2018 8:38 am I added a note suggesting that it should work with VS2015 and VS2017 too.
Hi,

did it work with those versions out of the box? I think i remember that also all dependencies must be built with the same compiler version... :?:
Once I tried to use VS2015 for the old 1.7dev, but it did not work with existing deps...
Support LuxCoreRender project with salts and bounties

Windows 10 64 bits, i7-4770 3.4 GHz, RAM 16 GB, GTX 970 4GB v445.87
Post Reply