jcelaya / hdrmerge

HDR exposure merging
http://jcelaya.github.io/hdrmerge/
Other
362 stars 78 forks source link

Link error on W32 #87

Closed gaaned92 closed 6 years ago

gaaned92 commented 8 years ago

I made a trial on W32 to build hdrmerge, but it stopped at link step. Build parameters are following:

> -- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: E:/msys32/mingw32/bin/gcc.exe
-- Check for working C compiler: E:/msys32/mingw32/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: E:/msys32/mingw32/bin/g++.exe
-- Check for working CXX compiler: E:/msys32/mingw32/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - not found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: E:/msys32/mingw32/bin/qmake.exe (found version "4.8.7")
-- Found PkgConfig: E:/msys32/mingw32/bin/pkg-config.exe (found version "0.29.1")
-- Checking for module 'libraw'
--   Found libraw, version 0.17.1
-- Checking for module 'libraw_r'
--   Found libraw_r, version 0.17.1
-- Found LibRaw: E:/msys32/mingw32/lib/libraw.dll.a (found version "0.17.1")
-- Found Exiv2: E:/msys32/mingw32/lib/libexiv2.dll.a (found suitable version "0.25.0", minimum required is "0.12")
-- Found ZLIB: E:/msys32/mingw32/lib/libz.dll.a (found version "1.2.8")
-- Found ALGLIB: E:/msys32/mingw32/lib/libalglib.dll.a
-- Boost version: 1.60.0
-- Found the following Boost libraries:
--   unit_test_framework
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp
-- Configuring done
-- Generating done

One compilation warning:

> In file included from E:/HDRsource/hdr/Image.hpp:28:0,
                 from E:/HDRsource/hdr/ImageStack.hpp:30,
                 from E:/HDRsource/hdr/ImageStack.cpp:24:
E:/HDRsource/hdr/Array2D.hpp: In instantiation of 'void hdrmerge::Array2D<T>::fillBorders(T) [with T = float]':
E:/HDRsource/hdr/ImageStack.cpp:360:24:   required from here
E:/HDRsource/hdr/Array2D.hpp:118:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(size_t i = 0; i < dy; ++i)
                                 ^
E:/HDRsource/hdr/Array2D.hpp:124:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 for(size_t j = 0; j < dx; ++j)
                                     ^

First linking error:

> [ 79%] Linking CXX executable hdrmerge-nogui.exe
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x16f6): undefined reference to `jpeg_std_error'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1770): undefined reference to `jpeg_CreateDecompress'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x17da): undefined reference to `jpeg_mem_src'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x17f0): undefined reference to `jpeg_read_header'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1807): undefined reference to `jpeg_start_decompress'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1886): undefined reference to `jpeg_read_scanlines'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x196a): undefined reference to `jpeg_finish_decompress'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1978): undefined reference to `jpeg_destroy_decompress'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1a44): undefined reference to `jpeg_finish_decompress'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1a52): undefined reference to `jpeg_destroy_decompress'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1a9a): undefined reference to `jas_init'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1ad2): undefined reference to `jas_stream_seek'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1aea): undefined reference to `jas_image_decode'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1b16): undefined reference to `jas_matrix_create'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1bbf): undefined reference to `jas_image_readcmpt'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1e4b): undefined reference to `jas_matrix_destroy'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1e57): undefined reference to `jas_image_destroy'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1e63): undefined reference to `jas_stream_close'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1e8e): undefined reference to `jas_stream_close'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1ee2): undefined reference to `jas_matrix_destroy'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1eee): undefined reference to `jas_image_destroy'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0x1efa): undefined reference to `jas_stream_close'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0xe29b): undefined reference to `jpeg_std_error'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0xe2c1): undefined reference to `jpeg_CreateDecompress'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0xe351): undefined reference to `jpeg_read_header'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0xe360): undefined reference to `jpeg_start_decompress'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0xe3d1): undefined reference to `jpeg_abort_decompress'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0xe41a): undefined reference to `jpeg_destroy_decompress'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0xe592): undefined reference to `jpeg_read_scanlines'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0xe67b): undefined reference to `jpeg_destroy_decompress'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_common.o):(.text+0xe6bc): undefined reference to `jpeg_destroy_decompress'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(libraw_datastream.o):(.text+0x4f6): undefined reference to `jpeg_stdio_src'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(libraw_datastream.o):(.text+0x556): undefined reference to `jas_stream_memopen'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(libraw_datastream.o):(.text+0x57e): undefined reference to `jpeg_mem_src'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(libraw_datastream.o):(.text+0x5da): undefined reference to `jas_stream_fdopen'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(libraw_datastream.o):(.text+0xdf5): undefined reference to `jas_stream_fopen'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(libraw_datastream.o):(.text+0xe86): undefined reference to `jpeg_stdio_src'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_fileio.o):(.text+0x750): undefined reference to `cmsOpenProfileFromFile'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_fileio.o):(.text+0x830): undefined reference to `cmsOpenProfileFromMem'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_fileio.o):(.text+0x89b): undefined reference to `cmsCreateTransform'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_fileio.o):(.text+0x8bf): undefined reference to `cmsDoTransform'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_fileio.o):(.text+0x8d1): undefined reference to `cmsDeleteTransform'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_fileio.o):(.text+0x8d9): undefined reference to `cmsCloseProfile'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_fileio.o):(.text+0x8e1): undefined reference to `cmsCloseProfile'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_fileio.o):(.text+0x98e): undefined reference to `cmsOpenProfileFromMem'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(dcraw_fileio.o):(.text+0x9a1): undefined reference to `cmsCreate_sRGBProfile'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(demosaic_packs.o):(.text+0x17174): undefined reference to `GOMP_critical_start'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(demosaic_packs.o):(.text+0x175d6): undefined reference to `GOMP_critical_end'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(demosaic_packs.o):(.text+0x17a87): undefined reference to `GOMP_parallel'
E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.4.0/../../../../lib\libraw_r.a(demosaic_packs.o):(.text+0x17b56): undefined reference to `GOMP_parallel[ 81%

And a second for hdrmerge.exe linking error identical to above

gaaned92 commented 7 years ago

@heckflosse Could you help to find what is missing in the build process for windows? André

heckflosse commented 7 years ago

@gaaned92 I can try to build for 64 bit windows but not for 32 bit. Which version of libraw do you use? Ingo

Beep6581 commented 7 years ago

I fixed the formatting. @gaaned92 it makes your posts much more readable when you surround code in three "```" marks. Edit your post to see what I mean.

heckflosse commented 7 years ago

@gaaned92 It looks like the linker is missing jpeg, jasper and lcms

gaaned92 commented 7 years ago

@Beep6581 : thank you for the tip

@heckflosse : I have the following packages installed in MSYS2

So it seems that a path or a command is missing in the cmake file. I tried to insert pkg-check-modules command with no result.

gaaned92 commented 7 years ago

Sorry! I inadvertently closed the topic

heckflosse commented 7 years ago

@gaaned92 And I wondered why you closed it :) One question: All link errors are related to libraw_r. Do we need libraw_r or would libraw just be ok? Sorry, that's just a question as I have no clue what's the difference between libraw_r and libraw...

