Make fails with GLIBC errors, even if SDL and libpng are installed correctly.

#4 · closed · 7 comments

View on GitHub ↗

spearsem

I'm using Ubuntu 13 -- just installed SDL2 2.0.3 and libpng with no problems. When I run `make` I get the following output: ``` ely@eschaton:~/programming/shapeme$ make cc -O3 shapeme.c `libpng-config --cflags` `libpng-config --L_opts` `libpng-config --libs` `sdl-config --cflags` `sdl-config --libs` -lm -o shapeme -Wall -W /usr/lib/x86_64-linux-gnu/libvorbis.so.0: undefined reference to `__acosf_finite@GLIBC_2.15' /usr/lib/x86_64-linux-gnu/libvorbis.so.0: undefined reference to `__log_finite@GLIBC_2.15' /usr/lib/x86_64-linux-gnu/libpulse.so.0: undefined reference to `__pow_finite@GLIBC_2.15' /usr/lib/x86_64-linux-gnu/libvorbis.so.0: undefined reference to `__exp_finite@GLIBC_2.15' /usr/lib/x86_64-linux-gnu/libpulse.so.0: undefined reference to `__log10_finite@GLIBC_2.15' collect2: error: ld returned 1 exit status make: *** [shapeme] Error 1 ``` Additionally, I've tried using `locate` and `ldd` to investigate some relevant files. Here's that output: ``` ely@eschaton:~$ locate libm.so /lib/i386-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/libm.so.6 /lib32/libm.so.6 /usr/lib/libopenlibm.so.0 /usr/lib/x86_64-linux-gnu/libm.so /usr/lib/x86_64-linux-gnu/julia/libopenlibm.so /usr/lib/x86_64-linux-gnu/julia/libopenlibm.so.0 /usr/lib/x86_64-linux-gnu/julia/libopenlibm.so.0.3 /usr/lib/x86_64-linux-gnu/julia/libopenlibm.so.0.3.0 /usr/share/systemimager/boot/x86_64/standard/initrd_template/lib/libm.so.6 ``` ``` ely@eschaton:~$ ldd /usr/lib/x86_64-linux-gnu/libvorbis.so.0 linux-vdso.so.1 => (0x00007fff1bdff000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6049cf3000) libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007f6049aec000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f604972b000) /lib64/ld-linux-x86-64.so.2 (0x00007f604a242000) ``` ``` ely@eschaton:~$ ldd /usr/lib/x86_64-linux-gnu/libm.so linux-vdso.so.1 => (0x00007fff0bbff000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff020b7b000) /lib64/ld-linux-x86-64.so.2 (0x00007ff02125d000) ``` Any ideas?

Comments

spearsem

I was able to solve this problem. I used [this resource](http://ubuntuforums.org/showthread.php?t=2138623) for installing libpng15 (shapeme is very unforgiving in its use of libpng, and _must_ have version 15 exactly). I also used [this resource](http://stackoverflow.com/questions/9934549/very-strange-linker-behavior) to deal with the GLIBC errors. To summarize: You can remove the "-lm" flag from the compiler call inside the Makefile. Other libraries will correctly pull in libm, but there is something wrong about the ordering of the requirements on the command line. I'm not exactly sure what, but removing "-lm" worked for me. I just copied the compiler instruction from Makefile, replaced `$(CC)` with `gcc` and removed `-lm`. You need to install precisely version 15 of libpng (I made the mistake of installing version 16, and trying to fool shapeme by making a link called libpng15.so.15 to point to version 16 -- but it actually checks version names and this won't work). To do this you can: 1. Download version 15 of libpng: < http://sourceforge.net/projects/libpng/files/libpng15/ >. Note that you _don't_ want the newest version link at the top. You need to click the 1.5.20 link and choose one of the tar files. 2. Extract to some folder, navigate there, and then run 3. `./configure --prefix=/usr/local/libpng` 4. `make check` 5. `sudo make install` 6. `make check` 7. run `locate libpng > ~/libpng_dump.txt` and then open that text file and search for the line with `libpng15.so.15`. Copy that location -- let's call the location "X" for now. (For me, "X" was `/usr/local/libpng/lib/libpng15.so.15`). 8. Make a sym link that shapeme will find: `ln -s "X" /usr/lib/libpng15.so.15` Do all of the libpng steps, then recompile shapeme with the `-lm` change described above.

antirez

Hello @spearsem, would be cool to fix with different versions of libpng, I'll try to do this. Do you have an easy way to report the compilation error you got with a different version? Thanks.

antirez

Btw... what is strange is that in the error that you reported in the first message, looks like the symbols not found are exactly the once of the mathlib, even if -lm is given in the default Makefile.

spearsem

Here is the output that I got after installing libpng16 and making a false link to /usr/lib/libpng15.so.15 to point to libpng16.so.16: ``` ely@eschaton:~/programming/shapeme$ gcc -O3 shapeme.c `libpng-config --cflags` `libpng-config --L_opts` `libpng-config --libs` `sdl-config --cflags` `sdl-config --libs` -o shapeme -Wall -W ely@eschaton:~/programming/shapeme$ ely@eschaton:~/programming/shapeme$ ely@eschaton:~/programming/shapeme$ ./shapeme ./shapeme: /usr/lib/libpng15.so.15: version `PNG15_0' not found (required by ./shapeme) ```

antirez

Oops... thanks. I'll try to understand how to relax this.

spearsem

I'm also poking around the algorithm too. I changed the linear cooling to geometric cooling -- and I am considering adding some functions to enable reheating-as-a-function-of-cost. Another thing that would be quite cool (but very involved) is to let the user pause the annealing at the whole-image level, select a sub-region of the image, and then "start" annealing solely within that sub-region. Once they stop the sub-region annealing, it resumes from that new point with the whole-image annealing.

antirez

Sounds cool! Let me know when you have something you want to integrate. Another random idea: to change the fitness function in order to give a different weight to different parts of the image, for example near the eyes/nose is more important for faces compared to the rest to give a realistic result, and it is how an actual painter would do most of the time, stressing the parts of the image that are cognitively more important for humans.