Filmulator and Windows

So, in the past week there have been two inquiries about running Filmulator on Windows.

It’s something I’m definitely interested in, I just don’t have the expertise needed for making it work with Windows and especially deployment. If anyone can provide help, that’d be great!

VMs work, but there seem to be various graphical glitches involved in QML, such as file picker dialog boxes appearing below the contents of the main window (even if above the window decorations of the main window)… I don’t think there’s really anything I could do about that, though.

The other angle on it is to use Windows Subsystem for Linux. There’s some issues with it, such as an inability to create certain directories (?) and MingW returning success despite that? Or something.

But first of all, since WSL doesn’t currently support FUSE AppImages don’t work, so you need to run the AppImage with the --appimage-extract parameter to unzip the contents. Then, you need to cd into that directory, and set two environment variables: export APPDIR=[the folder where you extracted the AppImage], which tells the binary where to look for the QML UI files, and export QMLSCENE_DEVICE=softwarecontext to enable the software renderer, since WSL doesn’t support OpenGL either. This’ll be a huge drag on performance if you try to zoom or pan the image, but it’s necessary.

I haven’t really tested it myself, because I don’t have a Windows computer on hand, but if anyone can offer any experiences or suggestions, I’d really appreciate it.

1 Like

I think @afre uses windows, offers super detailed feedback, and is willing to work through some issues; perhaps he can be of service. @Jacal and @McCap might also be willing to try some things out as well :slight_smile:

Maybe also @sguyader and @gaaned92 if you need some advice about building on windows.

Hope that is helpful!

I could do some general testing, but I’m not very good at giving precise bug reports etc…

It’s not even at that point, it needs developer attention first so I know where to put application data and thumbnails and stuff.

What I am doing for photoflow is the following:

  • cross-compile the code under Linux using mingw-64 and a tool called crossroad that handles the dependencies from the OpenSUSE repositories
  • I bundle everything needed into sub-folders of a single root folder
  • in the code, I look for files relative to the location of the photoflow.exe executable
  • I simply zip the root folder of the bundle in order to distribute the package

No installer needed, and multiple versions can co-exist simultaneously as they reside in separate folders…

So if a dependency isn’t in the openSUSE repository, I’ll need to build it myself, also in the crossroad environment? For example, LibRaw.

@CarVac Are you still interested by a W64 build.

I made a trial but was stopped by QT errors. As I have no knowledge about QT build environment, I cannot go further.

1 Like

Yes, I’m still interested.

What issues did you have?

What I’ve found with supporting dual Linux/Windows architectures is, 1) supporting Windows cross-compilation is simple because your supporting library structure can be insular to your application, and 2) supporting Windows cross-compilation can be vexing because you have to build your supporting library structure yourself.

Until rawproc 0.7 that I released yesterday, I used mingw-w64 and I cross-compiled my support libraries and installed them to /usr/[arch]/lib and include. That included libjpeg, libtiff, libpng, liblcms2 and libraw, and a couple of supporting libraries. Lensfun bolloxed that up considerably, as it requires glib, and glib requires iconv, and iconv… ow, hurts to recall it. What I finally found that works is mxe, one-stop shopping for building Windows toolchains that included ALL of the libraries I needed. Well, I hand-compiled wxWidgets and Libraw because the mxe versions were not what I wanted, but that worked ok. http://mxe.cc, highly recommended.

1 Like

@CarVac

Build environment

  • MSYS2 on windows10
  • gcc7.3.0
  • qmake 3.1
  • Qt 5.10.1

As qmake seems very silent, I cannot check if all dependencies are present in MSYS2/mingw64. How qmake can be made verbose.

I would like to build in a directory external to local repository and install filmulator and all dependencies in a specific directory (for instance /d/programmes/filmulator/fminstall/<somename>) (bundled build)

Log file: log.txt (39.2 KB)

It seems like a variable named RGB is conflicting with the RGB macro defined in some Windows something or other.

Try pulling the dev branch; I just changed the name of that variable.

branch dev v0.7.0-2-g9120297

  1. RGB variable

I searched in the MSYS2 environment and it seems there is no RGB variable or whatever.
So perhaps it is created during the build process with QT?

I suppressed an other occurence of RGB in colorspaces.cpp and it is ok now.

  1. desktop and extra path

What is the use of those variables? How to set them?

