湖濱散記部落格的樹心幽徑[login][主頁]
453:20181222在Ubuntu1604裝webp程式庫以解決ImageMagick的編譯問題1;重裝ImageMagick7以解決semaphore編譯問題

(1)$ g++  `Magick++-config --cxxflags --cppflags` -I/usr/local/include/ImageMagick-7  mtile6d.c `Magick++-config --ldflags --libs`  -L/usr/local/zlib/lib -lz   -Wall  -export-dynamic -lm -o mtile6d
/usr/bin/ld: 找不到 -lwebp
collect2: error: ld returned 1 exit status

(2)$  sudo apt-get install webp.

 

(3)

$ tar xvzf ImageMagick.tar.gz

:

ImageMagick-7.0.8-19/Platforms.txt

 


(4)

$ cd ImageMagick-7.0.8-19/

$ ./configure

 :

configure:
==============================================================================
ImageMagick is configured as follows. Please verify that this configuration
matches your expectations.

  Host system type: x86_64-pc-linux-gnu
  Build system type: x86_64-pc-linux-gnu

                 Option                        Value
  ------------------------------------------------------------------------------
  Shared libraries  --enable-shared=yes        yes
  Static libraries  --enable-static=yes        yes
  Build utilities   --with-utilities=yes        yes
  Module support    --with-modules=no        no
  GNU ld            --with-gnu-ld=yes        yes
  Quantum depth     --with-quantum-depth=16    16
  High Dynamic Range Imagery
                    --enable-hdri=yes        yes

  Install documentation:            yes

  Delegate Library Configuration:
  BZLIB             --with-bzlib=yes        yes
  Autotrace         --with-autotrace=no        no
  DJVU              --with-djvu=yes        no
  DPS               --with-dps=yes        no
  FFTW              --with-fftw=yes        no
  FLIF              --with-flif=yes        no
  FlashPIX          --with-fpx=yes        no
  FontConfig        --with-fontconfig=yes    yes
  FreeType          --with-freetype=yes        yes
  Ghostscript lib   --with-gslib=no        no
  Graphviz          --with-gvc=yes        no
  HEIC              --with-heic=yes             no
  JBIG              --with-jbig=yes        yes
  JPEG v1           --with-jpeg=yes        yes
  LCMS              --with-lcms=yes        yes
  LQR               --with-lqr=yes        no
  LTDL              --with-ltdl=yes        no
  LZMA              --with-lzma=yes        yes
  Magick++          --with-magick-plus-plus=yes    yes
  OpenEXR           --with-openexr=yes        no
  OpenJP2           --with-openjp2=yes        no
  PANGO             --with-pango=yes        yes
  PERL              --with-perl=no        no
  PNG               --with-png=yes        yes
  RAQM              --with-raqm=yes        no
  RAW               --with-raw=yes            no
  RSVG              --with-rsvg=no        no
  TIFF              --with-tiff=yes        yes
  WEBP              --with-webp=yes        yes
  WMF               --with-wmf=yes        yes
  X11               --with-x=            yes
  XML               --with-xml=yes        yes
  ZLIB              --with-zlib=yes        yes
  ZSTD              --with-zstd=yes        no

  Delegate Program Configuration:
  GhostPCL          None                pcl6 (unknown)
  GhostXPS          None                gxps (unknown)
  Ghostscript       None                gs (9.26)

  Font Configuration:
  Apple fonts       --with-apple-font-dir=default   
  Dejavu fonts      --with-dejavu-font-dir=default    none
  Ghostscript fonts --with-gs-font-dir=default    /usr/share/fonts/type1/gsfonts/
  URW-base35 fonts  --with-urw-base35-font-dir=default  none
  Windows fonts     --with-windows-font-dir=default    none

  X11 Configuration:
        X_CFLAGS        =
        X_PRE_LIBS      =  -lSM -lICE
        X_LIBS          =
        X_EXTRA_LIBS    =

  Options used to compile and link:
    PREFIX          = /usr/local
    EXEC-PREFIX     = /usr/local
    VERSION         = 7.0.8
    CC              = gcc
    CFLAGS          = -I/usr/include/libxml2   -I/usr/include/libpng12  -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12   -I/usr/include/freetype2 -I/usr/include/freetype2   -fopenmp -g -O2 -Wall -mtune=core2 -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16
    CPPFLAGS        =   -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16
    PCFLAGS         =
    DEFS            = -DHAVE_CONFIG_H
    LDFLAGS         = 
    LIBS            =  -ljbig -llcms2 -ltiff -lfreetype  -ljpeg   -lpng12      -lfontconfig -lfreetype  -lwebpmux -lwebp -lwebp -lwmflite  -lXext    -lSM -lICE -lX11  -llzma -lbz2   -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lcairo   -lxml2  -lz     -lm   
    CXX             = g++
    CXXFLAGS        = -g -O2 -pthread
    FEATURES        = DPC HDRI Cipher OpenMP
    DELEGATES       = bzlib mpeg fontconfig freetype jbig jng jpeg lcms lzma pango png ps tiff webp wmf x xml zlib
