The autoconf manual warns against using the posix shell command `[ ... ]`:
> The `test` program is the way to perform many file and string tests. It
> is often invoked by the alternate name `[`, but using that name in
> Autoconf code is asking for trouble since it is an M4 quote character.
Using `[ foo = bar ]` is evaluated as `foo = bar` with m4-quoting
resolved. Here, we used `[[ foo = bar ]]` instead, which superficially
looks like a bashism, but is actually an m4 quote escape that resolves
to `[ foo = bar ]`.
Avoid the confusion by using the configure.ac standard for spelling
`test`.
Change-Id: I31dfa6ab4abb181159a4364900e6da24c929705f
Fixes regression in commit f3a99e81e9
which prevented successfully running on non-bash shells.
Bash provides the standard `test XXX = YYY` or `[ XXX = YYY ]`
utilities. It also provides the ability to spell the equals sign as a
double equals. This does nothing whatsoever -- it adds no new
functionality to bash, it forbids nothing, it is *literally* an exact
alias.
It should never be used under any circumstances. All developers must
immediately forget that it exists. Using it is non-portable and does not
work in /bin/sh scripts such as configure scripts, and it results in
dangerous muscle memory when used in bash scripts because it makes
people unthinkingly use the double equals even in /bin/sh scripts. To
add insult to injury, it makes scripts take up more disk space (by a
whole byte! and sometimes even a few bytes...)
Delete this accidental bashism, and restore the ability to get correct
./configure behavior on systems where /bin/sh is something other than a
symlink to GNU bash.
Change-Id: I38ee6d19d12cf8702ef394f3ee40f353f749b2c6
The well-known idiom to compute a required number of data blocks
of size B to contain data of length d is:
(d + (B-1))/B
The code we use, with ceill(), computes the same value, but does
it in an unorthodox way. This makes a reviewer to doubt himself
and even run tests to make sure we're really computing the
obvious thing.
Apropos the reviewer confusion, the code in Phazr.IO looks weird.
It uses (word_size - hamming_distance) to compute the necessary
number of blocks... but then returns the amount of memory needed
to store blocks of a different size (word_size). We left all of it
alone and return exactly the same values that the old computation
returned.
All these computations were the only thing in the code that used
-lm, so drop that too.
Coincidentially, this patch solves the crash of distro-built
packages of liberasurecode (see Red Hat bug #1454543). But it's
a side effect. Expect a proper patch soon.
Change-Id: Ib297f6df304abf5ca8c27d3392b1107a525e0be0
We're having trouble on Fedora when the build system runs
on Intel CPUs. The ./configure detects AVX instructions and
builds liberasurecode with them. The resulting library crashes
with SIGILL when users run it on ADM CPUs without AVX.
See the details here:
https://bugzilla.redhat.com/show_bug.cgi?id=1454543
The patch allows to disable the optimizations, so that
distro packaging then can invoke this options and build
portable libraries.
For the record, "make test" runs about 16% slower on an Intel
CPU if optimizations are disabled. So, there's a measurable
performance impact. However, operators intersted in outright
performance might want to consider Erasure Coding implementations
other than the one built-in into liberasurecode. The library
supports other back-ends that are significantly faster than
even optimized built-in code.
Change-Id: I09603b97ceeb833ba582cf3217e0be51c019d645
Fedora build system sets global CFLAGS that include things like
mandatory security enhancements. It works for all other packages,
but ./configure in liberasurecode overrides provides CFLAGS.
See Red Hat bug for a humorous workaround:
https://bugzilla.redhat.com/show_bug.cgi?id=1208695#c4
Note that this patch does not monkey with the --debug side.
Hopefuly this does not violate KISS principle.
NOTE: We need to ensure that any erasure code backend using algebraic
signatures *must use* the same exact GF as those used in this library. This
usually means same 'w' and primitive polynomial.
I plan to make the same change to Jerasure, so it will be compatible.
.. so we don't add unnecessary libs to the AX_EXT compile lines
.. this has a tendancy to report false failures if libraries
.. are not found in LD_LIBRARY_PATH (e.g. -lgf_complete)
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>