Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation trouble on mac with gcc 4.8.5 #1283

Closed
keflavich opened this issue Aug 16, 2018 · 3 comments
Closed

Installation trouble on mac with gcc 4.8.5 #1283

keflavich opened this issue Aug 16, 2018 · 3 comments
Labels

Comments

@keflavich
Copy link

I'm trying to build on Mac OS X 10.9.5 with gcc 4.8.5 and get the following failure:

$ make
cc -O3   -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4  -c -o common/debug.o common/debug.c
cc -O3   -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4  -c -o common/entropy_common.o common/entropy_common.c
cc -O3   -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4  -c -o common/error_private.o common/error_private.c
cc -O3   -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4  -c -o common/fse_decompress.o common/fse_decompress.c
cc -O3   -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4  -c -o common/pool.o common/pool.c
cc -O3   -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4  -c -o common/threading.o common/threading.c
cc -O3   -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4  -c -o common/xxhash.o common/xxhash.c
cc -O3   -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4  -c -o common/zstd_common.o common/zstd_common.c
cc -O3   -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4  -c -o compress/fse_compress.o compress/fse_compress.c
cc -O3   -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4  -c -o compress/hist.o compress/hist.c
cc -O3   -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4  -c -o compress/huf_compress.o compress/huf_compress.c
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:410:no such instruction: `shlx %r10, %r9,%r10'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:418:no such instruction: `shlx %r9, %rax,%rax'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:431:no such instruction: `shrx %r9, %rax,%r9'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:454:no such instruction: `shlx %rcx, %r14,%rcx'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:455:no such instruction: `shlx %rax, %r15,%rax'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:459:no such instruction: `shlx %rbx, %rcx,%rbx'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:462:no such instruction: `shlx %r10, %rcx,%rcx'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:478:no such instruction: `shrx %r9, %rax,%r9'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:484:no such instruction: `shlx %rax, %rdx,%rax'
make[1]: *** [compress/huf_compress.o] Error 1
make: *** [lib-release] Error 2

The file compress/huf_compress.o is not produced. Any ideas what is causing this problem?

I have an older gcc-4.2 on my system, and using that as my compiler, make completed successfully, so this isn't a blocker, but I wanted to raise the problem in case it's easy to fix.

@Cyan4973
Copy link
Contributor

Cyan4973 commented Aug 16, 2018

I suspect your compiler doesn't completely support BMI2 instruction set,
which is strange because gcc 4.8 is supposed to support it.
gcc 4.8.x works well on Linux.

According to traces, the compilation stage itself generates the instruction correctly, but it seems the later assembly stage doesn't know this instruction.

gcc 4.2 does not support BMI2, so it's disabled for this target, hence no shlx instruction is generated.

You could try to do the same with gcc 4.8 by disabling BMI2, through build macro DYNAMIC_BMI2 (-DDYNAMIC_BMI2=0).

Alternatively, you will likely generate more efficient binaries by updating your version of gcc, typically through homebrew. brew install gcc currently delivers gcc 8.2.

@jwongz
Copy link

jwongz commented Dec 2, 2021

build no such instruction: error DataDog/zstd#76

gcc 8.2 in centos6.4 still have this problem

@jwongz
Copy link

jwongz commented Dec 3, 2021

Upgrade version of as can solve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants