Hello! The attached patch removes non-portable code from ginsh and checks, so it possible to compile ginsh and run checks on MinGW. -- All science is either physics or stamp collecting.
Dear Alexei, Sheplyakov Alexei wrote:
The attached patch removes non-portable code from ginsh and checks, so it possible to compile ginsh and run checks on MinGW.
Thanks for submitting a patch. However, your patch trades the measurement of used system time for the measurement of elapsed (physical) time. I don't think that's what we want. If you really want to make it work on systems that don't have getrusage, then I suggest to encapsulate the time measurement into a little abstraction of its own and use #ifdefs within that. Those #ifdefs could then check for something established by configure. (Sure there must be Autoconf macros out there checking for getrusage.) Also, your patch repeats a little mistake in the original code, that I'was going to fix anyway in a few minutes. :-) Regards -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
Hello, On Tue, Nov 01, 2005 at 09:04:01PM +0100, Richard B. Kreckel wrote:
Thanks for submitting a patch. However, your patch trades the measurement of used system time for the measurement of elapsed (physical) time.
Yes, since (AFAIK) there is no portable way to measure the former.
I don't think that's what we want.
OK, here is another patch. It uses getrusage() whenever available and std::clock() as a last resort. -- All science is either physics or stamp collecting.
Dear Alexei, Sheplyakov Alexei wrote:
OK, here is another patch. It uses getrusage() whenever available and std::clock() as a last resort.
Thanks a lot. It looks better, but two little issues remain:
diff -r1.21.2.5 configure.ac 24c24,25 < AC_CONFIG_HEADERS(config.h) ---
AC_CONFIG_AUX_DIR(config) AC_CONFIG_HEADERS([config/config.h])
Any reason to add another directory?
double elapsed; if (running()) used2 = clock(); elapsed = (used2 - used1)/CLOCKS_PER_SEC;
This looks wrong to me: used1 and used2 are of type time_t. On a UNIX system, that's an integral type, as is CLOCKS_PER_SEC. Is it a floating point type on MinGW?
Regards -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
Richard B. Kreckel wrote:
Thanks a lot. It looks better, but two little issues remain:
Never mind. I've committed a modified version of your patch that should address those issues. Please check if it works for you. Regards -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
Hello! On Thu, Nov 03, 2005 at 11:23:59PM +0100, Richard B. Kreckel wrote:
Never mind. I've committed a modified version of your patch that should address those issues. Please check if it works for you.
Could you please apply this trivial patch too? Index: check/exam_archive.cpp =================================================================== RCS file: /home/cvs/GiNaC/check/exam_archive.cpp,v retrieving revision 1.15 diff -r1.15 exam_archive.cpp 57c57 < std::ofstream fout("exam.gar"); ---
std::ofstream fout("exam.gar", std::ios_base::binary);
62c62 < std::ifstream fin("exam.gar"); ---
std::ifstream fin("exam.gar", std::ios_base::binary);
Index: tools/viewgar.cpp =================================================================== RCS file: /home/cvs/GiNaC/tools/viewgar.cpp,v retrieving revision 1.14 diff -r1.14 viewgar.cpp 49c49 < std::ifstream f(*argv); ---
std::ifstream f(*argv, std::ios_base::binary);
It makes viewgar and archiving tests work properly. Best regards, Alexei -- All science is either physics or stamp collecting.
Sheplyakov Alexei wrote:
Could you please apply this trivial patch too? [snip]
Done. -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
participants (2)
-
Richard B. Kreckel
-
varg@theor.jinr.ru