Welcome to Fractal Forums

Fractal Software => Fragmentarium => Topic started by: Adam Majewski on September 13, 2015, 09:08:42 PM




Title: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: Adam Majewski on September 13, 2015, 09:08:42 PM
Hi,

I try to install :

http://www.digilanti.org/fragmentarium/

I get error :

Linking CXX executable Fragmentarium-1.0.11
/usr/bin/ld: /home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/Fragmentarium-Source/../OpenEXR/lib/libIlmThread-2_1.a(IlmThreadSemaphorePosix.cpp.o): undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line


My system :

Ubuntu 14.04.3 LTS

I have tried to find solution using google but can't do it.

TIA

Adam


Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: 3dickulus on September 13, 2015, 11:31:53 PM
if you used the mklinux.sh script I am assuming ilmbase-2.1.0 and openexr-2.1.0 succeeded and installed the includes and libs in Fragmentarium-1.0.11-3Dickulus folder.

at this point you should be able to build using QtCreator IDE or CMake, I note that the Fragmentarium.pro (QtCreator) file has this @ line 98...
Code:
else:unix:CONFIG(release, debug|release): LIBS += -lz -lpthread
...and CMakeLists.txt file has this @ line 128...
Code:
  target_link_libraries ( Fragmentarium-1.0.11 GL z pthread ${OpenEXR_LIBRARIES})
...so in both cases pthread lib is there and should hookup.

try inserting this line to openexr-2.1.0/CMakeLists.txt as line 46...
Code:
  ADD_DEFINITIONS(-pthread)

delete any "build" folders and run the mklinux.sh script again

I have SuSE 13.2 (glibc-2.19-16.15.1) and use mklinux.sh to compile everything from a clean start.


Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: Adam Majewski on September 14, 2015, 06:52:19 PM


So lines 44-47 in openexr-2.1.0/CMakeLists.txt
are now :



IF (NOT WIN32)
  SET ( PTHREAD_LIB pthread )
  ADD_DEFINITIONS(-pthread)
ENDIF()

So I have :
- deleted any "build" folders ( sudo mc)
- and run the mklinux.sh script again

sudo ./mklinux.sh>log.txt
ILMBASE_PACKAGE_PREFIX = /home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/openexr-2.1.0/build/../../OpenEXR
Using /usr/lib/x86_64-linux-gnu/libz.so
In file included from /home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/openexr-2.1.0/IlmImf/ImfOptimizedPixelReading.h:57:0,
                 from /home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/openexr-2.1.0/IlmImf/ImfScanLineInputFile.cpp:58:
