I have homebrew with libjpeg 9c installed. openMVG compiled sucessfully with no errors, however when I run the test script I get an error:
- Image listing -
0% 10 20 30 40 50 60 70 80 90 100%
|----|----|----|----|----|----|----|----|----|----|
Wrong JPEG library version: library is 90, caller expects 80
***Wrong JPEG library version: library is 90, caller expects 80
****Wrong JPEG library version: library is 90, caller expects 80
****Wrong JPEG library version: library is 90, caller expects 80
****Wrong JPEG library version: library is 90, caller expects 80
****Wrong JPEG library version: library is 90, caller expects 80
****Wrong JPEG library version: library is 90, caller expects 80
***Wrong JPEG library version: library is 90, caller expects 80
****Wrong JPEG library version: library is 90, caller expects 80
****Wrong JPEG library version: library is 90, caller expects 80
****Wrong JPEG library version: library is 90, caller expects 80
*************
Any help much appreciated.
This is likely caused by cmake finding the libraries in Mono first before the homebrew ones. Those are pretty outdated. Uninstalling Mono should fix it, but one workaround is probably to add
set(CMAKE_FIND_FRAMEWORK LAST)
somewhere before
find_package(JPEG QUIET)
find_package(PNG QUIET)
find_package(TIFF QUIET)
in src/CMakeLists.txt.
@NikolausDemmel thank you for the quick response! Bit embarrassing, but what is Mono?
http://brewformulas.org/Mono, might have been installed as a dependency of some other stuff you use.
Just a few days ago I had the exact same issue.
@pmoulon, I could provide a PR for the addition of set(CMAKE_FIND_FRAMEWORK LAST), but I have no idea if that has some problematic side effect in some other setups...
Ah, I see. Don't have it. I did find that brew had two versions of jpeg on my machine, version 8d and 9c. Got rid of 8d and now I'm recompiling the openMVG project. Let's see if that works.
Huh, interesting. Question is why cmake would find version 8 during build when you have 9 installed... But nvm.
If you have only one version on your computer you should be fine.
Tip: You can (if you have many libraries) overwrite the JPEG CMake related define with the library you want.
@NikolausDemmel
Question is why cmake would find version 8 during build when you have 9 installed...
The specific issue with Mono seems to be know in other libraries as well, see for example: https://github.com/opentoonz/opentoonz/issues/79#issuecomment-371925249
Another fix is to force openMVG jpeg/tiff/png libraries by commenting the lines :
find_package(JPEG QUIET)
find_package(PNG QUIET)
find_package(TIFF QUIET)
however the solution of @NikolausDemmel may be a cleaner workaround.
Hi Everyone! Thanks for the comments and suggestions. Sorry it took me so long to get back.
Unfortunately, I wasn't very scientific about rebuilding openMVG with the above suggestions. As stated, I deleted all older versions of libjpeg and rebuilt, as well as updated the CMakeLists.txt file with the suggestion from @NikolausDemmel by adding the line set(CMAKE_FIND_FRAMEWORK LAST) before the find_package commands for the various image libraries. After doing both of those things, the project compiled as expected and I was able to run the examples.
Thx @rperrot @NikolausDemmel for the additional feedback.
@pmoulon, I could provide a PR for the addition of set(CMAKE_FIND_FRAMEWORK LAST), but I have no idea if that has some problematic side effect in some other setups...
Do we maybe still want to do that?
Most helpful comment
This is likely caused by cmake finding the libraries in Mono first before the homebrew ones. Those are pretty outdated. Uninstalling Mono should fix it, but one workaround is probably to add
somewhere before
in
src/CMakeLists.txt.