3Dickulus/FragM

Compile weirdness about OpenEXR

Closed this issue · 16 comments

Describe the bug

Entering the commands as indicated on the front page (apt-get for a bunch of things, then git clone, then go into the source, make a build dir etc) all working fine. but then

~/tmp/FragM/Fragmentarium-Source/build$> cmake -DUSE_OPEN_EXR=ON -DCMAKE_INSTALL_PREFIX=~/ ..
-- Fragmentarium-2.5.7-241007
-- The CXX compiler identification is GNU 13.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find OpenEXR (missing: OpenEXR_ILMIMF_LIBRARY
OpenEXR_HALF_LIBRARY) (found version "3.1.5")
Call Stack (most recent call first):
/usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/usr/share/ECM/find-modules/FindOpenEXR.cmake:102 (find_package_handle_standard_args)
CMakeLists.txt:103 (find_package)
`

OpenEXR is there and current:

~/tmp/FragM/Fragmentarium-Source/build$> sudo apt install libopenexr-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libopenexr-dev is already the newest version (3.1.5-5.1build3).
0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.
`

[shrugging emoji]

Desktop (please complete the following information):

Linux Mint 22 (Basically Ubuntu with some tweaks). I had FragM 2.5.5 working on this previously without a hitch.
Very basic graphics (from inxi):

Graphics:
Device-1: NVIDIA GK107 [NVS 510] driver: nvidia v: 470.256.02 arch: Kepler
pcie: speed: 2.5 GT/s lanes: 16 bus-ID: 81:00.0 chip-ID: 10de:0ffd

Additional context

Fresh update from Mint 21.3 to 22, FragM failed - so I decided to update that to the newest version as well. No such luck.

apologies for the delayed response...

ensure FindOpenEXR.cmake is available, delete the ${project}/build/cmake folder and re-run cmake ?

using SuSE Linux I find it in "Extra CMake Modules" package.

if that fails try setting...
File: CMakeLists.txt
Line 87: set (OpenEXR_INCLUDE_DIRS "")
...manually

or have a look at the WIN32 part of the cmakelists.tx file where glm imath and openexr are installed in the project folder and try that ?

I have neglected this project a a little so there may be some issues caused by third party dev package updates.

Not directly related to FragM but OpenEXR...

RE:Ubuntu 20.04 LTS From: https://forums.developer.nvidia.com/t/openexr-not-found-in-cmakelists/220910

For posterity, if you do want to compile with OpenEXR support, I think the right answer is what you already tried. For me it works when I set OpenEXR_ROOT=/usr/include/OpenEXR, after installing libopenexr-dev.

I swear I tried that path 2 days ago just like you did, and saw the same behavior - cmake error. But today when I create a clean new build/ folder and use that path it works. So maybe we both had a bad cmake cache state or something. It might be the case that we needed to clear our cmake cache and/or start with a fresh build/ folder. Just making a note of this in case anyone else hits the same problem.

Finally got to do a test compile and it failed to link, Qt5 modules not found

added "qt5_use_modules(${PROJECT_NAME} OpenGL Widgets Gui Xml Script ScriptTools)" as line 353 in CMakeLists.txt, cmake complains with a warning about this command being deprecated in Qt6 but it does compile to an executable using Qt5...

Plan to upgrade to Qt6 as soon as I have some time anyways.

Thanks for all the effort!

I re-cloned from github, re-made the build directory, made sure I had your new addition in CMakeLists and

~/tmp/FragM/Fragmentarium-Source/build$ head -351 ../CMakeLists.txt | tail -3
qt5_use_modules(${PROJECT_NAME} OpenGL Widgets Gui Xml Script ScriptTools)

# Runtime support files
~/tmp/FragM/Fragmentarium-Source/build$   cmake -DUSE_OPEN_EXR=ON -DCMAKE_INSTALL_PREFIX=~/ ..
-- Fragmentarium-2.5.7-241014
-- The CXX compiler identification is GNU 13.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find OpenEXR (missing: OpenEXR_ILMIMF_LIBRARY
  OpenEXR_HALF_LIBRARY) (found version "3.1.5")
Call Stack (most recent call first):
  /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/ECM/find-modules/FindOpenEXR.cmake:102 (find_package_handle_standard_args)
  CMakeLists.txt:103 (find_package)


-- Configuring incomplete, errors occurred!
~/tmp/FragM/Fragmentarium-Source/build$

That looks like that same error message to me.

[many shrugging emojis]

I do note that changing the USE_OPEN_EXR=ON on the command line to =OFF doesn't change anything at all. It errors out with the same message. 🤷‍♂️🤷‍♀️🤷

Two more things:

  • the Appimage works! Yay!
  • a quick grep to see why it always uses EXR (even when told on the compile line not to) showed a file "Fragmentarium.pro" in the sources folder that contained a line USE_OPEN_EXR=1. Changing that to '=0' or removing it entirely or deleting the entire .pro file changes nothing. 🤷‍♂️

The "Fragmentarium.pro" file is for Qt Creator IDE and is not used by CMake.

Good to hear the AppIm works :)

OpenEXR_ILMIMF_LIBRARY is part of a OpenEXR support package?
Screenshot_20241023_140305
This is what (OpenEXR) is installed on the FragM development system

I am suspecting that libIlmImf was removed somewhere between version 2.2 and 3.1 - since I'm starting fresh this is just not something I have on my machine.
As of now, SynAPTic yields this for a search on "OpenEXR" - I don't see any "Util" package and I appear to have everything installed that has function here.
Screenshot from 2024-10-23 15-39-26
The question becomes: what part of the compile process insists on accessing it? It vaguely looks like cmake thinks it should be there[?] But I know nothing, really, about cmake...

the util package is cmdline apps .

from the error it looks like ECM/find-modules/FindOpenEXR.cmake is not hooking up maybe that needs updating?

I do have package libIlmImf-2_2-23 - Library to Handle EXR Pictures in 16-Bit Floating-Point Format
that provides /usr/lib64/libIlmImf-2_2.so.23.0.0 this is installed as part of the OpenEXR-dev package and the lib is used by a number of other programs like gimp etc. so it must be there somewhere?

So on this page:
https://openexr.com/en/latest/news.html
I find (search for libilmimf) the following in the release notes of 3.0.0:

The library is now called libOpenEXR (instead of libIlmImf). No header files have been renamed, they retain the Imf prefix.

As I suspected, that particular file "libIlmImf.so" doesn't exist any more -- yet somehow (c)cmake insists on looking for it -- this appears to be what's driving this. Your build chain is still at v2.2, so this doesn't affect you; but somewhere along the way cmake was supposed to be told "hey, look for something called libOpenEXR now" and wasn't...

so ECM/find-modules/FindOpenEXR.cmake not familiar with 3.0 yet, good to know, another thing to add to the list

closing as this will be addressed with upcoming release ;)

I found a work-around! In CMakeLists.txt, line 103, change

find_package ( OpenEXR REQUIRED )

to

find_package ( OpenEXR CONFIG )

and it will configure >3.0 correctly and configure/compile/install.
Yay!

(I learned more about cmake in the last couple days than my whole life before combined...)

Nice! will make the adjustment.