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);}
  • Well, error message says your --host argument is invalid. – Allan Wind May 25 '23 at 03:16
  • 1
    Did you see this https://stackoverflow.com/questions/21990021/how-to-determine-host-value-for-configure-when-using-cross-compiler ? – Allan Wind May 25 '23 at 03:17
  • @AllanWind I'm completely a novice with this, so my apologies if this is basic. I've seen some posts that suggest using autoconf, but I'm not really understanding how to do it properly. I was hoping for the best asking all this to chatgpt, but I only got "x86_64-pc-Cygwin". How do I know if what I need is Native, Cross, Cross-native or Canadian? I got this using --help `Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST]` – ale.tenorio May 25 '23 at 03:36
  • Are you cross compiling? – Allan Wind May 25 '23 at 03:42
  • I'm not really sure, but from what I unterstand I think I am. I'm doing all this to run an R package with the Concorde extension. This is from wikipedia and I believe it fits with my purpose: "executable code for a platform other than the one on which the compiler is running". – ale.tenorio May 25 '23 at 03:50
  • I am afraid that I will not be of much help to you (never used cygwin, and it's been a long time since I used windows). Have you tried `--host=x86_64-w64-mingw32`? – Allan Wind May 25 '23 at 03:59
  • No luck :/ thank you anyway, Allan! I'll keep trying – ale.tenorio May 25 '23 at 04:03
  • you need to read the config.log to see the reason of the failure. If you are compiling R for Windows you need to use the same compiler , maybe Mingw64 one. The gcc Cygwin compiler will work for the Cygwin R package only. – matzeri May 25 '23 at 10:44
  • @matzeri This is on the download information "Executable versions of Concorde and Linkern are available for Linux, Solaris, and Windows/Cygwin." Does this mean I can only use Cygwin for my use case? P.D. I added the config.log to the post. – ale.tenorio May 25 '23 at 18:42
  • giving the `gcc ...` command line it works on my system if I remove the `#include "confdefs.h"` that of course I don't have. Write a `conftest.c` with the given content and try on your system – matzeri May 25 '23 at 19:20
  • @matzeri I did this for the conftest.c file `#include "confdefs.h" int main() { return 0; } ` and then `gcc conftest.c`, but it didn't display anything on the console – ale.tenorio May 25 '23 at 21:22
  • Is the compiler working ? – matzeri May 25 '23 at 21:30
  • @matzeri i don't think it is. I tried with another test file. It should create an executable file with the name of my .c, right? It isn't doing that. – ale.tenorio May 25 '23 at 21:58
  • `-o conftest` means to create a file called so – matzeri May 26 '23 at 14:01

1 Answers1

1

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
matzeri
  • 8,062
  • 2
  • 15
  • 16
  • Would `$ tar -tf co031219.tgz` have something to do that it isn't working out for me? I extracted the files with winzip. That's the only step I can spot that is different from yours. I verified and I also have those packages with the same versions installed. – ale.tenorio May 25 '23 at 21:05
  • sorry copying mistake. It is `-xf` of course – matzeri May 25 '23 at 21:29