ComputationalProteomicsUnit / maker

Makefile for R packages
GNU General Public License v3.0
31 stars 5 forks source link

time -f does not work on a Mac #7

Closed lgatto closed 10 years ago

lgatto commented 10 years ago

On a Mac terminal, time does not have an -f option. I would suggest to either remove it completely of ignore it unless defined explicitly.

sgibb commented 10 years ago

It seems time -f is a GNU extension. The normal output of /usr/bin/time is ugly and nearly unparseable (so we can't highlight build times > 5min):

/usr/bin/time echo "foo"
foo
0.00user 0.00system 0:00.00elapsed 0%CPU (0avgtext+0avgdata 620maxresident)k
0inputs+0outputs (0major+203minor)pagefaults 0swaps

There are two solutions:

  1. Tell all Mac users that they should use a proper OS :wink:
  2. Remove the highlighting feature and accept the ugly default output of GNU time on Linux.

Do you have another idea?

lgatto commented 10 years ago

What if TIMEFORMAT is not defined, ugly output an no highlighting, else current situation. We basically just need to add TIMEFORMAT := -f "time: %e" to our .makerrc files. How's that?