aferrero2707 / PhotoFlow

A fully non-destructive photo retouching program providing a complete layer-based workflow including RAW image development.
http://aferrero2707.github.io/PhotoFlow
GNU General Public License v3.0
319 stars 36 forks source link

Window 64-bit Build Error - Stable Branch #66

Open Partha1b opened 8 years ago

Partha1b commented 8 years ago

I am getting the following errors:

[ 35%] Building CXX object src/CMakeFiles/pfbase.dir/base/image.cc.obj In file included from z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/base/image.cc:36:0: z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/base/imageprocessor.hh:82:5: error: 'pthread_t' does not name a type pthread_t _thread; ^ z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/base/imageprocessor.hh: In member function 'void PF::ImageProcessor::join()': z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/base/imageprocessor.hh:119:18: error: '_thread' was not declared in this scope pthread_join(_thread, NULL); ^ z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/base/imageprocessor.hh:119:31: error: 'pthread_join' was not declared in this scope pthread_join(_thread, NULL); ^ src/CMakeFiles/pfbase.dir/build.make:263: recipe for target src/CMakeFiles/pfbase.dir/base/image.cc.obj' failed make[2]: *** [src/CMakeFiles/pfbase.dir/base/image.cc.obj] Error 1 CMakeFiles/Makefile2:106: recipe for targetsrc/CMakeFiles/pfbase.dir/all' failed make[1]: * [src/CMakeFiles/pfbase.dir/all] Error 2 Makefile:149: recipe for target `all' failed make: * [all] Error 2

I use the following: gcc 5.1.0 64-bit on MSYS Windows 10 - 64-bit All dependencies built with the same flags: "-O3 -ffast-math -ftree-vectorize"

aferrero2707 commented 8 years ago

Sorry, that was clearly a posix threads use that should have been protected by defines.

It should be fixed now in the "stable" branch, by using Glib threads under Windows.

On the other hand, I still need to un-bundle LensFun for the OSX and Windows cases... I'll do that as soon as possible.

aferrero2707 commented 8 years ago

Update: it is now possible to disable the use of the bundled lensfun version, and switch to the system-supplied one. For that you need to invoke cmake with the following option:

cmake -DBUNDLED_LENSFUN=OFF

This change has been committed into the "stable" branch.

Partha1b commented 8 years ago

My cmake command is as follows:

cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=./Release -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXXFLAGS="-std=c++11 -O3 -ffast-math -ftree-vectorize" -DCMAKE C_FLAGS="-O3 -ffast-math -ftree-vectorize" -DBUNDLED_LENSFUN=OFF ..

I am getting the following error: z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/base/photoflow.cc: In member function 'void PF::PhotoFlow::close()': z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/base/photoflow.cc:184:52: error: no matching function for call to 'PF::PhotoFlow::close(int&)' for (int i = 0; i < _getmaxstdio(); ++i) close (i); ^ z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/base/photoflow.cc:176:6: note: candidate: void PF::PhotoFlow::close() void PF::PhotoFlow::close() ^ z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/base/photoflow.cc:176:6: note: candidate expects 0 arguments, 1 provided src/CMakeFiles/pfbase.dir/build.make:487: recipe for target `src/CMakeFiles/pfbase.dir/base/photoflow.cc.obj' failed

aferrero2707 commented 8 years ago

Oooops! Fixed in stable branch.

Partha1b commented 8 years ago

