首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >在Github Actions windows msys2上,configure找不到icu

在Github Actions windows msys2上,configure找不到icu
EN

Stack Overflow用户
提问于 2021-03-06 13:00:41
回答 2查看 102关注 0票数 0

windows-latest上的Github操作中,我使用以下命令调用脚本:

代码语言:javascript
代码运行次数:0
运行
复制
C:\msys64\msys2_shell.cmd -mingw64 -defterm -here -full-path -no-start -shell bash scripts/cibw_before_all_windows.sh

我不明白所有的标志是什么意思,所以可能是其中一个标志错了。cibw_before_all_windows.sh脚本如下所示:

代码语言:javascript
代码运行次数:0
运行
复制
pacman -S --noconfirm --needed  \
           bison  \
           flex  \
           icu-devel  \
           swig

export CPPFLAGS="-I/c/msys2/usr/include ${CPPFLAGS}"
export LDFLAGS="-L/c/msys2/usr/lib ${LDFLAGS}"
export PATH="/c/msys2/usr/bin/:${PATH}"
export PKG_CONFIG_PATH="/c/msys2/usr/lib/pkgconfig:${PKG_CONFIG_PATH}"


cd hfst_src/
autoreconf -fvi
./configure --with-unicode-handler=icu
make
make check V=1 VERBOSE=1
make install
cd ..

python setup.py build_ext

该脚本在./configure --with-unicode-handler=icu上失败,并显示以下输出:

代码语言:javascript
代码运行次数:0
运行
复制
...
  checking for ld used by g++... C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe
  checking if the linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
  checking whether the g++ linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
  checking for g++ option to produce PIC... -DDLL_EXPORT -DPIC
  checking if g++ PIC flag -DDLL_EXPORT -DPIC works... yes
  checking if g++ static flag -static works... yes
  checking if g++ supports -c -o file.o... yes
  checking if g++ supports -c -o file.o... (cached) yes
  checking whether the g++ linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
  checking dynamic linker characteristics... Win32 ld.exe
  checking how to hardcode library paths into programs... immediate
  checking for gawk... (cached) gawk
  checking how to run the C preprocessor... gcc -E
  checking for bison... bison -y
  checking for flex... flex
  checking for lex output file root... lex.yy
  checking for lex library... none needed
  checking for library containing yywrap... no
  checking whether yytext is a pointer... yes
  checking for getopts... false
  checking for a Python interpreter with version >= 3.0... python
  checking for python... /mingw64/bin/python
  checking for python version... 3.8
  checking for python platform... win32
  checking for python script directory... ${prefix}/lib/python3.8/site-packages
  checking for python extension module directory... ${exec_prefix}/lib/python3.8/site-packages
  configure: WARNING: Building hfst successfully requires flex newer than 2.5.33 on some platforms. Unless you are building with pre-flex-generated sources, building will probably fail.
  checking whether ln -s works... no, using cp -pR
  checking whether make sets $(MAKE)... (cached) yes
  checking for doxygen... no
  checking for main in -ldl... no
  checking for main in -lpthread... yes
  checking for main in -lm... yes
  checking for ncurses.h... no
  checking for curses.h... no
  checking for termcap.h... yes
  checking for tgetent in -ltermcap... yes
  checking for icu-config... /usr/bin/icu-config
  checking for pkg-config... /mingw64/bin/pkg-config
  ### icu-config: Can't find /usr/lib/msys-icuuc68.dll - ICU prefix is wrong.
  ###      Try the --prefix= option 
  ###      or --detect-prefix
  ###      (If you want to disable this check, use  the --noverify option)
  ### icu-config: Exitting.
  expr: syntax error: unexpected argument '50'
  configure: error: in `/d/a/hfst-python/hfst-python/hfst_src':
  configure: error: --with-unicode-handler=icu requested but icu>=50 not found
  See `config.log' for more details
  Error: Command C:\msys64\msys2_shell.cmd -mingw64 -defterm -here -full-path -no-start -shell bash scripts/cibw_before_all_windows.sh failed with code 1. None

从输出中看,configure似乎找不到我全新安装的flexbisonicu。如何让configure查看来自pacman的安装?有没有更好的方法来解决这个问题?

编辑

pacman安装的版本是...

代码语言:javascript
代码运行次数:0
运行
复制
bison-3.7.4-1
flex-2.6.4-1
icu-devel-68.2-1
swig-4.0.2-1

我说它看不到我的flexbison的原因是它抱怨configure: WARNING: Building hfst successfully requires flex newer than 2.5.33 on some platforms. Unless you are building with pre-flex-generated sources, building will probably fail.。由于pacman的flex版本是flex-2.6.4-1,我假设configure在系统的其他地方找到了不同的版本。这让我怀疑它也没有找到任何其他依赖项的pacman版本。

EN

回答 2

Stack Overflow用户

发布于 2021-03-06 16:46:37

pacman为这些包安装.pc文件的位置添加到环境变量PKG_CONFIG_PATH

票数 0
EN

Stack Overflow用户

发布于 2021-03-06 23:13:46

从输出中可以看出,configure无法找到全新安装的flex、bison和icu。

不,这看起来一点也不像问题。configure输出显示它看到了Flex、Bison和ICU:

正在检查野牛...bison -y正在检查flex...flex

..。

正在检查icu-config.../usr/bin/icu-config

诊断输出由来自icu-configconfigure的消息组成

ICU -config:找不到/usr/lib/msys-icuuc68.dll -ICU前缀错误。请尝试使用-- ### =选项###或-- ### -prefix ### (如果您想禁用此检查,请使用--noverify选项)退出icu-config:退出。expr:语法错误:意外参数'50‘configure: error: in /d/a/hfst-python/hfst-python/hfst\_src': configure: error: --with-unicode-handler=icu requested but icu>=50 not found Seeconfig.log’有关更多详细信息

关键问题似乎是您的ICU安装损坏了,这将是您安装它的(pacman)包的问题。icu-config程序应该属于该包,如果它找不到或无法识别其他包组件,那么它要么是完全损坏的,要么是与包的其余部分不匹配。在您的控制下更直接地针对msys2安装进行验证是值得的,但是假设您可以这样做,则应该将其作为打包错误提出。我猜这会被用于msys2项目。

configure的诊断结果看起来像是icu-config故障的后续结果,这本身可能不是问题。

如何配置才能从pacman查看安装?

它能看到它们。它们就是坏了(无论如何,icu-devel包是坏的)。

有没有更好的方法来解决这个问题?

我认为你的方法总体上是好的。我建议您在将其设置为GitHub操作之前,在本地msys2安装上进行测试。对于您目前面临的问题,一种可能的解决方法是向pacman询问每个包的特定已知良好版本,而不是让它选择最新的可用版本。因为这样做会使您的构建更具可重复性,所以您可能会认为这是对您的方法的改进。

或者,icu-config输出提供了一些其他可能性,特别是将--detect-prefix选项或--noverify选项添加到icu-config命令行。这将在configure中完成,如果它真的解决了问题,那么它可能比等待通过msys2的进程解决问题要快得多(没有针对Msys2的问题;只是这些事情需要时间)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66502556

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档