jasper-software / jasper

Official Repository for the JasPer Image Coding Toolkit
http://www.ece.uvic.ca/~mdadams/jasper
Other
223 stars 101 forks source link

INSTALL instructions are misleading for those not used to installing #316

Closed pbhj closed 2 years ago

pbhj commented 2 years ago

The INSTALL doc in the project root directory says this (emphasis added):

1) Select an empty directory to use for building the software.
Let $BUILD_DIR denote this directory.
2) Generate the makefiles used for building the software.  To do this,
invoke the command:
    **cmake -H$SOURCE_DIR -B$BUILD_DIR -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR $OPTIONS**
where $OPTIONS corresponds to zero or more -D options as described below
under the heading "Cmake Options".
3) Build the code using the make utility.  To do this, invoke the command:
    cmake --build $BUILD_DIR
4) Run the test suite to ensure that the software seems to be working
correctly.  To do this, invoke the commands:
    cd $BUILD_DIR
    ctest --output-on-failure
5) Install the software.  To do this, invoke the command:
    cmake --build $BUILD_DIR --target install

This is a bit misleading, invoking that command (in bold) requires choices to be made for the directories to use. This should be made more clear by providing an example, say.

I found under Kubuntu, using BASH, that BUILD_DIR="~/Downloads/jasper/buildlocal/" for some reason didn't work with cmake. As you can see, I'm not experienced with cmake so I don't know why.

The following is what I did to install:

git clone https://github.com/jasper-software/jasper.git # for jasper for digikam
cd jasper/
mkdir buildlocal
cmake -H"/home/username/Downloads/jasper" -B"/home/username/Downloads/jasper/buildlocal" -DCMAKE_INSTALL_PREFIX="/usr/local" -DALLOW_IN_SOURCE_BUILD=TRUE
cmake --build /home/username/Downloads/jasper/buildlocal
cd buildlocal; ctest --output-on-failure
cd ..
sudo cmake --build '/home/username/Downloads/jasper/buildlocal' --target install

I tried to use checkinstall as I wanted to make a .deb package but I couldn't get it to work as cmake required to be run using sudo:

checkinstall -D "cmake --build '/home/username/Downloads/jasper/buildlocal' --target install" # this failed, as did running it with sudo

More info on my blog at alicious.com/compiling-jasper/

mdadams commented 2 years ago

I am sorry that you don't have experience using CMake. Using any build tool can be tricky for people who have not used the particular tool before. This said, however, I don't think that an example would have helped you. For example, I would never have included a "sudo" invocation in an example. The need for sudo has nothing really to do with CMake, it is simply a Unix/Linux thing, as you need to have permissions to write into the installation directory. If you are not building your own Linux distribution, I would recommend installing the software in a place that does not require special permissions like $HOME/local (i.e., -DCMAKE_INSTALL_PREFIX=$HOME/local) or something like that. A better solution would be to make a bug/feature request against the Linux distribution that you are using to include JasPer as a package. This would then eliminate the need to you to build the JasPer software yourself. As a general rule, the Linux distribution maintainers do not listen to people like me when deciding which software to package for a Linux distribution, they only listen to people like you (i.e., the end user). So, my suggestion, for what it's worth, would be to make your voice heard and request that the Linux distribution that you use consider including JasPer as a package.

jubalh commented 2 years ago

As a side note: Plenty of distributions ship the most recent version of JasPer: https://repology.org/project/jasper/versions It would be good if you could request the Debian maintainers ship JasPer again @pbhj.

mdadams commented 2 years ago

@jubalh Thanks for the repology link. I hope that pbhj will follow up. A while back, I tried requesting that Debian reinstate JasPer, but they did not, as I don't think that my comments carry much weight as the author of JasPer.

jubalh commented 2 years ago

A while back, I tried requesting that Debian reinstate JasPer, but they did not, as I don't think that my comments carry much weight as the author of JasPer.

I made the same request to some Debian Developer a while back.

@pbhj best would be to file a RFP: https://wiki.debian.org/RFP

pbhj commented 2 years ago

Thanks for the feedback, couple of notes.

@mdadams, even a non-sudo example would have helped me, I could have at least tested install for my user only if I'd thought to do it that way. I need to install for multiple accounts though. In part I was just raising this to provide an example of installation search engines could find in the absence of any other examples (that I found).

@jubalh I'm actually on Kubuntu, presumably for me I'd need to request Canonical/Ubuntu packaged JasPer? Not sure if any request from me would make any difference. Looks like there is a package on Launchpad, https://launchpad.net/ubuntu/+source/jasper. Seems like Ubuntu have settled on new fat package formats, flatpak, snap, etc., and so they're not bothering with .deb packages for some (IMO) pretty major applications. Think I'm swimming against the tide here.

Thanks both for your responses.

I should note the checkinstall fail was me using "" when they weren't needed, needed to rtfm; someone on SE helped.

jubalh commented 2 years ago

I'm actually on Kubuntu, presumably for me I'd need to request Canonical/Ubuntu packaged JasPer?

They pull this in from Debian. Just will take some time until it lands in the new release.

Seems like Ubuntu have settled on new fat package formats, flatpak, snap, etc., and so they're not bothering with .deb packages for some (IMO) pretty major applications. Think I'm swimming against the tide here.

No. They still use .deb. The snap is mostly for desktop applications. For applications to bundle all the dependencies in one sandbox/image.