Search code examples
macoslatexosx-yosemite

ChkTeX install not working on OSX 10.10.4


i tried to setup a latex linter in atom. The one I found was linter-chktex. For it to be working I have to install ChkTeX. So I have downloaded it here. But every time I'm trying to make i get the following error: FindErrs.c:39:10: fatal error: 'pcreposix.h' file not found

Can someone explain to me how to get it working?

EDIT: I fixed this error by giving the full path of pcreposix.h after locating it. make does work now and here is the log:

gcc -M -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ Utility.c > .Utility.d.tmp
sed 's,\(Utility\)\.o *:,\1.o .Utility.d : Makefile,g' .Utility.d.tmp > .Utility.d
rm -f .Utility.d.tmp 2>/dev/null
gcc -M -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ Resource.c > .Resource.d.tmp
sed 's,\(Resource\)\.o *:,\1.o .Resource.d : Makefile,g' .Resource.d.tmp > .Resource.d
rm -f .Resource.d.tmp 2>/dev/null
gcc -M -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ OpSys.c > .OpSys.d.tmp
sed 's,\(OpSys\)\.o *:,\1.o .OpSys.d : Makefile,g' .OpSys.d.tmp > .OpSys.d
rm -f .OpSys.d.tmp 2>/dev/null
gcc -M -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ FindErrs.c > .FindErrs.d.tmp
sed 's,\(FindErrs\)\.o *:,\1.o .FindErrs.d : Makefile,g' .FindErrs.d.tmp > .FindErrs.d
rm -f .FindErrs.d.tmp 2>/dev/null
gcc -M -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ ChkTeX.c > .ChkTeX.d.tmp
sed 's,\(ChkTeX\)\.o *:,\1.o .ChkTeX.d : Makefile,g' .ChkTeX.d.tmp > .ChkTeX.d
rm -f .ChkTeX.d.tmp 2>/dev/null
gcc -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ -g -O2 -Wstrict-prototypes -Wall -I/usr/local/Cellar/pcre/8.37/include -c ChkTeX.c -o ChkTeX.o
gcc -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ -g -O2 -Wstrict-prototypes -Wall -I/usr/local/Cellar/pcre/8.37/include -c FindErrs.c -o FindErrs.o
gcc -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ -g -O2 -Wstrict-prototypes -Wall -I/usr/local/Cellar/pcre/8.37/include -c OpSys.c -o OpSys.o
gcc -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ -g -O2 -Wstrict-prototypes -Wall -I/usr/local/Cellar/pcre/8.37/include -c Resource.c -o Resource.o
gcc -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ -g -O2 -Wstrict-prototypes -Wall -I/usr/local/Cellar/pcre/8.37/include -c Utility.c -o Utility.o
gcc -L/usr/local/Cellar/pcre/8.37/lib -lpcreposix -lpcre -o chktex ChkTeX.o FindErrs.o OpSys.o Resource.o Utility.o -ltermcap

But as soon as I try to sudo make install this error appears:

no ChkTeX.tex
make: no: No such file or directory
make: *** [ChkTeX.dvi] Error 1

But the ChkTeX.tex is in the directory.


Solution

  • I just had the same problem.

    Turns out make does not find the file no in your directory. no is the content of the LATEX variable in the Makefile, if ./configure did not find a LaTeX distribution.

    If you set the LATEX variable to the path of your latex executable, you can run sudo make install without a problem.

    In my case (El Capitan) I had to put

    LATEX=/usr/local/texlive/2015/bin/x86_64-darwin/latex
    

    on line 48 of the makefile, and thereby replace

    LATEX=no
    

    to make it work.