This project is archived and is in readonly mode.
Provide missing round function for solaris 8 & 9
Reported by Floris Bruynooghe | February 7th, 2012 @ 06:07 PM
The config.h file contains a round() function to use when the platform is missing it. However the conditions assume solaris has round. On our servers we found only Solaris 10 provided the symbols while they where missing on 8 and 9. The attached patch is what we currently use to fix this.
Comments and changes to this ticket
-
Floris Bruynooghe February 7th, 2012 @ 06:32 PM
The previously attached patch was for 2.4.2, sorry about that. This one is updated for 2.4.4.
-
Daniele Varrazzo February 8th, 2012 @ 12:28 PM
- State changed from new to open
Hello Floris, thank you for the patch, it's very welcome.
I've found in http://wiki.opencsw.org/porting-faq that there should be constants to detect the SunOS version: I've found mentioned:
#if defined(__SunOS_5_9) || defined(__SunOS_5_10)
would it be possible to use them instead of generating new symbols in the setup?
What should we do on 5.11? I expect it to be more similar to 5.10, than to 5.9: in this case looks like your test would fail. I would define it as:
#if [...] || ((defined(sun) || defined(__sun__)) && (defined(__SunOS_5_8) || defined(__SunOS_5_9)))
could you test if this would work? Thanks.
-
Floris Bruynooghe February 8th, 2012 @ 01:47 PM
Hi, I must admit I've been guilty of submitting the patch before running it on our build system (I did submit this in the middle between an upgrade from 3.4.2 to 2.4.4). After some more build failures I updated it to only include round for Solaris 8, this should also avoid the probable Solaris 11 issue (we don't build for Solaris 11 yet so I can't test).
As for using the __SunOS_5_8 symbols these are provided by the Sun Studio compiler, which is what OpenCSW uses, but gcc doesn't provide equivalents. So the only portable solution I found was to define these myself.
Having said this, Solaris 8 is out of normal support and soon the vintage patch service will stop as well (31 March 2012). And we will probably drop Solaris 8 soon too. So I guess this patch is not so important if you don't want to clutter up setup.py.
-
Daniele Varrazzo February 10th, 2012 @ 09:52 PM
Re: [psycopg #97] Provide missing round function for solaris 8 & 9
-
Daniele Varrazzo February 10th, 2012 @ 09:55 PM
Floris Bruynooghe updated this ticket at February 8th, 2012 @ 01:47 PM
Hi, I must admit I've been guilty of submitting the patch before running it on our build system (I did submit this in the middle between an upgrade from 3.4.2 to 2.4.4). After some more build failures I updated it to only include round for Solaris 8, this should also avoid the probable Solaris 11 issue (we don't build for Solaris 11 yet so I can't test).
Ok. So are you happy with the patch in its current form? If I read it correctly the round function is now only added for solaris 8, while instead we used to include it unconditionally on any solaris version. Right?
As for using the __SunOS_5_8 symbols these are provided by the Sun Studio compiler, which is what OpenCSW uses, but gcc doesn't provide equivalents. So the only portable solution I found was to define these myself.
Ok, makes sense.
Having said this, Solaris 8 is out of normal support and soon the vintage patch service will stop as well (31 March 2012). And we will probably drop Solaris 8 soon too. So I guess this patch is not so important if you don't want to clutter up setup.py.
It doesn't look a big problem for the setup, I'm fine with it.
-
Floris Bruynooghe February 18th, 2012 @ 03:01 PM
Hi, sorry for the delay. I've been away for a while and wanted to double check by compiling on Solaris8 as well (we ended up dropping it early so it's no longer included in our automated build).
However it turns out that now round is also available on Solaris8 so the ifdef statement simply becomes
#if (defined(__FreeBSD__) && __FreeBSD_version < 503000) || (defined(_WIN32) && !defined(__GNUC__)).
However this does make me wonder that maybe our build hosts have changed. We started having the originally submitted patch which suggest round was missing on sol8 & 9 but present on 10. But now it appears present on all 3 of them. Yet the only change on the hosts I can think of is an upgrade of the OpenCSW toolchain and libs while the round symbol is provided by libc afaik.
I could make a patch with just the above #if statement, trivial as it is, but am no longer confident that it would be the correct behaviour for all versions. I've tried to experiment a little with distutils' compiler .has_function() method but that doesn't seem capable of figuring out the presence of round correctly either.
-
Daniele Varrazzo December 3rd, 2012 @ 12:30 AM
- State changed from open to hold
From the last comment is unclear to me if any patch is necessary or useful for psycopg.
-
Daniel Enman April 18th, 2013 @ 08:02 PM
Hi Daniele,
I think I'm understanding form Floris' response that round is on all Solaris' version from 8 up.
The issue described here has caused us all sorts of trouble, as trivial as it is (and as easy as it is to patch!). With the the revitalization of "Solaris" (in things like the illumos project, or Joyent's SmartOS), I think there are quite a few more people using Solaris-like operating systems now.
I've sent up a pull request (https://github.com/psycopg/psycopg2/pull/4) which compiles for me on SmartOS (whereas it didn't before).
Dan
-
Daniele Varrazzo April 19th, 2013 @ 08:12 AM
- State changed from hold to open
- Tag set to solaris
Thank you very much: reopening the issue. Will take a look at your patch and integrate it.
-
Daniele Varrazzo April 21st, 2013 @ 08:23 PM
- State changed from open to resolved
I think this commit fixes the issue.
https://github.com/dvarrazzo/psycopg/commit/d159dfea9d1e7dd9ebc52c4...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
<b>WARNING:</b> the informations in this tracker are archived. Please submit new tickets or comments to <a href="https://github.com/psycopg/psycopg2/issues">the new tracker</a>.
<br/>
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.
People watching this ticket
Attachments
Tags
Referenced by
- 146 round() function build failure on Solaris 11 Please take a look at ticket #97: somebody was trying to ...