Still getting errors. :( z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/vips/lensfun.cc: In function 'int vips_lensfunbuild(VipsObject)': z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/vips/lensfun.cc:335:3: error: 'LensFunPar' is not a member of 'PF' PF::LensFunPar_ lfpar = dynamic_castPF::LensFunPar*( lensfun->processor->get_par() ); ^ etc.

Do you want the full error list? There are all related to the above.

aferrero2707 commented 8 years ago

That looks really weird... yes, I think I need a full copy of the build messages in order to look into this issue.

Thanks!

Partha1b commented 8 years ago

OK. I did a verbose Makefile. Here is the log: http://www.partha.com//temp/PotoFlow-Stable-Branch-Build.log

aferrero2707 commented 8 years ago

Thanks! I still do not really understand what's going on, as the same code compiles fine under OSX and Linux.

However, my impression is that there is some conflict in *.hh header inclusions, therefore I have cleaned up this part of the lensfun.cc file.

Could you try to build again with the current stable branch?

Hope this will solve this strange issue...

Partha1b commented 8 years ago

No, sorry. :(

I first thought it may be due to -std=c++11 and so I removed that option. It didn't compile. I tried with and without your bundle and still no joy.

I am getting the same error:

z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/vips/lensfun.cc:97:3: error: 'PF' does not name a type PF::ProcessorBase* processor; ^ z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/vips/lensfun.cc:106:3: error: 'lfDatabase' does not name a type lfDatabase* ldb; ^ z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/vips/lensfun.cc:107:3: error: 'lfModifier' does not name a type lfModifier* modifier;

On Mon, Jan 25, 2016 at 9:47 AM, aferrero2707 notifications@github.com wrote:

Thanks! I still do not really understand what's going on, as the same code compiles fine under OSX and Linux.

However, my impression is that there is some conflict in *.hh header inclusions, therefore I have cleaned up this part of the lensfun.cc file.

Could you try to build again with the current stable branch?

Hope this will solve this strange issue...

— Reply to this email directly or view it on GitHub https://github.com/aferrero2707/PhotoFlow/issues/66#issuecomment-174528145 .

aferrero2707 commented 8 years ago

Well, the problem seem to have moved somewhere else... I've added some C pre-processor diagnostics warnings, let's see if that helps.

-std=c++11 or the bundling do not seem to be responsible for that, it looks more like some sort of mess in the C++ header files inclusion. Could you try again to update your local repo, run the compilation with -DBUNDLED_LENSFUN=OFF and send me a log again? It will most likely fail once more, but I hope to have more information to pin down the issue.

Sorry for this trial-and-error approach, but I cannot reproduce this problem anywhere else...

Partha1b commented 8 years ago

I deleted my whole PhotoFlow folder and started fresh.

We seemed to have moved passed lensfun.cc!! :)

However, the error now is at:

z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/dt/iop/clipping.cc:284:65: error: narrowing conversion of '+Inf' from 'double' to 'float' inside { } [-Wnarrowing] float aabb_in[4] = { INFINITY, INFINITY, -INFINITY, -INFINITY }; ^ z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/dt/iop/clipping.cc:284:65: error: narrowing conversion of '+Inf' from 'double' to 'float' inside { } [-Wnarrowing] z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/dt/iop/clipping.cc:284:65: error: narrowing conversion of '-Inf' from 'double' to 'float' inside { } [-Wnarrowing] z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/dt/iop/clipping.cc:284:65: error: narrowing conversion of '-Inf' from 'double' to 'float' inside { } [-Wnarrowing] src/CMakeFiles/pfbase.dir/build.make:730: recipe for target `src/CMakeFiles/pfbase.dir/vips/perspective.cc.obj' failed

So, we are making progress! :) The full log is here: http://www.partha.com//temp/PhotoFlow-build.txt

aferrero2707 commented 8 years ago

Great!

I've added a floating-point version of the INFINITY define to avoid the narrowing error.

Looks like your compiler is stricter than what I'm using under OSX and Linux...

Partha1b commented 8 years ago

Great! We are getting there. I reached 51%. :)

Here is the next error:

z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/operations/raw_image.cc:136:19: error: 'filename' was not declared in this scope mbstowcs(filen, filename, len); ^ src/CMakeFiles/pfbase.dir/build.make:1783: recipe for target `src/CMakeFiles/pfbase.dir/operations/raw_image.cc.obj' failed make[2]: *\ [src/CMakeFiles/pfbase.dir/operations/raw_image.cc.obj] Error 1

Yes, the compiler is very strict. I think that makes for better code? :)

On Tue, Jan 26, 2016 at 5:09 AM, aferrero2707 notifications@github.com wrote:

Great!

I've added a floating-point version of the INFINITY define to avoid the narrowing error.

Looks like your compiler is stricter than what I'm using under OSX and Linux...

— Reply to this email directly or view it on GitHub https://github.com/aferrero2707/PhotoFlow/issues/66#issuecomment-174940656 .

aferrero2707 commented 8 years ago

Fix committed :)

Partha1b commented 8 years ago

Hmm, git says I am already update to date. Did you commit to the stable branch?

On Tue, Jan 26, 2016 at 7:00 AM, aferrero2707 notifications@github.com wrote:

