darktable-org / darktable

darktable is an open source photography workflow application and raw developer
https://www.darktable.org
GNU General Public License v3.0
9.71k stars 1.14k forks source link

Windows Build Issue #6487

Closed chhil closed 4 years ago

chhil commented 4 years ago

I set up the build environment from scratch.

Couple of things that were different

SAXON : The requirement to download it and place it and set classpath, uses saxon9he.jar but thats no longer available and I used SaxonHE10-2J.zip , extracted the files correctly and updated classpath to use saxon-he-10.2.jar.

Older version of lensfun is no longer available so I went with what got installed and did the lensfun update.


While trying to build I got a

-- The following OPTIONAL packages have not been found:

 * Saxon

Then later I got the error

[  6%] Checking validity of data/darktableconfig.xml
[  6%] Built target validate_darktableconfig_xml
[  6%] Built target generate_conf
[  6%] Built target generate_preferences
[  6%] Built target validate-cameras.xml
[ 18%] Built target rawspeed
[ 18%] Building C object src/CMakeFiles/lib_darktable.dir/common/camera_control.c.obj
C:/msys64/home/chill/darktable/src/common/camera_control.c: In function 'dt_camctl_import':
C:/msys64/home/chill/darktable/src/common/camera_control.c:1044:73: error: passing argument 3 of 'gp_file_get_data_and_size' from incompatible pointer type [-Werror=incompatible-pointer-types]
 1044 |       if((res = gp_file_get_data_and_size(camfile, (const char**)&data, &size)) < GP_OK)
      |                                                                         ^~~~~
      |                                                                         |
      |                                                                         size_t * {aka long long unsigned int *}
In file included from C:/msys64/mingw64/include/gphoto2/gphoto2.h:50,
                 from C:/msys64/home/chill/darktable/src/common/camera_control.h:30,
                 from C:/msys64/home/chill/darktable/src/common/camera_control.c:21:
C:/msys64/mingw64/include/gphoto2/gphoto2-file.h:136:30: note: expected 'long unsigned int *' but argument is of type 'size_t *' {aka 'long long unsigned int *'}
  136 |           unsigned long int *size);
      |           ~~~~~~~~~~~~~~~~~~~^~~~
cc1.exe: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/lib_darktable.dir/build.make:1831: src/CMakeFiles/lib_darktable.dir/common/camera_control.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:2331: src/CMakeFiles/lib_darktable.dir/all] Error 2
make: *** [Makefile:172: all] Error 2
codingdave commented 4 years ago

Ah, just thought of another possibility (not sure if it will work) - remove cmake -E env from add_custom_command and keep simple bash there (we will need to move LANG and LC_ALL into the script itself, or use -c option). If it works, it would be the simplest solution.

What I say ;-) This works on my side. - Ah, wait I propose to also remove bash. But lets see what works.

parafin commented 4 years ago

Yeah, bash is still needed, so please check.

codingdave commented 4 years ago

compiling

diff --git a/src/libs/CMakeLists.txt b/src/libs/CMakeLists.txt
index 728c6f370..eb854ae1b 100644
--- a/src/libs/CMakeLists.txt
+++ b/src/libs/CMakeLists.txt
@@ -9,7 +9,7 @@ add_custom_command(
   DEPENDS ${CMAKE_SOURCE_DIR}/tools/authors_h.sh ${CMAKE_SOURCE_DIR}/AUTHORS
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tools/darktable_authors.h
   COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/tools/
-  COMMAND ${CMAKE_COMMAND} -E env LANG=C LC_ALL=C bash ${CMAKE_SOURCE_DIR}/tools/authors_h.sh ${CMAKE_SOURCE_DIR}/AUTHORS ${CMAKE_CURRENT_BINARY_DIR}/tools/darktable_authors.h
+  COMMAND ${CMAKE_COMMAND} bash ${CMAKE_SOURCE_DIR}/tools/authors_h.sh ${CMAKE_SOURCE_DIR}/AUTHORS ${CMAKE_CURRENT_BINARY_DIR}/tools/darktable_authors.h
   COMMENT "Generating authors.h for about dialog."
 )

diff --git a/tools/authors_h.sh b/tools/authors_h.sh
index 35d32b2ed..7977a7e43 100755
--- a/tools/authors_h.sh
+++ b/tools/authors_h.sh
@@ -24,6 +24,11 @@

 set -e

+# https://github.com/travis-ci/travis-ci/issues/8812#issuecomment-347457115
+# Since TracisCI uses LC_ALL=en_US.UTF-8 by default we change these envs. This should keep BSD sed working.
+LANG=C
+LC_ALL=C 
+
 AUTHORS="$1"
 H_FILE="$2"
