Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Build for Windows ARM64 #17562

Closed
jinzapper opened this issue Sep 30, 2024 · 16 comments · Fixed by #17635
Closed

Cannot Build for Windows ARM64 #17562

jinzapper opened this issue Sep 30, 2024 · 16 comments · Fixed by #17635
Labels
scope: windows support windows related issues and PR

Comments

@jinzapper
Copy link

Describe the bug

Following the Windows build guide using MSYS2. Using the ARM64 versions. The build is successful but DLLs are missing so darktable does not load.

Steps to reproduce

Follow the instructions when building for Windows using MSYS2 with the following differences:

  1. Use clangarm64.exe to build and setup
  2. use the "*-w64-clang-aarch64-clang" versions of the required packages

Expected behavior

darktable should build the main executable and all the DLLs

Logfile | Screenshot | Screencast

No response

Commit

No response

Where did you obtain darktable from?

self compiled

darktable version

4.8.1

What OS are you using?

Windows

What is the version of your OS?

Windows 11 ARM64

Describe your system?

16GB ram, Snapdragon Elite 80-100

Are you using OpenCL GPU in darktable?

Yes

If yes, what is the GPU card and driver?

Adreno X1-85

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

No response

@kmilos
Copy link
Contributor

kmilos commented Sep 30, 2024

How are you actually trying to run it? Which DLL is missing?

Does it work if you try to launch it as a command from the CLANGARM64 terminal?

@kmilos kmilos added the scope: windows support windows related issues and PR label Sep 30, 2024
@kmilos
Copy link
Contributor

kmilos commented Sep 30, 2024

And can you also please check if the MSYS2 supplied darktable (pacman -S mingw-w64-clang-aarch64-darktable) runs from CLANGARM64 command line?

@jinzapper
Copy link
Author

How are you actually trying to run it? Which DLL is missing?

Does it work if you try to launch it as a command from the CLANGARM64 terminal?

Launching this in the CLANGARM64 terminal worked! I would probably just need to locate the paths so I can just double click to launch. Thanks!

@kmilos
Copy link
Contributor

kmilos commented Oct 1, 2024

I would probably just need to locate the paths

It means it's finding something on C:\msys64\clangarm64\bin (in the path when you're in the CLANGARM64 terminal).

However, we should still understand why it doesn't work OOTB (i.e. what DLLs are not being installed in the same location as darktable.exe and why, like it is the case for x64...).

@jinzapper
Copy link
Author

But OpenCL support is as expected not available for the GPU for the snapdragon X elite.

@jinzapper
Copy link
Author

jinzapper commented Oct 1, 2024

I would probably just need to locate the paths

It means it's finding something on C:\msys64\clangarm64\bin (in the path when you're in the CLANGARM64 terminal).

However, we should still understand why it doesn't work OOTB (i.e. what DLLs are not being installed in the same location as darktable.exe and why, like it is the case for x64...).

Yes. Found them in the clangarm64\bin folder. This is the first time I'm building and installing. I normally build the installer. But nsis fails as this I think is x64 only

@kmilos
Copy link
Contributor

kmilos commented Oct 1, 2024

I normally build the installer. But nsis fails as this I think is x64 only

Correct, NSIS is not available for Windows on ARM64 yet (natively, that is).

Did you do the full ./build.sh --prefix /opt/darktable --build-type Release --build-generator Ninja --install (note the --install; or cmake --install build yourself after building)? Can you please check if the DLLs are present in /opt/darktable/bin together w/ darktable.exe?

Again, what is the DLL that is claimed to be missing when you double-click /opt/darktable/bin/darktable.exe?

@kmilos
Copy link
Contributor

kmilos commented Oct 1, 2024

Oh, the installer also creates a couple more environment variables you might have to add by hand now for the double-click launch to work, e.g. (adjust for your install location and check version numbers obviously):

CAMLIBS="C:\msys64\opt\darktable\lib\libgphoto2\2.5.31\"
IOLIBS="C:\msys64\opt\darktable\lib\libgphoto2_port\0.12.2\"

(These are defined in the CLANGARM64 terminal automagically, but not outside of it...)

@jinzapper
Copy link
Author

I normally build the installer. But nsis fails as this I think is x64 only

Correct, NSIS is not available for Windows on ARM64 yet (natively, that is).

Did you do the full ./build.sh --prefix /opt/darktable --build-type Release --build-generator Ninja --install (note the --install; or cmake --install build yourself after building)? Can you please check if the DLLs are present in /opt/darktable/bin together w/ darktable.exe?

Again, what is the DLL that is claimed to be missing when you double-click /opt/darktable/bin/darktable.exe?

libglib-2.0-0.dll, libintl-8.dll, libwinpthread-1.dll, libomp.dll are missing when you double click the executable

@kmilos
Copy link
Contributor

kmilos commented Oct 3, 2024

libglib-2.0-0.dll, libintl-8.dll, libwinpthread-1.dll, libomp.dll

Hm, pretty fundamental ones, so CAMLIBS and IOLIBS, although necessary, would not solve this just yet...

Are you sure you did --install? Are there other DLLs copied to /opt/darktable/bin?

Unfortunately you'll just have to run from CLANGARM64 terminal for now, until we have a developer with such hardware who can look into the CMake installation part details.

@jinzapper
Copy link
Author

libglib-2.0-0.dll, libintl-8.dll, libwinpthread-1.dll, libomp.dll

Hm, pretty fundamental ones, so CAMLIBS and IOLIBS, although necessary, would not solve this just yet...

Are you sure you did --install? Are there other DLLs copied to /opt/darktable/bin?

Yes. This was the command:
./build.sh --prefix /opt/darktable --build-type Release --build-generator Ninja --install

@kmilos
Copy link
Contributor

kmilos commented Oct 3, 2024

Then there is something about collecting those dependencies not working out on ARM64...

On the off chance, can you please try w/ this change (and CAMLIBS and IOLIBS set):

--- packaging/CMakeLists_orig.txt 2024-10-03 09:10:32.939260800 +0200
+++ packaging/CMakeLists.txt      2024-10-03 09:16:15.018860700 +0200
@@ -5,7 +5,7 @@
   get_filename_component(MINGW_PATH ${CMAKE_CXX_COMPILER} PATH)

   find_program(cygcheck_BIN cygcheck)
-  if(${cygcheck_BIN} STREQUAL "cygcheck_BIN-NOTFOUND")
+  if(CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64" OR ${cygcheck_BIN} STREQUAL "cygcheck_BIN-NOTFOUND")

     # use the slower fixup_bundle

@jinzapper
Copy link
Author

Then there is something about collecting those dependencies not working out on ARM64...

On the off chance, can you please try w/ this change (and CAMLIBS and IOLIBS set):

--- packaging/CMakeLists_orig.txt 2024-10-03 09:10:32.939260800 +0200
+++ packaging/CMakeLists.txt      2024-10-03 09:16:15.018860700 +0200
@@ -5,7 +5,7 @@
   get_filename_component(MINGW_PATH ${CMAKE_CXX_COMPILER} PATH)

   find_program(cygcheck_BIN cygcheck)
-  if(${cygcheck_BIN} STREQUAL "cygcheck_BIN-NOTFOUND")
+  if(CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64" OR ${cygcheck_BIN} STREQUAL "cygcheck_BIN-NOTFOUND")

     # use the slower fixup_bundle

Need help, do I just append this in the packaging/CMakeLists.txt then rebuild? How do I exactly use this fragment?

@kmilos
Copy link
Contributor

kmilos commented Oct 4, 2024

How do I exactly use this fragment?

Remove the line that has "-" in front of it, add the line that has "+" (without these signs). Pretty intuitive 😉

You might not have to rebuild, you can just try cmake --install build first from your source tree first after you make the change. If you want to be extra sure, then rebuild...

@jinzapper
Copy link
Author

if(CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64" OR ${cygcheck_BIN} STREQUAL "cygcheck_BIN-NOTFOUND")

This worked! I can now just double click and run the executable as is! Thanks!

@kmilos
Copy link
Contributor

kmilos commented Oct 11, 2024

Great! Thanks for testing, I'll make the change on master permanent.

kmilos added a commit to kmilos/darktable that referenced this issue Oct 11, 2024
cygcheck comes from base MSYS2, not CLANGARM64, and currently works on X64 objects only

Fixes darktable-org#17562
TurboGit pushed a commit that referenced this issue Oct 11, 2024
cygcheck comes from base MSYS2, not CLANGARM64, and currently works on X64 objects only

Fixes #17562
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: windows support windows related issues and PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants