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

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

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:

$ CC="gcc" CFLAGS="-g -O3" ./configure --host="x86_64-pc-Cygwin"

loading cache ./config.cache
checking host system type... Invalid configuration 'x86_64-pc-Cygwin': machine 'x86_64-pc' not recognized

checking for prespecified compiler options... yes
    Using default CC:       gcc
    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
    Using default CFLAGS:   -g -O3
    Using default LDFLAGS:
checking for gcc... gcc
checking whether the C compiler (gcc -g -O3) works... no
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:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:593: checking host system type
configure:619: checking for prespecified compiler options
configure:716: checking for gcc
configure:829: checking whether the C compiler (gcc -g -O3 ) works
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
configure: failed program was:

#line 840 "configure"
#include "confdefs.h"

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:

$ CC="gcc" CFLAGS="-g -O3" ./configure --host="x86_64-pc-Cygwin"

loading cache ./config.cache
checking host system type... Invalid configuration `x86_64-pc-Cygwin': machine `x86_64-pc' not recognized

checking for prespecified compiler options... yes
    Using default CC:       gcc
    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
    Using default CFLAGS:   -g -O3
    Using default LDFLAGS:
checking for gcc... gcc
checking whether the C compiler (gcc -g -O3) works... no
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:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:593: checking host system type
configure:619: checking for prespecified compiler options
configure:716: checking for gcc
configure:829: checking whether the C compiler (gcc -g -O3 ) works
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
configure: failed program was:

#line 840 "configure"
#include "confdefs.h"

main(){return(0);}

答案1

得分: 1

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

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

$ tar -xf co031219.tgz

$ cd concorde

$ ./configure --host=x86_64-pc-cygwin
checking host system type... 无效的配置 'x86_64-pc-cygwin':不识别的机器 'x86_64-pc'

checking for prespecified compiler options... no
checking for gcc... gcc
..
creating VERIFY/Makefile
creating INCLUDE/config.h

$ make
cat ./INCLUDE/config.h ..
..
make[2]: 离开目录 '/pub/tmp/concorde/COMBS'
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
make[1]: 离开目录 '/pub/tmp/concorde/TSP'
make[1]: 进入目录 '/pub/tmp/concorde/UTIL'
make[1]: 无需为 'all' 做任何事情。
make[1]: 离开目录 '/pub/tmp/concorde/UTIL'
make[1]: 进入目录 '/pub/tmp/concorde/VERIFY'
make[1]: 无需为 'all' 做任何事情。
make[1]: 离开目录 '/pub/tmp/concorde/VERIFY'

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

$ find . -name "*.exe"
./CUT/mincut.exe
./EDGEGEN/edgegen.exe
./FMATCH/fmatch.exe
./LINKERN/linkern.exe
./LOCALCUT/localcut.exe
./TOOLS/edg2len.exe
./TOOLS/edgunion.exe
./TOOLS/fconvert.exe
./TOOLS/prob2tsp.exe
./TOOLS/showres.exe
./TOOLS/tourchk.exe
./TOOLS/tourlen.exe
./TSP/concorde.exe

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

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

$ cygcheck -c gcc-core make cygwin-devel
Cygwin Package Information
Package              Version        Status
cygwin-devel         3.4.6-1        OK
gcc-core             11.3.0-1       OK
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

$ tar -xf co031219.tgz

$ cd concorde

$ ./configure --host=x86_64-pc-cygwin
checking host system type... Invalid configuration `x86_64-pc-cygwin': machine `x86_64-pc' not recognized

checking for prespecified compiler options... no
checking for gcc... gcc
..
creating VERIFY/Makefile
creating INCLUDE/config.h

$ make
cat ./INCLUDE/config.h ..
..
make[2]: Leaving directory '/pub/tmp/concorde/COMBS'
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
make[1]: Leaving directory '/pub/tmp/concorde/TSP'
make[1]: Entering directory '/pub/tmp/concorde/UTIL'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/pub/tmp/concorde/UTIL'
make[1]: Entering directory '/pub/tmp/concorde/VERIFY'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/pub/tmp/concorde/VERIFY'

and it seems to have built all programs

$ find . -name "*.exe"
./CUT/mincut.exe
./EDGEGEN/edgegen.exe
./FMATCH/fmatch.exe
./LINKERN/linkern.exe
./LOCALCUT/localcut.exe
./TOOLS/edg2len.exe
./TOOLS/edgunion.exe
./TOOLS/fconvert.exe
./TOOLS/prob2tsp.exe
./TOOLS/showres.exe
./TOOLS/tourchk.exe
./TOOLS/tourlen.exe
./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

$ cygcheck -c gcc-core make cygwin-devel
Cygwin Package Information
Package              Version        Status
cygwin-devel         3.4.6-1        OK
gcc-core             11.3.0-1       OK
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:

确定