1

我正在尝试安装 Kaldi,为此我安装了相关的东西(例如 gcc、automakers、autoconf 等)。但是,因为编译错误,我无法更进一步......错误信息如下......

(base) C-MacBook-Pro:tools ninackjeong$ extras/check_dependencies.sh
extras/check_dependencies.sh: all OK.
(base) C-MacBook-Pro:tools ninackjeong$ make -j 6
extras/check_dependencies.sh
cd sph2pipe_v2.5/ && \
    x86_64-apple-darwin13.4.0-clang -o sph2pipe  *.c -lm
if [ -d "" ]; then \
        cp -p "/cub-1.8.0.zip" .; \
    else \
        wget -T 10 -t 3 -O cub-1.8.0.zip https://github.com/NVlabs/cub/archive/1.8.0.zip; \
    fi
--2020-02-03 09:44:29--  https://github.com/NVlabs/cub/archive/1.8.0.zip
Resolving github.com (github.com)... extras/check_dependencies.sh: all OK.
tar xojf sctk-2.4.10-20151007-1312Z.tar.bz2 || \
    tar --exclude '*NONE*html' -xvojf sctk-2.4.10-20151007-1312Z.tar.bz2
cd openfst-1.6.7/ && \
    ./configure --prefix=`pwd` --enable-static --enable-shared --enable-far --enable-ngram-fsts CXX="x86_64-apple-darwin13.4.0-clang++" CXXFLAGS="-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 " LDFLAGS="-Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs" LIBS="-ldl"
192.30.255.112
Connecting to github.com (github.com)|192.30.255.112|:443... file_headers.c:149:24: warning: format specifies type 'int' but the argument has type 'off_t' (aka 'long long') [-Wformat]
                        inpname, sampcount, statbuf.st_size );
                                            ^~~~~~~~~~~~~~~
file_headers.c:579:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
ConvertToIeeeExtended(num, bytes)
^
file_headers.c:629:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
3 warnings generated.
connected.
shorten_x.c:187:29: warning: too many arguments in call to 'word_get'
            gbuffer = word_get(fpin);
                      ~~~~~~~~     ^
shorten_x.c:325:22: warning: implicit declaration of function 'pcm2alaw' is invalid in C99 [-Wimplicit-function-declaration]
                    *writebufp++ = pcm2alaw( ulaw2pcm[data0[i]] );
                                   ^
shorten_x.c:381:24: warning: implicit declaration of function 'pcm2ulaw' is invalid in C99 [-Wimplicit-function-declaration]
                      *writebufp++ = pcm2ulaw( data0[i] );
                                     ^
HTTP request sent, awaiting response... 3 warnings generated.
sph2pipe.c:191:18: warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration]
    while (( i = getopt( ac, av, "daupf:c:t:s:h:" )) != EOF )
                 ^
sph2pipe.c:530:11: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            cptr = inpbuf;
                 ^ ~~~~~~
sph2pipe.c:545:8: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
                cptr = inpbuf;
                     ^ ~~~~~~
sph2pipe.c:547:15: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
                wptr = cptr = outbuf;
                            ^ ~~~~~~
sph2pipe.c:547:8: warning: assigning to 'char *' from 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
                wptr = cptr = outbuf;
                     ^ ~~~~~~~~~~~~~
sph2pipe.c:561:11: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            cptr = inpbuf;
                 ^ ~~~~~~
sph2pipe.c:568:11: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            cptr = inpbuf;
                 ^ ~~~~~~
sph2pipe.c:616:7: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        cptr = inpbuf;
             ^ ~~~~~~