==============================================================================

$

(5)$ make

:

ar: `u' modifier ignored since `D' is the default (see `U')
cp -f MagickCore/ImageMagick.pc MagickCore/ImageMagick-7.Q16HDRI.pc
cp -f MagickCore/MagickCore.pc MagickCore/MagickCore-7.Q16HDRI.pc
cp -f MagickWand/MagickWand.pc MagickWand/MagickWand-7.Q16HDRI.pc
cp -f Magick++/lib/Magick++.pc Magick++/lib/Magick++-7.Q16HDRI.pc
make[1]: Leaving directory '/home/treehrt/ImageMagick-7.0.8-19'

(6)$ sudo make install

:

 /bin/mkdir -p '/usr/local/lib/pkgconfig'
 /usr/bin/install -c -m 644 MagickCore/ImageMagick.pc MagickCore/MagickCore.pc MagickCore/ImageMagick-7.Q16HDRI.pc MagickCore/MagickCore-7.Q16HDRI.pc MagickWand/MagickWand.pc MagickWand/MagickWand-7.Q16HDRI.pc Magick++/lib/Magick++.pc Magick++/lib/Magick++-7.Q16HDRI.pc '/usr/local/lib/pkgconfig'
make[2]: Leaving directory '/home/treehrt/ImageMagick-7.0.8-19'
make[1]: Leaving directory '/home/treehrt/ImageMagick-7.0.8-19'

(7)

treehrt@treehrt-D630MT:~/ImageMagick-7.0.8-19$ sudo ldconfig /usr/local/lib
treehrt@treehrt-D630MT:~/ImageMagick-7.0.8-19$ /usr/local/bin/convert logo: logo.gif
treehrt@treehrt-D630MT:~/ImageMagick-7.0.8-19$ ls
aclocal.m4     config         gitversion.sh        Install-unix.txt     logo.gif      Magickshr.opt  NOTICE          tests
AUTHORS.txt    config.log     ImageMagick.spec     Install-vms.txt      m4            MagickWand     PerlMagick      utilities
ChangeLog      config.status  ImageMagick.spec.in  Install-windows.txt  Magick++      Makefile       Platforms.txt   version.sh
coders         configure      images               libtool              MagickCore    Makefile.am    QuickStart.txt  winpath.sh
common.shi     configure.ac   index.html           LICENSE              magick.sh     Makefile.in    README.txt      www
common.shi.in  filters        Install-mac.txt      local.exp            magick.sh.in  NEWS.txt       scripts
treehrt@treehrt-D630MT:~/ImageMagick-7.0.8-19$ pwd
/home/treehrt/ImageMagick-7.0.8-19
treehrt@treehrt-D630MT:~/ImageMagick-7.0.8-19$

 

(8) $make check

PASS: Magick++/demo/demos.tap 24
============================================================================
Testsuite summary for ImageMagick 7.0.8
============================================================================
# TOTAL: 86
# PASS:  86
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make[3]: Leaving directory '/home/treehrt/ImageMagick-7.0.8-19'
make[2]: Nothing to be done for 'check-local'.
make[2]: Leaving directory '/home/treehrt/ImageMagick-7.0.8-19'
make[1]: Leaving directory '/home/treehrt/ImageMagick-7.0.8-19'

(9)

treehrt@treehrt-D630MT:~/gtk$ ./mtile6d 312x2689-4x3-cw1.png 312x2686-4x3-cw2.png 312x2683-4x3-cw3.png 312x2680-4x3-cw4.png 312x2677-4x3-cw5.png 312x2674-4x3-cw6.png 2 1
mtile6d: magick/semaphore.c:601: LockSemaphoreInfo: Assertion `semaphore_info != (SemaphoreInfo *) NULL' failed.
已經終止 (core dumped)
treehrt@treehrt-D630MT:~/gtk$ g++  `Magick++-config --cxxflags --cppflags` -I/usr/local/include/ImageMagick-7  mtile6d.c `Magick++-config --ldflags --libs`  -L/usr/local/zlib/lib -lz   -Wall  -export-dynamic -lm -o mtile6d

 

treehrt@treehrt-D630MT:~/gtk$ ./mtile6d 312x2695-4x3-cw10.png 312x2692-4x3-cw0.png 312x2689-4x3-cw1.png 312x2686-4x3-cw2.png 312x2683-4x3-cw3.png 312x2680-4x3-cw4.png  3 1
argv[1]=312x2695-4x3-cw10.png
argv[2]=312x2692-4x3-cw0.png
argv[3]=312x2689-4x3-cw1.png
argv[4]=312x2686-4x3-cw2.png
argv[5]=312x2683-4x3-cw3.png
argv[6]=312x2680-4x3-cw4.png

 0
 0(0,0)
 1
 1(1,0)
 2
 2(2,0)
輸出六圖合併後的圖檔 xtile6d.jpg 成功!

 


select id,article_id,topic,text from lt_articles_text where article_id =453; ok. update lt_articles set num_reads=num_reads +1 where id=453; ok.