gambit / gambit

Gambit is an efficient implementation of the Scheme programming language.
http://gambitscheme.org/
1.31k stars 167 forks source link

"--enable-single-host" option not recognized on the latest commit when also using "--enable-cplusplus" #502

Closed philsuero closed 4 years ago

philsuero commented 4 years ago

Tested on: Darwin 18.7.0 Darwin Kernel Version 18.7.0 Linux 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86-64 GNU/Linux

Latest commit: 8ab6cc3e94676ef4961f992d595c327932edc2fb 4.9.3 commit: baf7de67f6d800821412fe83a8d9e9e09faeb490

Issue: --enable-single-host option not recognized when using the following options on the latest commit:

C=/usr/local/Cellar/gcc/9.2.0_3/bin/gcc-9 \
CXX=/usr/local/Cellar/gcc/9.2.0_3/bin/g++-9 \
CXXFLAGS="-std=c++11 -Og -g -fstack-protector-all" \
./configure --enable-single-host --enable-cplusplus \
--prefix=/path/to/gambit-test

The following message appears on make output on mac and linux only on the latest commit (on gambit 4.9.3, this message is not showed):

**************************************************************************
***                                                                    ***
*** The option "--enable-single-host" was not specified to the         ***
*** configure script.  The Gambit system will compile correctly but    ***
*** typically the executables will run considerably slower than when   ***
*** "--enable-single-host" is specified.  On the other hand the build  ***
*** with "--enable-single-host" is typically slower and requires lots  ***
*** of RAM memory (>= 1 GB).  If you are willing to wait for the       ***
*** longer build, try the configure option "--enable-single-host".     ***
***                                                                    ***
**************************************************************************

But, when running configure without the --enable-cplusplus:

C=/usr/local/Cellar/gcc/9.2.0_3/bin/gcc-9 \
CXX=/usr/local/Cellar/gcc/9.2.0_3/bin/g++-9 \
CXXFLAGS="-std=c++11 -Og -g -fstack-protector-all" \
./configure --enable-single-host \
--prefix=/path/to/gambit-test

It gives me the following message on configure only on mac (no message about --enable-single-host shows on linux here):

**************************************************************************
***                                                                    ***
*** The option "--enable-single-host" was specified to the configure   ***
*** script and a LLVM C compiler is being used (clang or LLVM GCC).    ***
*** This combination is not recommended as the build may require a     ***
*** lot of memory and a very long time (over 30 minutes on a fairly    ***
*** fast machine with clang 3.0).  Configuring with GNU GCC will give  ***
*** a faster build (1 min on the same machine with GNU GCC 4.2.1) and  ***
*** the executable will be faster.                                     ***
***                                                                    ***
**************************************************************************
philsuero commented 4 years ago

Also, please note, I am using a GNU GCC (according to homebrew) and the script complains it is a CLANG GCC.

Edit: My bad. There was a problem with my paste on terminal. I should set the CC flag, not the C one.

The rest of the issue remains.

feeley commented 4 years ago

Could you put the whole trace of the build on a pastebin? I suspect that the messages you are seeing come from the bootstrap (which does another ./configure). I always put the CC=gcc-9 at the end of the configure command, and maybe this propagates it better to the second ./configure.

philsuero commented 4 years ago

So, this is the outuput for the ./configure script.

And this is the output of the make

Edit: For other people's future reference, I'm adding the content in files, for the case the pastebins expires.

configure-output-first-reply.txt make-output-first-reply.txt

feeley commented 4 years ago

You are still using C=... instead of CC=...

philsuero commented 4 years ago

oh gosh.

Ok, I ran it again. I double checked this time.

But still, on lines 381 and 1028 of make there were --enable-single-host warnings, even if I configure it without --enable-cplusplus.

$ ./configure --enable-single-host \
> --prefix=/path/to/gambit-test \
> CC=/usr/local/Cellar/gcc/9.3.0/bin/gcc-9 \
> CXX=/usr/local/Cellar/gcc/9.3.0/bin/g++-9 \
> CXXFLAGS="-std=c++11 -Og -g -fstack-protector-all" 

Here are the outputs: configure-output.txt make-output.txt

feeley commented 4 years ago

These are normal messages because of the bootstrapping process which does 2 runs of ./configure (in the boot subdirectory) for the bootstrap compiler in addition to the main run of ./configure.

The configure flags that are specified at the main run of ./configure are not propagated to the "boot" runs of ./configure for the following reasons:

1) the boot directory contains a previous release of Gambit that may not support the same configure flags as the main repository so it would be wrong to blindly propagate configure options to the bootstrap runs of ./configure

2) the use of --enable-single-host may cause bootstrapping problems because some C compilers will fail to build the gsc-boot compiler, either because it requires too much memory or it triggers a bug in the C compiler (I have seen it before)

So it is safer to build the gsc-boot with configure flags that are known to not cause issues.

Note however that after building gsc-boot the main Gambit will be built with the configure options that were specified initially, so in the end you get what you want.

pclouds commented 4 years ago

Should some of this be noted in INSTALL.txt (or perhaps not, I don't know much about Gambit to tell, just a suggestion)