Code Monkey home page Code Monkey logo

Comments (8)

DanBloomberg avatar DanBloomberg commented on August 18, 2024 1

For leptonica, a simple way to make your "headless" build is to edit only environ.h and use the static makefile, as described in the README.html.

from leptonica.

zdenop avatar zdenop commented on August 18, 2024 1

I plan to adjust cmake configuration, so you can choose which dependencies should be compiled.

from leptonica.

zdenop avatar zdenop commented on August 18, 2024

At the moment you can disable only webp (with -DLIBWEBP_SUPPORT=OFF) and openjpeg (-DOPENJPEG_SUPPORT=OFF).

Just for notice: jpeg is (optional) dependency for tiff, so error could come also from this source especially if you are making static build.

from leptonica.

fschutt avatar fschutt commented on August 18, 2024

I eventually managed to disable everything by editing the source code, especially environ.h and the Makefile (to get rid of all mentions of libjpeg, etc.). The resulting library was about 4MB for leptonica and 3MB for tesseract. It would be great if the Makefile could be edited so that it's easier to create a "headless" build.

from leptonica.

fschutt avatar fschutt commented on August 18, 2024

@DanBloomberg Yeah I found it, but I'm just suggesting making those environ.h flags configurable from the Makefile, so that it's easier to enable / disable without using sed (when using automated scripts / CI, etc.).

from leptonica.

fschutt avatar fschutt commented on August 18, 2024

@zdenop I also had to modify cmake/Configure.cmake and prog/makefile.static to completely disable linking to libpng, libtiff, libjpeg and libz: https://github.com/fschutt/tesseract-static-rs/blob/e5fffdf9fc1f5592d304ceab1237f8051535994b/build.rs#L123-L199

from leptonica.

DanBloomberg avatar DanBloomberg commented on August 18, 2024

As you demonstrate, in addition to editing environ.h, you also need to modify the ALL_LIBS variable in prog/makefile.static.
Nice use of rust!

from leptonica.

zdenop avatar zdenop commented on August 18, 2024

please try with current master:
cmake -Bbuild -DBUILD_PROG=OFF -DSW_BUILD=OFF -DBUILD_SHARED_LIBS=ON -DENABLE_ZLIB=OFF -DENABLE_PNG=OFF -DENABLE_GIF=OFF -DENABLE_JPEG=OFF -DENABLE_TIFF=OFF -DENABLE_WEBP=OFF -DENABLE_OPENJPEG=OFF

from leptonica.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.