Closed yurivict closed 6 years ago
Two solutions:
make DONT_BUILD_TORNADO=1
However, 1. obviously just avoids some place in code, doesn't really fix it.
DONT_BUILD_TORNADO=1
disables the Tornado compressor but you still have about 40 other compressors available :)
What kind of compiler and processor do you have? Is it PowerPC as _BIG_ENDIAN seems to be defined?
No, I have an average run-of-the-mill intel amd64 processor, little endian.
What kind of compiler do you have? Can you compile
printf("_BIG_ENDIAN=%d\n", _BIG_ENDIAN);
and provide its output.
Moreover after https://github.com/inikep/lzbench/commit/38ecf5ad8eb1456cf718046ca8080871041153ff the error should be changed from:
#error "You're compiling for Motorola byte order, but FREEARC_INTEL_BYTE_ORDER was defined."
to:
#error "You're compiling for Intel byte order, but FREEARC_MOTOROLA_BYTE_ORDER was defined."
I have clang-4.0.0
$ cc -dM -E - | grep -i endian
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __LITTLE_ENDIAN__ 1
#define __ORDER_BIG_ENDIAN__ 4321
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __ORDER_PDP_ENDIAN__ 3412
$ cc --version
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
Target: x86_64-unknown-freebsd11.1
Thread model: posix
InstalledDir: /usr/bin
Can you compile
#include <stdio.h>
int main(void)
{
#ifdef _BIG_ENDIAN
printf("_BIG_ENDIAN=%d\n", _BIG_ENDIAN);
#else
printf("_BIG_ENDIAN not defined\n");
#endif
}
and provide its output?
$ ./x
_BIG_ENDIAN not defined
The message "You're compiling for Motorola byte order, but FREEARC_INTEL_BYTE_ORDER was defined." requires _BIG_ENDIAN to be defined as non-zero value: https://github.com/inikep/lzbench/blob/master/tornado/Common.h#L45
I don't see possibility that _BIG_ENDIAN is defined by lzbench. It seems that the issue is that one of your system includes defines _BIG_ENDIAN.
Removing the following 3 lines should allow you to compile tornado: https://github.com/inikep/lzbench/blob/master/tornado/Common.h#L44-L46
It seems that the issue is that one of your system includes defines _BIG_ENDIAN.
Yes:
#define _BIG_ENDIAN 4321
This isn't generally an indication of big-endianness of the system.
This is discussed here https://stackoverflow.com/questions/4239993/determining-endianness-at-compile-time
Practically speaking, if the check is the only a problem on the FreeBSD, you can change this line to:
#if (!defined(__FreeBSD__) && _BIG_ENDIAN_) || (defined(__FreeBSD__) && defined(__LITTLE_ENDIAN__))
Or, to have a correct code, take the check from the above link.
I don't like to change sources of compressors but I had to fix tornado/Common.h
: https://github.com/inikep/lzbench/commit/df29c6062ce4062d0ba34cc755bb2c74373cd0a0