G'MIC: lookup symbol err on openSUSE darktable master build

@David_Tschumperle I experience the same issue on 2.9.3_pre:

 LD_LIBRARY_PATH=/home/asn/workspace/package/obs/home:gladiac:branches:graphics/gmic/gmic-2.8.3_pre/obj /home/asn/workspace/package/obs/home:gladiac:branches:graphics/gmic/gmic-2.8.3_pre/obj/gmic -v
/home/asn/workspace/package/obs/home:gladiac:branches:graphics/gmic/gmic-2.8.3_pre/obj/gmic: symbol lookup error: /home/asn/workspace/package/obs/home:gladiac:branches:graphics/gmic/gmic-2.8.3_pre/obj/gmic: undefined symbol: _ZN4gmic13search_sortedIN12cimg_library8CImgListIcEEEEbPKcRKT_jRj

This command is used to generate the manpage ā€¦

How can it be done ?

Hum, another mystery to solve :slight_smile:

Actually, this should not happen, as I explicitely have a

template bool gmic::search_sorted(const char *const str, const gmic_list<char>& list,
                                  const unsigned int length, unsigned int &out_ind);

in gmic.cpp.

Iā€™m discovering this subject myself, then ā€¦

Here are my finding:
https://cmake.org/cmake/help/v3.0/command/find_package.html

where there some explanation:

