- edited description
pthread_condattr_setclock on MAC
Hello All! I have a question regarding ODE v0.15 compilation on MAC
I got the following error:
./threading_impl_posix.h:166:37: error: use of undeclared identifier 'pthread_condattr_setclock'; did you mean 'pthread_condattr_setpshared'?
int condattr_clock_result = pthread_condattr_setclock(&cond_condattr, CLOCK_MONOTONIC);
^~~~~~~~~
pthread_condattr_setpshared
But ODE v0.13 compiles with the same configure parameters without any problems.
Looks like HAVE_CLOCK_GETTIME has to be undefined if compile on MAC's.
Thanks!
Comments (17)
-
reporter -
Account Deactivated I have default-enabled some parts that were excluded by default in previous releases. In particular this is the built-in threading implementation that allows using several threads for running simulations.
Alas, I do not have Mac system to test for compatibility. If you will be willing to help, we can try to resolve this.
-
reporter yes, sure! I am ready to help!
-
Account Deactivated So, I looked in sources and what I can say, this define was once used to support compilation on Macs. It just looks like your system now does have clock_gettime() but still does not have pthread_condattr_setclock().
What particular OS version do you have?
-
Account Deactivated You should be able to run "man clock_gettime", I suppose.
Could you please paste the output here?
-
reporter - attached clock_gettime.txt
man clock_gettime macOS SIerra 10.12.5
-
reporter - attached CLOCK_GETTIME(3)_readable.txt
-
reporter I change libtoolize to glibtoolize in bootstrap script. Maybe it is because of that?
-
Account Deactivated Thank you.
No, your change does not matter for this.
May I also ask for "man pthread_cond_timedwait"?
-
reporter - attached PTHREAD_COND_TIMEDWAI.txt
-
Account Deactivated Could you please get the latest version from the repository and check if it builds for you?
-
reporter It works! Thank you very much!
So, to take advantage of ODE internal threading I need to use these flags in ./configure ? "--enable-ou --enable-builtin-threading-impl"
-
Account Deactivated Not exactly. 1) These flags are enabled by default (see ./configure --help). You can disable them to save on library size if you don't need that. 2) The enabled features only "make it possible for you" to take the advantage. To use that mode you need to make several additional calls (see demo_boxstack, for example)
-
reporter Thanks! You mean, I need to make an extra calls of this:
dThreadingImplementationID threading = dThreadingAllocateMultiThreadedImplementation(); dThreadingThreadPoolID pool = dThreadingAllocateThreadPool(4, 0, dAllocateFlagBasicData, NULL); dThreadingThreadPoolServeMultiThreadedImplementation(pool, threading); // dWorldSetStepIslandsProcessingMaxThreadCount(world, 1); dWorldSetStepThreadingImplementation(world, dThreadingImplementationGetFunctions(threading), threading);
// run simulation dsSimulationLoop(argc,argv,640,480,&fn);
dThreadingImplementationShutdownProcessing(threading); dThreadingFreeThreadPool(pool); dWorldSetStepThreadingImplementation(world, NULL, NULL); dThreadingFreeImplementation(threading);
-
Account Deactivated Yes, that's correct.
-
Account Deactivated Also add some return status/value validation. ODE demos are not the best example to be copied directly.
-
Account Deactivated - changed status to resolved
The change has been merged into 0.15.2
- Log in to comment