Ingo

gaaned92 commented 7 years ago

According to libraw doc ,

In the current version, only static libraries are built:

libraw.a: non-thread-safe version
libraw_r.a: thread-safe

I fear that the problem will be the same with libraw.a André

heckflosse commented 7 years ago

@gaaned92 Did you build libraw this way?

gaaned92 commented 7 years ago

@heckflosse : Ah! I see that jasper, jpeg, lcms are disabled. I wonder why? and why I should not use the libraw that is distributed in MSYS2?

I built 0.17 with" libraw cmake", but as it was available through MSYS2, I installed the package with pacman. As libraw cmake is incompatible with 0.18, I tried to build 0.18 with ./configure way but found problems. I asked to libraw people with no success(I don't rememer why). If you think I should build libraw myself (0.17 or 0.18?), I can try again.

heckflosse commented 7 years ago

@gaaned92 I would try building libraw 0.17 yourself (without jasper and so on) to see whether that solves the link errors. If that works, of course using libraw 0.18 would be even better, but let's make small steps (as in my optimizations ;)

gaaned92 commented 7 years ago

@heckflosse That'not a pleasant perspective! I am first trying building 0.17 the ./configure way.

gaaned92 commented 7 years ago

It miserably fails on compile error this time. here the error log

There are a huge amount of warnings : perhaps you know the flag permitting to suppress them. and an error on dcraw_common.cpp

heckflosse commented 7 years ago

@gaaned92 André, iirc there is an option to build libraw without the demosaic pack. The errors in you log are related to vng demosaic. Maybe it helps to build without that. Hdrmerge only needs very basic demosaic to create the thumbs for the dng files.

Beep6581 commented 7 years ago

Actually when I tried compiling LibRaw manually two weeks ago, the demosaic pack(s) did not try to compile by default - to compile them one had to enable them manually.

Beep6581 commented 6 years ago

@Hombre57 can we close this with your pending commit?

Hombre57 commented 6 years ago

@Beep6581 yes

HDRMerge can be built on Windows with MSYS2 now, but the installer part is not functional yet. I worked on this today but will have to continue tomorrow, it's too late.

Hombre57 commented 6 years ago

@jcelaya @heckflosse @Beep6581 I'd like to solve the build & setup process but would need some time. I've a patch ready to be committed that convert / by \ for PROJECT_SOURCE_DIR in setup.nsi (in a spearate branch).

Should I clone hdrmerge and submit a PR or is it possible to have commit rights ? (I'm asking here because I didn't found a link for private message on GitHub)

Hombre57 commented 6 years ago

I just opened PR #127 .

Beep6581 commented 6 years ago

@Hombre57 only @jcelaya can grant you commit rights.

Hombre57 commented 6 years ago

Can someone explain me why QtCore4 and QtGui4 are dynamically linked to hdrmerge.exe given that content of CMakeFiles\hdrmerge.dir\linklibs.rsp (generated by cmake) :

-s -Wl,-Bstatic -lraw_r -lQtGui4 -lQtCore4 -Wl,-Bdynamic -lexiv2 -ljasper -Wl,-Bstatic -ljpeg -lz -ljpeg -llcms2 -lexpat -lintl -liconv -Wl,-Bdynamic -lpsapi -lwsock32 -limm32 -lwinmm -Wl,-Bstatic -lz -llcms2 -lexpat -lintl -liconv -Wl,-Bdynamic -lpsapi -lwsock32 -limm32 -lwinmm -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32

Having statically linked libs with MSYS seems overcomplicated... I have no choice now than having dynamically linked libs if we want to be able to create a setup package now. At least, alglib is built and statically linked to hdrmerge.

Ping @heckflosse @Floessie @agriggio

Beep6581 commented 6 years ago

@Hombre57 Qt4 is deprecated, better to focus on the Qt5 branch: https://github.com/jcelaya/hdrmerge/tree/qt5 (it doesn't answer your question, but maybe the problem isn't there in the qt5 branch?)

Hombre57 commented 6 years ago

@Beep6581 Is it planned to merge the Qt5 branch before the next release ?

Beep6581 commented 6 years ago

@Hombre57 yes.

Beep6581 commented 6 years ago

Issue made obsolete by #123