#257 Need to link with -ldl

closed-fixed
nobody
None
5
2010-02-20
2010-02-15
No

gdl-basic_pro_jmg.cpp calls dlopen, so gdl needs to be linked directly against -ldl on linux. Currently fails to build on Fedora development branch which now enforces this behavior:

/bin/sh ../libtool --tag=CXX --mode=link g++ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -lMagick++ -lMagickCore -rdynamic -z muldefs -o gdl gdl-assocdata.o gdl-basic_fun_cl.o gdl-basic_fun.o gdl-basic_fun_jmg.o gdl-basic_op.o gdl-basic_pro.o gdl-basic_pro_jmg.o gdl-CFMTLexer.o gdl-color.o gdl-convert2.o gdl-datatypes.o gdl-dcommon.o gdl-dcompiler.o gdl-default_io.o gdl-dinterpreter.o gdl-dnode.o gdl-dpro.o gdl-dstructdesc.o gdl-dstructgdl.o gdl-dvar.o gdl-envt.o gdl-extrat.o gdl-FMTIn.o gdl-FMTLexer.o gdl-fmtnode.o gdl-FMTOut.o gdl-FMTParser.o gdl-gdleventhandler.o gdl-gdlexception.o gdl-gdlgstream.o gdl-GDLInterpreter.o gdl-GDLInterpreterOptimized.o gdl-GDLLexer.o gdl-GDLParser.o gdl-gdlpsstream.o gdl-gdlsvgstream.o gdl-gdlpython.o gdl-GDLTreeParser.o gdl-gdlwinstream.o gdl-gdlxstream.o gdl-getfmtast.o gdl-graphics.o gdl-gsl_fun.o gdl-ifmt.o gdl-initct.o gdl-initsysvar.o gdl-io.o gdl-libinit_cl.o gdl-libinit.o gdl-libinit_jmg.o gdl-math_fun.o gdl-math_fun_jmg.o gdl-math_utl.o gdl-ncdf_att_cl.o gdl-ncdf_cl.o gdl-ncdf_dim_cl.o gdl-ncdf_var_cl.o gdl-new.o gdl-objects.o gdl-ofmt.o gdl-math_fun_ac.o gdl-libinit_ac.o gdl-math_fun_gm.o gdl-libinit_gm.o gdl-math_fun_ng.o gdl-libinit_ng.o gdl-plotting.o gdl-print.o gdl-print_tree.o gdl-read.o gdl-str.o gdl-terminfo.o gdl-topython.o gdl-typetraits.o gdl-hdf_fun.o gdl-hdf_pro.o gdl-magick_cl.o gdl-gdlwidget.o gdl-widget.o gdl-basegdl.o gdl-hdf5_fun.o gdl-libinit_mes.o gdl-file.o gdl-image.o gdl-gdljournal.o gdl-convol.o gdl-convol_inc0.o gdl-convol_inc1.o gdl-convol_inc2.o gdl-sigfpehandler.o gdl-gdlzstream.o gdl-arrayindex.o gdl-fftw.o gdl-mpi.o gdl-plot3d_nr.o gdl-prognode.o gdl-prognodeexpr.o gdl-gdl.o -lantlr -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 -lgslcblas -lgsl -lncurses -L/usr/lib/hdf -lreadline -lz -lgsl -lgslcblas -lplplotd -lplplotcxxd -lMagick++ -lMagickCore -lnetcdf -lhdf5_hl -lhdf5 -lz -lm -lcurl -L/usr/lib/hdf -lmfhdf -ldf -ljpeg -lz -L/usr/lib/hdf -L/usr/lib/hdf5 -lhdf5 -lfftw3 -lfftw3f -lpython2.6
libtool: link: g++ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -rdynamic -z muldefs -o gdl gdl-assocdata.o gdl-basic_fun_cl.o gdl-basic_fun.o gdl-basic_fun_jmg.o gdl-basic_op.o gdl-basic_pro.o gdl-basic_pro_jmg.o gdl-CFMTLexer.o gdl-color.o gdl-convert2.o gdl-datatypes.o gdl-dcommon.o gdl-dcompiler.o gdl-default_io.o gdl-dinterpreter.o gdl-dnode.o gdl-dpro.o gdl-dstructdesc.o gdl-dstructgdl.o gdl-dvar.o gdl-envt.o gdl-extrat.o gdl-FMTIn.o gdl-FMTLexer.o gdl-fmtnode.o gdl-FMTOut.o gdl-FMTParser.o gdl-gdleventhandler.o gdl-gdlexception.o gdl-gdlgstream.o gdl-GDLInterpreter.o gdl-GDLInterpreterOptimized.o gdl-GDLLexer.o gdl-GDLParser.o gdl-gdlpsstream.o gdl-gdlsvgstream.o gdl-gdlpython.o gdl-GDLTreeParser.o gdl-gdlwinstream.o gdl-gdlxstream.o gdl-getfmtast.o gdl-graphics.o gdl-gsl_fun.o gdl-ifmt.o gdl-initct.o gdl-initsysvar.o gdl-io.o gdl-libinit_cl.o gdl-libinit.o gdl-libinit_jmg.o gdl-math_fun.o gdl-math_fun_jmg.o gdl-math_utl.o gdl-ncdf_att_cl.o gdl-ncdf_cl.o gdl-ncdf_dim_cl.o gdl-ncdf_var_cl.o gdl-new.o gdl-objects.o gdl-ofmt.o gdl-math_fun_ac.o gdl-libinit_ac.o gdl-math_fun_gm.o gdl-libinit_gm.o gdl-math_fun_ng.o gdl-libinit_ng.o gdl-plotting.o gdl-print.o gdl-print_tree.o gdl-read.o gdl-str.o gdl-terminfo.o gdl-topython.o gdl-typetraits.o gdl-hdf_fun.o gdl-hdf_pro.o gdl-magick_cl.o gdl-gdlwidget.o gdl-widget.o gdl-basegdl.o gdl-hdf5_fun.o gdl-libinit_mes.o gdl-file.o gdl-image.o gdl-gdljournal.o gdl-convol.o gdl-convol_inc0.o gdl-convol_inc1.o gdl-convol_inc2.o gdl-sigfpehandler.o gdl-gdlzstream.o gdl-arrayindex.o gdl-fftw.o gdl-mpi.o gdl-plot3d_nr.o gdl-prognode.o gdl-prognodeexpr.o gdl-gdl.o -lantlr -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 -lncurses -L/usr/lib/hdf -lreadline -lgsl -lgslcblas -lplplotd -lplplotcxxd -lMagick++ -lMagickCore -lnetcdf -lhdf5_hl -lm -lcurl /usr/lib/hdf/libmfhdf.a /usr/lib/hdf/libdf.a -ljpeg -lz -L/usr/lib/hdf5 -lhdf5 -lfftw3 -lfftw3f -lpython2.6
/usr/bin/ld: gdl-basic_pro_jmg.o: undefined reference to symbol 'dlopen@@GLIBC_2.1'
/usr/bin/ld: note: 'dlopen@@GLIBC_2.1' is defined in DSO /lib/libdl.so.2 so try adding it to the linker command line
/lib/libdl.so.2: could not read symbols: Invalid operation
collect2: ld returned 1 exit status

Perhaps something like:

AC_SEARCH_LIBS([dlopen], [dl])
if test x"$ac_cv_search_dlopen" = x-ldl; then
LIBS="$LIBS -ldl"
fi

Full build log is attached to the following bug report: https://bugzilla.redhat.com/show_bug.cgi?id=565070

Discussion

  • Marc Schellens

    Marc Schellens - 2010-02-20

    I included your suggestion into configure.in
    Thanks

     
  • Marc Schellens

    Marc Schellens - 2010-02-20
    • status: open --> closed-fixed
     

Log in to post a comment.