Fix committed :)

— Reply to this email directly or view it on GitHub https://github.com/aferrero2707/PhotoFlow/issues/66#issuecomment-174969634 .

aferrero2707 commented 8 years ago

Something went wrong with my commit... now it should be there.

Partha1b commented 8 years ago

OK! Now the code is all fine though there are a lot of warnings. Perhaps we can clean them up later. :)

However I have another issue. Malformed link files. I am getting the following errors:

[100%] Building CXX object src/plugin/CMakeFiles/pfgimp.dir/pfgimp.cc.obj g++.exe: error: Process: No such file or directory g++.exe: error: failed: No such file or directory g++.exe: error: because:: Invalid argument g++.exe: error: The: No such file or directory g++.exe: error: system: No such file or directory g++.exe: error: cannot: No such file or directory g++.exe: error: find: No such file or directory g++.exe: error: the: No such file or directory g++.exe: error: file: No such file or directory g++.exe: error: specified: No such file or directory src/plugin/CMakeFiles/pfgimp.dir/build.make:55: recipe for target src/plugin/CMakeFiles/pfgimp.dir/pfgimp.cc.obj' failed make[2]: *** [src/plugin/CMakeFiles/pfgimp.dir/pfgimp.cc.obj] Error 1 CMakeFiles/Makefile2:387: recipe for target src/plugin/CMakeFiles/pfgimp.dir/all' failed make[1]: * [src/plugin/CMakeFiles/pfgimp.dir/all] Error 2 Makefile:116: recipe for target `all' failed make: * [all] Error 2

Grepping for "Process failed" gives me the following:

$ grep "Process failed" . -R -n

./src/plugin/CMakeFiles/pfgimp.dir/flags.make:5:CXX_FLAGS = -DPF_HAS_LENSFUN -O3 -ffast-math -ftree-vectorize -DNDEBUG -std=gnu++11 -Dgmic_build -Dcimg_use_vt100 -Dgmic_is_parallel -Dcimg_use_fftw3 -Dcimg_use_tiff -Dcimg_use_zlib -Dcimg_display=0 -fno-ipa-sra -fpermissive -IZ:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/dt -DLIBRAW_NODLL -DINSTALL_PREFIX='""' -DGTKMM_2 -Wno-unused-parameter @CMakeFiles/pfgimp.dir/includes_CXX.rsp Process failed because: The system cannot find the file specified

./src/plugin/CMakeFiles/pfgimp.dir/linklibs.rsp:1: -LZ:/opts/opt64-posix/lib ../libpfgui.a ../libpfbase.a ../libpfdt.a Z:/opts/opt64-posix/lib/libtiff.dll.a Z:/opts/opt64-posix/lib/libpng.dll.a Z:/opts/opt64-posix/lib/libz.dll.a Z:/opts/opt64-posix/lib/libjpeg.dll.a -llcms2 -lvips -lgobject-2.0 -lglib-2.0 -lintl Z:/opts/opt64-posix/lib/libtiff.dll.a Z:/opts/opt64-posix/lib/libpng.dll.a Z:/opts/opt64-posix/lib/libz.dll.a Z:/opts/opt64-posix/lib/libjpeg.dll.a -llcms2 -lxml2 -lexif Z:/opts/opt64-posix/lib/libexiv2.dll.a -lgexiv2 -lexiv2 -lgobject-2.0 -lglib-2.0 -lintl -lsigc-2.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lfontconfig -lfreetype -lpixman-1 -lProcess failed because: The system cannot find the file specified

./src/plugin/CMakeFiles/pfgimp.dir/linklibs.rsp:3:for command: gimptool-2.0

--libs -lgtkmm-2.4 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgtk-win32-2.0 -lgdk-win32-2.0 -lgdi32 -limm32 -lshell32 -lole32 -lpangowin32-1.0 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lglibmm-2.4 -lgobject-2.0 -lglib-2.0 -lintl -lsigc-2.0 -lglib-2.0 -lintl -lgmodule-2.0 -lglib-2.0 -lintl -lgobject-2.0 -lglib-2.0 -lintl -lgthread-2.0 -lglib-2.0 -lintl Z:/opts/opt64-posix/lib/libz.dll.a ../external/LibRaw/liblibraw_r.a ../external/rawspeed/librawspeed.a -lfftw3 -lws2_32 -lshlwapi -lpsapi -lpugixml Z:/opts/opt64-posix/lib/libtiff.dll.a Z:/opts/opt64-posix/lib/libpng.dll.a Z:/opts/opt64-posix/lib/libjpeg.dll.a -llcms2 -lvips -lgobject-2.0 -lxml2 -lexif Z:/opts/opt64-posix/lib/libexiv2.dll.a -lgexiv2 -lexiv2 -lsigc-2.0 -lpango-1.0 -lpangoft2-1.0 -lfontconfig -lfreetype -lpixman-1 -lProcess failed because: The system cannot find the file specified

I am not sure which file it's looking for where the process failed above?

On Tue, Jan 26, 2016 at 7:05 AM, aferrero2707 notifications@github.com wrote:

Something went wrong with my commit... now it should be there.

— Reply to this email directly or view it on GitHub https://github.com/aferrero2707/PhotoFlow/issues/66#issuecomment-174971514 .

Partha1b commented 8 years ago

I took this forward. I removed that text from the files mentioned above and then reran make.

I get the following error: z:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/plugin/pfgimp.cc:8:34: fatal error: libgimpbase/gimpbase.h: No such file or directory compilation terminated. src/plugin/CMakeFiles/pfgimp.dir/build.make:55: recipe for target src/plugin/CMakeFiles/pfgimp.dir/pfgimp.cc.obj' failed make[2]: *** [src/plugin/CMakeFiles/pfgimp.dir/pfgimp.cc.obj] Error 1 CMakeFiles/Makefile2:387: recipe for targetsrc/plugin/CMakeFiles/pfgimp.dir/all' failed make[1]: * [src/plugin/CMakeFiles/pfgimp.dir/all] Error 2 Makefile:116: recipe for target `all' failed make: * [all] Error 2

