htk를 설치할 때“/ usr / bin / ld : -lX11을 찾을 수 없습니다”오류


11

음성 인식에 htk (HMM 툴킷)를 사용하려고합니다.

'readme'파일의 지침 지침을 따릅니다.

먼저 './configure'를 입력하고 작동했습니다.

다음은 './configure'를 입력했을 때의 터미널 출력입니다.

checking whether make sets $(MAKE)... yes
checking for gawk... no
checking for mawk... mawk
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for ranlib... ranlib
checking for main in -lX11... yes
checking for main in -lm... yes
checking how to run the C preprocessor... gcc -E
checking for X... libraries , headers 
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking float.h usability... yes
checking float.h presence... yes
checking for float.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for memory.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking whether gcc needs -traditional... no
checking for working memcmp... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for working strtod... yes
checking return type of signal handlers... void
checking for vprintf... yes
checking for _doprnt... no
checking for floor... yes
checking for gettimeofday... yes
checking for memmove... yes
checking for memset... yes
checking for modf... yes
checking for pow... yes
checking for socket... yes
checking for sqrt... yes
checking for strchr... yes
checking for strcspn... yes
checking for strrchr... yes
checking for strspn... yes
checking for strstr... yes
checking for strtol... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
configure: creating ./config.status
config.status: creating HTKLib/Makefile
config.status: WARNING:  HTKLib/Makefile.in seems to ignore the --datarootdir setting
config.status: creating HTKTools/Makefile
config.status: WARNING:  HTKTools/Makefile.in seems to ignore the --datarootdir setting
config.status: creating HLMLib/Makefile
config.status: WARNING:  HLMLib/Makefile.in seems to ignore the --datarootdir setting
config.status: creating HLMTools/Makefile
config.status: WARNING:  HLMTools/Makefile.in seems to ignore the --datarootdir setting
config.status: creating HTKLVRec/Makefile
config.status: WARNING:  HTKLVRec/Makefile.in seems to ignore the --datarootdir setting
config.status: creating Makefile
config.status: WARNING:  Makefile.in seems to ignore the --datarootdir setting
**************************************************

HTK is now ready to be built.

Type "make all" to build the HTK libraries
and tools.

Then "make install" to install them.

The tools will be installed in /usr/local/bin

Build notes: Language Modelling tools will be
built. HDecode will not be built. You can build
it manually later by running 'make hdecode
install-hdecode'

**************************************************

그리고 'make all'을 입력했습니다. 터미널 출력에서 ​​다음 오류 메시지를 찾을 수 있습니다. / usr / bin / ld : -lX11을 찾을 수 없습니다. 다음은 터미널 출력의 완전한 버전입니다.

(cd HTKLib && make HTKLib.a) \
      || case "" in *k*) fail=yes;; *) exit 1;; esac;
