3

I'm trying to build Emacs 26 from source but make fails

./temacs --batch  --load loadup bootstrap
./temacs: error while loading shared libraries: libjpeg.so.9: cannot open shared object file: No such file or directory

If I search for libjpeg.so I have

$ locate libjpeg.so
/home/boffi/Downloads/processing-3.3.5/java/lib/amd64/libjpeg.so
/home/boffi/lib/miniconda3/lib/libjpeg.so
/home/boffi/lib/miniconda3/lib/libjpeg.so.9
/home/boffi/lib/miniconda3/lib/libjpeg.so.9.2.0
/home/boffi/lib/miniconda3/pkgs/jpeg-9b-habf39ab_1/lib/libjpeg.so
/home/boffi/lib/miniconda3/pkgs/jpeg-9b-habf39ab_1/lib/libjpeg.so.9
/home/boffi/lib/miniconda3/pkgs/jpeg-9b-habf39ab_1/lib/libjpeg.so.9.2.0
/usr/lib/x86_64-linux-gnu/libjpeg.so
/usr/lib/x86_64-linux-gnu/libjpeg.so.62
/usr/lib/x86_64-linux-gnu/libjpeg.so.62.2.0

and it seems to me that Emacs is not looking at the system libraries...

Grepping the output of configure I have another suspicious line

$ ./configure | grep miniconda
  Does Emacs use a png library?    yes -  L/home/boffi/lib/miniconda3/lib -lpng16

My question is, how can I screen the libraries installed by the Anaconda Python Distribution for its own use, so that ./configure does not mess with them?

Or, on the other hand, how can I have temacs and later Emacs find the library they expect to load?

  • I had to uninstall conda to get the compile to work. – Justin Thomas Jun 4 '18 at 18:07
  • 1
    @JustinThomas Uninstalling conda is a bit too much, have a look at the answers below. It suffices to temporarily change the PATH during the execution of config... – gboffi Jun 5 '18 at 9:51
  • Deactivating conda before install is sufficient. – al0 Aug 18 '18 at 13:31
1

Emacs uses the "libpng-config" tool to locate PNG include files and libraries. So yes, if you have multiple versions installed you need to adjust PATH so that the one you want to be used, is. For other libraries, it's normally "pkg-config" that is consulted, for which there is the PKG_CONFIG_PATH environment variable. If Anaconda provides a pkg-config, it probably prefers Anaconda packages, so again adjusting PATH is probably the right solution.

  • Ooops, in December I somehow missed your answer, but it exactly pinpoints the problem... ፨ $ libpng-config --ldflags → -L/home/boffi/lib/miniconda3/lib -lpng16 — thanks a lot – gboffi Jun 5 '18 at 9:47
2

TL;DR export PATH=/usr/bin:/bin

I had a look at config.log to see where configure mentioned the paths used by the Anaconda distribution and I found 3 references to miniconda3 — 2 were related to the PNG libraries and one to the PATH variable... of course the bin directory of the Anaconda distribution has to be prepended to PATH, hasn't it?

To be sure that was not a problem with my PATH I issued the command

$ PATH=/usr/bin:/bin ./configure 2>/dev/null | grep -qs miniconda || make
...
make[1]: Leaving directory '/home/boffi/src/emacs-26.0.90'
$

I have now a way to shade private Anaconda libraries from the scrutiny of configure, I have an instance of Emacs 26 too and eventually I have the doubt that configure had been too smart in deducing too much from my PATH.


ps I'm not going to approve my answer because it seems to me just a workaround, I'm convinced that a better solution is possible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.