CMake does not establish any convention for the meaning of version numbers. Package version numbers are checked by ā€œversionā€ files provided by the packages themselves. For a candidate package configuration file .cmakethe corresponding version file is located next to it and named either-version.cmakeorVersion.cmake. If no such version file is available then the configuration file is assumed to not be compatible with any requested version. A basic version file containing generic version matching code can be created using the [CMakePackageConfigHelpers ](https://cmake.org/cmake/help/v3.0/module/CMakePackageConfigHelpers.html#module:CMakePackageConfigHelpers) module.

@David_Tschumperle

As mentioned earlier this uses LTO (Link Time Optimizations). I fumbled out the command from the spec file which boils down to this:

mkdir obj
cd obj
cmake -DCMAKE_INSTALL_PREFIX:PATH=/tmp/local/gmic -DCMAKE_BUILD_TYPE=RelWithDebInfo '-DCMAKE_C_FLAGS=-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_CXX_FLAGS=-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_Fortran_FLAGS=-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_EXE_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' '-DCMAKE_MODULE_LINKER_FLAGS=-flto=auto -Wl,--as-needed' '-DCMAKE_SHARED_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' -DLIB_SUFFIX=64 -DCMAKE_SKIP_RPATH:BOOL=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF -DCMAKE_COLOR_MAKEFILE:BOOL=OFF -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF -DCMAKE_MODULES_INSTALL_DIR=/usr/share/cmake/Modules -DENABLE_DYNAMIC_LINKING=ON -DBUILD_LIB_STATIC=OFF -DENABLE_DYNAMIC_LINKING=ON -DBUILD_LIB_STATIC=OFF ..
make -j20

Using gcc 9.2.1

Please donā€™t hijack threads with unrelated issues. However you need to look into install(EXPORTS ā€¦) Feel free to contact me through other ways than this thread :wink:

1 Like

So, Iā€™ve tested here, on Ubuntu 19.10, with gcc 9.2.1, with the exact command line you put, cmake, then make, then export LD_LIBRARY_PATH=. and ./gmic, and this is working flawlessly, with v.2.8.3_pre.

Another test Iā€™ve done is just add the flags -flto=auto in the custom Makefile in src/ (not the one generated by cmake), and did make lib, and this works also nicely.

At this point, I donā€™t know how I can reproduce the issue here, and it will be hard for me to fix it if I can reproduce it at home :frowning:

(podman|docker) pull opensuse/tumbleweed ???

Never used Docker before, but I took the time to see how it works.
Installed Docker image OpenSuse Tumbleweed from the Docker registry, then installed all necessary packages with zipper, and at this point, I got :

2284093b5ecc:~/gmic/src # lsb_release -a
LSB Version:	n/a
Distributor ID:	openSUSE
Description:	openSUSE Tumbleweed
Release:	20200113
Codename:	n/a
2284093b5ecc:~/gmic/src # make clean && make OPT_CFLAGS="-flto=auto" OPT_LIBS="-flto=auto" FFTW_CFLAGS="" FFTW_LIBS="" lib
rm -rf CImg.h gmic_stdlib.h gmic use_libgmic use_libcgmic use_libcgmic_static gmic*.o libgmic* libcgmic* *~
make "CFLAGS+=-Dgmic_build -Dcimg_date=\\\"\\\" -Dcimg_time=\\\"\\\" -Dcimg_use_zlib  -Dgmic_prerelease="\\\"200115\\\""  -std=c++11 -pedantic -Wall -Wextra -Wfatal-errors -Werror=unknown-pragmas -Werror=unused-label -Wshadow -Dcimg_use_vt100 -Dcimg_use_abort -Dgmic_is_parallel   -Dcimg_use_curl  -Dcimg_use_png -I/usr/include/libpng16  -Dcimg_use_jpeg -Dcimg_use_tiff  -fopenmp -Dcimg_use_openmp -Dcimg_display=1   -flto=auto" "LIBS+=-L/lib64 -lz   -L/usr/lib -lm -lpthread   -lcurl  -lpng16 -L/lib64 -lz  -ljpeg -ltiff  -lgomp -lX11  -lpthread  -flto=auto" _lib
make[1]: Entering directory '/root/gmic/src'
> Retrieve G'MIC Standard Library...
 done!
> Retrieve CImg Library...
 done!
g++ -o libgmic.o -c gmic.cpp -fPIC -Dgmic_build -Dcimg_date=\"\" -Dcimg_time=\"\" -Dcimg_use_zlib  -Dgmic_prerelease=\"200115\"  -std=c++11 -pedantic -Wall -Wextra -Wfatal-errors -Werror=unknown-pragmas -Werror=unused-label -Wshadow -Dcimg_use_vt100 -Dcimg_use_abort -Dgmic_is_parallel   -Dcimg_use_curl  -Dcimg_use_png -I/usr/include/libpng16  -Dcimg_use_jpeg -Dcimg_use_tiff  -fopenmp -Dcimg_use_openmp -Dcimg_display=1   -flto=auto
ar rcs libgmic.a libgmic.o
g++ -shared -std=c++11 -pedantic -Wl,-soname,libgmic.so.2 -o libgmic.so libgmic.o -L/lib64 -lz   -L/usr/lib -lm -lpthread   -lcurl  -lpng16 -L/lib64 -lz  -ljpeg -ltiff  -lgomp -lX11  -lpthread  -flto=auto
g++ -o use_libgmic use_libgmic.cpp -std=c++11 -pedantic -L. -lgmic -L/lib64 -lz   -L/usr/lib -lm -lpthread   -lcurl  -lpng16 -L/lib64 -lz  -ljpeg -ltiff  -lgomp -lX11  -lpthread  -flto=auto
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: warning: libjpeg.so.8, needed by /usr/lib64/gcc/x86_64-suse-linux/9/../../../../lib64/libtiff.so, may conflict with libjpeg.so.62
make[1]: Leaving directory '/root/gmic/src'
2284093b5ecc:~/gmic/src # export LD_LIBRARY_PATH=.
2284093b5ecc:~/gmic/src # ln -s libgmic.so libgmic.so.2
2284093b5ecc:~/gmic/src # ldd ./use_libgmic
	linux-vdso.so.1 (0x00007ffe277a8000)
	libgmic.so.2 => ./libgmic.so.2 (0x00007fd4578ff000)
	libz.so.1 => /lib64/libz.so.1 (0x00007fd4578da000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd4578b8000)
	libcurl.so.4 => /usr/lib64/libcurl.so.4 (0x00007fd45782d000)
	libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007fd4577e5000)
	libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x00007fd45774d000)
	libtiff.so.5 => /usr/lib64/libtiff.so.5 (0x00007fd4576cd000)
	libgomp.so.1 => /usr/lib64/libgomp.so.1 (0x00007fd457694000)
	libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007fd457550000)
	libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fd45736e000)
	libm.so.6 => /lib64/libm.so.6 (0x00007fd457229000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fd45720f000)
	libc.so.6 => /lib64/libc.so.6 (0x00007fd457046000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fd457fb5000)
	libnghttp2.so.14 => /usr/lib64/libnghttp2.so.14 (0x00007fd457021000)
	libidn2.so.0 => /usr/lib64/libidn2.so.0 (0x00007fd457000000)
	libssh.so.4 => /usr/lib64/libssh.so.4 (0x00007fd456f96000)
	libpsl.so.5 => /usr/lib64/libpsl.so.5 (0x00007fd456f83000)
	libssl.so.1.1 => /usr/lib64/libssl.so.1.1 (0x00007fd456ef7000)
	libcrypto.so.1.1 => /usr/lib64/libcrypto.so.1.1 (0x00007fd456c2f000)
	libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00007fd456be3000)
	libldap_r-2.4.so.2 => /usr/lib64/libldap_r-2.4.so.2 (0x00007fd456b8c000)
	liblber-2.4.so.2 => /usr/lib64/liblber-2.4.so.2 (0x00007fd456b7b000)
	liblzma.so.5 => /usr/lib64/liblzma.so.5 (0x00007fd456b3f000)
	libjbig.so.2 => /usr/lib64/libjbig.so.2 (0x00007fd456b31000)
	libjpeg.so.8 => /usr/lib64/libjpeg.so.8 (0x00007fd456a97000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fd456a92000)
	libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007fd456a67000)
	libunistring.so.2 => /usr/lib64/libunistring.so.2 (0x00007fd4568e2000)
	libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00007fd456810000)
	libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00007fd4567f1000)
	libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007fd4567eb000)
	libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00007fd4567db000)
	libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fd4567c3000)
	libsasl2.so.3 => /usr/lib64/libsasl2.so.3 (0x00007fd4567a4000)
	libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007fd45679f000)
	libkeyutils.so.1 => /usr/lib64/libkeyutils.so.1 (0x00007fd456796000)
	libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fd45676a000)
	libpcre.so.1 => /usr/lib64/libpcre.so.1 (0x00007fd4566d1000)
