[IPOL discuss] Unable to build IPOL demo due to libraries' link order problem in some source codes

Miguel Colom colom at cmla.ens-cachan.fr
Fri Sep 12 21:38:19 CEST 2014


Quoting Jacques Froment <Jacques.Froment at univ-ubs.fr>:
> Dear all,
>
> I hope I won't be too boring with that first, long and technical post.

Dear Jacques,
your detailed message is really helpful for us, because you've come up  
with a issue that is important to solve as soon as possible.

> The offending line is
>  g++ -lpng -lm -fopenmp -L/opt/local/lib/ -L/usr/local/lib/ -fopenmp  
> -lpng -o img_diff_ipol img_diff_ipol.o io_png.o libauxiliar.o  
> libdenoising.o mt19937ar.o
> In io_png, all png_* functions appear as undefined.
> Note that two "-lpng" appear in that line.
> If I remove them and put "-lpng" at the very end of the line, that is
>  g++ -lm -fopenmp -L/opt/local/lib/ -L/usr/local/lib/ -fopenmp -o  
> img_diff_ipol img_diff_ipol.o io_png.o libauxiliar.o libdenoising.o  
> mt19937ar.o -lpng
> then the link is done without error.

Indeed, until some version of the gcc compiler the right order of the  
parameters was not taken into account and flawed arguments compiled  
without any error or warning. Later, the bad ordering of the  
parameters became an error. This is the good behavior of the compiler.

Therefore, it is important that the authors of NL-means submit a  
revised version of the source code where this problem is solved.  
NL-means is one of the most downloaded source codes, so it should work  
perfectly. Even in IPOL the demo may stop working if the compiler is  
updated and the source code rebuild.

> Performing the linking "manually" in src/nlmeansC and then running
>  ./demo.py build
> does not solve the problem either.

The local server checks if the file in dl/... is updated. If not, it  
downloads it, decompresses it in src/ and compiles it.
It should have worked, but don't lose your time with that. Just put  
the binaries in the "bin/" directory, if the other demos compile  
correctly.
Once you have copied manually the binaries into "bin/", the demo should work.

> In summary,
> - I don't know how to build the demo on my computers without error  
> during linking of some IPOL codes;

Any others apart of NL-means?

> - I suspect libraries' link order mistake on some published IPOL  
> codes that may affect other users,

Indeed. We need to fix that and warn the authors. Or fix it ourselves  
(IPOL staff).

I'm forwarding this message to the NL-means authors (BCC), so they can  
fix the code.
And thank you very much for communicating this bug.

Best,
Miguel




More information about the discuss mailing list