parafin commented 4 years ago

Better make it export LANG=C and export LC_ALL=C (actually I think LANG might be unneeded here, but let's not change this).

codingdave commented 4 years ago

Better make it export LANG=C and export LC_ALL=C (actually I think LANG might be unneeded here, but let's not change this).

Ok. But with current patch:

cd /C/msys64/home/david/darktable/build/lib/darktable/plugins/lighttable && /C/msys64/mingw64/bin/cmake.exe -E make_directory C:/msys64/home/david/darktable/build/lib/darktable/plugins/lighttable/tools/
cd /C/msys64/home/david/darktable/build/lib/darktable/plugins/lighttable && /C/msys64/mingw64/bin/cmake.exe bash C:/msys64/home/david/darktable/tools/authors_h.sh C:/msys64/home/david/darktable/AUTHORS C:/msys64/home/david/darktable/build/lib/darktable/plugins/lighttable/tools/darktable_authors.h
Re-run cmake no build system arguments
CMake Error: The source directory "C:/msys64/home/david/darktable/build/lib/darktable/plugins/lighttable/tools/darktable_authors.h" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
make[2]: *** [lib/darktable/plugins/lighttable/CMakeFiles/generate_authors_h.dir/build.make:85: lib/darktable/plugins/lighttable/tools/darktable_authors.h] Error 1
make[2]: Leaving directory '/C/msys64/home/david/darktable/build'
make[1]: *** [CMakeFiles/Makefile2:3581: lib/darktable/plugins/lighttable/CMakeFiles/generate_authors_h.dir/all] Error 2
make[1]: Leaving directory '/C/msys64/home/david/darktable/build'
make: *** [Makefile:172: all] Error 2

copy, paste, execute:

$ /C/msys64/mingw64/bin/cmake.exe bash C:/msys64/home/david/darktable/tools/authors_h.sh C:/msys64/home/david/darktable/AUTHORS C:/msys64/home/david/darktable/build/lib/darktable/plugins/lighttable/tools/darktable_authors.h
CMake Error: The source directory "C:/msys64/home/david/darktable/build/lib/darktable/plugins/lighttable/tools/darktable_authors.h" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
parafin commented 4 years ago

right, you didn't remove ${CMAKE_COMMAND}

codingdave commented 4 years ago

ok, that succeeded. Now I am doing a full rebuild.

codingdave commented 4 years ago

That worked. PR attached.

codingdave commented 4 years ago

@chhil @todd-prior @phrrk please test @parafin thanks for your help!

codingdave commented 4 years ago
  • Saxon and building the manuals - solved I think, but BUILD.txt needs to be updated
  • version 0.3.2 of lensfun no longer being available - I convinced the MSYS2 people to revert from 0.3.95, but that seems to have run into a bit of a problem see: msys2/MINGW-packages#7108 presumably that will get solved soon
  • The use of bash, sh or whatever in .../src/libs/MakeLists.txt. It seems full path to bash (/usr/bin/bash or /bin/bash) works for everyone. sh works for me, but not bash (despite them being one and the same). No shell at all being given works for some. Which all seems very strange.

The last item should have been resolved now, the others are still left open.

ptilopteri commented 4 years ago

sorry, cannot. I do not have access to windows aside from the ones to look thru. And really feel they are better purposed and more functional. :)

codingdave commented 4 years ago

PR updated to fix Saxon build instructions as well. Since we expect a reaction from the mingw team soon (they want to revert back to lensfun 0.3.2) we can close this issue, right?

todd-prior commented 4 years ago

Will do

Get Outlook for Android

From: David-Tillmann Schaefer notifications@github.com Sent: Thursday, October 15, 2020 4:53:31 PM To: darktable-org/darktable darktable@noreply.github.com Cc: Prior,Todd priort@mcmaster.ca; Mention mention@noreply.github.com Subject: Re: [darktable-org/darktable] Windows Build Issue (#6487)  

@chhil @todd-prior @phrrk please test @parafin thanks for your help! — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

todd-prior commented 4 years ago

@TurboGit @parafin @codingdave Great detective work everyone...working fine on my setup!!!

chhil commented 4 years ago

Thank you @codingdave , @phrrk , @parafin and @TurboGit .

@todd-prior , it builds for me. Though you build it differently using the windows linux subsystem so your milage may vary.

Back in business... just built darktable-3.3.0+1112~ge0cff08d1-win64.exe

Should this be closed ? I ask this because lensfun is not resolved and maybe a blurb somewhere on how to get the older lensfun in the interim needs to be there.

This will sound silly, but people with an older msys install, will it work for them?

TurboGit commented 4 years ago

Yes I'm closing ! And the thanks goes to @parafin and @codingdave.