cannot find -lOpenEXR on Ubuntu 20.04

Issue #55 closed
Former user created an issue

Context: Linux Dev, Building on Ubuntu 20.04

When I run make I get /usr/bin/ld: cannot find -lOpenEXR

Despite apt install libopenexr24 libopenexr-dev openexr It seems nothing is providing libOpenEXR.so in ubuntu

$ ldconfig -p |grep -i exr
<empty>

Looking at Arch's file list for the openexp package it seems like they include usr/lib/libOpenEXR.so which the ubuntu package does not

My workaround was to compile OpenExr from source. Then everything worked.

Opened and closed so that others might learn from my experience.

Comments (7)

  1. Seth

    Unfortunately this did not completely resolve the problem.

    I got errors about missing references to half symboles

    /usr/bin/ld: EmberAnimate.o: in function `EmberCommon::Rgba32ToRgbaExr(glm::vec<4, float, (glm::qualifier)0>*, Imf_2_3::Rgba*, unsigned long, unsigned long, bool)':
    EmberAnimate.cpp:(.text+0x8ab): undefined reference to `half::_eLut'
    /usr/bin/ld: EmberAnimate.cpp:(.text+0x8ed): undefined reference to `half::_eLut'
    

    So I added references to -lIlmImf and after a few iterations this worked

    diff --git a/Builds/QtCreator/defaults.pri b/Builds/QtCreator/defaults.pri
    index ce686f6..0c5f1a0 100644
    --- a/Builds/QtCreator/defaults.pri
    +++ b/Builds/QtCreator/defaults.pri
    @@ -94,7 +94,9 @@ else {
            LIBS += -ljpeg
            LIBS += -lpng
            LIBS += -lpthread
            LIBS += -lOpenEXR
    +       LIBS += -lIlmImf
    +       LIBS += -lIex
    +       LIBS += -lHalf
    
             unix:!macx {
                 LIBS += -lxml2
    

    I believe this helps but I still get at least one error

    g++ -m64 -Wl,-O1 -s -o ../../../Bin/release/emberanimate EmberAnimate.o EmberCommonPch.o   -ljpeg -lpng -lpthread -lOpenEXR -lIlmImf -lxml2 -lGL -lOpenCL -L/home/five/Projects/fractorium/Bin/release -lember -lembercl   
    /usr/bin/ld: EmberAnimate.o: undefined reference to symbol '_ZN4half5_eLutE'
    /usr/bin/ld: /lib/x86_64-linux-gnu/libHalf.so.24: error adding symbols: DSO missing from command line
    

    Finally one error about ambiguous `ToString`

    ../../../Source/Fractorium/FractoriumCommon.h:98:39: error: call of overloaded ‘toString(long int&)’ is ambiguous
       98 |  return QLocale::system().toString(val);
    

    I hacked this by defining an ToString(long val) as ToString((int) val); and hoping that doesn’t come back to bit me


    Finally I get a `fractorium` binary that runs and the UI renders.

    Sadly one second later it crashes basic_string::_M_construct null not valid 😞 . This probably comes from returning 0 from a method expecting a string?

  2. Matt Feemster repo owner

    Hi Seth, sorry to hear you are having such a hard time.

    First question, have you just tried using the installer from the website, fractorium.com? It uses AppImage and installs easily. Much better than building from source.

    If you are intent on building from source, you’ll notice in the commit logs that I recently upgraded the version of OpenExr that is used. It now uses 3.1.3, however I think any 3.1 version will do.

    Can you please verify that is what you are building with? From your linker errors, it appears you are running with version 2.3, which no longer works with Fractorium.

    The reason I upgraded was because someone else had trouble getting the older version of OpenExr on some version of linux.

  3. Matt Feemster repo owner

    If you plan to use the program for a while, we can always chat on our fractals Discord to make sure you’re up and running properly. Just a thought.

  4. Log in to comment