Discussion:
missing functions
(too old to reply)
J
2013-01-15 05:03:49 UTC
Permalink
I tried to compile BulletPysics with OpenWatcom, and it's missing a family
of functions ....


#ifdef __WATCOMC__
#define sinf(n) ((float)sin(n))
#define asinf(n) ((float)asin(n))
#define cosf(n) ((float)cos(n))
#define acosf(n) ((float)acos(n))
#define tanf(n) ((float)tan(n))
#define atanf(n) ((float)atan(n))
#define floorf(n) ((float)floor(n))
#define sqrtf(n) ((float)sqrt(n))
#define fabsf(n) ((float)fabs(n))
#define atan2f(n,m) ((float)atan2(n,m))
#endif


not sure if it's been fixed in the ever to be released next patch
--
Using Opera's revolutionary email client: http://www.opera.com/mail/
Lynn McGuire
2013-01-15 17:16:50 UTC
Permalink
I tried to compile BulletPysics with OpenWatcom, and it's missing a family of functions ....
#ifdef __WATCOMC__
#define sinf(n) ((float)sin(n))
#define asinf(n) ((float)asin(n))
#define cosf(n) ((float)cos(n))
#define acosf(n) ((float)acos(n))
#define tanf(n) ((float)tan(n))
#define atanf(n) ((float)atan(n))
#define floorf(n) ((float)floor(n))
#define sqrtf(n) ((float)sqrt(n))
#define fabsf(n) ((float)fabs(n))
#define atan2f(n,m) ((float)atan2(n,m))
#endif
not sure if it's been fixed in the ever to be released next patch
Why would anyone want to use single precision
floating point math? All you get is 5.5
digits of precision versus the 13 digits of
precision in double.

Lynn
J
2013-01-15 18:13:20 UTC
Permalink
Post by Lynn McGuire
Post by J
I tried to compile BulletPysics with OpenWatcom, and it's missing a
family of functions ....
#ifdef __WATCOMC__
#define sinf(n) ((float)sin(n))
#define asinf(n) ((float)asin(n))
#define cosf(n) ((float)cos(n))
#define acosf(n) ((float)acos(n))
#define tanf(n) ((float)tan(n))
#define atanf(n) ((float)atan(n))
#define floorf(n) ((float)floor(n))
#define sqrtf(n) ((float)sqrt(n))
#define fabsf(n) ((float)fabs(n))
#define atan2f(n,m) ((float)atan2(n,m))
#endif
not sure if it's been fixed in the ever to be released next patch
Why would anyone want to use single precision
floating point math? All you get is 5.5
digits of precision versus the 13 digits of
precision in double.
Lynn
Because all you really get on video cards is single precision float; so
why would you use anything bigger?