make[1]: Entering directory `/home/geon-min/Downloads/htk/HTKLib'
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HGraf.o HGraf.c
HGraf.c: In function ‘DecodeKeyPress’:
HGraf.c:179:8: warning: variable ‘n’ set but not used [-Wunused-but-set-variable]
HGraf.c: In function ‘HGetEvent’:
HGraf.c:221:18: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o esig_asc.o esig_asc.c
esig_asc.c: In function ‘ReadAsciiEscape’:
esig_asc.c:2025:16: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o esig_edr.o esig_edr.c
esig_edr.c: In function ‘ReadEdrRecord’:
esig_edr.c:338:25: warning: ‘flags’ may be used uninitialized in this function [-Wuninitialized]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o esignal.o esignal.c
esignal.c: In function ‘GetLine’:
esignal.c:1760:9: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
esignal.c: In function ‘GetLong’:
esignal.c:1808:9: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o esig_nat.o esig_nat.c
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HAdapt.o HAdapt.c
HAdapt.c: In function ‘SetSemiTiedAvCov’:
HAdapt.c:1381:15: warning: variable ‘si’ set but not used [-Wunused-but-set-variable]
HAdapt.c: In function ‘ParseNode’:
HAdapt.c:1550:12: warning: variable ‘size’ set but not used [-Wunused-but-set-variable]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HArc.o HArc.c
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HAudio.o HAudio.c
HAudio.c: In function ‘StartAudioInput’:
HAudio.c:2174:11: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HDict.o HDict.c
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HExactMPE.o HExactMPE.c
HExactMPE.c: In function ‘DoCorrectness’:
HExactMPE.c:288:58: warning: value computed is not used [-Wunused-value]
HExactMPE.c:332:12: warning: variable ‘cb’ set but not used [-Wunused-but-set-variable]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HFB.o HFB.c
HFB.c: In function ‘Setotprob’:
HFB.c:999:15: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]
HFB.c: In function ‘SetBeta’:
HFB.c:1161:12: warning: variable ‘hset’ set but not used [-Wunused-but-set-variable]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HFBLat.o HFBLat.c
HFBLat.c: In function ‘StepAlpha’:
HFBLat.c:737:20: warning: variable ‘transP’ set but not used [-Wunused-but-set-variable]
HFBLat.c: In function ‘DoAllMixUpdates’:
HFBLat.c:1070:33: warning: variable ‘al_otvs’ set but not used [-Wunused-but-set-variable]
HFBLat.c: In function ‘UpMixParms’:
HFBLat.c:1198:25: warning: variable ‘vSize’ set but not used [-Wunused-but-set-variable]
HFBLat.c: In function ‘StepForward’:
HFBLat.c:1389:25: warning: variable ‘bqt1’ set but not used [-Wunused-but-set-variable]
HFBLat.c: In function ‘DoAllMixUpdates’:
HFBLat.c:1175:30: warning: ‘mammi’ may be used uninitialized in this function [-Wuninitialized]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HLabel.o HLabel.c
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HLat.o HLat.c
HLat.c: In function ‘LatSetScores’:
HLat.c:690:14: warning: variable ‘best’ set but not used [-Wunused-but-set-variable]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HLM.o HLM.c
HLM.c: In function ‘WriteNGrams’:
HLM.c:235:16: warning: variable ‘N’ set but not used [-Wunused-but-set-variable]
HLM.c: In function ‘ReadNGrams’:
HLM.c:379:18: warning: variable ‘size’ set but not used [-Wunused-but-set-variable]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HMap.o HMap.c
HMap.c: In function ‘TotMixInSet’:
HMap.c:384:10: warning: variable ‘hmm’ set but not used [-Wunused-but-set-variable]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HMath.o HMath.c
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HMem.o HMem.c
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HModel.o HModel.c
HModel.c: In function ‘CompressItemList’:
HModel.c:1149:11: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]
HModel.c: In function ‘CreateHMM’:
HModel.c:4225:12: warning: variable ‘newMacro’ set but not used [-Wunused-but-set-variable]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HNet.o HNet.c
HNet.c: In function ‘CreateXEModels’:
HNet.c:3144:36: warning: variable ‘searchNode’ set but not used [-Wunused-but-set-variable]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HParm.o HParm.c
HParm.c: In function ‘SetWaveSpDetParms’:
HParm.c:2584:18: warning: variable ‘nBl’ set but not used [-Wunused-but-set-variable]
HParm.c:2582:11: warning: variable ‘v’ set but not used [-Wunused-but-set-variable]
HParm.c: In function ‘CompressPBlock’:
HParm.c:4945:16: warning: variable ‘count’ set but not used [-Wunused-but-set-variable]
HParm.c: In function ‘OpenAsChannel’:
HParm.c:4351:25: warning: ‘initRows’ may be used uninitialized in this function [-Wuninitialized]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HRec.o HRec.c
HRec.c: In function ‘LatFromPaths’:
HRec.c:1650:33: warning: ‘labid’ may be used uninitialized in this function [-Wuninitialized]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HShell.o HShell.c
HShell.c: In function ‘KeyPressed’:
HShell.c:1489:14: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
HShell.c: In function ‘NextArg’:
HShell.c:725:13: warning: ignoring return value of ‘strtod’, declared with attribute warn_unused_result [-Wunused-result]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HSigP.o HSigP.c
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HTrain.o HTrain.c
HTrain.c: In function ‘RestoreAccsParallel’:
HTrain.c:1716:12: warning: variable ‘size’ set but not used [-Wunused-but-set-variable]
HTrain.c: In function ‘InitClustering’:
HTrain.c:755:22: warning: ‘cov.var’ may be used uninitialized in this function [-Wuninitialized]
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HUtil.o HUtil.c
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HVQ.o HVQ.c
HVQ.c: In function ‘LoadVQTab’:
HVQ.c:199:9: warning: ‘cov.var’ may be used uninitialized in this function [-Wuninitialized]
HVQ.c:169:15: note: ‘cov.var’ was declared here
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HWave.o HWave.c
HWave.c: In function ‘GetAIFFHeaderInfo’:
HWave.c:997:22: warning: variable ‘commchunk1’ set but not used [-Wunused-but-set-variable]
HWave.c: In function ‘GetWAVHeaderInfo’:
HWave.c:1062:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
HWave.c:1068:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
HWave.c:1069:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
HWave.c:1081:12: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
HWave.c:1082:12: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
HWave.c:1087:15: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
HWave.c:1097:15: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
HWave.c:1105:15: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
HWave.c:1108:15: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
HWave.c:1109:15: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
HWave.c:1110:15: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
HWave.c:1125:33: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
HWave.c: In function ‘PutESIGHeaderInfo’:
HWave.c:1379:21: warning: ‘inList’ may be used uninitialized in this function [-Wuninitialized]
HWave.c: In function ‘OpenWaveInput’:
HWave.c:1042:18: warning: ‘commchunk2.nSamples’ may be used uninitialized in this function [-Wuninitialized]
HWave.c:998:22: note: ‘commchunk2.nSamples’ was declared here
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o strarr.o strarr.c
if [ -f HTKLib.a ] ; then  /bin/rm HTKLib.a ; fi
ar rv HTKLib.a HGraf.o esig_asc.o esig_edr.o esignal.o esig_nat.o HAdapt.o HArc.o HAudio.o HDict.o HExactMPE.o HFB.o HFBLat.o HLabel.o HLat.o HLM.o HMap.o HMath.o HMem.o HModel.o HNet.o HParm.o HRec.o HShell.o HSigP.o HTrain.o HUtil.o HVQ.o HWave.o strarr.o
ar: creating HTKLib.a
a - HGraf.o
a - esig_asc.o
a - esig_edr.o
a - esignal.o
a - esig_nat.o
a - HAdapt.o
a - HArc.o
a - HAudio.o
a - HDict.o
a - HExactMPE.o
a - HFB.o
a - HFBLat.o
a - HLabel.o
a - HLat.o
a - HLM.o
a - HMap.o
a - HMath.o
a - HMem.o
a - HModel.o
a - HNet.o
a - HParm.o
a - HRec.o
a - HShell.o
a - HSigP.o
a - HTrain.o
a - HUtil.o
a - HVQ.o
a - HWave.o
a - strarr.o
ranlib HTKLib.a
make[1]: Leaving directory `/home/geon-min/Downloads/htk/HTKLib'
(cd HTKTools && make all) \
      || case "" in *k*) fail=yes;; *) exit 1;; esac;