WARNING: desktop.path is not defined: install target not created

WARNING: extra.path is not defined: install target not created

WARNING: desktop.path is not defined: install target not created

WARNING: extra.path is not defined: install target not created
  1. other errors

log.txt (52.3 KB)

Okay, the next issue is the interface class has a name collision as well. I’ll fix it in a few hours when I get back home for lunch.

patch for colorspaces.cpp

diff --git a/filmulator-gui/core/colorSpaces.cpp b/filmulator-gui/core/colorSpaces.cpp
index 4a379ce..014c3bf 100644
--- a/filmulator-gui/core/colorSpaces.cpp
+++ b/filmulator-gui/core/colorSpaces.cpp
@@ -143,15 +143,15 @@ void Lab_to_XYZ(float   L, float   a, float   b,
 //The L* is 0 = 0, 1 = 65535.
 //a* and b* are -1 = 1, 0 = 32768, +1 = 65535.
 //Reference: http://www.brucelindbloom.com/index.html?Eqn_RGB_to_XYZ.html
-void sRGB_to_Lab_s(matrix<unsigned short> &RGB,
+void sRGB_to_Lab_s(matrix<unsigned short> &in,
                    matrix<unsigned short> &Lab)
 {
-    int nRows = RGB.nr();
-    int nCols = RGB.nc();
+    int nRows = in.nr();
+    int nCols = in.nc();
 
     Lab.set_size(nRows, nCols);
 
-#pragma omp parallel shared(RGB, Lab) firstprivate(nRows, nCols)
+#pragma omp parallel shared(in, Lab) firstprivate(nRows, nCols)
     {
 #pragma omp for schedule(dynamic) nowait
         for (int i = 0; i < nRows; i++)
@@ -159,9 +159,9 @@ void sRGB_to_Lab_s(matrix<unsigned short> &RGB,
             for (int j = 0; j < nCols; j += 3)
             {
                 //First, linearize the sRGB.
-                float r = sRGB_inverse_gamma(float(RGB(i, j  ))/65535.0);
-                float g = sRGB_inverse_gamma(float(RGB(i, j+1))/65535.0);
-                float b = sRGB_inverse_gamma(float(RGB(i, j+2))/65535.0);
+                float r = sRGB_inverse_gamma(float(in(i, j  ))/65535.0);
+                float g = sRGB_inverse_gamma(float(in(i, j+1))/65535.0);
+                float b = sRGB_inverse_gamma(float(in(i, j+2))/65535.0);
 
                 //Next, convert to XYZ.
                 float x, y, z;

Add a null line at the end

Uh, isn’t that what my latest two commits to the dev branch did?

In any case, I just pushed another change to the dev branch to refactor the name interface.

the commits begin at line 198. The patch above concerns lines before 170.

Now, with my patch above, I have those errors

  • error 1

    …/filmulator/filmulator-gui/ui/filmImageProvider.cpp:3:10: fatal error: pwd.h: No such file or directory
    #include <pwd.h>
    ^~~~~~~
    compilation terminated.

pwd.h seems to be part of mingw-w64-x86_64-postgresql package. So I installed it.
pacman indicates that path to pwd.h is /mingw64/include/postgresql/server/port/win32/pwd.h, but it is not found when building.
furthermore, when I edit pwd.h, I find following code:

/*
 * src/include/port/win32/pwd.h
 */
  • error 2

      ../filmulator/filmulator-gui/database/sqlInsertion.cpp:129:15: error: multiple types in one declaration
           Interface interface;
                     ^
      ../filmulator/filmulator-gui/database/sqlInsertion.cpp:129:15: error: declaration does not declare anything [-fpermissive]
      ../filmulator/filmulator-gui/database/sqlInsertion.cpp:129:15: error: expected primary-expression before 'struct'
      ../filmulator/filmulator-gui/database/sqlInsertion.cpp:135:74: error: expected primary-expression before 'struct'
           matrix<unsigned short> image = pipeline.processImage(&paramManager, &interface, exif);
    

I tried to figure out what the <pwd.h> inclusion is for, and… I have no idea. It’s from the very first commit in the gui version of Filmulator, so pretty much I had no idea what I was doing at the time.

So I removed it and a bunch of other unnecessary includes from filmImageProvider.cpp.

Now, only error 2 remains