rawtoaces icon indicating copy to clipboard operation
rawtoaces copied to clipboard

Building on Windows.

Open KelSolaar opened this issue 8 years ago • 14 comments

Hi,

I'm trying to build on Windows and I'm not exactly sure how to pass the various dependencies includes and libraries directories to CMake and it is very likely that the various find_package macros will not on our system.

Here is my current log:

[localhost] local: cmake -DCMAKE_INSTALL_PREFIX=D:\Documents\Development\ThirdParty\rawtoaces/build\release -G "Visual Studio 15 Win64"
-- The C compiler identification is MSVC 19.10.25019.0
-- The CXX compiler identification is MSVC 19.10.25019.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.10.25017/bin/HostX86/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.10.25017/bin/HostX86/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.10.25017/bin/HostX86/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.10.25017/bin/HostX86/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:11 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "MSVC" will no longer be dereferenced when the policy
  is set to NEW.  Since the policy is not set the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- D:/Documents/Development/ThirdParty/rawtoaces/build/rawtoaces/lib/openexr/IlmBase/build
CMake Error at lib/CMakeLists.txt:4 (include_directories):
  include_directories given empty-string as include directory.


-- Configuring incomplete, errors occurred!
See also "D:/Documents/Development/ThirdParty/rawtoaces/build/rawtoaces/CMakeFiles/CMakeOutput.log".

Fatal error: local() encountered an error (return code 1) while executing 'cmake -DCMAKE_INSTALL_PREFIX=D:\Documents\Development\ThirdParty\rawtoaces/build\release -G "Visual Studio 15 Win64"'

Aborting.

KelSolaar avatar Jun 05 '17 04:06 KelSolaar

Let me finish a few more core features now and get back to this.

I did try to generate VS solution before using CMAKE with a similar settings in the configure file on Win64. I had the same problem when it comes to IlmBase. I did get a solution file though. Then I needed to open it to continue downloading and compilation for "IlmBase".

This part of "CMakeLists.txt" should do something:

` include(ExternalProject) if ( NOT IlmBase_FOUND ) set (openexr_EXTERNAL_BUILD "${CMAKE_CURRENT_BINARY_DIR}/lib/openexr") set (ilmbase_EXTERNAL_BUILD "${CMAKE_CURRENT_BINARY_DIR}/lib/openexr/IlmBase") set (ilmbase_EXTERNAL_MAKE_BUILD "${CMAKE_CURRENT_BINARY_DIR}/lib/openexr/IlmBase/build")

if (WIN32) STRING(REGEX REPLACE "\\" "/" openexr_EXTERNAL_BUILD ${openexr_EXTERNAL_BUILD}) STRING(REGEX REPLACE "\\" "/" ilmbase_EXTERNAL_BUILD ${ilmbase_EXTERNAL_BUILD}) STRING(REGEX REPLACE "\\" "/" ilmbase_EXTERNAL_MAKE_BUILD ${ilmbase_EXTERNAL_MAKE_BUILD}) message (STATUS ${ilmbase_EXTERNAL_MAKE_BUILD})

  ExternalProject_Add( project_ilmbase
	GIT_REPOSITORY https://github.com/openexr/openexr.git
	GIT_TAG "origin/master"

    SOURCE_DIR ${openexr_EXTERNAL_BUILD}
    CONFIGURE_COMMAND cd ${ilmbase_EXTERNAL_BUILD}
  	CMAKE_ARGS -DBuildShared=OFF -DBuildExamples=OFF -DCMAKE_INSTALL_PREFIX=${GLOBAL_OUTPUT_PATH}/project_ilmbase
  	BUILD_COMMAND cmake ${ilmbase_EXTERNAL_BUILD} -G "Visual Studio 14 2015"
  	# BUILD_COMMAND cmake ${ilmbase_EXTERNAL_BUILD}
)
set (IlmBase_LIBRARY_DIRS "${CMAKE_CURRENT_BINARY_DIR}/project_ilmbase-prefix/src/project_ilmbase-build/Half")
set (IlmBase_INCLUDE_DIRS "${ilmbase_EXTERNAL_BUILD}/IlmBase/Half")

else () ExternalProject_Add( project_ilmbase GIT_REPOSITORY https://github.com/openexr/openexr.git GIT_TAG "master"

	SOURCE_DIR "${openexr_EXTERNAL_BUILD}"
	CONFIGURE_COMMAND mkdir "${ilmbase_EXTERNAL_BUILD}/build" && cd "${ilmbase_EXTERNAL_BUILD}/build"
  	CMAKE_ARGS -DBuildShared=ON -DBuildExamples=OFF -DCMAKE_INSTALL_PREFIX=${GLOBAL_OUTPUT_PATH}/project_ilmbase
  	BUILD_COMMAND cmake "${ilmbase_EXTERNAL_BUILD}" && make -s "${ilmbase_EXTERNAL_BUILD}/build"
)

endif ()

set (IlmBase_FOUND TRUE) endif() `