The only thing I can think of is that libmypaint is not in my path but is in my pkgconfig path. Could this be the issue?

aferrero2707 commented 8 years ago

I'm suspecting those two lines in the src/plugin/CMakeLists.txt file:

exec_program(gimptool-2.0 ARGS --cflags OUTPUT_VARIABLE GIMP_C_FLAGS)
exec_program(gimptool-2.0 ARGS --libs OUTPUT_VARIABLE GIMP_LIBS)

I'm afraid gimptool-2.0 cannot be run so easily on WIN, and also those calls are most likely not necessary, as the flags are already set by

pkg_check_modules(GIMP_2_9 gimp-2.0>=2.9.0)

in the top-level CMakeLists.txt file.

I'm testing if those lines can indeed be removed.

Partha1b commented 8 years ago

Simply run pkg-config --cflags gimp-2.0. It will be fine.

On Tue, Jan 26, 2016 at 9:20 AM, aferrero2707 notifications@github.com wrote:

I'm suspecting those two lines in the src/plugin/CMakeLists.txt file:

exec_program(gimptool-2.0 ARGS --cflags OUTPUT_VARIABLE GIMP_C_FLAGS) exec_program(gimptool-2.0 ARGS --libs OUTPUT_VARIABLE GIMP_LIBS)

I'm afraid gimptool-2.0 cannot be run so easily on WIN, and also those calls are most likely not necessary, as the flags are already set by

pkg_check_modules(GIMP_2_9 gimp-2.0>=2.9.0)

in the top-level CMakeLists.txt file.

I'm testing if those lines can indeed be removed.

— Reply to this email directly or view it on GitHub https://github.com/aferrero2707/PhotoFlow/issues/66#issuecomment-175038014 .

aferrero2707 commented 8 years ago

So I've got rid of the calls to gimptool-2.0, and only used pkg_check_modules, in a way that should be compatible with all platforms...

We are almost there!

Partha1b commented 8 years ago

I am testing your theory (which I think is correct) by temporarily adding GIMP to the path. Do you want me to instead do a git pull or see if this works?

You are right. We're almost there. :)

On Tue, Jan 26, 2016 at 9:50 AM, aferrero2707 notifications@github.com wrote:

So I've got rid of the calls to gimptool-2.0, and only used pkg_check_modules, in a way that should be compatible with all platforms...

We are almost there!

— Reply to this email directly or view it on GitHub https://github.com/aferrero2707/PhotoFlow/issues/66#issuecomment-175055995 .

aferrero2707 commented 8 years ago

I would propose a git pull, since I would like to see if this is a reliable and durable solution for all systems...

Thanks!

Partha1b commented 8 years ago

You are right. I did a git pull and the issue with "Process failed" disappeared.

Just some final issues and we'll be set I think. -lgimp etc., -lgegl etc. and -lbabl are not found, probably because it does not pick up the lib locations? They need to be obtained from pkg-config --libs gimp-2.0 pkg-config --libs gegl-0.3 pkg-config --libs babl

In my case,

$ pkg-config --libs gimp-2.0

-LZ:/opts/opt64-posix/lib -LZ:/opts/opt64-posix/gimp-2.9/lib -LZ:/opts/opt64-posix/babl/lib -LZ:/opts/opt64-posix/gegl/lib -lgimp-2.0 -lgimpmath-2.0 -lgimpconfig-2.0 -lgimpcolor-2.0 -lgimpbase-2.0 -lgdk_pixbuf-2.0 -lcairo -lgegl-0.3 -lgegl-npd-0.3 -lgmodule-2.0 -ljson-glib-1.0 -lgio-2.0 -lgmodule-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lbabl-0.1

$ pkg-config --libs gegl-0.3

-LZ:/opts/opt64-posix/lib -LZ:/opts/opt64-posix/babl/lib -LZ:/opts/opt64-posix/gegl/lib -lgegl-0.3 -lgegl-npd-0.3 -lgmodule-2.0 -ljson-glib-1.0 -lgio-2.0 -lgmodule-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lbabl-0.1

$ pkg-config --libs babl

-LZ:/opts/opt64-posix/babl/lib -lbabl-0.1

I manually changed links.rsp to fix the above.

More importantly, I get these undefined references:

../libpfgui.a(lensfun_config.cc.obj):lensfun_config.cc:(.text+0x502):

undefined reference to lf_db_new' ../libpfgui.a(lensfun_config.cc.obj):lensfun_config.cc:(.text+0x511): undefined reference tolfDatabase::Load()' ../libpfgui.a(lensfun_config.cc.obj):lensfun_config.cc:(.text+0x869): undefined reference to lfDatabase::FindCameras(char const*, char const*) const' ../libpfgui.a(lensfun_config.cc.obj):lensfun_config.cc:(.text+0x899): undefined reference tolf_free' ../libpfgui.a(lensfun_config.cc.obj):lensfun_config.cc:(.text+0x909): undefined reference to lfDatabase::FindLenses(lfCamera const*, char const*, char const*, int) const' ../libpfgui.a(lensfun_config.cc.obj):lensfun_config.cc:(.text+0x919): undefined reference tolf_free' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x9): undefined reference to lf_db_new' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x3d8): undefined reference tolfModifier::ApplySubpixelGeometryDistortion(float, float, int, int, float) const' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x861): undefined reference to `lfModifier::ApplySubpixelGeometryDistortion(float, float, int, int, float) const' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0xdc0): undefined reference to lfModifier::ApplySubpixelGeometryDistortion(float, float, int, int, float*) const' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1280): undefined reference tolfModifier::ApplySubpixelGeometryDistortion(float, float, int, int, float) const' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1999): undefined reference to `lfDatabase::FindCameras(char const, char const_) const' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1afc): undefined reference to lf_free' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1b7f): undefined reference tolfDatabase::FindLenses(lfCamera const, char const, char const_, int) const' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1d27): undefined reference to lf_free' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1e9a): undefined reference tolfModifier::Create(lfLens const, float, int, int)' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1fe2): undefined reference to `lfModifier::Initialize(lfLens const, lfPixelFormat, float, float, float, float, lfLensType, int, bool)' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1d): undefined reference to lfDatabase::Load()' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1b6): undefined reference tolfDatabase::FindCameras(char const, char const) const' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1e6): undefined reference to lf_free' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x22c): undefined reference tolfDatabase::FindLenses(lfCamera const, char const, char const_, int) const' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x240): undefined reference to lf_free' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x862): undefined reference tolf_dbnew' ../libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x871): undefined reference to lfDatabase::Load()' collect2.exe: error: ld returned 1 exit status src/plugin/CMakeFiles/pfgimp.dir/build.make:132: recipe for target src/plugin/pfgimp.exe' failed make[2]: ** [src/plugin/pfgimp.exe] Error 1

