[GRASS5] [bug #2373] (grass) undefined reference in libgrass_driver.so

Glynn Clements glynn.clements at virgin.net
Fri Apr 2 14:41:01 EST 2004


Request Tracker wrote:

> this bug's URL: http://intevation.de/rt/webrt?serial_num=2373

> Subject: undefined reference in libgrass_driver.so
> 
> Platform: Solaris2.X/Sparc
> grass obtained from: Trento Italy site
> grass binary for platform: Compiled from Sources
> GRASS Version: 5.7_exp_2004_03_20
> 
> I'm trying to compile grass 5.7 from a CVS snapshot (3/20/04), and
> the current problem (the one I hit the wall on :p) is that make
> craps out with:
> 
> gcc  -L/export/home/gwurman/Codes/grass57_exp_2004_03_20/dist.sparc-sun-solaris2.8/lib   -o /export/home/gwurman/Codes/grass57_exp_2004_03_20/dist.sparc-sun-solaris2.8/driver/XDRIVER  -L/export/home/gwurman/Codes/grass57_exp_2004_03_20/dist.sparc-sun-solaris2.8/lib OBJ.sparc-sun-solaris2.8/Box_abs.o OBJ.sparc-sun-solaris2.8/Can_do.o OBJ.sparc-sun-solaris2.8/Client.o OBJ.sparc-sun-solaris2.8/Clr_table.o OBJ.sparc-sun-solaris2.8/Color.o OBJ.sparc-sun-solaris2.8/Draw_line.o OBJ.sparc-sun-solaris2.8/Get_w_box.o OBJ.sparc-sun-solaris2.8/Get_w_line.o OBJ.sparc-sun-solaris2.8/Get_w_pnt.o OBJ.sparc-sun-solaris2.8/Graph_Clse.o OBJ.sparc-sun-solaris2.8/Graph_Set.o OBJ.sparc-sun-solaris2.8/Panel.o OBJ.sparc-sun-solaris2.8/Plylne_abs.o OBJ.sparc-sun-solaris2.8/Polygn_abs.o OBJ.sparc-sun-solaris2.8/Raster.o OBJ.sparc-sun-solaris2.8/Raster_RGB.o OBJ.sparc-sun-solaris2.8/Respond.o OBJ.sparc-sun-solaris2.8/Serve_Xevent.o OBJ.sparc-sun-solaris2.8/Work.o OBJ.sparc-sun-solaris2.8/alloc.o -lgrass_driver -lgrass_D -lgrass_display -lgrass_raster -lgrass_gis -lgrass_datetime -lnsl    -lz  -lsocket  -L/usr/openwin/lib -R/usr/openwin/lib -lSM -lICE -lX11 -lsocket  -lnsl -lm  -lnsl    -lz 
> /export/home/gwurman/Codes/grass57_exp_2004_03_20/dist.sparc-sun-solaris2.8/lib/libgrass_driver.so: undefined reference to `nanosleep'
> collect2: ld returned 1 exit status
> make[4]: *** [/export/home/gwurman/Codes/grass57_exp_2004_03_20/dist.sparc-sun-solaris2.8/driver/XDRIVER] Error 1
> make[4]: Leaving directory `/export/home/gwurman/Codes/grass57_exp_2004_03_20/display/drivers/XDRIVER/XDRIVER24'
> 
> I can't figure out where the nanosleep reference comes from or why
> it's broken. Any help is appreciated.

The use of nanosleep() is part of the (badly broken) attempt to extend
the behaviour of the R_get_location_with_* functions. The calls can be
found in the three GET_LOCATION_WITH_* cases in process_command(), in
display/drivers/lib/command.c.

Apart from the fact that using polling (instead of e.g. select()) is a
bad idea in itself, there's also the fact that nanosleep() isn't
portable. Unfortunately, the other common alternative, i.e. usleep(),
isn't portable either, and the only portable "sleep" function is
sleep(), which sleeps for a whole number of seconds (which is probably
too coarse).

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list