0

Trying to install Concorde TSP solver on Windows/Cygwin (ultimately for use in the R package TSP) and I'm running into errors when configuring the software. I've installed cygwin and followed the instructions here to get Concorde set up in cygwin, but when I run the configure file, I get the error "C compiler cannot create executables".

$ CC="gcc" CFLAGS="-g -O3" ./configure --host=i686-pc-cygwin
loading cache ./config.cache
checking host system type... i686-pc-cygwin
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.

Here is the output from the config.log file as well:

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);}

There's another question with essentially the same error here, but there doesn't seem to be any real solutions to the problem other than someone saying they didn't run into the issue on their system. Here's the output I get from running cygcheck on the packages that should be required to configure and compile Concorde.

$ cygcheck -c gcc-core make cygwin-devel
Cygwin Package Information
Package              Version        Status
cygwin-devel         3.4.8-1        OK
gcc-core             11.4.0-1       OK
make                 4.4.1-2        OK

I've tried reinstalling cygwin and making sure I have the latest versions for all the packages I think I'd need in the cygwin setup, and it doesn't seem to have helped.

mda2894
  • 1
  • 2
  • What happens if you run `gcc` on the command line by itself? Maybe it's not on the path, and your `CC` definition should give a full path to it. – user2554330 Aug 20 '23 at 15:33
  • @user2554330 I'm able to run gcc --help and gcc --version and get the expected output, so it seems to be finding gcc fine. But when I try to compile a simple "hello, world" test script with gcc test.c, I don't get a compiled exe or any errors. – mda2894 Aug 20 '23 at 20:09
  • I tried building Concorde TSP Solver with MSYS2+MinGW-w64 (instead of cygwin), and that builds just fine. – Brecht Sanders Aug 24 '23 at 19:05
  • @BrechtSanders I was finally able to get it to configure with clang instead of gcc, but then I couldn’t compile because it couldn’t find my QSopt library, even though I tried everything I could to make sure it was on the path and specified in the configure options. I might have to try building in another environment because I’ve had nothing but problems with cygwin. Thanks for the tip. – mda2894 Aug 25 '23 at 02:24

0 Answers0