Hi,
I'm currently switching to github branch libraw 0.21-stable and tried to compile a more recent version of libraw. Unfortunately, running make after ./configure, I'm getting below error on macos Sonoma. What is needed to fix this?
Best,
Thilo
macbook:LibRaw user$ make
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh '/Users/tbauer/git/LibRaw/missing' aclocal-1.16 -I m4
/Users/tbauer/git/LibRaw/missing: line 81: aclocal-1.16: command not found
WARNING: 'aclocal-1.16' is missing on your system.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
make: *** [aclocal.m4] Error 127
You need to either install
You need to either install autotools or just use make -f Makefile.dist
(adjust makefile to meet your needs: JPEG comression support, etc)
-- Alex Tutubalin @LibRaw LLC
Hi Alex,
Hi Alex,
Again, thanks for your quick support. I realized, that I had to update the whole brew installation on my mac and also install and upgrade a lot more tools and libraries, like automake or pkg-config, which is mentioned in an earlier post.
Also I had to install libraries, like jasper, or zlib. From a perspective of such an upgraded full fledged development machine, it is hard to judge, what libraries need to be provided with libraw bundled with an app on a plain macos end-user installation.
All dependencies (additional libraries) that are now compiled with libraw obviously do not exist on a barebone macos installation, esp. without additional development tools like XCode and additional add-ons installed using homebrew installation manager.
Is there a list of libraries (DLLs, share libs) that need to be provided together with any application that relies on libraw and not running in a full fledged development machine environment?
It would be a nightmare for a developer of collecting complaints from end-users that quickly refuse to use your app because its not running on a real world mac. :-)
Thanks,
Thilo
With default/unchanged
With default/unchanged Makefile.dist LibRaw requires zlib only (present in base macOS).
All additional dependencies (libjpeg, RawSpeed, Adobe DNG SDK) are optional and disabled by default.
-- Alex Tutubalin @LibRaw LLC
Thanks again. I could solve
Thanks again. I could solve the compile problems. Now, I'm getting a lot of undefined symbols when trying to link the library against my app. Most of them sound like the optional packages have been compiled into the library, now missing their references when linking against the static library for branch "LibRaw 0.21-stable", which sounds weird.
I tried to resolve this, by rolling back to version 0.20 and rebuild the library for this version, which previously worked. However, the list of undefined references I get while linking is even longer. Now, it sounds like optional libraries haven't been detected as optional when switching to branch "LibRaw 0.20-stable" and rebuilding after 'make clean'.
I followed the instructions how to compile by executing these commands:
autoreconf --install
./configure
make
Also I tried 'make clean' and rebuild from scratch and removed many files manually, with no success.
Any suggestion how to solve this?
Undefined symbols: LibRaw:
Undefined symbols: LibRaw::open_file means "You've forgot to link with libraw library"
The second group of errors means: you've build libraw with JPEG decompression support but forgot to add libjpeg to your linker input.
-- Alex Tutubalin @LibRaw LLC
The makefile for creation and
The makefile for creation and linking did not change. This is how linking of the source code is defined:
This actually runs following command to link the collected object files (mixed C/C++) with static library libraw and create a dynamic library as target
So the process of linking takes place, but the linker complains it cannot find the symbols in the created binary of 'libraw.a' at this stage. As if libraw binaries and the compiled sources from the project created different object binaries on the same machine and architecture (target machine currently is an Intel type MacBook Pro, x86_64), with all *.o files and libraries, or at least they do seem to have different method signatures.
Also I do not understand, why code segments are compiled into libraw, like DNG ore Kodak related stuff, if this is optional.
I tried to apply same compiler binaries and options to compile other projects *.cpp resources, but linking all created binaries against libraw still fails.
Again, I checked LibRaw's collected output of './configure', but cannot get insights why the binaries cannot be linked together:
This is the (sample) output during compilation of the sources of libraw:
Sorry, but your huge quotes
Sorry, but your huge quotes don't tell me anything at all, since all this happens within your build system, which I know nothing about.
Two short questions:
1) Do you build LibRaw via make -f Makefile.dist or via ./configure?
2) (in both cases): Does the LibRaw build result in compiled examples or not? (these examples are in ...LibRaw/bin/ folder if you're using provided Makefile.dist. They may be located somewhere else when configure is used)
-- Alex Tutubalin @LibRaw LLC
According to libraw
According to libraw documentation, it has been built like
Library binaries are created and placed in subdirectory 'lib' of the project repository and also placed at location '/usr/local/lib'.
Examples are also created in directory 'bin' of the libraw project repository.
Great.
Great.
Please link your binary the same way as LibRaw's examples.
-- Alex Tutubalin @LibRaw LLC
After reverse engineering of
After reverse engineering of 'libtool' and inspecting the output of the build, I found the samples link against the shared library using a deprecated options '-Wl,-bind_at_load'.
In my case I need to link my shared library against the static library 'libraw.a' and also avoid additional DLLs must be packed in addition to the dynamic library of libraw.
Could it be configure did something wrong and symbols are no longer exported during build process of libraw?
I still do not understand why the linker complains about undefined symbols of DNG or Kodak parts of the library, that should be incorporated as optional.
I don't think that the task
I don't think that the task of supporting our library is to teach anyone the linking options in their system.
If both the shared and static libraries are in the same directory, which you pass to the linker via the -L option, then it is not surprising that it chooses the shared one from the two possible libraries. Perhaps your linker has an option "choose from two - the static version" but again I don't think that the LibRaw forum is the right place to discuss macOS's ld options.
Other possible solutions (besides of linker option 'prefer static') are to move the static version to a separate directory or, conversely, remove the dynamic one from the directory passed to the linker. Also, configure can only create a static library without a dynamic one (again, I hope that we will not discuss configure options in our forum)
Regarding your second question (which I already answered above): you've build LibRaw with JPEG decompression support, you need to add libjpeg to your application linking input (since you say that the examples build successfully: configure/libtool already do that)
-- Alex Tutubalin @LibRaw LLC