areaDetector / ADSupport

Source code for support libraries for areaDetector.
https://areadetector.github.io/areaDetector/user_guide.html
Other
1 stars 15 forks source link

Can't build using MingW on Linux. #38

Open pheest opened 2 years ago

pheest commented 2 years ago

Issues I've identified:

  1. GraphicsMagickSrc/magick/Makefile and GraphicsMagickSrc/coders/Makefile link to WIN32 libraries Advapi32 User32 Gdi32 and User32 Gdi32 OleAut32 respectively. Microsoft have these file names with a Capital letter on (case-insensitive) Windows. But MingW has these file names in lower case, which is a problem on (case-sensitive) Linux. The file names should be in lower case in the make file, this will be fine on both Windows and Linux.
  2. GraphicsMagickSrc/ttf/builds/windows/ftdebug cannot compile in these circumstances. The folder is one of several that the GraphicsMagick distribution has, I believe these are intended to allow internal debugging of the GraphicsMagick library. I believe the folder can be removed from the ADSupport compilation.
  3. hdf5src/h5win32defs.h declares struct timezone and struct timespec. But these structures are already declared by Linux headers which are used by MingW. This results in a redefinition error.
pheest commented 2 years ago

Can anyone shed any light on this linker error?

/usr/bin/x86_64-w64-mingw32-ld: /usr/lib/gcc/x86_64-w64-mingw32/9.3-posix/libgcc_eh.a(unwind-seh.o):(.text+0x3d0): multiple definition of `_Unwind_Resume'; /builds/DATAnet/adurl/.cache/adsupport-master/lib/windows-x64-mingw/libMagick++.dll.a(d000016.o):(.text+0x0): first defined here

mfurseman commented 2 years ago

We've been cross compiling with mingw static builds for MAST-U with the following Area Detector configuration:

# AreaDetector specific configuration
WITH_BOOST     = NO
BOOST_EXTERNAL = YES

WITH_PVA  = NO
WITH_QSRV = NO

WITH_BLOSC     = YES
BLOSC_EXTERNAL = NO

WITH_BITSHUFFLE     = YES
BITSHUFFLE_EXTERNAL = NO

WITH_GRAPHICSMAGICK     = YES
GRAPHICSMAGICK_EXTERNAL = NO

WITH_HDF5     = YES
HDF5_EXTERNAL = NO

WITH_JSON     = YES

WITH_JPEG     = YES
JPEG_EXTERNAL = NO

WITH_NETCDF     = YES
NETCDF_EXTERNAL = NO

WITH_NEXUS     = YES
NEXUS_EXTERNAL = NO

WITH_OPENCV     = NO
OPENCV_EXTERNAL = YES

WITH_SZIP     = YES
SZIP_EXTERNAL = NO

WITH_TIFF     = YES
TIFF_EXTERNAL = NO

XML2_EXTERNAL = NO

WITH_ZLIB     = YES
ZLIB_EXTERNAL = NO

The changes in https://github.com/areaDetector/ADSupport/pull/36 are what we needed to get things working there. Without looking in detail I'm guessing you are touching code we didn't use for our build?