Further frustrations with OSX…

Recent versions of the command line tools for Xcode appear to have changed the way the -pthread argument to the compiler is handled such that it generates a warning if used in a call to the compiler that actually only links existing objects into an executable. When used to compile C or C++ into .o files it’s fine.

This wouldn’t be a big deal but for the fact (as stated elsewhere) that I compile my own code with -Wall -Werror. The warning then causes the link stage to fail. Unfortunately fixing this is not a simple case of removing -pthread from my link command because it isn’t me who puts it there. In fact that flag is added by libtool as it is also used during the compilation of one of the third-party libraries I’m linking against, libhidapi.

I thought salvation had come my way last night when I discovered that clang on OSX has another flag, -Qunused-arguments, which is supposed to prevent the compiler issuing warnings about unused command line arguments. But here’s where I am now:

If I build the project as normal, with -Wall -Werror, all the code compiles happily but fails at the link stage because of the -pthread warning. If I repeat the command manually without that flag then the link stage works.

If I build the project only changing CFLAGS to add -Qunused-arguments then compilation again completes happily, but the link stage this time fails with hundreds of duplicate symbols, many of which appear to be inline functions from the libm. Linking manually removing both this and the -pthread flag fails the same way.

I can only assume that -Qunused-arguments is causing some other side-effect, perhaps when configure is run, but at the moment I just can’t find it.

Posted in Computing, Projects | Tagged , , | Leave a comment

Swimming, 26th April 2017

Yes, that session again 🙂 This time made up to 2.7km with front crawl.

It was very tough today and my legs felt like jelly by halfway through the session, but it does feel as though my breaststroke (particularly) and backstroke are slowly improving. Somewhat oddly I’ve noticed that I tend to close my eyes whilst my head is under water when I’m swimming breaststroke. I don’t know if that’s because I’m trying to concentrate so hard on what’s happening, but it does mean I tend to drift off the centre line a bit.

Had the pool pretty much to myself for the entire session too, which was quite pleasant.

Total distance for the month: 35,600m
Total distance for this year: 142,600m
Distance compared to annual target: 23,400m under

Posted in Swimming | Tagged | Leave a comment

Swimming, 25th April 2017

Being something of a glutton for punishment (or as some might put it, “unbelievably pig-headed” 🙂 I repeated my current Swimfit session for the umpteenth time, with much the same result as yesterday. For some reason despite feeling rather tired on my way to the pool I’m in quite a positive frame of mind about it today. I’m getting the distance done that I intended so I stay in touch with my target for the year and it does mean I’m getting practice in on my breaststroke and backstroke which I really do need.

Breaststroke is supposed to have a certain amount of undulation in the stroke and I think my body is too rigid in the water. Today I tried to be a bit more flexible and relaxed, stopping my hips being permanently low in the water, and to achieve a good streamline position with my upper body before starting the kick. It also occurred to me to question exactly how the “A-pull” might be performed. Naively perhaps, I’ve always done it with my arms starting in a streamline position and my hands describing an arc in the horizontal plane back to my hips. I wonder though if it might not produce more forward motion if it were performed more like a butterfly pull, with the hands and forearms dropping to the vertical near the front of the pull to catch the water, then rotating the arms backwards to the body around the shoulder, keeping the elbows high. Experimenting over the course of a few lengths it seems to me that the pressure wave I feel along my lower legs when doing the pull this way is far stronger than if I do it the original way. I’m not sure about the legality of it so I’ll have to check that. I should have a look at what Maglischo might have to say about the breaststroke transition too. One of the dangers I’ve already discovered, especially in relatively shallow water, is that it’s quite easy to have a downwards component to the pull, thereby bringing the body closer to the surface. I didn’t find it such a problem at the deep end though.

As for backstroke, I think first I need to work on getting better longitudinal rotation of my body and a wider entry position for my arms so I can get into a proper catch more quickly. An interesting apparent side-effect of the rotation I’ve discovered is that it means I’m effectively not having to lift my recovering arm out of the water. Instead it rotates out with the body taking much less effort.

For today at least I feel as though I could repeat the session every day until I do hit that target time. Of course tomorrow I might feel utterly sick of it and want to move on again.

Anyhow, after the main session I made the distance up to 2.6km with some front crawl. Last one out of the pool again 😀

Total distance for the month: 32,900m
Total distance for this year: 139,900m
Distance compared to annual target: 24,100m under

Posted in Swimming | Tagged | Leave a comment

Well that’s not going to work then

A short while ago I posted about the problems when combining Xcode’s -Wall and -Werror flags with pkg-config to get include directory flags.

I’ve just been through my configure script doing the necessary work to replace the -I flags with -isystem. In the end it turned out to be fairly straightforward to do it in just for OSX. But there are unintended consequences…

The application uses Qt to build the user interface and as part of the build uses Qt’s moc to generate some intermediate sources. moc needs to be passed the C/C++ preprocessor flags, but it only recognises -I, not -isystem and therefore throws an error.

It looks as though what I’ll need to do is maintain two separate copies of the flags, one for compiling code and one for moc. Fairly hideous, but at the moment I see no other choice.

Posted in Computing, Projects | Tagged , , | Leave a comment

Swimming, 24th April 2017

As I don’t swim at the weekend I thought I’d give the latest Swimfit session another crack first thing this week:

12 lengths front crawl
8 lengths breaststroke
4 lengths backstroke
1 minute rest
2 x ( 2 lengths each of front crawl, backstroke, breaststroke ) 15 sec rest after each length
8 x ( 1 length each of front crawl, backstroke, breaststroke, 30 sec rest )
10 lengths fast front crawl, 30 seconds rest every 2 lengths
8 lengths easy front crawl

I still can’t do it in the expected 55 minutes. I think my breaststroke and backstroke just aren’t fast enough. By my reckoning in the above set there are ten and a half minutes rest, leaving forty-four and a half minutes swimming for seventy-eight lengths which is just over 34 seconds per length. I can’t do that in breaststroke and backstroke. In fact, covering 1950m at 34 seconds per length is a pretty reasonable pace (for me, at least) just sticking to front crawl.

For the previous session the timing was sixty minutes for three quarters the distance, mostly in front crawl and the session before that allowed seventy minutes for seventy-four lengths, again mostly front crawl though there were four lengths of kick. On the other hand the next session asks for about sixty lengths in twenty-seven minutes (with rest time on top). I just can’t see that happening in the near future. Perhaps I need some other guide as to when to move on to the next session.

Anyhow, having done the session I made the distance up to 2,700m with front crawl, until I was kicked out of the lane to make room for a swimming lesson 🙂

Total distance for the month: 30,300m
Total distance for this year: 137,300m
Distance compared to annual target: 24,700m under

Posted in Swimming | Tagged | Leave a comment

A different sort of MOAB

Over the winter we had a few trees in our hedges decide that they couldn’t stand life any longer and fell into part of the orchard. Over the last week or so I’ve been out there with the chainsaw, removing what would be suitable for the log-burner this winter (or even in the chiminea over the summer) and stacking what was left (including some savage bits of blackthorn) around a large old sycamore stump. Eventually I ended up with a heap about three to four metres across and perhaps five metres tall.

Very little effort was required to get a fire started and I was amazed how fast it got going. At one point we had flames that were getting close to ten metres high. Of course I forgot to take pictures, but my daughter appears to be permanently attached to her phone these days and she has some videos. I shall try to get a copy of them from her. Once it had died back a bit both my son and daughter toasted marsh mallows on the end of some sticks of green willow. I remember when we had bonfires in my own childhood my parents used to wrap up potatoes in baking foil and put them in the hot ashes to cook once the fire had died back. I really must try that again one day.

Posted in Smallholding | Leave a comment

Taunton & Exeter Level 1 Meet at Millfield

My Easter weekend was spent coaching swimmers (including, to be fair, my own offspring) at the Taunton and Exeter Level 1 meet at Millfield pool. I do enjoy this sort of stuff, but as one nears the end of a couple of 7:30am to 6pm days in an environment designed to be comfortable for people wearing, well, not a whole lot, it does feel exceptionally draining.

For our club it was mostly a chance to get in a bit of practice at swimming in a long course (50m) pool and a last-ditch attempt to get qualification times for the Regional Championships. It looks as though we weren’t the only ones either. For me it’s about an hour drive, but it’s our nearest 50m pool so we have to live with it. There were other swimmers there from as far afield as Birmingham, London and even Edinburgh though.

Highlights of the meet included…

  • One of our swimmers absolutely smashing his personal best times in a couple of events, with no prior indication that he would be even remotely close to the times he achieved
  • My daughter achieving adding another regional qualifying time, giving her five events in total at her first regionals
  • The MC, who made an excellent effort at trying to liven up the tedious job of announcing all the heats and swimmers names, often whilst wearing a pair of armless sunglasses. I assume he must be a Matrix fan
  • A swimmer (from Street Swimming Club, I believe) who I’d guess was in his mid-teens turning up for the warm-up wearing a pair of trunks with a girl’s costume over the top, and carrying the entire thing off with some aplomb. I assume he either lost a bet, or was in the process of winning one

All in all it was a very well-run meet. I shouldn’t be in the least surprised if we’re back there next year.

Posted in Swimming | Tagged | Leave a comment

OSX fun with pkg-config and Xcode

In the configure script for the release of oacapture that I’m currently working on I’ve made fairly heavy use of pkg-config to determine compiler and linker flags for installed packages and to check installed versions to see if they provide the necessary functionality. Other than the slight niggle that when adding, say, include directory locations for multiple packages can cause duplication of the flags it works very nicely.

When doing development work I prefer to pass the flags -Wall -Werror to the compiler when building my own code and if any warnings cause the build to fail I tidy up the code to fix the problem.

I’ve run into an awkward situation with recent versions of Xcode however. The libusb-1.0 package makes fairly heavy use of static inline functions in its header files and for reasons I’m currently unable to justify to myself Xcode flags a warning if these functions are not used. Of course with the above flags set this halts the build, and I do make fairly heavy use of libusb 🙁

I have discovered that there is a “workaround” whereby replacing the -I compiler flag with -isystem prevents the compiler throwing warnings for files in the specified directory. Seems fairly ugly to me, but there you go. Replacing the flag manually does indeed appear to fix compilation. Of course there’s a problem once you start using flags generated by pkg-config because it still uses -I. There is the temptation to fudge something up to convert -I to -isystem, but it’s really not pretty. I can’t see as I have much choice though, unless Apple care to fix their compiler implementation to work the way a sane person might expect it to.

Posted in Computing, Projects | Tagged , , | 1 Comment

Swimming, 21st April 2017

Another front-crawl only day as we’re back to the normal swimming timetable at the pool now and there’s not much time available that works for me on Fridays. 2.2km front crawl today.

Total distance for the month: 27,600m
Total distance for this year: 134,600m
Distance compared to annual target: 25,400m under

Posted in Swimming | Tagged | Leave a comment

Swimming, 20th April 2017

Another repeat of the current Swimfit session and I’m still struggling with the backstroke. I’m really not sure how much I’m progressing with this, but I’m going to keep pressing on with it.

12 lengths front crawl
8 lengths breaststroke
4 lengths backstroke
1 minute rest
2 x ( 2 lengths each of front crawl, backstroke, breaststroke ) 15 sec rest after each length
8 x ( 1 length each of front crawl, backstroke, breaststroke, 30 sec rest )
10 lengths fast front crawl, 30 seconds rest every 2 lengths
8 lengths easy front crawl

After this I made the distance up to 2,200m with front crawl.

Total distance for the month: 25,400m
Total distance for this year: 132,400m
Distance compared to annual target: 25,600m under

Posted in Swimming | Tagged | Leave a comment