mc-cnn icon indicating copy to clipboard operation
mc-cnn copied to clipboard

Error when loading module

Open YaoChou opened this issue 8 years ago • 13 comments

Hi Jure,

Thanks so much for sharing this code. I am trying to running the code following your instruction. However I got a error when I ran the command

./main.lua kitti fast -a predict -net_fname net/net_kitti_fast_-a_train_all.t7 -left samples/input/kittiL.png -right samples/input/kittiR.png -disp_max 70

The error is

luajit: error loading module 'libadcensus' from file './libadcensus.so': ./libadcensus.so: undefined symbol: png_set_longjmp_fn stack traceback: [C]: at 0x0047aff0 [C]: in function 'require' ./main.lua:327: in main chunk [C]: at 0x00406670

Do you have any suggestions about it? Thanks!

Yao

YaoChou avatar Jun 27 '16 03:06 YaoChou

Hi Yao,

I haven't seen this before. Looks like a problem with the png++ library. Which version of png++ library are you using?

jzbontar avatar Jun 28 '16 00:06 jzbontar

Probably yes, I had a trouble when I installed png++, couple test can not pass, but I think I install it right now. I use the latest version, png++-0.2.9. Thanks!

YaoChou avatar Jun 28 '16 21:06 YaoChou

Can you please paste the output of the following command:

$ ldd libadcensus.so

jzbontar avatar Jun 28 '16 23:06 jzbontar

Here they are. linux-vdso.so.1 => (0x00007fffd0d35000) libluaT.so => /home/ecestudent/torch/install/lib/libluaT.so (0x00007f87a4d88000) libTHC.so => /home/ecestudent/torch/install/lib/libTHC.so (0x00007f87a2ae2000) libTH.so => /home/ecestudent/torch/install/lib/libTH.so (0x00007f87a2669000) libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f87a2443000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f87a223b000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f87a201d000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f87a1e19000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f87a1b15000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f87a180f000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f87a15f9000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f87a1234000) libcudart.so.7.5 => /usr/local/cuda/lib64/libcudart.so.7.5 (0x00007f87a0fd6000) libcublas.so.7.5 => /usr/local/cuda/lib64/libcublas.so.7.5 (0x00007f879f6f7000) libmkl_gf_lp64.so => /opt/intel/mkl/lib/intel64/libmkl_gf_lp64.so (0x00007f879ed93000) libmkl_gnu_thread.so => /opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so (0x00007f879de1f000) libmkl_core.so => /opt/intel/mkl/lib/intel64/libmkl_core.so (0x00007f879c498000) libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f879c289000) /lib64/ld-linux-x86-64.so.2 (0x00007f87a5231000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f879c070000)

YaoChou avatar Jun 29 '16 18:06 YaoChou

On my machine it's linking against libpng16.

libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007fc45b0e8000)

Could you try updating libpng?

jzbontar avatar Jul 01 '16 18:07 jzbontar

Sorry just saw your reply.

I update the libpng to the newest version in my computer, but still the version of 12. So still get the same above error when loading module.

why your version is libpng16, which png++ package version are you using?

Thanks!

YaoChou avatar Jul 08 '16 18:07 YaoChou

I'm using png++ 0.2.9 and libpng 1.6.21. The png++ is a C++ wrapper around libpng, so it might matter which libpng library you have installed.

jzbontar avatar Jul 08 '16 18:07 jzbontar

I use the same version png++ with yours. but the libpng is 1.2.50, however, the computer shows it's already the newest version, I will re install it, see if I can get the version 1.6.21. Thanks!

YaoChou avatar Jul 08 '16 20:07 YaoChou

Hi @YaoChou I got the same error as you. Did you figure out how to fix it? I updated the libpng the error is still there. Thank you for the help.

xiao1228 avatar Aug 02 '16 09:08 xiao1228

The png++ library seems to be responsible for the majority of complaints I receive. I'm planning to rewrite the code so that png++ is not used anymore. Stay tuned!

jzbontar avatar Aug 04 '16 17:08 jzbontar

Reference:

In my case, I have the old png 1.2 came with my ubuntu installed in /usr. I installed the 1.6.x in /usr/local. In my make system, the default include /usr/include and linking /usr/lib were picked up. When compiling any software that rely on the new interface, you need to add

CPPFLAGS="-I/usr/local/include $CPPFLAGS" LDFLAGS="-L/usr/local/lib $LDFLAGS"

this will pick up

grep png_set_longjmp_fn png.h PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structrp png_ptr, (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf))))

Then libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f8ac214e000) change to libpng16.so.16 => /usr/local/lib/libpng16.so.16 (0x00007fc9c273f000)

adong7639 avatar Sep 08 '17 07:09 adong7639

Hi Adong,

I am getting the same error, although I installed libpng-1.6.21, I am not sure why I still get "libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007fa102c9f000)" when I run $ ldd libadcensus.so. Could you please tell where do I write the below?

CPPFLAGS="-I/usr/local/include $CPPFLAGS" LDFLAGS="-L/usr/local/lib $LDFLAGS"

PLease suggest how can I correct the error: "luajit: error loading module 'libadcensus' from file './libadcensus.so': ./libadcensus.so: undefined symbol: png_set_longjmp_fn"

ranjeethks avatar Jan 12 '18 11:01 ranjeethks

I solved this issue by updating my libpng12 to libpng16 by executing following commands

sudo apt-get update sudo apt-get install libpng16-dev

after this, libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 changed to.. libpng16.so.16 => /usr/local/lib/libpng16.so.16

ranjeethks avatar Jan 12 '18 23:01 ranjeethks