windows build msys

Discussion related to the LuxCore functionality, implementations and API.
Post Reply
marcel.ritter
Posts: 4
Joined: Fri Jul 31, 2020 1:31 pm
Location: Austria
Contact:

windows build msys

Post by marcel.ritter »

Hi all,

I'm trying to do a build using the msys environment on windows. I have added boost and openimage via the package manager there and use mingw and ninja for building. Is this a supported toolchain? I have an error in cmake, that maybe someone has already seen. The boost 1.72 somehow is detected, but still not 'found'. Maybe it has something todo with the python dependency?

The libboost*files are all installed in the msys64/mingw64/bin and ../lib directories.

Code: Select all

CMake version 3.17.0 detected
The C compiler identification is GNU 9.3.0
Check for working C compiler: C:/msys64/mingw64/bin/cc.exe
Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
The CXX compiler identification is GNU 9.3.0
Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe
Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Single-config generator detected
Using build variant: 
Available custom configurations in cmake/SpecializedConfig:
  Config_Dade
  Config_Linux-Static
  Config_OSX
  Config_Windows
Looking for pthread.h
Looking for pthread.h - found
Performing Test CMAKE_HAVE_LIBC_PTHREAD
Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
Found Threads: TRUE  
Found OpenImageIO: C:/msys64/mingw64/lib/libOpenImageIO.dll.a  
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args` (OPENEXR)
  does not match the name of the calling package (OpenEXR).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/Packages/FindOpenEXR.cmake:120 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  cmake/Dependencies.cmake:33 (find_package)
  CMakeLists.txt:101 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

Found OPENEXR: C:/msys64/mingw64/lib/libIex.dll.a;C:/msys64/mingw64/lib/libIlmImf.dll.a;C:/msys64/mingw64/lib/libHalf.dll.a;C:/msys64/mingw64/lib/libImath.dll.a;C:/msys64/mingw64/lib/libIlmThread.dll.a  
Found TIFF: C:/msys64/mingw64/lib/libtiff.dll.a (found version "4.1.0") 
Found JPEG: C:/msys64/mingw64/lib/libjpeg.dll.a (found version "80") 
Found ZLIB: C:/msys64/mingw64/lib/libz.dll.a (found version "1.2.11") 
Found PNG: C:/msys64/mingw64/lib/libpng.dll.a (found version "1.6.37") 
Found PythonLibs: C:/msys64/mingw64/lib/libpython3.8.dll.a (found suitable version "3.8.2", minimum required is "3.4") 

Could NOT find Boost (missing: python numpy) (found suitable version "1.72.0", minimum required is "1.56.0")
Re-trying with link static = ON
Could NOT find Boost (missing: python numpy) (found suitable version "1.72.0", minimum required is "1.56.0")

Found OpenGL: opengl32   
Found OpenMP_C: -fopenmp (found version "4.5") 
Found OpenMP_CXX: -fopenmp (found version "4.5") 
Found OpenMP: TRUE (found version "4.5")  
OpenMP found - compiling with
Found BISON: C:/Tools/GNU32/bin/bison.exe (found version "2.4.1") 
Could NOT find FLEX (missing: FLEX_EXECUTABLE) 
CMake Error at CMakeLists.txt:104 (MESSAGE):
  --> Could not locate required Boost files - Please check
Any hint and comment is highly appreciated. :)

Best,
Marcel
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: windows build msys

Post by Dade »

marcel.ritter wrote: Fri Jul 31, 2020 1:49 pm Is this a supported toolchain?
Nope, you need to use the procedure described here: https://github.com/LuxCoreRender/WindowsCompile

Visual Studio is available for free or you need to use Mingw for a specific reason ?
Support LuxCoreRender project with salts and bounties
marcel.ritter
Posts: 4
Joined: Fri Jul 31, 2020 1:31 pm
Location: Austria
Contact:

Re: windows build msys

Post by marcel.ritter »

Ok. Thank you for pointing my to the location. It justed looked more like a linux-style project setup to me (and i found the dependent packages in the mingw pacman also). I have other projects running via the msys environment as well, thats why I gave it a try. I'm totally fine with a Visual Studio toolchain.
marcel.ritter
Posts: 4
Joined: Fri Jul 31, 2020 1:31 pm
Location: Austria
Contact:

Re: windows build msys

Post by marcel.ritter »

Ok. It did work fine now. I had the current VS 2019 installed. Thus, I installed the 2017 v141 build tools. But, I had to adjust the generator and the toolsversion in the cmake-build-x64.bat.

Then the build succeeded using the script, and I rendered the nice reflecting sphere demo from the luxcoredemo.exe. :D

Here, a diff of the bat file:
diff --git a/cmake-build-x64.bat b/cmake-build-x64.bat
index 60e6a65..702a7f8 100644
--- a/cmake-build-x64.bat
+++ b/cmake-build-x64.bat
@@ -108,7 +108,7 @@ for /F "tokens=3" %%G in ('cmd /c "%CMAKE%" --version ^| findstr /I /C:"cmake ve
for /F "tokens=1 delims=." %%G in ("%CMAKE_VER%") do set CMAKE_VN_MAJOR=%%G
echo We are using CMake version: %CMAKE_VN_MAJOR%
:: Default values
-set CMAKE_GENERATOR="Visual Studio 15 2017"
+set CMAKE_GENERATOR="Visual Studio 16 2019"

set CMAKE_TOOLSET=-T v141,host=x64
set CMAKE_PLATFORM=-A x64

@@ -152,7 +152,7 @@ if %BUILD_DLL% EQU 1 (
echo CMAKE_OPTS=-G %CMAKE_GENERATOR% %CMAKE_PLATFORM% %CMAKE_TOOLSET% -D CMAKE_INCLUDE_PATH="%INCLUDE_DIR%" -D CMAKE_LIBRARY_PATH="%LIB_DIR%" -D PYTHON_LIBRARY="%LIB_DIR%" -D PYTHON_V="%PYTHON_VERSION%" -D PYTHON_INCLUDE_DIR="%INCLUDE_DIR%\Python%PYTHON_VERSION%" -D CMAKE_BUILD_TYPE=%BUILD_TYPE% %OCL_OPTION% %CUDA_OPTION% %DLL_OPTION%
set CMAKE_OPTS=-G %CMAKE_GENERATOR% %CMAKE_PLATFORM% %CMAKE_TOOLSET% -D CMAKE_INCLUDE_PATH="%INCLUDE_DIR%" -D CMAKE_LIBRARY_PATH="%LIB_DIR%" -D PYTHON_LIBRARY="%LIB_DIR%" -D PYTHON_V="%PYTHON_VERSION%" -D PYTHON_INCLUDE_DIR="%INCLUDE_DIR%\Python%PYTHON_VERSION%" -D CMAKE_BUILD_TYPE=%BUILD_TYPE% %OCL_OPTION% %CUDA_OPTION% %DLL_OPTION%
rem To display only errors add: /clp:ErrorsOnly
-set MSBUILD_OPTS=/nologo %CPUCOUNT% /verbosity:normal /toolsversion:15.0 /property:"Platform=%MSBUILD_PLATFORM%" /property:"Configuration=%BUILD_TYPE%" /p:WarningLevel=0
+set MSBUILD_OPTS=/nologo %CPUCOUNT% /verbosity:normal /toolsversion:Current /property:"Platform=%MSBUILD_PLATFORM%" /property:"Configuration=%BUILD_TYPE%" /p:WarningLevel=0


if %FULL_REBUILD%==1 rd /q /s Build_CMake
mkdir Build_CMake
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: windows build msys

Post by Dade »

marcel.ritter wrote: Fri Jul 31, 2020 3:45 pm Here, a diff of the bat file:
Thanks Marcel. @Acasta69, should we switch to VisualStudio 2019 ? I hate to touch stuff that works but is 2017 still available ?
Support LuxCoreRender project with salts and bounties
acasta69
Developer
Developer
Posts: 472
Joined: Tue Jan 09, 2018 3:45 pm
Location: Italy

Re: windows build msys

Post by acasta69 »

Dade wrote: Fri Jul 31, 2020 3:58 pm @Acasta69, should we switch to VisualStudio 2019 ? I hate to touch stuff that works but is 2017 still available ?
I hate that too... We have to switch sooner or later, it's in my to-do list, but honestly with not so high priority.

As for availability, it is more and more difficult to access older versions of MS tools.
At the moment old VS versions, including VS2017, are available through participation to the free "Dev Essentials" program:
https://visualstudio.microsoft.com/vs/older-downloads/
Support LuxCoreRender project with salts and bounties

Windows 10 64 bits, i7-4770 3.4 GHz, RAM 16 GB, GTX 970 4GB v445.87
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: windows build msys

Post by Dade »

acasta69 wrote: Fri Jul 31, 2020 8:01 pm At the moment old VS versions, including VS2017, are available through participation to the free "Dev Essentials" program:
https://visualstudio.microsoft.com/vs/older-downloads/
From my point of view, if it is still available, we can wait.
Support LuxCoreRender project with salts and bounties
marcel.ritter
Posts: 4
Joined: Fri Jul 31, 2020 1:31 pm
Location: Austria
Contact:

Re: windows build msys

Post by marcel.ritter »

Yes, its always a pain to keep stuff up-to-date ... but its really nice if it is.
I'm glad to help out a bit (if I can). Let me know in case.
Post Reply