miaoqi avatar Jun 05 '17 06:06 miaoqi

Getting "Ceres::Solve" built on Windows will be more complicated. Please see the following from its website on Installation

" On Windows, we support building with Visual Studio 2010 or newer. Note that the Windows port is less featureful and less tested than the Linux or Mac OS X versions due to the lack of an officially supported way of building SuiteSparse and CXSparse. There are however a number of unofficial ways of building these libraries. Building on Windows also a bit more involved since there is no automated way to install dependencies. "

For "rawtoaces", I think we can build an "executable", static library ".lib" or dynamic library ".dll" for the users on Windows and then just distribute them.

miaoqi avatar Jun 05 '17 06:06 miaoqi

Yeah Ceres is a royal pain, hence my comment on Slack, oh and this was my facebook status earlier:

Compiling Ceres-Solver on Windows, I want to cry :|

I managed to build a version without glog and gflags, I had some nasty compiler errors happening when including eigen otherwise.

KelSolaar avatar Jun 05 '17 07:06 KelSolaar

Ideally and whatever the platform is, I would like to be able to pass arguments to CMake, something along those lines:

-DILMBASE_INCLUDE_DIR_HINTS="pat/to/ilmbase/include"

Ceres Solver has actually a very nice configuration in that regard.

KelSolaar avatar Jun 05 '17 07:06 KelSolaar

About Ceres on Windows: https://groups.google.com/forum/#!topic/ceres-solver/cR8SSDPFvAk

KelSolaar avatar Jun 05 '17 11:06 KelSolaar

Probably need to add a few more "FindPackage.cmake" files to get these variables defined so you can pass stuff to CMake. In fact, as your mentioned, "Cere Solver" already has them.

miaoqi avatar Jun 05 '17 19:06 miaoqi

Yeah, I managed very difficulty to compile Ceres with glog and gflags support yesterday night, everything needs to be dynamically linked among other things.

KelSolaar avatar Jun 05 '17 20:06 KelSolaar

Hey guys, is there a compiled version of rawtoaces for Windows somewhere ? I'm about to start the adventure but since I compile things once every 4 years, if someone has done it and can share it, it would be a blast! Thanks!

chistof avatar Dec 03 '18 07:12 chistof

Would love to have a windows-build with this but I got it running successfully using WSL on Windows, so we windows users aren't dead in the water at least! Next thing will be to build a bat file to simply drag the raw files to, to convert them.

utjduo avatar Aug 21 '19 08:08 utjduo

Hey there! Just like the other 2 people who already commented on the status of this issue: is there any news on a Windows build?

bkamphues avatar Sep 10 '20 10:09 bkamphues

Hey there! Just like the other 2 people who already commented on the status of this issue: is there any news on a Windows build?

You can make a build using WSL: https://github.com/ampas/rawtoaces/issues/116

EmberLightVFX avatar Sep 10 '20 10:09 EmberLightVFX

Hey there! Just like the other 2 people who already commented on the status of this issue: is there any news on a Windows build?

You can make a build using WSL: #116

Yeah I know! I got that working perfectly, but we would like to use this tool on our Windows systems without having to use WSL. WSL is not really usable in terms of pipeline development.

bkamphues avatar Sep 10 '20 10:09 bkamphues

Another alternative is Docker: https://github.com/ampas/rawtoaces/pull/118

KelSolaar avatar Sep 10 '20 10:09 KelSolaar

Another alternative is Docker: #118

Ooh thanks! This is perfect! Hadn't even though of it!

bkamphues avatar Sep 10 '20 10:09 bkamphues