Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#2497 closed defect (fixed)

check whether libm defines sincos() at configure time

Reported by: msieczka Owned by: Mateusz Łoskot
Priority: normal Milestone: 1.5.3
Component: ConfigBuild Version: svn-trunk
Severity: critical Keywords: unix libm math sincos
Cc: Mateusz Łoskot, Even Rouault

Description

On GRASS and QGIS MLs it was noticed that GDAL should "be a bit more careful about defining sincos, i.e. have configure actually check whether libm defines sincos()". See [1], [2] for the whole story, [3] for resume.

In the discussion on GDAL ML [4] Andrew Brooks adds:

"And don't forget that on Solaris sincos() is defined in libsunmath. On old versions of Solaris it used to be wise to use -Bstatic -lsunmath -Bdynamic in case libsunmath was not installed by default." [1]http://www.nabble.com/forum/ViewPost.jtp?post=18555960&framed=y [2]http://www.nabble.com/forum/ViewPost.jtp?post=18581292&framed=y [3]http://www.nabble.com/forum/ViewPost.jtp?post=18579971&framed=y [4]http://www.nabble.com/forum/ViewPost.jtp?post=18583950&framed=y

Change History (10)

comment:1 by Mateusz Łoskot, 16 years ago

Cc: Mateusz Łoskot added
Keywords: unix libm math sincos added

comment:2 by warmerdam, 16 years ago

Cc: Even Rouault added
Priority: highnormal

See also #2494 related to the sincos() issue.

Even, perhaps you can advise on what ought to be done? Feel free to assign the ticket to mloskot if there is work to do and you don't want to do it yourself.

comment:3 by Mateusz Łoskot, 16 years ago

I'd draw something like this:

  1. Detect sincos from ./configure script
  1. Set preprocessor macro if native sincos implementation available, ie. HAVE_SINCOS
  1. Wrap private implementations of sincos with #ifdef HAVE_SINCOS
  1. Detect target platform and
  • on Unix - add libm

  • on Solaris - add libsunmath to linker flags

comment:4 by warmerdam, 16 years ago

My understanding is that Even removed use of sincos() from our copy of the hdfeos code. So it isn't clear to me that we need any of this detection stuff. Perhaps I'm misunderstanding?

comment:5 by Mateusz Łoskot, 16 years ago

I understand it, but I still see the second part of the issue: distinguish platforms (Unix and Solaris, at least) to be able to set proper linker flags.

comment:6 by Mateusz Łoskot, 16 years ago

Owner: changed from warmerdam to Mateusz Łoskot
Status: newassigned

Folks,

As we have clarified and confirmed with Frank that GDAL does not use sincos function. So, we have came to the following conclusion:

  • Even's patch removing private implementation of sincos is sufficient to fix the problem

  • We do not need to distinguish Linux and Solaris in order to add specific math library to linker flags

Shortly, fix for #2494 is supposed to fix this problem as well.

Maciej,

Please, could you confirm the problem has been fixed in GDAL SVN?

in reply to:  6 comment:7 by msieczka, 16 years ago

Replying to mloskot:

Maciej,

Please, could you confirm the problem has been fixed in GDAL SVN?

Hi Mateusz!

As to GRASS all is fine now when built against GDAL 1.5.2 + SVN r14997, even when both GRASS and GDAL are built with "-g -O2".

comment:8 by Mateusz Łoskot, 16 years ago

Resolution: fixed
Status: assignedclosed

Maciej,

Good to hear. So, I think I can close the ticket.

comment:9 by msieczka, 15 years ago

Paolo,

What GDAL version do you use? If you use GDAL 1.5.2 + SVN r14997 or greater is the problem gone? I suggest to close the ticket then.

in reply to:  9 comment:10 by msieczka, 15 years ago

Replying to msieczka:

Paolo,

What GDAL version do you use? If you use GDAL 1.5.2 + SVN r14997 or greater is the problem gone? I suggest to close the ticket then.

Sorry for this entry. It was supposed to go to http://trac.osgeo.org/grass/ticket/361 where this GDAL issue has re-appeared.

Note: See TracTickets for help on using tickets.