8 warnings generated.
ld: warning: ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libm.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libm.tbd
ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd
Undefined symbols for architecture x86_64:
  "___sprintf_chk", referenced from:
      _writeSphHeader in file_headers-d8b2d2.o
  "___stack_chk_fail", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
      _writeSphHeader in file_headers-d8b2d2.o
      _writeAIFFHeader in file_headers-d8b2d2.o
  "___stack_chk_guard", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
      _writeSphHeader in file_headers-d8b2d2.o
      _writeAIFFHeader in file_headers-d8b2d2.o
  "___stderrp", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
      _writeSphHeader in file_headers-d8b2d2.o
      _writeAUHeader in file_headers-d8b2d2.o
      _writeRIFFHeader in file_headers-d8b2d2.o
      _writeAIFFHeader in file_headers-d8b2d2.o
      _word_get in shorten_x-0926aa.o
      _init_offset in shorten_x-0926aa.o
      ...
  "___stdoutp", referenced from:
      _doConversion in sph2pipe-035023.o
  "___strncpy_chk", referenced from:
      _writeSphHeader in file_headers-d8b2d2.o
  "_exit", referenced from:
      _writeSphHeader in file_headers-d8b2d2.o
      _writeAUHeader in file_headers-d8b2d2.o
      _writeRIFFHeader in file_headers-d8b2d2.o
      _writeAIFFHeader in file_headers-d8b2d2.o
      _fwrite_type in shorten_x-0926aa.o
      _shortenXtract in shorten_x-0926aa.o
      _main in sph2pipe-035023.o
      ...
  "_fclose", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
      _doConversion in sph2pipe-035023.o
  "_fileno", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
  "_floor", referenced from:
      _ConvertToIeeeExtended in file_headers-d8b2d2.o
  "_fopen", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
      _doConversion in sph2pipe-035023.o
  "_fprintf", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
      _writeSphHeader in file_headers-d8b2d2.o
      _writeAUHeader in file_headers-d8b2d2.o
      _writeRIFFHeader in file_headers-d8b2d2.o
      _writeAIFFHeader in file_headers-d8b2d2.o
      _word_get in shorten_x-0926aa.o
      _init_offset in shorten_x-0926aa.o
      ...
  "_fputs", referenced from:
      _main in sph2pipe-035023.o
  "_fread", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
      _word_get in shorten_x-0926aa.o
      _copySamples in sph2pipe-035023.o
  "_free", referenced from:
      _fwrite_type in shorten_x-0926aa.o
  "_frexp", referenced from:
      _ConvertToIeeeExtended in file_headers-d8b2d2.o
  "_fseek", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
      _copySamples in sph2pipe-035023.o
  "_fstat$INODE64", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
  "_fwrite", referenced from:
      _writeSphHeader in file_headers-d8b2d2.o
      _writeAUHeader in file_headers-d8b2d2.o
      _writeRIFFHeader in file_headers-d8b2d2.o
      _writeAIFFHeader in file_headers-d8b2d2.o
      _fwrite_type in shorten_x-0926aa.o
      _copySamples in sph2pipe-035023.o
     (maybe you meant: _fwrite_type)
  "_getc", referenced from:
      _shortenXtract in shorten_x-0926aa.o
  "_getopt", referenced from:
      _getUserOpts in sph2pipe-035023.o
  "_index", referenced from:
      _getUserOpts in sph2pipe-035023.o
  "_ldexp", referenced from:
      _ConvertToIeeeExtended in file_headers-d8b2d2.o
  "_malloc", referenced from:
      _long2d in shorten_x-0926aa.o
      _fwrite_type in shorten_x-0926aa.o
      _shortenXtract in shorten_x-0926aa.o
      _main in sph2pipe-035023.o
  "_optarg", referenced from:
      _getUserOpts in sph2pipe-035023.o
  "_optind", referenced from:
      _getUserOpts in sph2pipe-035023.o
  "_putc", referenced from:
      _shortenXtract in shorten_x-0926aa.o
  "_sscanf", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
      _writeSphHeader in file_headers-d8b2d2.o
      _getUserOpts in sph2pipe-035023.o
  "_strcmp", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
      _writeSphHeader in file_headers-d8b2d2.o
      _copylong in file_headers-d8b2d2.o
      _copyshort in file_headers-d8b2d2.o
      _fwrite_type in shorten_x-0926aa.o
      _getUserOpts in sph2pipe-035023.o
      _doConversion in sph2pipe-035023.o
      ...
  "_strdup", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
      _getUserOpts in sph2pipe-035023.o
  "_strlen", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
  "_strncasecmp", referenced from:
      _getUserOpts in sph2pipe-035023.o
  "_strncmp", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
      _writeSphHeader in file_headers-d8b2d2.o
  "_strtok", referenced from:
      _readSphHeader in file_headers-d8b2d2.o
      _writeSphHeader in file_headers-d8b2d2.o
  "_swab", referenced from:
      _copyshort in file_headers-d8b2d2.o
      _fwrite_type in shorten_x-0926aa.o
      _copySamples in sph2pipe-035023.o
ld: symbol(s) not found for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sph2pipe_v2.5/sph2pipe] Error 1
make: *** Waiting for unfinished jobs....
302 Found
Location: https://codeload.github.com/NVlabs/cub/zip/1.8.0 [following]
--2020-02-03 09:44:30--  https://codeload.github.com/NVlabs/cub/zip/1.8.0
Resolving codeload.github.com (codeload.github.com)... 192.30.255.121
Connecting to codeload.github.com (codeload.github.com)|192.30.255.121|:443... connected.
HTTP request sent, awaiting response... checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
200 OK
Length: 602396 (588K) [application/zip]
Saving to: ‘cub-1.8.0.zip’

cub-1.8.0.zip         0%[                    ]       0  --.-KB/s               checking for style of include used by make... GNU
checking for gcc... x86_64-apple-darwin13.4.0-clang
cub-1.8.0.zip        37%[======>             ] 220.43K  1.07MB/s               checking whether the C compiler works... no
configure: error: in `/Users/ninackjeong/kaldi/tools/openfst-1.6.7':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** [openfst-1.6.7/Makefile] Error 77
cub-1.8.0.zip       100%[===================>] 588.28K  1.93MB/s    in 0.3s    

2020-02-03 09:44:30 (1.93 MB/s) - ‘cub-1.8.0.zip’ saved [602396/602396]

unzip -oq cub-1.8.0.zip
rm -f cub
ln -s cub-1.8.0 cub
rm -rf sctk && ln -s sctk-2.4.10 sctk

当我输入更具体的命令“make CXX=g++-4.8”时,错误消息如下。看来这需要 g++ 4.8.3.、Apple Xcode 5.0 或 clang 3.3,但我的是 gcc 和 gcc@4.9(通过 brew 安装),而我的 Xcode 和 clang 远远超出 5.0 和 3.3。如果这些是问题,我想问一下如何安装它们(我尝试安装g++ 4.8.3,但是brew上似乎没有提供“gcc48”,我找不到Xcode 5.0安装文件......)。

对于给您带来的任何不便,我深表歉意,非常感谢您的所有时间!

<< gcc -v 检查>>

(base) C-MacBook-Pro:~ ninackjeong$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

<< 放置更具体的命令时可能出现的问题>>

(base) C-MacBook-Pro:tools ninackjeong$ make CXX=g++-4.8
extras/check_dependencies.sh
extras/check_dependencies.sh: Compiler 'g++-4.8' is not installed.
extras/check_dependencies.sh: You need g++ >= 4.8.3, Apple Xcode >= 5.0 or clang >= 3.3.
extras/check_dependencies.sh: The following prerequisites are missing; install them first:
   g++
make: *** [check_required_programs] Error 1
4

0 回答 0