配置过程中出现错误:C编译器无法创建可执行文件(Concorde TSP)

huangapple go评论92阅读模式
英文:

Error during configuration: C compiler cannot create executables (Concorde TSP)

问题

I'm currently experiencing an issue while trying to install and configure a software package (Concorde TSP solver) on my Windows machine using Cygwin. I've followed the installation instructions provided, but I keep encountering the following error:

  1. $ CC="gcc" CFLAGS="-g -O3" ./configure --host="x86_64-pc-Cygwin"
  2. loading cache ./config.cache
  3. checking host system type... Invalid configuration 'x86_64-pc-Cygwin': machine 'x86_64-pc' not recognized
  4. checking for prespecified compiler options... yes
  5. Using default CC: gcc
  6. Using default CPPFLAGS: -ansi -pedantic -Wall -W -Wtraditional -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs
  7. Using default CFLAGS: -g -O3
  8. Using default LDFLAGS:
  9. checking for gcc... gcc
  10. checking whether the C compiler (gcc -g -O3) works... no
  11. configure: error: installation or configuration problem: C compiler cannot create executables.

I have installed the dependencies with Cygwin: gcc-core, gcc-g++. I've also set the necessary environment variables, CC and CFLAGS, as mentioned in the installation instructions.

However, the issue persists.

I have checked that the gcc compiler is indeed installed, but it seems to be failing to create executables during the configuration process. I suspect that there might be an issue with the host system type or some other configuration setting.

  • Cygwin version: cygcheck (cygwin) 3.4.6-1.x86_64
  • gcc version: gcc (GCC) 11.3.0

config.log message:

  1. This file contains any messages produced by compilers while
  2. running configure, to aid debugging if configure makes a mistake.
  3. configure:593: checking host system type
  4. configure:619: checking for prespecified compiler options
  5. configure:716: checking for gcc
  6. configure:829: checking whether the C compiler (gcc -g -O3 ) works
  7. configure:845: gcc -o conftest -g -O3 -ansi -pedantic -Wall -W -Wtraditional -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs conftest.c 1>&5
  8. configure: failed program was:
  9. #line 840 "configure"
  10. #include "confdefs.h"
  11. main(){return(0);}
英文:

I'm currently experiencing an issue while trying to install and configure a software package (Concorde TSP solver) on my Windows machine using Cygwin. I've followed the installation instructions provided, but I keep encountering the following error:

  1. $ CC="gcc" CFLAGS="-g -O3" ./configure --host="x86_64-pc-Cygwin"
  2. loading cache ./config.cache
  3. checking host system type... Invalid configuration `x86_64-pc-Cygwin': machine `x86_64-pc' not recognized
  4. checking for prespecified compiler options... yes
  5. Using default CC: gcc
  6. Using default CPPFLAGS: -ansi -pedantic -Wall -W -Wtraditional -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs
  7. Using default CFLAGS: -g -O3
  8. Using default LDFLAGS:
  9. checking for gcc... gcc
  10. checking whether the C compiler (gcc -g -O3) works... no
  11. configure: error: installation or configuration problem: C compiler cannot create executables.

I have installed the this dependencies with Cygwin: gcc-core, gcc-g++. I've also set the necessary environment variables, CC and CFLAGS, as mentioned in the installation instructions.
>$ CC="gcc" CFLAGS="-g -O3" ./configure

However, the issue persists.

I have checked that the gcc compiler is indeed installed, but it seems to be failing to create executables during the configuration process. I suspect that there might be an issue with the host system type or some other configuration setting.

  • Cygwin version: cygcheck (cygwin) 3.4.6-1.x86_64
  • gcc version: gcc (GCC) 11.3.0

config.log message:

  1. This file contains any messages produced by compilers while
  2. running configure, to aid debugging if configure makes a mistake.
  3. configure:593: checking host system type
  4. configure:619: checking for prespecified compiler options
  5. configure:716: checking for gcc
  6. configure:829: checking whether the C compiler (gcc -g -O3 ) works
  7. configure:845: gcc -o conftest -g -O3 -ansi -pedantic -Wall -W -Wtraditional -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs conftest.c 1>&5
  8. configure: failed program was:
  9. #line 840 "configure"
  10. #include "confdefs.h"
  11. main(){return(0);}

答案1

得分: 1

在我的系统上,在下载了最后一个版本(日期为2003年12月19日)之后,编译顺利完成。

