[ncl-install] Fedora link issue

Mary Haley haley at ucar.edu
Wed Feb 17 09:39:21 MST 2010


Hi Orion,

Thanks for the heads up on this.

There may be some other places where "-lm" is needed.

Rather than adding it to individual yMakefile's, you can try adding  
it to your $NCARG/config/LINUX file. I usually add it to the  
CtoFLibraries line:

#define CtoFLibraries    -lgfortran -lm

You will need to run "make Everything" in order to regenerate all the  
Makefiles, or "make All" (this doesn't do a "make clean" first,  
whereas "make Everything" does).


--Mary


On Feb 17, 2010, at 8:39 AM, Orion Poplawski wrote:

> The next version of Fedora enforces strict linking requirements.  This
> has revealed that ictrans needs to get linked with -lm:
>
> gcc -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 -fPIC     -o ictrans  
> main.o
> ../../../.././ncarview/src/lib/libictrans/libictrans.o
> ../../../.././ncarview/src/lib/libctrans/libctrans.o
> -L../../../.././ncarview/src/lib/libcgm -lcgm
> -L../../../.././ncarview/src/lib/libncarg_ras -lncarg_ras 		
> -L../../../.././common/src/libncarg_c -lncarg_c -L/usr/lib/ncarg
> -L/usr/lib/hdf -lX11 -lXext   -lmfhdf -ldf -ljpeg -lz -lgfortran
> ../../../.././ncarview/src/lib/libcgm/libcgm.a(meta_edit.o): In  
> function
> `CGM_initMetaEdit':
> /builddir/build/BUILD/ncl_ncarg-5.1.1/ncarview/src/lib/libcgm/ 
> meta_edit.c:1043:
> warning: the use of `mktemp' is dangerous, better use `mkstemp'
> /usr/bin/ld: ../../../.././ncarview/src/lib/libctrans/libctrans.o:
> undefined reference to symbol 'sqrt@@GLIBC_2.0'
> /usr/bin/ld: note: 'sqrt@@GLIBC_2.0' is defined in DSO /lib/libm.so. 
> 6 so
> try adding it to the linker command line
> /lib/libm.so.6: could not read symbols: Invalid operation
>
> I've used the following patch, but I'm sure there is a better way:
>
> --- ncl_ncarg-5.1.1/ncarview/src/bin/ictrans/yMakefile.libs
> 1998-02-04 08:58:14.000000000 -0700
> +++ ncl_ncarg-5.1.1/ncarview/src/bin/ictrans/yMakefile  2010-02-16
> 17:01:18.942677616 -0700
> @@ -29,6 +29,8 @@
>
>   #ifdef  IRIX
>   MORE_LIBS      = -lmalloc
> +#else
> +MORE_LIBS      = -lm
>   #endif
>
>   EXTRA_LIBS     = $(X11LIBS) $(SUNLIBS) $(NETCDFLIB) $(HDFLIB) $ 
> (CTOFLIBS)
>
> -- 
> Orion Poplawski
> Technical Manager                     303-415-9701 x222
> NWRA/CoRA Division                    FAX: 303-415-9702
> 3380 Mitchell Lane                  orion at cora.nwra.com
> Boulder, CO 80301              http://www.cora.nwra.com
> _______________________________________________
> ncl-install mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-install



More information about the ncl-install mailing list