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/
?