下载链接:https://www.math.uwaterloo.ca/tsp/concorde/downloads/downloads.htm

  1. $ tar -xf co031219.tgz
  2. $ cd concorde
  3. $ ./configure --host=x86_64-pc-cygwin
  4. checking host system type... 无效的配置 'x86_64-pc-cygwin':不识别的机器 'x86_64-pc'
  5. checking for prespecified compiler options... no
  6. checking for gcc... gcc
  7. ..
  8. creating VERIFY/Makefile
  9. creating INCLUDE/config.h
  10. $ make
  11. cat ./INCLUDE/config.h ..
  12. ..
  13. make[2]: 离开目录 '/pub/tmp/concorde/COMBS'
  14. gcc -g -O2 -o concorde concorde.o tsp.a ../PQ/pq.a ../VERIFY/verify.a ../LOCALCUT/localcut.a ../TINY/tiny.a ../LINKERN/linkern.a ../EDGEGEN/edgegen.a ../KDTREE/kdtree.a ../FMATCH/fmatch.a ../UTIL/util.a ../BIGGUY/bigguy.a ../CUT/cut.a ../HELDKARP/heldkarp.a ../LP/lp.a ../COMBS/combs.a -liberty -lm
  15. make[1]: 离开目录 '/pub/tmp/concorde/TSP'
  16. make[1]: 进入目录 '/pub/tmp/concorde/UTIL'
  17. make[1]: 无需为 'all' 做任何事情。
  18. make[1]: 离开目录 '/pub/tmp/concorde/UTIL'
  19. make[1]: 进入目录 '/pub/tmp/concorde/VERIFY'
  20. make[1]: 无需为 'all' 做任何事情。
  21. make[1]: 离开目录 '/pub/tmp/concorde/VERIFY'

看起来已经成功构建了所有程序。

  1. $ find . -name "*.exe"
  2. ./CUT/mincut.exe
  3. ./EDGEGEN/edgegen.exe
  4. ./FMATCH/fmatch.exe
  5. ./LINKERN/linkern.exe
  6. ./LOCALCUT/localcut.exe
  7. ./TOOLS/edg2len.exe
  8. ./TOOLS/edgunion.exe
  9. ./TOOLS/fconvert.exe
  10. ./TOOLS/prob2tsp.exe
  11. ./TOOLS/showres.exe
  12. ./TOOLS/tourchk.exe
  13. ./TOOLS/tourlen.exe
  14. ./TSP/concorde.exe

消息 Invalid configuration x86_64-pc-cygwin 不足为奇,因为在2003年时还没有Cygwin 64位版本。

看起来只需要基本的软件包:

  1. $ cygcheck -c gcc-core make cygwin-devel
  2. Cygwin Package Information
  3. Package Version Status
  4. cygwin-devel 3.4.6-1 OK
  5. gcc-core 11.3.0-1 OK
  6. make 4.4.1-2 OK
英文:

On my system, it builds fine after downloading the last version dated Dec 19, 2003
https://www.math.uwaterloo.ca/tsp/concorde/downloads/downloads.htm

  1. $ tar -xf co031219.tgz
  2. $ cd concorde
  3. $ ./configure --host=x86_64-pc-cygwin
  4. checking host system type... Invalid configuration `x86_64-pc-cygwin': machine `x86_64-pc' not recognized
  5. checking for prespecified compiler options... no
  6. checking for gcc... gcc
  7. ..
  8. creating VERIFY/Makefile
  9. creating INCLUDE/config.h
  10. $ make
  11. cat ./INCLUDE/config.h ..
  12. ..
  13. make[2]: Leaving directory '/pub/tmp/concorde/COMBS'
  14. gcc -g -O2 -o concorde concorde.o tsp.a ../PQ/pq.a ../VERIFY/verify.a ../LOCALCUT/localcut.a ../TINY/tiny.a ../LINKERN/linkern.a ../EDGEGEN/edgegen.a ../KDTREE/kdtree.a ../FMATCH/fmatch.a ../UTIL/util.a ../BIGGUY/bigguy.a ../CUT/cut.a ../HELDKARP/heldkarp.a ../LP/lp.a ../COMBS/combs.a -liberty -lm
  15. make[1]: Leaving directory '/pub/tmp/concorde/TSP'
  16. make[1]: Entering directory '/pub/tmp/concorde/UTIL'
  17. make[1]: Nothing to be done for 'all'.
  18. make[1]: Leaving directory '/pub/tmp/concorde/UTIL'
  19. make[1]: Entering directory '/pub/tmp/concorde/VERIFY'
  20. make[1]: Nothing to be done for 'all'.
  21. make[1]: Leaving directory '/pub/tmp/concorde/VERIFY'

and it seems to have built all programs

  1. $ find . -name "*.exe"
  2. ./CUT/mincut.exe
  3. ./EDGEGEN/edgegen.exe
  4. ./FMATCH/fmatch.exe
  5. ./LINKERN/linkern.exe
  6. ./LOCALCUT/localcut.exe
  7. ./TOOLS/edg2len.exe
  8. ./TOOLS/edgunion.exe
  9. ./TOOLS/fconvert.exe
  10. ./TOOLS/prob2tsp.exe
  11. ./TOOLS/showres.exe
  12. ./TOOLS/tourchk.exe
  13. ./TOOLS/tourlen.exe
  14. ./TSP/concorde.exe

the message Invalid configuration x86_64-pc-cygwin is not a surprise as in 2003 there was no Cygwin 64 bit.

It seems to require just vanilla packages

  1. $ cygcheck -c gcc-core make cygwin-devel
  2. Cygwin Package Information
  3. Package Version Status
  4. cygwin-devel 3.4.6-1 OK
  5. gcc-core 11.3.0-1 OK
  6. make 4.4.1-2 OK

huangapple
  • 本文由 发表于 2023年5月25日 10:56:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/76328621.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定