Page 1 of 1

LuxCore Windows Compile Time

Posted: Wed Jan 27, 2021 3:54 pm
by NickMoon
Hi everyone, quick question.
So the Luxcore windows build repository says that a first compile of Luxcore will take about 15 minutes, which is about the time I'm getting, but is there anyway to make subsequent compilations, such as after changing a couple lines in a file, not take the full 15 minutes? Right now I'm just executing the same .bat file.

Re: LuxCore Windows Compile Time

Posted: Wed Jan 27, 2021 4:00 pm
by Dade
Yes, you can directly load the Project in VisualStudio and directly build whatever you want. CMake just generate complete VS project on Windows.

Re: LuxCore Windows Compile Time

Posted: Wed Jan 27, 2021 8:43 pm
by alpistinho
On windows, for development I would disable the LTCG option in the build.

It takes a long time because it goes over all build artifacts to do linking-time optimization

It is really short without it

Re: LuxCore Windows Compile Time

Posted: Wed Jan 27, 2021 9:50 pm
by TAO
I don't know if this is going to help you or not, but in the past, I was building the whole LuxCore project for every single test in MaxToLux and it takes almost 10 to 12 minutes on my computer, but from the last build, I decide to just build all DLL's and use them externally (side by side), so instead of compiling LuxCore projects all the time I build it ones and that changes the game for me. now, with using dynamic Dll, I reached the build time of 25 to 30 seconds instead of 10 to 12 minutes.
I'm not sure if that's the same case but if it is you can always use the dynamic library instead of building the project.
I think this is much easier for upgrading the project too.

Re: LuxCore Windows Compile Time

Posted: Wed Jan 27, 2021 10:38 pm
by B.Y.O.B.
TAO wrote: Wed Jan 27, 2021 9:50 pm but from the last build, I decide to just build all DLL's and use them externally (side by side), so instead of compiling LuxCore projects all the time I build it ones and that changes the game for me. now, with using dynamic Dll, I reached the build time of 25 to 30 seconds instead of 10 to 12 minutes.
This won't apply here, since LuxCore itself is being changed and needs to be rebuilt. It only works if the LuxCore API is used in another project, like in your case (MaxToLux).

Re: LuxCore Windows Compile Time

Posted: Wed Jan 27, 2021 11:37 pm
by TAO
Yes, of course, it will work from other apps as side by side dynamic library.

Re: LuxCore Windows Compile Time

Posted: Thu Jan 28, 2021 1:24 pm
by acasta69
Also using the .bat file processes only the actual changes (unless you use the "/rebuild" switch), however the most time consuming task is linking all binaries with LTCG, and also the initial project generation by CMake is not super fast.

You might want to check the following, which can give some performance improvement:
  • Try using the .bat file with "/minimal": it builds only pyluxcore and LuxCoreUI instead of all the samples, so it should be faster
  • As above, also using "/debug", if it is acceptable for you, speeds up things a lot (no /LTCG nor other optimizations are used when building a debug version, but the generated executables will be much slower, and you'll have to copy binaries manually, as all scripts such as "collect-compiled-binaries.bat" assume a non-debug build)
If you are using Visual Studio full IDE, as suggested by Dade, the generated solution file can be loaded and used directly, so that you can select only the desired subproject to build, e.g. LuxCoreUI or pyluxcore.
The solution file name is "LuxRays.sln" and it is located in "WindowsCompile\Build_CMake\LuxCore" after the .bat has been used for the first time.

If you don't have the full IDE but only the "Visual Studio Tools", you can call msbuild directly from the command line.
For example, this will build only pyluxcore:

Code: Select all

msbuild /nologo /verbosity:normal /toolsversion:15.0 /property:"Platform=x64" /property:"Configuration=Release" /p:WarningLevel=0 LuxRays.sln /target:pyluxcore