make[1]: Entering directory `/home/geon-min/Downloads/htk/HTKTools'
if [ ! -d /usr/local/bin -a X_ = X_yes ] ; then mkdir -p /usr/local/bin ; fi
if [ xHSLab = xHSLab ] ; then \
        gcc -o HSLab -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I../HTKLib -DPHNALG HSLab.c ../HTKLib/HTKLib.a -L/usr/X11R6/lib  -lm -lX11 ; \
        else \
        gcc -o HSLab -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I../HTKLib -DPHNALG HSLab.c ../HTKLib/HTKLib.a -L/usr/X11R6/lib  -lm ; fi
HSLab.c: In function ‘FileExists’:
HSLab.c:1209:12: warning: variable ‘isEXF’ set but not used [-Wunused-but-set-variable]
HSLab.c: In function ‘DoSpecial’:
HSLab.c:1596:13: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
/usr/bin/ld: cannot find -lX11
collect2: ld returned 1 exit status
make[1]: *** [HSLab] Error 1
make[1]: Leaving directory `/home/geon-min/Downloads/htk/HTKTools'
make: *** [htktools] Error 1

이미 'libx11-dev'를 설치했습니다. 그러나 '모두 만들기'는 여전히 작동하지 않습니다. 나에게 의견을주는 사람이 있습니까? 도와 주셔서 감사합니다.

감사합니다 !


1
configure를 실행할 때 LDFLAGS 환경 변수를 사용하여 libX11이있는 디렉토리가있는 링커에 알릴 수 있어야합니다. 따라서 먼저 LDFLAGS = "-L / usr / lib / x86_64-linux-gnu"./configure ...를 실행하고 실행하십시오. 나중에 모든 것을 컴파일 할 수 있기를 바랍니다. 편집 : LDFLAGS =와 ./configure는 같은 줄에 있어야합니다 ...
soulsource

또한 ssh를 사용하는 경우 "-X"플래그로 로그인했는지 확인해야합니다.
David White

답변:


9

다음은 64 비트 및 32 비트 라이브러리가 사용 가능한지 확인하여이를 올바르게 컴파일 할 수있게합니다.

sudo apt-get install libx11-dev:i386 libx11-dev

그것은 나를 위해 일했다.
Saul Berardo 2016 년

나를 위해 일했습니다. 우분투 12.04, 64 비트.
iamkhush

4

hslab을 만들 수 없다면이 오류를 쉽게 피할 수 있다는 것을 알았습니다.

./configure --disable-hslab

실제로 X 사용에 의존하는 유일한 부분은 어느 것입니까?


0

Ubuntu를 실행하는 새로운 플랫폼 (기술적으로 Docker에서)에 HTK 3.5.1을 설치하려고 시도하면서 OP와 동일한 문제가 발생했습니다. 나는 이것이 누군가를 돕기를 바랍니다 ...

Ubuntu 14.04.3에서 다음을 사용하여 HTK를 컴파일 할 수있었습니다.

./configure --without-x --disable-hslab

나는 이것 또는 nils의 해결책이 같은 결과를 가져올 것이라고 생각하지만 테스트를 귀찮게하지 않았다.

참고로, 이것은 macOS에서도 트릭을 수행했습니다.

우분투 16.04와 18.04에서 동일한 작업을 수행했지만 HLMTools/Makefile.in컴파일러가 더 까다 롭기 때문에 여덟 공백을 탭으로 바꾸는 L.77에서 편집해야했습니다 .

물론 HSLab이 필요하다면 도움이되지 않습니다. HTK의 최신 버전 인 3.5 (현재 베타 버전)로 행운을 시험해 볼 수 있습니다 .


내가있는 동안 :

편집 할했다 HRec.c대체 L. 1650 labid != splabidlabpr != splabid(발 명예 페이지그 페이지 ).

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.