gonum / blas

A BLAS implementation for Go [DEPRECATED]
172 stars 16 forks source link

native: sed on OS X is broken #121

Closed kortschak closed 9 years ago

kortschak commented 9 years ago

This was identified in https://github.com/gonum/blas/pull/119#issuecomment-94514983.

sed on OS X requires special syntax to represent a new line. This syntax appears to not be acceptable to GNU sed without significant change to the expression. Here is an example that does work with GNU sed:

sed -e 's_^\(func (Implementation) \)D\(.*\)$_//$\n// Float32 implementations are autogenerated and not directly tested.$\n\1S\2_'

Note that the expression is now quoted with " rather than ', so any existing re $ now needs to be guarded with \, as do all escaped characters (\n becomes \\n).

kortschak commented 9 years ago

@btracey, please try the expression above to see if that works on OS X.

kortschak commented 9 years ago

No, that doesn't work on GNU - either with my first, double quoted, or second, single quoted, expression.

I am leaning towards just mandating GNU sed for this, otherwise we just end up duplicating the entire script. The alternative is to rewrite it in Go. That has been suggested before, but I'm not very interested in that path right now - others can pick that up.

kortschak commented 9 years ago

OK. I have something that works on GNU and is likely to work with OS

@btracey, would you try the script here please.

kortschak commented 9 years ago

Just tried that on one of my student's machines and it no good. It has the same behaviour as the original script.