2284093b5ecc:~/gmic/src # ./use_libgmic 

- 1st step : Create input list of images.
    Input image 0 =  256x256x1x3, buffer : 0x7f65cb2cc010
    Input image 1 =  256x256x1x3, buffer : 0x7f65cb20b010
    Input image 2 =  256x256x1x3, buffer : 0x7f65cb14a010
    Input image 3 =  256x256x1x3, buffer : 0x7f65cb089010
    Input image 4 =  256x256x1x3, buffer : 0x7f65cafc8010

- 2st step : Call G'MIC interpreter.
[gmic]-5./ Start G'MIC interpreter.
[gmic]-5./ Add images [0,1,2,3,4].
[gmic]-1./ Normalize image [0] in range [0,255], with constant-case ratio 0.
[gmic]-1./ Apply flower deformation on image [0], with amplitude 8, frequency 6, offset 0, angle 0 deg. and center point (8,6).
[gmic]-1./ Sharpen image [0] with inverse diffusion and amplitude 100.
[gmic]-1./ Output image [0] as bmp file 'foo1.bmp' (1 image 256x256x1x3).
[gmic]-1./ End G'MIC interpreter.

- 3rd step (alternative) : Call G'MIC interpreter twice from empty instance.
[gmic]-1./ Start G'MIC interpreter.
[gmic]-1./ Blur image [0] with standard deviation 5, neumann boundary conditions and quasi-gaussian kernel.
[gmic]-1./ Sharpen image [0] with inverse diffusion and amplitude 1000.
[gmic]-1./ Normalize image [0] in range [0,255], with constant-case ratio 0.
[gmic]-1./ Output image [0] as bmp file 'foo2.bmp' (1 image 256x256x1x3).
[gmic]-1./ End G'MIC interpreter.

