5 votes

Help needed with jpegli please

Topic deleted by author

13 comments

  1. [8]
    Wes
    (edited )
    Link
    Sure. I compiled these with gcc. It includes two binaries: cjpegli (encoder) and djpegli (decoder). Download zip via Dropbox. Link will probably expire eventually, when I clean up my files.

    Sure. I compiled these with gcc. It includes two binaries: cjpegli (encoder) and djpegli (decoder).

    Download zip via Dropbox. Link will probably expire eventually, when I clean up my files.

    4 votes
    1. [8]
      Comment deleted by author
      Link Parent
      1. [7]
        Wes
        (edited )
        Link Parent
        Ah, missing library. I'll have to see if I can include that in the build as well. Hang tight.

        Ah, missing library. I'll have to see if I can include that in the build as well. Hang tight.

        2 votes
        1. [7]
          Comment deleted by author
          Link Parent
          1. [6]
            Wes
            Link Parent
            Okay, I've repackaged it and updated the link above. Give it another try.

            Okay, I've repackaged it and updated the link above. Give it another try.

            1 vote
            1. [6]
              Comment deleted by author
              Link Parent
              1. [5]
                Wes
                Link Parent
                The customer demands even more static. Alright, I've basically bundled every dependency that your Linux system might not have. Link is updated again. If this doesn't work, I claim ignorance of...

                The customer demands even more static. Alright, I've basically bundled every dependency that your Linux system might not have. Link is updated again.

                If this doesn't work, I claim ignorance of using cmake as a pitiful web dev.

                4 votes
                1. [5]
                  Comment deleted by author
                  Link Parent
                  1. [4]
                    Wes
                    Link Parent
                    It may honestly be easier to build yourself, as it'll use your systems libraries. In this case, I think my C++ runtime was too new for your system. Nonetheless, one more for the road? Link is...

                    It may honestly be easier to build yourself, as it'll use your systems libraries. In this case, I think my C++ runtime was too new for your system.

                    Nonetheless, one more for the road? Link is updated...

                    Gosh, I don't envy C devs.

                    3 votes
                    1. [4]
                      Comment deleted by author
                      Link Parent
                      1. [3]
                        Wes
                        Link Parent
                        I'm pretty confused, because libc should be included in basically every Linux distro. I can only guess that it's running in an extremely locked down environment like Docker, or a bare bones Linux...

                        I'm pretty confused, because libc should be included in basically every Linux distro. I can only guess that it's running in an extremely locked down environment like Docker, or a bare bones Linux distro designed for IoT or something.

                        In any case, I'm sorry I couldn't be of more help. Best of luck in finding an alternative solution.

                        3 votes
                        1. [2]
                          bitwyze
                          Link Parent
                          It is included in every distro, but you two have different versions based on which OS you're running. It could be that one of you is very out-of-date, or just that one distro is a bit behind....

                          It is included in every distro, but you two have different versions based on which OS you're running. It could be that one of you is very out-of-date, or just that one distro is a bit behind. Since yours was linked against one version and OP has a different one on their system, it's failing to link properly. This is one of the reasons containerization has gotten so popular.

                          Also, a .so file is a shared object file (a .dll in Windows) which is dynamically linked. A .a file is a statically linked library (I don't remember what windows calls their static libraries? .lib or something?)

                          2 votes
                          1. Wes
                            Link Parent
                            I'm on a rolling release, so probably too recent. It seems like glibc can be statically linked, but it's highly discouraged on Linux. I guess the solution is to simply build from an older system...

                            I'm on a rolling release, so probably too recent.

                            It seems like glibc can be statically linked, but it's highly discouraged on Linux. I guess the solution is to simply build from an older system for wider compatibility.

                            Sharing libraries may once have made sense for saving disk space, but fully packaging and containerizing tools definitely seems like the way forward.

  2. teaearlgraycold
    (edited )
    Link
    This is a great use case for an LLM agent like Claude Code. OpenCode will let you use their LLM a bit for free.

    This is a great use case for an LLM agent like Claude Code. OpenCode will let you use their LLM a bit for free.

    3 votes
  3. [2]
    DistractionRectangle
    (edited )
    Link
    So what I like to do when trying to build a project is poke around their .github/workflows if they have any. In this case, it looks like they have the build process documented in release.yaml....

    So what I like to do when trying to build a project is poke around their .github/workflows if they have any. In this case, it looks like they have the build process documented in release.yaml. Edit: I like to reference the workflows directly because sometimes the written docs aren't up to date with the actual build process. (edit edit: whoops, linked to build_test, not release, fixed)

    If you need further help distilling this into a local build script, add what platform you're trying to compile for (e.g. distro + version + cpu arch) and one of the other tildren will probably help you before I find the time to take a stab at it.

    Aaaand they already did.

    1 vote
    1. DistractionRectangle
      Link Parent
      @Fishtail_Parka build.sh #!/usr/bin/env bash # yanked steps from ubuntu_static_x86_64 job in https://github.com/google/jpegli/blob/main/.github/workflows/release.yaml mkdir -p ./jpegli-tools...

      @Fishtail_Parka

      build.sh
      #!/usr/bin/env bash
      
      # yanked steps from ubuntu_static_x86_64 job in https://github.com/google/jpegli/blob/main/.github/workflows/release.yaml
      
      mkdir -p ./jpegli-tools
      docker run --rm -i -v ./jpegli-tools:/output ubuntu:latest /bin/bash << 'EOF'
      
      apt update
      DEBIAN_FRONTEND=noninteractive apt install -qqy \
              asciidoc \
              clang \
              cmake \
              doxygen \
              graphviz \
              libgif-dev \
              libgtest-dev \
              libjpeg-dev \
              libopenexr-dev \
              libpng-dev \
              libwebp-dev \
              ninja-build \
              pkg-config \
              git \
          #
      
      export CC="clang"
      export CXX="clang++"
      
      # include -b <release tag> to clone a specific version
      git clone --recurse-submodules --depth 1 https://github.com/google/jpegli.git
      
      cd ./jpegli
      
      SKIP_TEST=1 \
      ./ci.sh release \
          -DJPEGLI_DEP_LICENSE_DIR=/usr/share/doc \
          -DJPEGLI_STATIC=ON \
          -DBUILD_TESTING=OFF \
          -DJPEGLI_ENABLE_JPEGLI_LIBJPEG=OFF \
          -DJPEGLI_ENABLE_OPENEXR=OFF \
          -DJPEGLI_ENABLE_DEVTOOLS=OFF \
          #
      
      cp ./build/tools/cjpegli /output
      cp ./build/tools/djpegli /output
      EOF
      
      

      Seems to work in my limited testing. Built in ubuntu, ran on arch host.

      Edit: There's also instructions for a windows build in release.yaml

  4. kacey
    Link
    May I ask if you're trying to link against it for perf reasons, or just to try out the library? If the latter, it looks like someone might've compiled it to wasm here. Can't vouch for it, though,...

    May I ask if you're trying to link against it for perf reasons, or just to try out the library? If the latter, it looks like someone might've compiled it to wasm here.

    Can't vouch for it, though, so it might steal your photo, download a car, or hack into your mainframes. Please do exercise caution.