I was able to get further by just defining the btScalar type (bullet's
base type) to be a double; but there were more issues later...
J
2013-01-15 19:08:44 UTC
Permalink
Even after fixing the above functions (or defining the base type as double
so they're not required) I really don't even know how to approach this to
fix it (C++ noob).



c:\tools\startups\..\..\tools\watcom\H\vector(68): Error! E340: col(59)
cannot construct object from argument(s)

#line 68 (vector)
explicit vector( size_type n, const Type &value = Type( ), const
Allocator & = Allocator( ) );



c:\tools\startups\..\..\tools\watcom\H\vector(68): Note! N393: col(59)
included from M:\bullet\Extras\ConvexDecomposition\concavity.cpp(7)

#line 7
#include <vector>



c:\tools\startups\..\..\tools\watcom\H\vector(68): Note! N633: col(59)
template class instantiation for
'std::vector<ConvexDecomposition::Wpoint,std::allocator<ConvexDecomposition::Wpoint>>'
was in: M:\bullet\Extras\ConvexDecomposition\concavity.cpp(357) (col 5)

#line 357
list.push_back(p1);


c:\tools\startups\..\..\tools\watcom\H\vector(68): Note! N638: col(59)
'Wpoint' defined in:
M:\bullet\Extras\ConvexDecomposition\concavity.cpp(87) (col 7)

#line 87
class Wpoint



c:\tools\startups\..\..\tools\watcom\H\vector(86): Error! E340: col(49)
cannot construct object from argument(s)

c:\tools\startups\..\..\tools\watcom\H\vector(86): Note! N633: col(49)
template class instantiation for
'std::vector<ConvexDecomposition::Wpoint,std::allocator<ConvexDecomposition::Wpoint>>'
was in: M:\bullet\Extras\ConvexDecomposition\concavity.cpp(357) (col 5)

c:\tools\startups\..\..\tools\watcom\H\vector(86): Note! N638: col(49)
'Wpoint' defined in:
M:\bullet\Extras\ConvexDecomposition\concavity.cpp(87) (col 7)
jimP
2013-01-30 16:39:20 UTC
Permalink
are you including the math .lib? e.g. -lm at link time?
Post by J
I tried to compile BulletPysics with OpenWatcom, and it's missing a
family of functions ....
#ifdef __WATCOMC__
#define sinf(n) ((float)sin(n))
#define asinf(n) ((float)asin(n))
#define cosf(n) ((float)cos(n))
#define acosf(n) ((float)acos(n))
#define tanf(n) ((float)tan(n))
#define atanf(n) ((float)atan(n))
#define floorf(n) ((float)floor(n))
#define sqrtf(n) ((float)sqrt(n))
#define fabsf(n) ((float)fabs(n))
#define atan2f(n,m) ((float)atan2(n,m))
#endif
not sure if it's been fixed in the ever to be released next patch
Hans-Bernhard Bröker
2013-01-30 17:58:28 UTC
Permalink
Post by J
I tried to compile BulletPysics with OpenWatcom, and it's missing a
family of functions ....
Well, they're missing because these function are only promised to exist
by rather later editions of the C and C++ language definitions than the
ones OpenWatcom was originally aiming for. sinf() &friends only
appeared in C as of C99 --- which OpenWatcom does support. So they
would be present in C compilations (see h\math.h).

But C++ is a different matter. C++ only includes these functions by
reference to C99 as of the 2011 edition. It is _way_ too early for
code to blindly assume that such functions are present in all compilers.
Post by J
not sure if it's been fixed
For it to need fixing, it would have to be broken first. It's not.
J
2013-02-05 23:35:58 UTC
Permalink
On Wed, 30 Jan 2013 09:58:28 -0800, Hans-Bernhard Br=F6ker =
Post by Hans-Bernhard Bröker
(see h\math.h).
I did, and they are not there, or I would have figured I was missing a =

library. There are no definitions anywhere in h for 'sinf' there is an =
=

isinf(math.h)... there is cacosf (complex.h), but no cosf anywhere...

-- =

Using Opera's revolutionary email client: http://www.opera.com/mail/
Hans-Bernhard Bröker
2013-02-06 16:55:53 UTC
Permalink
On Wed, 30 Jan 2013 09:58:28 -0800, Hans-Bernhard Bröker
Post by Hans-Bernhard Bröker
(see h\math.h).
I did, and they are not there, or I would have figured I was missing a
library. There are no definitions anywhere in h for 'sinf' there is an
isinf(math.h)... there is cacosf (complex.h), but no cosf anywhere...
Sorry, my bad. I had forgotten to tell my usual search tool to ignore
the Cygwin headers while searching in Watcom's installation tree...

These C99 additions to the language are actually not yet supported by
OpenWatcom. Not even by the development version, it seems.
Wilton Helm
2013-02-13 23:44:10 UTC
Permalink
There is some C99 support, particularly in the Compiler, where it requires a
special switch to access. But since this is a library issue, I'm not
surprised, considering that such a switch wouldn't automatically expose
library functionality.

The shortcut way would be to include those #defines in the library header,
but depending on the target processor that might miss the point. I believe
the point was that some CPUs (/FPUs) can compute single precision faster
than double precision, and if that is all that is needed, then why waste the
extra CPU cycles. For a current x86 (pentium) CPU with FPU, I don't think
that would be the case, so it probably doesn't make any difference. OTOH,
if I needed sin() on my 80186, which has to compute it in software, and only
needed single precision, it would probably be close to a 2:1 difference in
throughput.

Wilton

Loading...