On Tue, Jan 26, 2016 at 9:58 AM, aferrero2707 notifications@github.com wrote:

I would propose a git pull, since I would like to see if this is a reliable and durable solution for all systems...

Thanks!

— Reply to this email directly or view it on GitHub https://github.com/aferrero2707/PhotoFlow/issues/66#issuecomment-175058941 .

aferrero2707 commented 8 years ago

Are you using the bundled or your system-wide LensFun package? I suppose not the bundled one, but I just want to make sure before digging in the cmake files...

Partha1b commented 8 years ago

My system wide LensFun package. My cmake command line is:

cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/opt -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-std=c++11 -O3 -ffast-math -ftree-vectorize" -DCMAKE_C_FLAGS="-O3 -ffast-math -ftree-vectorize" -DBUNDLED_LENSFUN=OFF ..

On Tue, Jan 26, 2016 at 10:30 AM, aferrero2707 notifications@github.com wrote:

Are you using the bundled or your system-wide LensFun package? I suppose not the bundled one, but I just want to make sure before digging in the cmake files...

— Reply to this email directly or view it on GitHub https://github.com/aferrero2707/PhotoFlow/issues/66#issuecomment-175078720 .

aferrero2707 commented 8 years ago

And you get this undefined references only for the pfgimp executable, or also for photoflow.exe and pfbatch.exe?

Partha1b commented 8 years ago

Only for the pfgimp executable.

On Tue, Jan 26, 2016 at 10:34 AM, aferrero2707 notifications@github.com wrote:

And you get this undefined references only for the pfgimp executable, or also for photoflow.exe and pfbatch.exe?

— Reply to this email directly or view it on GitHub https://github.com/aferrero2707/PhotoFlow/issues/66#issuecomment-175080443 .

aferrero2707 commented 8 years ago

Ok... would you mind to share again a full build log? That would help me to figure out the exact list of libraries that is not properly linked.

Thanks!

Partha1b commented 8 years ago

Here is the log:

http://www.partha.com/temp/PhotoFlow-build.txt

I am sure you'll solve it. :)

Let me know if you need anything else.

Thanks!

On Tue, Jan 26, 2016 at 4:33 PM, aferrero2707 notifications@github.com wrote:

Ok... would you mind to share again a full build log? That would help me to figure out the exact list of libraries that is not properly linked.

Thanks!

— Reply to this email directly or view it on GitHub https://github.com/aferrero2707/PhotoFlow/issues/66#issuecomment-175240959 .

aferrero2707 commented 8 years ago

I think that having a separate CMakeLists.txt file for the plugin directory is creating more troubles than I was expecting, so I moved everything in the src/CMakeLists.txt, and also added some debugging messages with the library definitions used by cmake.

Could you pull and build again, and send me the full log if it doesn't work? Hopefully this time it will not be necessary ;-)

Thanks!

P.S: did you already manage to test the OSX version of the plug-in? Is there a lace where I can get the preliminary DMG files for testing them as well?

Partha1b commented 8 years ago

Sorry, no change. It still does not pull the library locations for gimp/babl/gegl. I can get passed that by manually modifying linklibs.rsp. However, then we are back to undefined references to lensfun stuff.

Do you still want the log file?

On Wed, Jan 27, 2016 at 5:27 AM, aferrero2707 notifications@github.com wrote:

I think that having a separate CMakeLists.txt file for the plugin directory is creating more troubles than I was expecting, so I moved everything in the src/CMakeLists.txt, and also added some debugging messages with the library definitions used by cmake.

Could you pull and build again, and send me the full log if it doesn't work? Hopefully this time it will not be necessary ;-)

Thanks!

P.S: did you already manage to test the OSX version of the plug-in? Is there a lace where I can get the preliminary DMG files for testing them as well?

— Reply to this email directly or view it on GitHub https://github.com/aferrero2707/PhotoFlow/issues/66#issuecomment-175536099 .

Partha1b commented 8 years ago

Any reason for building static libs?

On Wed, Jan 27, 2016 at 6:19 PM, Partha Bagchi partha1b@gmail.com wrote:

Sorry, no change. It still does not pull the library locations for gimp/babl/gegl. I can get passed that by manually modifying linklibs.rsp. However, then we are back to undefined references to lensfun stuff.

Do you still want the log file?

On Wed, Jan 27, 2016 at 5:27 AM, aferrero2707 notifications@github.com wrote:

I think that having a separate CMakeLists.txt file for the plugin directory is creating more troubles than I was expecting, so I moved everything in the src/CMakeLists.txt, and also added some debugging messages with the library definitions used by cmake.

Could you pull and build again, and send me the full log if it doesn't work? Hopefully this time it will not be necessary ;-)

Thanks!

P.S: did you already manage to test the OSX version of the plug-in? Is there a lace where I can get the preliminary DMG files for testing them as well?

— Reply to this email directly or view it on GitHub https://github.com/aferrero2707/PhotoFlow/issues/66#issuecomment-175536099 .

aferrero2707 commented 8 years ago

"Do you still want the log file?"

Yes, please! I've added some cmake debugging messages that will hopefully help me to clarify what's wrong...

"Any reason for building static libs?" No, apart from the fact that I wasn't sure how to deal with library paths on OSX and Windows, and that the libraries are only needed for photoflow itself...

Partha1b commented 8 years ago

OK, Here is the logfile: http://www.partha.com//temp/PhotoFlow-build.txt

I'd suggest building shared and relying on pkg-config --libs for library paths.

PS: One of the reasons I don't like cmake is that it's very difficult to debug. :(

On Thu, Jan 28, 2016 at 2:45 AM, aferrero2707 notifications@github.com wrote:

"Do you still want the log file?"

Yes, please! I've added some cmake debugging messages that will hopefully help me to clarify what's wrong...

"Any reason for building static libs?" No, apart from the fact that I wasn't sure how to deal with library paths on OSX and Windows, and that the libraries are only needed for photoflow itself...

— Reply to this email directly or view it on GitHub https://github.com/aferrero2707/PhotoFlow/issues/66#issuecomment-176037384 .

aferrero2707 commented 8 years ago

I found at least one mistake in my src/CMakeLists.txt that could explain the missing libraries for the GIMP plug-in:

  add_executable(pfgimp ${PluginSources})

was wrongly placed BEFORE the calls to link_directories(), so it could not work like that.

This is fixed now in the git stable branch.

If it still doesn't link correctly, could you provide me the content of @CMakeFiles/pfgimp.dir/linklibs.rsp in addition to the build log?

Thanks again!

Partha1b commented 8 years ago

OK, GIMP linked is solved. :)

The only thing that remains is the lensfun linking to the 2 static libs:

Linking CXX executable pfgimp.exe cd /Z/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/build/src && /z/foss/cmake/bin/cmake.exe -E remove -f CMakeFiles/pfgimp.dir/objects.a cd /Z/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/build/src && /Z/foss/gcc/64bit/gcc-posix-5.3.0/bin/ar.exe cr CMakeFiles/pfgimp.dir/objects.a @CMakeFiles/pfgimp.dir/objects1.rsp cd /Z/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/build/src && /Z/foss/gcc/64bit/gcc-posix-5.3.0/bin/g++.exe -DPF_HAS_LENSFUN -O3 -ffast-math -ftree-vectorize -DNDEBUG -std=gnu++11 -Dgmic_build -Dcimg_use_vt100 -Dgmic_is_parallel -Dcimg_use_fftw3 -Dcimg_use_tiff -Dcimg_use_zlib -Dcimg_display=0 -fno-ipa-sra -fpermissive -Iz:/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/src/dt -DLIBRAW_NODLL -DINSTALL_PREFIX='""' -DGTKMM_2 -Wno-unused-parameter -Wl,--whole-archive CMakeFiles/pfgimp.dir/objects.a -Wl,--no-whole-archive -o pfgimp.exe -Wl,--out-implib,libpfgimp.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/pfgimp.dir/linklibs.rsp libpfgui.a(lensfun_config.cc.obj):lensfun_config.cc:(.text+0x502): undefined reference to lf_db_new' libpfgui.a(lensfun_config.cc.obj):lensfun_config.cc:(.text+0x511): undefined reference tolfDatabase::Load()' libpfgui.a(lensfun_config.cc.obj):lensfun_config.cc:(.text+0x869): undefined reference to lfDatabase::FindCameras(char const*, char const*) const' libpfgui.a(lensfun_config.cc.obj):lensfun_config.cc:(.text+0x899): undefined reference tolf_free' libpfgui.a(lensfun_config.cc.obj):lensfun_config.cc:(.text+0x909): undefined reference to lfDatabase::FindLenses(lfCamera const*, char const*, char const*, int) const' libpfgui.a(lensfun_config.cc.obj):lensfun_config.cc:(.text+0x919): undefined reference tolf_free' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x9): undefined reference to lf_db_new' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x3d8): undefined reference tolfModifier::ApplySubpixelGeometryDistortion(float, float, int, int, float) const' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x861): undefined reference to `lfModifier::ApplySubpixelGeometryDistortion(float, float, int, int, float) const' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0xdc0): undefined reference to lfModifier::ApplySubpixelGeometryDistortion(float, float, int, int, float*) const' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1280): undefined reference tolfModifier::ApplySubpixelGeometryDistortion(float, float, int, int, float) const' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1999): undefined reference to `lfDatabase::FindCameras(char const, char const_) const' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1afc): undefined reference to lf_free' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1b7f): undefined reference tolfDatabase::FindLenses(lfCamera const, char const, char const_, int) const' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1d27): undefined reference to lf_free' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1e9a): undefined reference tolfModifier::Create(lfLens const, float, int, int)' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1fe2): undefined reference to `lfModifier::Initialize(lfLens const, lfPixelFormat, float, float, float, float, lfLensType, int, bool)' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1d): undefined reference to lfDatabase::Load()' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1b6): undefined reference tolfDatabase::FindCameras(char const, char const) const' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x1e6): undefined reference to lf_free' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x22c): undefined reference tolfDatabase::FindLenses(lfCamera const, char const, char const_, int) const' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x240): undefined reference to lf_free' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x862): undefined reference tolf_dbnew' libpfbase.a(lensfun.cc.obj):lensfun.cc:(.text+0x871): undefined reference to lfDatabase::Load()' collect2.exe: error: ld returned 1 exit status src/CMakeFiles/pfgimp.dir/build.make:135: recipe for target src/pfgimp.exe' failed make[2]: ** [src/pfgimp.exe] Error 1 make[2]: Leaving directory /usr/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/build' CMakeFiles/Makefile2:202: recipe for targetsrc/CMakeFiles/pfgimp.dir/all' failed make[1]: * [src/CMakeFiles/pfgimp.dir/all] Error 2 make[1]: Leaving directory /usr/src/gimp/plug-ins/Useful-Plugins/PhotoFlow/build' Makefile:119: recipe for targetall' failed make: * [all] Error 2

Note that all the above are defined in my library.

On Thu, Jan 28, 2016 at 7:58 AM, aferrero2707 notifications@github.com wrote:

I found at least one mistake in my src/CMakeLists.txt that could explain the missing libraries for the GIMP plug-in: add_executable(pfgimp ${PluginSources}) was wrongly placed BEFORE the calls to link_directories(), so it could not work like that.

This is fixed now in the git stable branch.

If it still doesn't link correctly, could you provide me the content of @CMakeFiles/pfgimp.dir/linklibs.rsp in addition to the build log?

Thanks again!

— Reply to this email directly or view it on GitHub https://github.com/aferrero2707/PhotoFlow/issues/66#issuecomment-176170991 .

aferrero2707 commented 8 years ago

Ok, I have found yet another mistake in the CMakeLists.txt that was preventing the proper linking of lensfun libraries for the plug-in...

Partha1b commented 8 years ago

All right! :) That did it. Now I can build and use it except for the theme you are using. :)

Anyway, there is another issue I think you need to fix in your cmake file.

If I set the install prefix to where all my files are (/opt) then cmake can find all the dependencies. If I use anything else (say /opt/PhotoFlow) no libraries are found.

I think this is because you are not using find_package in your CmakeLists.txt.

On Fri, Jan 29, 2016 at 4:24 AM, aferrero2707 notifications@github.com wrote:

Ok, I have found yet another mistake in the CMakeLists.txt that was preventing the proper linking of lensfun libraries for the plug-in...

— Reply to this email directly or view it on GitHub https://github.com/aferrero2707/PhotoFlow/issues/66#issuecomment-176659483 .