Math插件安装了但是没有搞定Mathoid服务,所以打算另辟蹊径安装LaTeXML,没准会容易些。
进入控制台,输入:

git clone https://github.com/brucemiller/LaTeXML.git
cd LaTeXML

执行:

perl Makefile.PL

返回错误如下:

# perl Makefile.PL
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 6.
BEGIN failed--compilation aborted at Makefile.PL line 6.

从网上的结果来看,是需要安装相应的库:
yum install perl-ExtUtils-MakeMaker

再次执行,错误依旧,只是稍有变化:

git version 2.31.1

    Can't exec "kpsewhich": No such file or directory at Makefile.PL line 216.
    Warning: no TeX installation found.
      TeX is NOT required, but LaTeXML will have limited functionality.
    Checking if your kit is complete...
    Looks good
    Warning: prerequisite Archive::Zip 0 not found.
    Warning: prerequisite DB_File 0 not found.
    Warning: prerequisite File::Which 0 not found.
    Warning: prerequisite IO::String 0 not found.
    Warning: prerequisite Image::Size 0 not found.
    Warning: prerequisite JSON::XS 0 not found.
    Warning: prerequisite LWP 0 not found.
    Warning: prerequisite Parse::RecDescent 0 not found.
    Warning: prerequisite Pod::Parser 0 not found.
    Warning: prerequisite Test::More 0 not found.
    Warning: prerequisite Text::Unidecode 0 not found.
    Warning: prerequisite URI 0 not found.
    Warning: prerequisite XML::LibXML 1.61 not found.
    Warning: prerequisite XML::LibXSLT 1.58 not found.
    Warning: prerequisite version 0 not found.
    Could not eval '
                    package ExtUtils::MakeMaker::_version;
                    no strict;
                    BEGIN { eval {
                        # Ensure any version() routine which might have leaked
                        # into this package has been deleted.  Interferes with
                        # version->import()
                        undef *version;
                        require version;
                        "version"->import;
                    } }
    
                    local $VERSION;
                    $VERSION=undef;
                    do {
                        use version; our $VERSION = version->declare("0.8.6");
                    };
                    $VERSION;
                ' in lib/LaTeXML.pm: Can't locate version.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 11) line 16, <$fh> line 33.
    BEGIN failed--compilation aborted at (eval 11) line 16, <$fh> line 33.
    WARNING: Setting VERSION via file 'lib/LaTeXML.pm' failed
     at /usr/share/perl5/vendor_perl/ExtUtils/MakeMaker.pm line 619.
    Writing Makefile for LaTeXML
    =======================================================
    | If you plan on developing code, please consider using
    | the git pre-commit hook to assure style compliant code.
    | To install:
    |    ln -s ../../tools/pre-commit .git/hooks
    =======================================================

不管了,先安装textlive试试:

yum -y install texlive texlive-*.noarch

再次执行终于不报错了。好了,终于可以make了。报错如下:

Can't locate Parse/RecDescent.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).
BEGIN failed--compilation aborted.
make: *** [blib/lib/LaTeXML/MathGrammar.pm] Error 2

老规矩,安装库:

yum install perl-Parse-RecDescent

貌似报错没那么多了,就进行下一步make test,然后是缺少各种库

Can't locate Pod/Find.pm in @INC
Can't locate IO/String.pm in @INC
Can't locate Archive/Zip.pm in @INC
Can't locate version.pm in @INC
Can't locate Test/More.pm in @INC
Can't locate File/Which.pm in @INC
Can't locate JSON/XS.pm in @INC
Can't locate XML/LibXML.pm in @INC
Can't locate XML/LibXSLT.pm in @INC
Can't locate DB_File.pm in @INC
Can't locate Text/Unidecode.pm in @INC

逐一安装:

yum install perl-Pod-Parser
yum install perl-IO-String
yum install perl-Archive-Zip
yum install perl-Test-Simple
yum install perl-File-Which
yum install perl-JSON-XS
yum install perl-XML-LibXML
yum install perl-XML-LibXSLT
yum install perl-DB_File
yum install perl-Text-Unidecode

基本上提示缺什么就安装对应的,结果发现装完一个又有一个,很多还不是改改名字就可以的,最终从网上的搜索结果中找到一条关键信息,原来完全安装的话要用perl-core,如果只是安装perl则只是安装基本的。

yum install perl-core

重新make test,终于少了好多错误,不过还是提示缺库:

Can't locate Image/Size.pm in @INC

继续安装:

yum install perl-Image-Size

再跑一次,终于顺利跑完(不过竟然把数据库弄崩溃了)。
接下来执行:

make install

顺利成功。
然后就是为将该服务作为web服务,从有限的文档来看,需要安装插件而后还是apache的配置。
捣鼓半天无果,放弃。

参考文档:
https://math.nist.gov/~BMiller/LaTeXML/get.html#linux.rpm
https://stackoverflow.com/questions/54469247/cant-find-version-pm-while-trying-to-install-dbd-pg-2-19-3-on-centos-7

最后修改:2022 年 01 月 27 日
如果觉得我的文章对你有用,请随意赞赏