Build for Windows, help please

good tip !

Done.
Pull request created, it is my first one so please be patient

Marco I was curious about your last part of this comment…why the 2 shells…why essential to use one for part of the process and one for the building??

The two shells have environment variables set differently, PATH for example: if you type

$ echo $PATH

you will get different output. As a consequence, if you give

$ lensfun-update-data

in the MSYS2 shell, you will get “command not found”

Thanks Marco. I did read this and there were cautions about the path and if you included both bin paths from the two shells etc…what should be added in the path…I have seen a couple of different suggestions online for additions and order

@MarcoNex This is what I am using

Environment (Path) Settings
“MSYS2_DIR C:\msys64”
MSYS2_DIR\mingw64\bin”
MSYS2_DIR\usr\bin”

If you use the right shell for the job, no modifications of the PATH are needed.
MSYS2 for adding / removing packages
MINGW64 for building

Thanks for holding my hand…still have the issue where if I build on Win10 64bit home version it won’t work on Pro version and the reverse…One of the Pro machines also has DT installed in a user account but the Pro machine I compiled only had an admin account so I have a couple of potential issues maybe related to user permissions maybe as the one compiled on the Pro version with only an admin account works fine there but not on the other one when trying to install in the normal user account…need to try installing on the admin account to see if that is the issue or if it is machine specific…I have a bit of trouble shooting to do but I think I have the directions all sorted now thanks to your help. One line was not clear…Copy fop.xconf to /etc/fop.xml not sure if this means copy the fob.xconf to a folder named fop.xml or to rename it in etc as fop.xml…I think this is only for the manual anyway but other wise I should be good…just need to take a systematic approach to this to sort it out…

The second option

Try the following:
delete the build folder in ~/darktable
Then in your home, with MINGW64 terminal, give the commands:

$ mkdir build
$ cd build
$ cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/darktable -DBINARY_PACKAGE_BUILD=ON ../.
$ cmake --build .
$ cmake --build . --target package

This will build a package where the compiler does not use the specific optimizations for your current machine, so it should run on all x86 CPUs.

I will add this to my Pull Request to update the build instruction

Thanks Marco I will dry that I have built it with the script build.sh and manually I think but as I said not systematically. I have 2 machines running Win10 Pro …one is AMD and one is Intel and the one at work running Win10 home is Intel. Then on a couple I run a user account for restricted access during day to day use but on the Win10 pro machine with the AMD processor where I have done most of my attempts there is only an admin account. So I could have an issue with the processor maybe AMD vs Intel?? Win versions?? Admin privileges?? or it could be something else…I am using the 64 bit shell and the code from git but I did notice early in the build some lines about detecting the installation type and install type Win32 build …that was a bit curious…not sure what that means I don’t think its compiling a 32 bit version…There were a couple of other small errors about variable length for the introspection/colormapping and colortransfer modules but all clear otherwise and it seems to install and run fine on the AMD machine…I think I will setup the Intel machine to compile it and compare it to what I get with the AMD box…

With the procedure I described above I have just built DT 2.7 package on my desktop PC, AMD Ryzen 5 / Win 10 Home and it runs fine on my laptop, Intel i5 / Win 10 Pro.

I will give it a try tonight…was looking through the build directory and there are several cmake files…a couple have the generic binary option set to off so I assume that means the compiler will try to be CPU specific…I am going to try your suggestion first and then I may edit those files and try turning generic on…not sure which one needs to be changed or both…I guess I have to do some reading to understand the workflow from source code to finished package…here’s hoping I don’t have to.

I think I discovered the issue…so because I just use the PC I compiled on for photos mostly and its my PC I just have one account and its an admin account. The others , one I use t work and he other here is a family computer…they
are setup day to day as running in a user account so with restricted privileges…Last night after building and installing instead of running DT for the first time from the start menu I went to the folder and right clicedvan ran as an administrator. Boom installed…I
think some of the initial steps when ou first install DT must require admin privileges…app/data filed maybe…anyway I do believe this wad the source of the issue at least for me…Thanks for all your advice along the way

Hi, I need to dig this topic again…
When i"m building DT I get error at checking validity of noiseprofiles.json

[ 93%] Checking validity of noiseprofiles.json
Traceback (most recent call last):
File “C:/msys64/mingw64/lib/python3.8/site-packages\appdirs.py”, line 560, in
import win32com.shell
ModuleNotFoundError: No module named ‘win32com’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\msys64\mingw64\bin\jsonschema-script.py”, line 6, in
from pkg_resources import load_entry_point
File “C:/msys64/mingw64/lib/python3.8/site-packages\pkg_resources_init_.py”, line 80, in
import appdirs
File “C:/msys64/mingw64/lib/python3.8/site-packages\appdirs.py”, line 564, in
from ctypes import windll
File “C:/msys64/mingw64/lib/python3.8\ctypes_init_.py”, line 453, in
pythonapi = PyDLL(“libpython%d.%d%s.dll” % (_sys.version_info[:2] + (sys.abiflags,)), None)
File "C:/msys64/mingw64/lib/python3.8\ctypes_init
.py", line 369, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 87] The parameter is incorrect
make[2]: *** [data/CMakeFiles/validate_noiseprofiles_json.dir/build.make:59: data/CMakeFiles/validate_noiseprofiles_json] Error 1
make[1]: *** [CMakeFiles/Makefile2:7325: data/CMakeFiles/validate_noiseprofiles_json.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

What can be a problem? and how fix it? Because I don’t have idea for 2 days…

It could be related to the recent updates of MSYS which bring Python 3.8
Build instructions have been updated with the following

Copy the lensfun folder and the lensfun-0.3.2-py3.6.egg-info file from /mingw64/lib/python3.6/site-packages to /mingw64/lib/python3.8/site-packages

Also, because of the updates, in my case I found a new missing dependency

pacman -S mingw-w64-x86_64-python3-importlib-metadata

I have just created a PR.
Hope it helps.

Marco

Ok, I will try with
pacman -S mingw-w64-x86_64-python3-importlib-metadata
Because I copied files from python 3.6 to 3.8 without effect

unfortunetlly it doesn’t work

Have you tried to update your MSYS2 installation?
Also check your Java version

MSYS2 reinstalled Java also and no effect.
Still the same error:
Traceback (most recent call last):
File “C:/msys64/mingw64/lib/python3.8/site-packages\appdirs.py”, line 560, in
import win32com.shell
ModuleNotFoundError: No module named ‘win32com’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\msys64\mingw64\bin\jsonschema-script.py”, line 6, in
from pkg_resources import load_entry_point
File “C:/msys64/mingw64/lib/python3.8/site-packages\pkg_resources_init_.py”, line 80, in
import appdirs
File “C:/msys64/mingw64/lib/python3.8/site-packages\appdirs.py”, line 564, in
from ctypes import windll
File “C:/msys64/mingw64/lib/python3.8\ctypes_init_.py”, line 453, in
pythonapi = PyDLL(“libpython%d.%d%s.dll” % (_sys.version_info[:2] + (sys.abiflags,)), None)
File "C:/msys64/mingw64/lib/python3.8\ctypes_init
.py", line 369, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 87] The parameter is incorrect
make[2]: *** [data/CMakeFiles/validate_noiseprofiles_json.dir/build.make:59: data/CMakeFiles/validate_noiseprofiles_json] Error 1
make[1]: *** [CMakeFiles/Makefile2:7325: data/CMakeFiles/validate_noiseprofiles_json.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
In step about lensfun should I rename lensfun-0.3.2-py3.6.egg-info to lensfun-0.3.2-py3.8.egg-info. Or how to install win32com.shell?

I’ve just updated mingw packages, following the last build.txt instructions and now I have the same issue as @mk989.

Edit:

[ 93%] Checking validity of noiseprofiles.json
Traceback (most recent call last):
File “C:\msys64\mingw64\bin\jsonschema-script.py”, line 6, in
from pkg_resources import load_entry_point
File “C:/msys64/mingw64/lib/python3.8/site-packages\pkg_resources_init_.py”, line 3251, in
def initialize_master_working_set():
File "C:/msys64/mingw64/lib/python3.8/site-packages\pkg_resources_init
.py", line 3234, in call_aside
f(*args, **kwargs)
File "C:/msys64/mingw64/lib/python3.8/site-packages\pkg_resources_init
.py", line 3263, in initialize_master_working_set
working_set = WorkingSet.build_master()
File "C:/msys64/mingw64/lib/python3.8/site-packages\pkg_resources_init
.py", line 583, in build_master
ws.require(requires)
File "C:/msys64/mingw64/lib/python3.8/site-packages\pkg_resources_init
.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "C:/msys64/mingw64/lib/python3.8/site-packages\pkg_resources_init
.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The ‘importlib_metadata’ distribution was not found and is required by jsonschema
make[2]: *** [data/CMakeFiles/validate_noiseprofiles_json.dir/build.make:59: data/CMakeFiles/validate_noiseprofiles_json] Error 1
make[1]: *** [CMakeFiles/Makefile2:7325: data/CMakeFiles/validate_noiseprofiles_json.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

Edit2:

This solved the issue.