GreycLab / gmic

GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing
Other
66 stars 11 forks source link

[JOSS] mutex failure when building GMIC 3.4.0 #60

Open Smattr opened 1 month ago

Smattr commented 1 month ago

Following https://github.com/GreycLab/gmic/issues/55, my next attempt at building from the release tarball:

$ wget https://github.com/GreycLab/gmic/releases/download/v.3.4.0/gmic_3.4.0.tar.gz
…
$ tar xvf gmic_3.4.0.tar.gz
…
$ cd gmic-3.4.0
$ cmake -DCMAKE_INSTALL_PREFIX=$(mktemp -d) -B build -S .
…
-- The following OPTIONAL packages have been found:                                  
                                                                                                                                                                            * OpenMP                                                                            
 * ZLIB                                                                                                                                                                    
 * Threads                                                                           

-- The following REQUIRED packages have been found:                                                                                                                        

 * CImg                                                                              
 * GMicStdlib                                                                        

-- The following OPTIONAL packages have not been found:                              

 * CURL                                                                              
 * X11                                                                                                                                                                     
 * Fftw                                                                              
 * GraphicsMagick                                                                    
 * TIFF                                                                              
 * PNG                                                                               
 * JPEG                                                                              
 * PkgConfig                                                                         
 * OpenEXR

-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/tmp.GwIM5z52ev/gmic-3.4.0/build
$ cmake --build build
…
/usr/include/x86_64-linux-gnu/bits/stdio2.h:105:24: warning: \u2018%s\u2019 directive argument is null [-Wformat-overflow=]
  105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
      |          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106 |                         __va_arg_pack ());
      |                         ~~~~~~~~~~~~~~~~~
[ 50%] Linking CXX static library libgmic.a
[ 50%] Built target libgmicstatic
[ 62%] Building CXX object CMakeFiles/gmic.dir/src/gmic_cli.cpp.o
[ 75%] Linking CXX executable gmic
[ 75%] Built target gmic
[ 87%] Generating man/gmic.1
gmic: pthread_mutex_lock.c:94: ___pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.
Aborted (core dumped)
gmake[2]: *** [CMakeFiles/man.dir/build.make:73: man/gmic.1] Error 134
gmake[2]: *** Deleting file 'man/gmic.1'
gmake[1]: *** [CMakeFiles/Makefile2:169: CMakeFiles/man.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy
$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

gmic apparently does something incorrect with mutexes when generating the Bash completions. Any suggestions?

dtschump commented 1 month ago

Hello. Thanks for reporting this issue. I've tested and it's working here for me (using Ubuntu 22.04 LTS and g++ 11.4.0). Could you please give me some details on which distribution you encounter this error ?

As a work-around, I'd suggest to use the custom Makefile that is already present in folder src/, just as described in the G'MIC Download page : https://gmic.eu/download.html#linux

Thanks.

Smattr commented 1 month ago

This is on a vanilla Ubuntu 22.04 Desktop with the same compiler. This is a VM with an almost out-of-the-box Ubuntu 22.04, upgraded to the latest packages via apt, so I’m not really sure what could be going wrong.

I’ll try the custom Makefile and report back…

Smattr commented 3 weeks ago

Sorry for the delay on this. Following the instructions on that page, I still can’t get a successful build though the problem I hit is different:

$ sudo apt install git build-essential libgimp2.0-dev libcurl4-openssl-dev libfftw3-dev libtiff-dev libjpeg-dev libopenexr-dev qtbase5-dev qttools5-dev-tools
…
$ wget https://gmic.eu/files/source/gmic_3.4.0.tar.gz && tar zxvf gmic_3.4.0.tar.gz && cd gmic-3.4.0/src
…
$ make all
…
**
** Warning: folder 'zart' was not found !
** It is mandatory to compile 'zart'.
** Trying to retrieve it, with: $ cd ../../ && git clone https://github.com/c-koi/zart.git
**
Cloning into 'zart'...
remote: Enumerating objects: 735, done.
remote: Counting objects: 100% (163/163), done.
remote: Compressing objects: 100% (112/112), done.
remote: Total 735 (delta 102), reused 99 (delta 49), pack-reused 572
Receiving objects: 100% (735/735), 818.15 KiB | 7.05 MiB/s, done.
Resolving deltas: 100% (550/550), done.
**
** Success !
**
cd ../zart && qmake CONFIG+=release GMIC_PATH=/tmp/tmp.AgN8qlxPkW/gmic-3.4.0/src zart.pro && make && strip zart
Info: creating stash file /tmp/tmp.AgN8qlxPkW/zart/.qmake.stash
Project MESSAGE: GMIC_PATH is set (/tmp/tmp.AgN8qlxPkW/gmic-3.4.0/src)
Project ERROR: Cannot find OpenCV
make[1]: *** [Makefile:637: zart] Error 3
make[1]: Leaving directory '/tmp/tmp.AgN8qlxPkW/gmic-3.4.0/src'
make: *** [Makefile:374: all] Error 2
…

Thanks for all your help with this, but I’m going to step down from the JOSS review. We don’t seem to be making progress and I am quite time-poor, so I’d prefer to unblock the review by letting someone else take over who might be able to get things working.