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] project does not build #55

Closed Smattr closed 2 months ago

Smattr commented 2 months ago

(In relation to JOSS review at https://github.com/openjournals/joss-reviews/issues/6618)

On the latest commit (f2d22d64f3bfd84e37b21b18d23414ecc8ae16b9), after downloading https://gmic.eu/gmic_stdlib_community337.h (SHA256 601e267b08907773c2a6d798331d22092c38d15a4f839ca80ea359bd413898cf at time of writing), configure and build does not seem to work:

$ cmake -B build -S .
-- The CXX compiler identification is GNU 11.4.0                                                                                                                                 
-- The C compiler identification is GNU 11.4.0                                                                                                                                   
-- Detecting CXX compiler ABI info                                                                                                                                               
-- Detecting CXX compiler ABI info - done                                                                                                                                        
-- Check for working CXX compiler: /usr/bin/c++ - skipped                                                                                                                        
-- Detecting CXX compile features                                                                                                                                                
-- Detecting CXX compile features - done                                                                                                                                         
-- Detecting C compiler ABI info                                                                                                                                                 
-- Detecting C compiler ABI info - done                                                                                                                                          
-- Check for working C compiler: /usr/bin/cc - skipped                                                                                                                           
-- Detecting C compile features                                                                                                                                                  
-- Detecting C compile features - done                                                                                                                                           
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)                                                                                                                     
-- Found CImg: /tmp/tmp.W1ovy1i20l/gmic/src/CImg.h                                                                                                                               
-- Found OpenMP_C: -fopenmp (found version "4.5")                                                                                                                                
-- Found OpenMP_CXX: -fopenmp (found version "4.5")                                                                                                                              
-- Found OpenMP: TRUE (found version "4.5")                                                                                                                                      
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")                                                                                                        
-- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)                                                                                                                  
-- Could NOT find X11 (missing: X11_X11_INCLUDE_PATH X11_X11_LIB)                                                                                                                
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)                                                                                                                     
-- Could NOT find Fftw (missing: FFTW3_LIBRARIES)                                                                                                                                
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)                                                                                                                     
-- Could NOT find GraphicsMagick (missing: GRAPHICSMAGICK_LIBRARIES)                                                                                                             
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)                                                                                                                  
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)                                                                                                                 
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)                                                                                                                  
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)                                                                                                                     
-- Could NOT find OpenEXR (missing: OPENEXR_LIBRARIES)                                                                                                                           
-- Looking for pthread.h                                                                                                                                                         
-- Looking for pthread.h - found                                                                                                                                                 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD                                                                                                                                       
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success                                                                                                                             
-- Found Threads: TRUE                                                                                                                                                           
-- Found GMicStdlib: /tmp/tmp.W1ovy1i20l/gmic/src/gmic_stdlib_community.h                                                                                                        
-- 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.W1ovy1i20l/gmic/build                                                                                                              
$ cmake --build build
[ 12%] Building CXX object CMakeFiles/libgmic.dir/src/gmic.cpp.o
/tmp/tmp.W1ovy1i20l/gmic/src/gmic.cpp:1788:1: error: expected \u2018}\u2019 before \u2018using\u2019
 1788 | using namespace gmic_library;
      | ^~~~~
In file included from /tmp/tmp.W1ovy1i20l/gmic/src/gmic.cpp:1787:
/tmp/tmp.W1ovy1i20l/gmic/src/gmic_stdlib_community.h:55:35: note: to match this \u2018{\u2019
   55 | const unsigned char data_gmic[] = {
      |                                   ^
/tmp/tmp.W1ovy1i20l/gmic/src/gmic.cpp:1788:1: error: expected \u2018,\u2019 or \u2018;\u2019 before \u2018using\u2019
 1788 | using namespace gmic_library;
      | ^~~~~
/tmp/tmp.W1ovy1i20l/gmic/src/gmic.cpp: In static member function \u2018static const gmic_library::gmic_image<char>& gmic::decompress_stdlib()\u2019:
/tmp/tmp.W1ovy1i20l/gmic/src/gmic.cpp:2741:71: error: \u2018size_data_gmic\u2019 was not declared in this scope; did you mean \u2018data_gmic\u2019?
 2741 |       CImgList<char>::get_unserialize(CImg<unsigned char>(data_gmic,1,size_data_gmic,1,1,true))[0].
      |                                                                       ^~~~~~~~~~~~~~
      |                                                                       data_gmic
gmake[2]: *** [CMakeFiles/libgmic.dir/build.make:76: CMakeFiles/libgmic.dir/src/gmic.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:91: CMakeFiles/libgmic.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
$ uname -rms
Linux 6.5.0-15-generic x86_64
dtschump commented 2 months ago

Thanks for reporting. This works here for me, with latest development version 3.4.0:

~/work/src/gmic/build$ make
make: *** No targets specified and no makefile found.  Stop.
~/work/src/gmic/build$ cmake ..
-- The CXX compiler identification is GNU 11.4.0
-- The C compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Found CImg: /home/tschumperle/work/src/gmic/src/CImg.h  
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "7.81.0")  
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Checking for module 'fftw3>=3.0'
--   Found fftw3, version 3.3.8
-- Found Fftw: fftw3  
-- Checking for module 'GraphicsMagick++'
--   No package 'GraphicsMagick++' found
-- Could NOT find GraphicsMagick (missing: GRAPHICSMAGICK_LIBRARIES) 
-- Found TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (found version "4.3.0")  
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.37") 
-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (found version "80") 
-- Checking for module 'OpenEXR'
--   Found OpenEXR, version 2.5.7
-- Found OpenEXR: IlmImf-2_5;Imath-2_5;Half-2_5;Iex-2_5;IexMath-2_5;IlmThread-2_5  
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found GMicStdlib: /home/tschumperle/work/src/gmic/src/gmic_stdlib_community.h  
-- The following OPTIONAL packages have been found:

 * OpenMP
 * CURL
 * X11
 * Fftw
 * TIFF
 * ZLIB
 * PNG
 * JPEG
 * PkgConfig
 * OpenEXR
 * Threads

-- The following REQUIRED packages have been found:

 * CImg
 * GMicStdlib

-- The following OPTIONAL packages have not been found:

 * GraphicsMagick

-- Configuring done
-- Generating done
-- Build files have been written to: /home/tschumperle/work/src/gmic/build
~/work/src/gmic/build$ make
[ 12%] Building CXX object CMakeFiles/libgmic.dir/src/gmic.cpp.o
In file included from /usr/include/stdio.h:894,
                 from /usr/include/c++/11/cstdio:42,
                 from /usr/include/c++/11/ext/string_conversions.h:43,
                 from /usr/include/c++/11/bits/basic_string.h:6608,
                 from /usr/include/c++/11/string:55,
                 from /usr/include/c++/11/bits/locale_classes.h:40,
                 from /usr/include/c++/11/locale:39,
                 from /home/tschumperle/work/src/gmic/src/gmic.h:185,
                 from /home/tschumperle/work/src/gmic/src/gmic.cpp:1786:
In function 'int fprintf(FILE*, const char*, ...)',
    inlined from 'static double gmic_library::gmic_image<T>::_cimg_math_parser::mp_vector_print(gmic_library::gmic_image<T>::_cimg_math_parser&) [with T = float]' at /home/tschumperle/work/src/gmic/src/CImg.h:29144:25:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:105:24: warning: '%s' directive argument is null [-Wformat-overflow=]
  105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
      |          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106 |                         __va_arg_pack ());
      |                         ~~~~~~~~~~~~~~~~~
[ 25%] Linking CXX shared library libgmic.so
[ 25%] Built target libgmic
[ 37%] Building CXX object CMakeFiles/libgmicstatic.dir/src/gmic.cpp.o
In file included from /usr/include/stdio.h:894,
                 from /usr/include/c++/11/cstdio:42,
                 from /usr/include/c++/11/ext/string_conversions.h:43,
                 from /usr/include/c++/11/bits/basic_string.h:6608,
                 from /usr/include/c++/11/string:55,
                 from /usr/include/c++/11/bits/locale_classes.h:40,
                 from /usr/include/c++/11/locale:39,
                 from /home/tschumperle/work/src/gmic/src/gmic.h:185,
                 from /home/tschumperle/work/src/gmic/src/gmic.cpp:1786:
In function 'int fprintf(FILE*, const char*, ...)',
    inlined from 'static double gmic_library::gmic_image<T>::_cimg_math_parser::mp_vector_print(gmic_library::gmic_image<T>::_cimg_math_parser&) [with T = float]' at /home/tschumperle/work/src/gmic/src/CImg.h:29144:25:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:105:24: warning: '%s' 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]./ Start G'MIC interpreter (v.3.4.0).
[gmic]./ Input custom command file '/home/tschumperle/work/src/gmic/src/gmic_stdlib.gmic' (2443 replaced, total: 4930).
[gmic]./ Input text-data file '/home/tschumperle/work/src/gmic/src/gmic_stdlib.gmic'.
[gmic]./ End G'MIC interpreter.
[ 87%] Built target man
[100%] Generating resources/gmic_bashcompletion.sh
[gmic]./ Start G'MIC interpreter (v.3.4.0).
[gmic]./ Input custom command file '/home/tschumperle/work/src/gmic/src/gmic_stdlib.gmic' (2443 replaced, total: 4930).
[gmic]./ Input text-data file '/home/tschumperle/work/src/gmic/src/gmic_stdlib.gmic'.
[gmic]./ Parse '#@cli' command(s) '*' and output in 'bashcompletion' mode.
[gmic]./ End G'MIC interpreter.
[100%] Built target bashcompletion

Maybe it could be due to the fact I've recently (yesterday) switched to a dev version 3.4.0 (instead of 3.3.7) ?

Smattr commented 2 months ago

Any suggestions to debug/fix this? This is a pretty vanilla Ubuntu install I’m on.

dtschump commented 2 months ago

Hello, sorry for the delay. I've been managing the release of the latest version (3.4.0) of G'MIC these last days. Compiling G'MIC, assuming all required dependencies have been installed, should be as simple as that:

$  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 cli

(change cli by gimp to compile the G'MIC-Qt plug-in for GIMP).

Required dependencies are listed here : https://gmic.eu/download.html#linux

Hope this helps,

D.

Smattr commented 2 months ago

So for the JOSS review we should base our assessment on the tarball rather than the Github repository?

dtschump commented 2 months ago

So for the JOSS review we should base our assessment on the tarball rather than the Github repository?

Yes, definitely. the repository is just a work-in-progress version, which isn't the easiest way to get the latest version of the project and compile it. I'm going to update the download page to clarify this.

Smattr commented 2 months ago

Understood, thanks.