|
From: Brian D. <br...@de...> - 2007-09-13 19:18:24
|
Ro'ee Sfaradi wrote: > I'm trying to compile a package called ppl (The Parma Polyhedra Library) in > msys environment. > > When I'm run the ./configure after it runs a bit, I get the following > message : > > ------ > configure: error: CANNOT BUILD THE WATCHDOG LIBRARY > *** THE SYSTEM DOES NOT PROVIDE THE SETITIMER FUNCTION. > configure: error: /bin/sh './configure' failed for Watchdog > ------ > > I searched over FAQs and googled and didn't find any hint about it. Is it > something I need to install to have the timer support on msys? There's nothing to install. I think the problem is in expectations. MinGW is a toolchain for windows, that provides the APIs that the windows operating system exposes. The POSIX function setitimer() is not an API that windows provides, so you can't use it from code compiled with MinGW. MSYS is a set of tools that assists in running POSIX build environments like the configure script, but this is just a fancy way of driving the MinGW tools, it does not change the fact that if the OS doesn't provide something there's no way to build software that expects that interface. (With a small list of exceptions for replacement functions that libmingw and libmingwex provide.) This is why people often say that if you want to build your software with MinGW it must be ported to Win32. Here ported means the software must be adapted to use the functions and APIs that are available on windows, not those which exist on POSIX/Linux/et cetera. In this case there is a significant difference between how timers work on Win32 and POSIX, primarily because the concept of signals that the POSIX interval timer API uses does not really exist on windows. Instead you'd probably use CreateWaitableTimer(), SetWaitableTimer(), and WaitForSingleObject() or WaitForMultipleObjects(). But this is likely just one of many ways you'd have to adapt/port the software, so it is far from just being able to plug in some replacement for a function -- it can be a significant undertaking. An alternative is to use something that provides implementations of these POSIX functions that don't exist on windows. Cygwin is an example, and Cygwin provides the setitimer()/getitimer() interface. Brian |