Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

'lzma.h' file not found, please help!

Looking for advice for when I try to install some tools, an error comes as following:

''

cd ../htslib && /Library/Developer/CommandLineTools/usr/bin/make lib-static

gcc -g -Wall -O2 -I. -c -o cram/cram_io.o cram/cram_io.c

cram/cram_io.c:60:10: fatal error: 'lzma.h' file not found

#include <lzma.h>

^

1 error generated.

make[1]: *** [cram/cram_io.o] Error 1

make: *** [../htslib/libhts.a] Error 2

'''

I am using OS X EI Capitan Version 10.11.6. I greatly appreciate any help or advice you can offer!


Best,

MacBook Air, OS X El Capitan (10.11.6)

Posted on Mar 19, 2017 10:19 PM

Reply
12 replies

Mar 21, 2017 3:58 AM in response to ssabu1234

ssabu1234 wrote:


Furthermore, I do have lzma file in bin, I even try to rewrite it in lzma.h. However, it does not work...

This does not make sense.

A .h file is a "header" file that contains definitions of stuff so other parts of the program know how to use them.


Either the xz package was not correctly installed, or the lzma.h file is there but the compiler can't find it.

Probably because it is an folder that includes a version number in the path.

You should find where xz is installed.

Try this command in Terminal:


sudo find /usr -name lzma.h -print


enter your password when asked (nothing will display), and press enter. In a few seconds it should show you something. Let us know.

Jun 28, 2017 1:33 AM in response to astroperson08

astroperson08 wrote:


/usr/local/Cellar/xz/5.2.3/include/lzma.h

/usr/local/include/lzma.h

was the print

Have tried installing a few packages and also get

fatal error: 'lzma.h' file not found

#include <lzma.h>

Thoughts?


Try adding the path to the appropriate include folders to the command line, with the -I option (that is a capital vowel "eye", not a lowercase "ell")


It could be something like:


gcc -g -Wall -O2 -I. -I/usr/local/include -c -o cram/cram_io.o cram/cram_io.c

Jul 3, 2017 3:32 AM in response to ssabu1234

I had the same not found issue and ended up downloading the xz-5.2.3 source from (https://tukaani.org/xz/) and building it from source.This solved my problem.


Note that I first downloaded the OS package installer (same page) which did not add the libraries, you apparently really need to build the whole thing from source to get the right files put in /usr/local/include and alikes ....

Hope this will help others!

Jul 12, 2017 1:59 AM in response to Stephane Plaisance

I would like to say that I am still facing the issue. I am trying to install a tool known as samtools and it has the problem with this lzma.h, so going through the forums, I downloaded the xz utils from this link (https://tukaani.org/xz/) , downloaded source *.tar.gz and build it , compiled. It ran smoothly but then again when am trying to complile the samtools it shows the same error below

samtools-1.5 vdas$ make

cd htslib-1.5 && /Applications/Xcode.app/Contents/Developer/usr/bin/make lib-static

gcc -g -Wall -O2 -I.
-c -o cram/cram_io.o cram/cram_io.c

cram/cram_io.c:60:10: fatal error: 'lzma.h' file not found

#include <lzma.h>

^

1 error generated.

make[1]: *** [cram/cram_io.o] Error 1

make: *** [htslib-1.5/libhts.a] Error 2

Now having tried to see where the lzma files are I tried

sudo find /usr -name lzma.h -print

Password:

/usr/local/Cellar/xz/5.2.3/include/lzma.h

/usr/local/include/lzma.h

/usr/local/octave/3.8.0/include/lzma/lzma.h

/usr/local/octave/3.8.0/include/lzma.h

I also tried the below command:

host009:samtools-1.5 vdas$ gcc -g -Wall -O2 -I. -I/usr/local/include -c -o cram/cram_io.o cram/cram_io.c

clang: error: no such file or directory: 'cram/cram_io.c'

clang: error: no input files

Now am not sure how to get rid of this error. It would be nice to have some pointers.

Sep 5, 2017 3:38 AM in response to ssabu1234

Hello:

I had this same problem as well and tried various iterations of installing xz. I finally managed to fix it by including a flag --disable-lzma in the configure step.


So, from start to finish:


cd bcftools-1.5

./configure --disable-lzma --prefix=

/where/to/install
/

make

make install

export PATH=

/where/to/install
/bin:$PATH

Best of luck!

'lzma.h' file not found, please help!

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.