[gmic]-1./ Start G'MIC interpreter.
[gmic]-1./ Resize image [0] to 50%x50%x100%x100% , with nearest-neighbor interpolation, dirichlet boundary conditions and alignment (0,0,0,0).
[gmic]-1./ Force image [1] to be in RGBA mode.
[gmic]-2./ Rotate image [1] of 30 deg., with linear interpolation and dirichlet boundary conditions.
[gmic]-1./ Drop shadow behind image [1], with offsets (0,13), smoothness 5 and curvature 0.
[gmic]-1./ Apply radial blur on image [0], with amplitude 10% and center point (50%,50%).
[gmic]-2./ Blend all images [0,1] together, using 'alpha' mode and opacity 1.
[gmic]-1./ Output image [0] as bmp file 'foo3.bmp' (1 image 256x256x1x3).
[gmic]-1./ End G'MIC interpreter.

- 4th step : Returned 1 output images.
   Output image 0 = 256x256x1x3, buffer : 0x1e86e20

- That's it !

It works, with -flto=auto enabledā€¦
Next, iā€™ll test with the cmake way of doing it.
Does it work for you when using the Makefile already provided in gmic/src/ ?

This is also working as expected, at least with the latest code in the gmic repo
(branch develop).

Did you see the cmake command above and used that?

Yes, thatā€™s exactly this one I used.

If I run cmake without any options, it works fine. With all the options from above, it doesnā€™t.

cmake -DCMAKE_INSTALL_PREFIX:PATH=/tmp/local/gmic -DCMAKE_BUILD_TYPE=RelWithDebInfo '-DCMAKE_C_FLAGS=-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_CXX_FLAGS=-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_Fortran_FLAGS=-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_EXE_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' '-DCMAKE_MODULE_LINKER_FLAGS=-flto=auto -Wl,--as-needed' '-DCMAKE_SHARED_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' -DLIB_SUFFIX=64 -DCMAKE_SKIP_RPATH:BOOL=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF -DCMAKE_COLOR_MAKEFILE:BOOL=OFF -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF -DCMAKE_MODULES_INSTALL_DIR=/usr/share/cmake/Modules -DENABLE_DYNAMIC_LINKING=ON -DBUILD_LIB_STATIC=OFF -DENABLE_DYNAMIC_LINKING=ON -DBUILD_LIB_STATIC=OFF ..

gcc (SUSE Linux) 9.2.1 20191209 [gcc-9-branch revision 279114]

I have this:

2284093b5ecc:~/gmic/obj # cmake -DCMAKE_INSTALL_PREFIX:PATH=/tmp/local/gmic -DCMAKE_BUILD_TYPE=RelWithDebInfo '-DCMAKE_C_FLAGS=-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_CXX_FLAGS=-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_Fortran_FLAGS=-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_EXE_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' '-DCMAKE_MODULE_LINKER_FLAGS=-flto=auto -Wl,--as-needed' '-DCMAKE_SHARED_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' -DLIB_SUFFIX=64 -DCMAKE_SKIP_RPATH:BOOL=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF -DCMAKE_COLOR_MAKEFILE:BOOL=OFF -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF -DCMAKE_MODULES_INSTALL_DIR=/usr/share/cmake/Modules -DENABLE_DYNAMIC_LINKING=ON -DBUILD_LIB_STATIC=OFF -DENABLE_DYNAMIC_LINKING=ON -DBUILD_LIB_STATIC=OFF ..
CMake Deprecation Warning at CMakeLists.txt:57 (cmake_policy):
  The OLD behavior for policy CMP0046 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- The CXX compiler identification is GNU 9.2.1
-- The C compiler identification is GNU 9.2.1
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.6.3") 
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11") 
-- Found CURL: /usr/lib64/libcurl.so (found version "7.68.0")  
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/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
X11_INCLUDE_DIR: /usr/include
X11_INCLUDE_DIRs: 
X11_LIBRARY_DIR: /usr/lib64
X11_LIBRARY_DIRS: 
-- Checking for module 'fftw3>=3.0'
--   Found fftw3, version 3.3.8
-- Checking for module 'opencv'
--   Package 'opencv', required by 'virtual:world', not found
-- Checking for module 'GraphicsMagick++'
--   Package 'GraphicsMagick++', required by 'virtual:world', not found
-- Found TIFF: /usr/lib64/libtiff.so (found version "4.1.0") 
-- Found PNG: /usr/lib64/libpng.so (found version "1.6.37") 
-- Found JPEG: /usr/lib64/libjpeg.so (found version "62") 
-- Checking for module 'OpenEXR'
--   Found OpenEXR, version 2.4.0
-- The following OPTIONAL packages have been found:

 * CURL
 * X11
 * TIFF
 * ZLIB
 * PNG
 * JPEG

-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    BUILD_STATIC_LIBS
    CMAKE_Fortran_FLAGS
    CMAKE_INSTALL_DO_STRIP
    CMAKE_MODULES_INSTALL_DIR
    LIB_SUFFIX