/home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/openexr-2.1.0/IlmImf/ImfSystemSpecific.h: In function ‘void* Imf_2_1::EXRAllocAligned(size_t, size_t)’:
/home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/openexr-2.1.0/IlmImf/ImfSystemSpecific.h:64:42: warning: ignoring return value of ‘int posix_memalign(void**, size_t, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
     posix_memalign(&ptr, alignment, size);
                                          ^
/home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/openexr-2.1.0/IlmImfFuzzTest/main.cpp: In function ‘int main(int, char**)’:
/home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/openexr-2.1.0/IlmImfFuzzTest/main.cpp:72:30: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
     system (ss.str().c_str());
                              ^
/home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/openexr-2.1.0/IlmImfTest/testFutureProofing.cpp: In function ‘void {anonymous}::modifyType(bool)’:
/home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/openexr-2.1.0/IlmImfTest/testFutureProofing.cpp:1236:33: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
             fread(&length,4,1,f);
                                 ^
/home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/openexr-2.1.0/IlmImfTest/testMultiPartFileMixingBasic.cpp: In function ‘void {anonymous}::killOffsetTables(const string&)’:
/home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/openexr-2.1.0/IlmImfTest/testMultiPartFileMixingBasic.cpp:1385:33: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
             fread(&length,4,1,f);
                                 ^
/home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/Fragmentarium-Source/ThirdPartyCode/hdrloader.cpp: In static member function ‘static bool HDRLoader::load(const char*, HDRLoaderResult&)’:
/home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/Fragmentarium-Source/ThirdPartyCode/hdrloader.cpp:41:25: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
  fread(str, 10, 1, file);
                         ^
/usr/bin/ld: /home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/Fragmentarium-Source/../OpenEXR/lib/libIlmThread-2_1.a(IlmThreadSemaphorePosix.cpp.o): undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [Fragmentarium-1.0.11] Błąd 1
make[1]: *** [CMakeFiles/Fragmentarium-1.0.11.dir/all] Błąd 2
make: *** [all] Błąd 2


It looks tha same.
 :-\


Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: Adam Majewski on September 14, 2015, 06:58:04 PM
I have also tried with Qt creator : build :

18:55:28: Uruchamianie kroków budowania dla projektu Fragmentarium...
18:55:28: Konfiguracja niezmieniona, krok qmake opuszczony.
18:55:28: Uruchamianie "/usr/bin/make"
g++ -Wl,-rpath,/home/a/Qt/5.5/gcc_64 -Wl,-rpath,/home/a/Qt/5.5/gcc_64/lib -o Fragmentarium-1_0_11 Main.o CameraControl.o asmbrowser.o DisplayWidget.o TextEdit.o MainWindow.o VariableEditor.o VariableWidget.o EasingWindow.o qrangeslider.o qdoublerangeslider.o Preprocessor.o ListWidgetLogger.o Logging.o Matrix4.o Vector3.o ColorUtils.o MiniParser.o Misc.o Persistence.o Version.o OutputDialog.o FileManager.o hdrloader.o QtSpline.o qrc_Fragmentarium.o moc_asmbrowser.o moc_DisplayWidget.o moc_TextEdit.o moc_MainWindow.o moc_VariableEditor.o moc_VariableWidget.o moc_qrangeslider.o moc_qdoublerangeslider.o moc_EasingWindow.o moc_PreferencesDialog.o moc_OutputDialog.o   -L/home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/Fragmentarium-Source/../OpenEXR/lib/ -lIlmImf-2_1 -lHalf -lIex-2_1 -lIexMath-2_1 -lImath-2_1 -lIlmThread-2_1 -lGL -L/home/a/Qt/5.5/gcc_64/lib -lQt5OpenGL -L/usr/lib64 -lQt5Widgets -lQt5Gui -lQt5Xml -lQt5Script -lQt5Core -lpthread
/home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/Fragmentarium-Source/../OpenEXR/lib//libIlmImf-2_1.a(ImfZipCompressor.cpp.o): In function `Imf_2_1::ZipCompressor::compress(char const*, int, int, char const*&)':
ImfZipCompressor.cpp:(.text+0x13f): undefined reference to `compress'
/home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/Fragmentarium-Source/../OpenEXR/lib//libIlmImf-2_1.a(ImfZipCompressor.cpp.o): In function `Imf_2_1::ZipCompressor::uncompress(char const*, int, int, char const*&)':
ImfZipCompressor.cpp:(.text+0x1f3): undefined reference to `uncompress'
/home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/Fragmentarium-Source/../OpenEXR/lib//libIlmImf-2_1.a(ImfPxr24Compressor.cpp.o): In function `Imf_2_1::Pxr24Compressor::compress(char const*, int, Imath_2_1::Box<Imath_2_1::Vec2<int> >, char const*&) [clone .part.1]':
ImfPxr24Compressor.cpp:(.text+0x214): undefined reference to `compress'
/home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/Fragmentarium-Source/../OpenEXR/lib//libIlmImf-2_1.a(ImfPxr24Compressor.cpp.o): In function `Imf_2_1::Pxr24Compressor::uncompress(char const*, int, Imath_2_1::Box<Imath_2_1::Vec2<int> >, char const*&) [clone .part.2]':
ImfPxr24Compressor.cpp:(.text+0x4e7): undefined reference to `uncompress'
collect2: error: ld returned 1 exit status
make: *** [Fragmentarium-1_0_11] Error 1
18:55:28: Proces "/usr/bin/make" zakończył się kodem wyjściowym 2.
Błąd budowania / instalowania projektu Fragmentarium (zestaw narzędzi: Desktop Qt 5.5.0 GCC 64bit)
Podczas wykonywania kroku "Make"
18:55:28: Czas trwania: 00:00.


Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: 3dickulus on September 14, 2015, 07:43:59 PM
Quote
sudo ./mklinux.sh>log.txt
should not be compiling or installing as root user!!! don't use 'sudo'

ok, pthread lib is there, now I see the whole error, you also need to install zlib-devel pkg, I have zlib-1.2.8-5.1.2 installed on my system

OpenEXR uses threads and zlib for compressing the image data, this all gets compiled and linked with static libs so no need to install .dll or .so files, it is self contained, only windows needs zlib1.dll. The linux devel pkg should have the static libz.a and the dynamic libz.so files, CMake uses FIND_PACKAGE() to locate the package in your system automatically.

if this is not it then I'm stumped  :-\


Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: 3dickulus on September 14, 2015, 08:10:45 PM
in a shell type...
Code:
locate libz.so
you should see something like...
Code:
/lib/libz.so.1
/lib/libz.so.1.2.8
/lib64/libz.so.1
/lib64/libz.so.1.2.8
/usr/lib/debug/lib64/libz.so.1.2.8.debug
/usr/lib64/libz.so

CMakeLists.txt has libz linked on line 127
Code:
target_link_libraries ( Fragmentarium-1.0.11 GL z pthread ${OpenEXR_LIBRARIES})
Fragmentarium.pro has libz linked on line 98
Code:
else:unix:CONFIG(release, debug|release): LIBS += -lz -lpthread

not sure about Ubuntu, if FIND_PACKAGE fails you may have to adjust the CMake line in mklinux.sh for OpenEXR-2.1.0 to look like the windows version but with your paths...
Code:
-DZLIB_ROOT=<zlib install path> -DZLIB_INCLUDE_DIR=<zlib install path>/include -DZLIB_LIBRARY=<zlib library path>/<zlib library>

edit:OpenEXR-2.1.0/CMakeLists.txt uses FIND_PACKAGE(ZLIB REQUIRED) and should fail at configure, not at link time, if the zlib pkg is not found.
If zlib is installed but not being found as a last resort I suggest editing line 130 in OpenEXR-2.1.0/IlmImf/CMakeLists.txt from this...
Code:
  ${PTHREAD_LIB} ${ZLIB_LIBRARIES}
to this...
Code:
  ${PTHREAD_LIB} z

tip: http://askubuntu.com/questions/219692/why-the-value-of-path-is-different-for-root-and-normal-user



Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: Adam Majewski on September 14, 2015, 09:26:23 PM
locate libz.so
/lib/x86_64-linux-gnu/libz.so.1
/lib/x86_64-linux-gnu/libz.so.1.2.8
/usr/lib/x86_64-linux-gnu/libz.so


Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: Adam Majewski on September 14, 2015, 09:34:35 PM
./mklinux.sh


[ 94%] Building CXX object CMakeFiles/Fragmentarium-1.0.11.dir/qrc_Fragmentarium.cpp.o
[ 97%] Building CXX object CMakeFiles/Fragmentarium-1.0.11.dir/Fragmentarium/GUI/moc_PreferencesDialog.cpp.o
[100%] Building CXX object CMakeFiles/Fragmentarium-1.0.11.dir/Fragmentarium-1.0.11_automoc.cpp.o
Linking CXX executable Fragmentarium-1.0.11
/usr/bin/ld: /home/a/Pobrane/Fragmentarium-1.0.11-3Dickulus/Fragmentarium-Source/../OpenEXR/lib/libIlmThread-2_1.a(IlmThreadSemaphorePosix.cpp.o): undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [Fragmentarium-1.0.11] Błąd 1
make[1]: *** [CMakeFiles/Fragmentarium-1.0.11.dir/all] Błąd 2
make: *** [all] Błąd 2


 :-\


Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: Adam Majewski on September 14, 2015, 09:56:08 PM
instalation of standard version

git clone https://github.com/Syntopia/Fragmentarium
 works well


Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: 3dickulus on September 14, 2015, 11:19:46 PM
well, pthread and z libraries are the only requirements since adding OpenEXR and they are standard on linux, you have them but it seems like a path is wrong somewhere. If you don't need OpenEXR I/O then I can post a version of the source without this dependency.


Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: quaz0r on September 15, 2015, 12:27:04 AM
http://stackoverflow.com/questions/19901934/strange-linking-error-dso-missing-from-command-line


Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: 3dickulus on September 15, 2015, 06:21:25 AM
ty quazor,  :beer: cmake uses target_link_libraries ( Fragmentarium-1.0.11 GL z pthread ${OpenEXR_LIBRARIES})
according to that link it should be target_link_libraries ( Fragmentarium-1.0.11 GL ${OpenEXR_LIBRARIES} z pthread) ???

because OpenEXR libs use z+pthread, odd that we both are using cmake 3 but I don't get any error no matter the order of libs in target_link_libraries() call, I will make the adjustment asap if this is the problem.

is it an Ubuntu only thing?


Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: Adam Majewski on September 19, 2015, 02:49:47 PM
Hi,

After :
"in file Fragmentarium/GUI/DisplayWidget.h

line 4
#define NVIDIAGL4PLUS
comment this line out
// #define NVIDIAGL4PLUS
"

It works fine

Thx


Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: Adam Majewski on September 19, 2015, 02:57:08 PM
I have the same computer but upgraded ubuntu from 12.04.4 LTS to 14.04 LTS

Now when I try to use the code :

https://en.wikibooks.org/wiki/Fractals/fragmentarium#Components

which was working earlier ( I have made it befoer upgrading Ubuntu )

now gives errors :

Could not create fragment shader: 0:98(2): error: illegal use of reserved word `switch'
0:98(2): error: syntax error, unexpected ERROR_TOK

It gives errors in both 1.0.0 and 1.01 versions

If I change switch to if then :

Could not create fragment shader: 0:122(32): error: operator '%' is reserved in GLSL 1.10 (GLSL 1.30 or GLSL ES 3.00 required)
0:122(32): error: RHS of `&&' must be scalar boolean
0:127(27): error: could not implicitly convert operands to arithmetic operator
0:127(27): error: operands to arithmetic operators must be numeric
0:127(6): error: cannot construct `vec2' from a non-numeric data type
0:127(6): error: operands to arithmetic operators must be numeric

???





Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: 3dickulus on September 19, 2015, 08:06:40 PM
as the first line of your shader in the editor window (must be at the very top before any comments) use the version statement...
Code:
#version 130


Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: Adam Majewski on September 19, 2015, 09:10:37 PM
Ok, but then :
Could not create fragment shader: 0:130(32): error: RHS of `&&' must be scalar boolean


Title: Re: error : undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5
Post by: 3dickulus on September 19, 2015, 09:46:30 PM
look for the boolean test that uses "&&"
check the values being compared at line 130 ?

can't offer much more than that without seeing it, if can you attach the frag file you are using I might be able to offer a  fix :)

for the sake of the topic, I have adjusted the CMakeLists.txt as quaz0r pointed out, and removed the dependence (MinGW version) on zlib.dll for the windows executables (v1.0.12 available on my website) (http://www.digilanti.org/fragmentarium) this patch also brings the ability to populate the EXR alpha channel with data from the DE as described here http://www.fractalforums.com/index.php?topic=21759.msg87183#msg87183 it doesn't have to be depth value, it can be any single float value.