Hi, I tried to install gambit with the installer. The interpreter worked, the compiler failed to compile a simple file (xcode and its command lines tools were installed). I finally installed apple's old gcc4.2 and then gambit with HomeBrew (the gambit formula allows to specify a compiler) and it seems to work fine. Well I might get some problems when linking with some 10.9 libs, I have no idea whether apple's previous and present compilers produce compatible binaries or not. Any thoughts, similar troubles related to this topic? Thanks, Denis
Afficher les réponses par date
On May 5, 2014, at 12:34 PM, Denis Fourt denis.prog@hotmail.com wrote:
Hi,
I tried to install gambit with the installer. The interpreter worked, the compiler failed to compile a simple file (xcode and its command lines tools were installed). I finally installed apple's old gcc4.2 and then gambit with HomeBrew (the gambit formula allows to specify a compiler) and it seems to work fine. Well I might get some problems when linking with some 10.9 libs, I have no idea whether apple's previous and present compilers produce compatible binaries or not.
Any thoughts, similar troubles related to this topic?
Thanks,
Denis
Can you open an issue for this on github? (https://github.com/feeley/gambit/issues)
It would help if you could give the error messages that were produced. You should try to call gsc with the -verbose option so that the invocations of the C compiler are shown.
Marc
Issue #72 describes the same problem. I have just done some tests and compared between gsc from the installer and HomeBrew Ok here is the error message : The full verbose (gsc -verbose test.scm)Parsing: fact-aux fact Compiling: fact-auxfact Dumping: #<primitive | test|> #<procedure fact-aux> #<procedure fact> Compilation finished.gcc -arch x86_64 -m64 -arch x86_64 -m64 -bundle -Wno-unused -Wno-write-strings -O1 -fno-math-errno -fschedule-insns2 -fno-trapping-math -fno-strict-aliasing -fwrapv -fomit-frame-pointer -fPIC -fno-common -mieee-fp -flat_namespace -undefined suppress -D___SINGLE_HOST -D___DYNAMIC -I"/Library/Gambit-C/v4.7.2/include" -o "test.o1" test.c clang: error: unknown argument: '-fschedule-insns2' [-Wunused-command-line-argument-hard-error-in-future]clang: note: this will be a hard error (cannot be downgraded to a warning) in the future*** ERROR IN ##main -- C compilation or link failed while compiling "test.scm" Here is the code:;(standard-bindings) (extended-bindings) (block))(define (fact-aux n a) (if (<= n 1) a (fact-aux (- n 1) (* a n)))) (define (fact n) (fact-aux n 1)) **************************************************Then I reinstalled the HomeBrew gambit and I got this : Parsing: fact-aux fact Compiling: fact-auxfact Dumping: #<primitive | test|> #<procedure fact-aux> #<procedure fact> Compilation finished.clang -bundle -Wno-unused -Wno-write-strings -O1 -fno-math-errno -fno-strict-aliasing -fwrapv -fomit-frame-pointer -fPIC -fno-common -flat_namespace -undefined suppress -D___DYNAMIC -I"/usr/local/Cellar/gambit-scheme/4.7.2/include" -o "test.o1" test.c ************************** to compare with (from the installer)gcc -arch x86_64 -m64 -arch x86_64 -m64 -bundle -Wno-unused -Wno-write-strings -O1 -fno-math-errno -fschedule-insns2 -fno-trapping-math -fno-strict-aliasing -fwrapv -fomit-frame-pointer -fPIC -fno-common -mieee-fp -flat_namespace -undefined suppress -D___SINGLE_HOST -D___DYNAMIC -I"/Library/Gambit-C/v4.7.2/include" -o "test.o1" test.c *************************************************** To my surprise the HomeBrew gsc uses clang and not the gcc-4.2 though it was given the path at installation. Same gambit versions but different command lines !!!!! -fschedule-insns2 seems to be one part of the problem Thanks, Denis
Subject: Re: [gambit-list] macos 10.9 From: feeley@iro.umontreal.ca Date: Mon, 5 May 2014 12:50:04 -0400 CC: gambit-list@iro.umontreal.ca To: denis.prog@hotmail.com
On May 5, 2014, at 12:34 PM, Denis Fourt denis.prog@hotmail.com wrote:
Hi,
I tried to install gambit with the installer. The interpreter worked, the compiler failed to compile a simple file (xcode and its command lines tools were installed). I finally installed apple's old gcc4.2 and then gambit with HomeBrew (the gambit formula allows to specify a compiler) and it seems to work fine. Well I might get some problems when linking with some 10.9 libs, I have no idea whether apple's previous and present compilers produce compatible binaries or not.
Any thoughts, similar troubles related to this topic?
Thanks,
Denis
Can you open an issue for this on github? (https://github.com/feeley/gambit/issues)
It would help if you could give the error messages that were produced. You should try to call gsc with the -verbose option so that the invocations of the C compiler are shown.
Marc
On May 5, 2014, at 2:23 PM, Denis Fourt denis.prog@hotmail.com wrote:
To my surprise the HomeBrew gsc uses clang and not the gcc-4.2 though it was given the path at installation.
Same gambit versions but different command lines !!!!!
-fschedule-insns2 seems to be one part of the problem
Thanks,
The problem is that the Gambit compiler installed by the prebuilt installer has been configured to use the C compiler that was used when building the installer. Moreover the “preferred” C compiler when installing Gambit is not clearly defined. A developper could in fact have different C compilers for different projects. One approach would be to have a compiler switch to select the C compiler to use, with all of the necessary otions. But this seems complex for a novice user to use. People usually prefer when it “just works”.
A simple solution would be to drop the use of -fschedule-insns2 so that clang will not raise an error if it is the C compiler that ends up being used. That option is for performance reasons but as I recall it doesn’t improve performance by very much.
Marc
On 05/05/2014 03:11 PM, Marc Feeley wrote:
A simple solution would be to drop the use of -fschedule-insns2 so that clang will not raise an error if it is the C compiler that ends up being used. That option is for performance reasons but as I recall it doesn’t improve performance by very much.
With older gcc's, it used to improve it a lot (sometimes doubling the speed or more).
Perhaps you should just benchmark it with and without -fschedule-insns2. I just did some partial benchmarks with gcc-4.8.2 on my Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz and didn't notice much difference.
Brad
Well, the gsc from the pre-built calls gcc which on macos 10.9 seems to be clang in fact. HomeBrew provides a precompiled gambit actually and I do not know which compiler was used, likely clang. Denis
Subject: Re: [gambit-list] macos 10.9 From: feeley@iro.umontreal.ca Date: Mon, 5 May 2014 15:11:44 -0400 CC: gambit-list@iro.umontreal.ca To: denis.prog@hotmail.com
On May 5, 2014, at 2:23 PM, Denis Fourt denis.prog@hotmail.com wrote:
To my surprise the HomeBrew gsc uses clang and not the gcc-4.2 though it was given the path at installation.
Same gambit versions but different command lines !!!!!
-fschedule-insns2 seems to be one part of the problem
Thanks,
The problem is that the Gambit compiler installed by the prebuilt installer has been configured to use the C compiler that was used when building the installer. Moreover the “preferred” C compiler when installing Gambit is not clearly defined. A developper could in fact have different C compilers for different projects. One approach would be to have a compiler switch to select the C compiler to use, with all of the necessary otions. But this seems complex for a novice user to use. People usually prefer when it “just works”.
A simple solution would be to drop the use of -fschedule-insns2 so that clang will not raise an error if it is the C compiler that ends up being used. That option is for performance reasons but as I recall it doesn’t improve performance by very much.
Marc