-- Build files have been written to: /root/gmic/obj
2284093b5ecc:~/gmic/obj # make -j20
/usr/bin/cmake -S/root/gmic -B/root/gmic/obj --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /root/gmic/obj/CMakeFiles /root/gmic/obj/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/root/gmic/obj'
make -f CMakeFiles/gmic_extra_headers.dir/build.make CMakeFiles/gmic_extra_headers.dir/depend
make[2]: Entering directory '/root/gmic/obj'
cd /root/gmic/obj && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /root/gmic /root/gmic /root/gmic/obj /root/gmic/obj /root/gmic/obj/CMakeFiles/gmic_extra_headers.dir/DependInfo.cmake
Scanning dependencies of target gmic_extra_headers
make[2]: Leaving directory '/root/gmic/obj'
make -f CMakeFiles/gmic_extra_headers.dir/build.make CMakeFiles/gmic_extra_headers.dir/build
make[2]: Entering directory '/root/gmic/obj'
make[2]: Nothing to be done for 'CMakeFiles/gmic_extra_headers.dir/build'.
make[2]: Leaving directory '/root/gmic/obj'
[  0%] Built target gmic_extra_headers
make -f CMakeFiles/libgmic.dir/build.make CMakeFiles/libgmic.dir/depend
make[2]: Entering directory '/root/gmic/obj'
cd /root/gmic/obj && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /root/gmic /root/gmic /root/gmic/obj /root/gmic/obj /root/gmic/obj/CMakeFiles/libgmic.dir/DependInfo.cmake
Scanning dependencies of target libgmic
make[2]: Leaving directory '/root/gmic/obj'
make -f CMakeFiles/libgmic.dir/build.make CMakeFiles/libgmic.dir/build
make[2]: Entering directory '/root/gmic/obj'
[ 16%] Building CXX object CMakeFiles/libgmic.dir/src/gmic.cpp.o
/usr/bin/c++  -Dlibgmic_EXPORTS -I/usr/include/OpenEXR -I/root/gmic/include -I/root/gmic/include/OpenEXR  -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG -Ofast -g -Dgmic_build -Dcimg_use_vt100 -Dgmic_is_parallel -Dcimg_use_abort -Wno-error=narrowing -fno-ipa-sra -fpermissive -fopenmp -Dcimg_use_openmp -Dcimg_use_zlib -Dcimg_use_curl -Dcimg_display=1 -Dcimg_appname=\"gmic\" -Dcimg_use_xshm -Dcimg_use_fftw3 -Dcimg_use_fftw3_singlethread -fPIC    -Dcimg_use_tiff -Dcimg_use_png -Dcimg_use_jpeg -Dcimg_use_openexr -std=gnu++11 -o CMakeFiles/libgmic.dir/src/gmic.cpp.o -c /root/gmic/src/gmic.cpp
[ 33%] Linking CXX shared library libgmic.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/libgmic.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG -Ofast -g -Dgmic_build -Dcimg_use_vt100 -Dgmic_is_parallel -Dcimg_use_abort -Wno-error=narrowing -fno-ipa-sra -fpermissive -fopenmp -Dcimg_use_openmp -Dcimg_use_zlib -Dcimg_use_curl -Dcimg_display=1 -Dcimg_appname=\"gmic\" -Dcimg_use_xshm -Dcimg_use_fftw3 -Dcimg_use_fftw3_singlethread -flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now -shared -Wl,-soname,libgmic.so.1 -o libgmic.so.1 CMakeFiles/libgmic.dir/src/gmic.cpp.o  /usr/lib64/libSM.so /usr/lib64/libICE.so /usr/lib64/libX11.so /usr/lib64/libXext.so /usr/lib64/libtiff.so /usr/lib64/libpng.so /usr/lib64/libz.so /usr/lib64/libjpeg.so -lIlmImf-2_4 -lImath-2_4 -lHalf-2_4 -lIex-2_4 -lIexMath-2_4 -lIlmThread-2_4 /usr/lib64/libz.so /usr/lib64/libcurl.so -lfftw3 -lgomp -lpthread /usr/lib64/libjpeg.so -lIlmImf-2_4 -lImath-2_4 -lHalf-2_4 -lIex-2_4 -lIexMath-2_4 -lIlmThread-2_4 /usr/lib64/libcurl.so -lfftw3 -lgomp -lpthread 
/usr/bin/cmake -E cmake_symlink_library libgmic.so.1 libgmic.so.1 libgmic.so
make[2]: Leaving directory '/root/gmic/obj'
[ 33%] Built target libgmic
make -f CMakeFiles/gmic.dir/build.make CMakeFiles/gmic.dir/depend
make[2]: Entering directory '/root/gmic/obj'
cd /root/gmic/obj && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /root/gmic /root/gmic /root/gmic/obj /root/gmic/obj /root/gmic/obj/CMakeFiles/gmic.dir/DependInfo.cmake
Scanning dependencies of target gmic
make[2]: Leaving directory '/root/gmic/obj'
make -f CMakeFiles/gmic.dir/build.make CMakeFiles/gmic.dir/build
make[2]: Entering directory '/root/gmic/obj'
[ 50%] Building CXX object CMakeFiles/gmic.dir/src/gmic_cli.cpp.o
/usr/bin/c++   -I/usr/include/OpenEXR -I/root/gmic/include -I/root/gmic/include/OpenEXR  -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG -Ofast -g -Dgmic_build -Dcimg_use_vt100 -Dgmic_is_parallel -Dcimg_use_abort -Wno-error=narrowing -fno-ipa-sra -fpermissive -fopenmp -Dcimg_use_openmp -Dcimg_use_zlib -Dcimg_use_curl -Dcimg_display=1 -Dcimg_appname=\"gmic\" -Dcimg_use_xshm -Dcimg_use_fftw3 -Dcimg_use_fftw3_singlethread -fPIE    -Dcimg_use_tiff -Dcimg_use_png -Dcimg_use_jpeg -Dcimg_use_openexr -std=gnu++11 -o CMakeFiles/gmic.dir/src/gmic_cli.cpp.o -c /root/gmic/src/gmic_cli.cpp
[ 66%] Linking CXX executable gmic
/usr/bin/cmake -E cmake_link_script CMakeFiles/gmic.dir/link.txt --verbose=1
/usr/bin/c++  -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG -Ofast -g -Dgmic_build -Dcimg_use_vt100 -Dgmic_is_parallel -Dcimg_use_abort -Wno-error=narrowing -fno-ipa-sra -fpermissive -fopenmp -Dcimg_use_openmp -Dcimg_use_zlib -Dcimg_use_curl -Dcimg_display=1 -Dcimg_appname=\"gmic\" -Dcimg_use_xshm -Dcimg_use_fftw3 -Dcimg_use_fftw3_singlethread  -flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now CMakeFiles/gmic.dir/src/gmic_cli.cpp.o  -o gmic  libgmic.so.1 /usr/lib64/libSM.so /usr/lib64/libICE.so /usr/lib64/libX11.so /usr/lib64/libXext.so /usr/lib64/libtiff.so /usr/lib64/libpng.so /usr/lib64/libz.so /usr/lib64/libjpeg.so -lIlmImf-2_4 -lImath-2_4 -lHalf-2_4 -lIex-2_4 -lIexMath-2_4 -lIlmThread-2_4 /usr/lib64/libz.so /usr/lib64/libjpeg.so -lIlmImf-2_4 -lImath-2_4 -lHalf-2_4 -lIex-2_4 -lIexMath-2_4 -lIlmThread-2_4 /usr/lib64/libcurl.so -lfftw3 -lgomp -lpthread 
make[2]: Leaving directory '/root/gmic/obj'
[ 66%] Built target gmic
make -f CMakeFiles/man.dir/build.make CMakeFiles/man.dir/depend
make -f CMakeFiles/bashcompletion.dir/build.make CMakeFiles/bashcompletion.dir/depend
make[2]: Entering directory '/root/gmic/obj'
cd /root/gmic/obj && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /root/gmic /root/gmic /root/gmic/obj /root/gmic/obj /root/gmic/obj/CMakeFiles/man.dir/DependInfo.cmake
make[2]: Entering directory '/root/gmic/obj'
cd /root/gmic/obj && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /root/gmic /root/gmic /root/gmic/obj /root/gmic/obj /root/gmic/obj/CMakeFiles/bashcompletion.dir/DependInfo.cmake
Scanning dependencies of target bashcompletion
Scanning dependencies of target man
make[2]: Leaving directory '/root/gmic/obj'
make -f CMakeFiles/bashcompletion.dir/build.make CMakeFiles/bashcompletion.dir/build
make[2]: Leaving directory '/root/gmic/obj'
make -f CMakeFiles/man.dir/build.make CMakeFiles/man.dir/build
make[2]: Entering directory '/root/gmic/obj'
make[2]: Entering directory '/root/gmic/obj'
[ 83%] Generating resources/gmic_bashcompletion.sh
LD_LIBRARY_PATH=/root/gmic/obj /root/gmic/obj/gmic -v - /root/gmic/src/gmic_stdlib.gmic raw:/root/gmic/src/gmic_stdlib.gmic,uchar -document_gmic bash 2> /root/gmic/obj/resources/gmic_bashcompletion.sh
[100%] Generating man/gmic.1
LD_LIBRARY_PATH=/root/gmic/obj /root/gmic/obj/gmic -v - /root/gmic/src/gmic_stdlib.gmic raw:/root/gmic/src/gmic_stdlib.gmic,uchar -__help man 2> /root/gmic/obj/man/gmic.1
make[2]: Leaving directory '/root/gmic/obj'
[100%] Built target man
make[2]: Leaving directory '/root/gmic/obj'
[100%] Built target bashcompletion
make[1]: Leaving directory '/root/gmic/obj'
/usr/bin/cmake -E cmake_progress_start /root/gmic/obj/CMakeFiles 0
2284093b5ecc:~/gmic/obj # nm libgmic.so
libgmic.so    libgmic.so.1  
2284093b5ecc:~/gmic/obj # nm libgmic.so.1 | grep sorted
000000000051b4c0 T _ZN4gmic13search_sortedIN12cimg_library8CImgListIcEEEEbPKcRKT_jRj

But as I said, Iā€™ve tried with the latest code in the develop branch of gmic. Maybe it makes a difference?

Iā€™ve used https://gmic.eu/files/prerelease/gmic_2.8.3_pre200115.tar.gz

I will try the dev branch.

Iā€™ve done other changes since then, so maybe getting the code from the github repository is worth a try.

Aha, the develop branch works!

1 Like

Ah OK, I donā€™t know exactly why it works now, but this is good news anyway :slight_smile: