|
From: Arthur N. <ac...@ca...> - 2012-01-09 12:49:59
|
On Sun, 8 Jan 2012, mark brethen wrote:
> An update to my previous post:
>
> Macports handles the configure and build phases; all that needs to be
passed are the arguments, it handles all the environment variables. One
drawback is that I can't pass both --with-csl and --with-psl. So I had to
override macports' configure phase. At first, I used:
>
> configure {
> system -W ${worksrcpath} "./configure --prefix=${prefix} --with-csl ; ./configure --with-psl"
> }
>
As regards this I might note that the CSL and PSL variants of Reduce are
for almost all purposes ALTERNATIVES rather than being things where
installing one should automatically install the other. I guess there are
three sorts of people in the world:
(1) Developers who are not just keen on getting their Reduce package in
good condition, but who wish to be properly careful that the code involved
is compatible with both the CSL and the PSL-supported variants. Of all the
people who download and install Reduce I believe these count as a tiny
minority.
(2) General users. They only need EITHER the PSL or the CSL based version
of Reduce. Installing both just clutters up their disc space, makes the
installation process slower and in general causes confusion! There is of
course a potential uncertainty as to which to choose, but even if theyu
install both to start with after a while tidiness will cause them to
de-install the one that does not suit them.
(3) Extreme users. Some (but ony a VERY FEW) users will be trying
calculations so large that they fail on one or other version. Or they may
trigger a bug in one or other version, or performance may differ enough to
be critical. These people may want both versions installed so thay can
switch between them as thay hit issues. Again I believe these are a tiny
(but obviosuly important) minority.
So I might have expected that one Macport package for the CSL and one for
the PSL version would be more use for customers as well as less strain for
you.
> but I didn't realize that by overriding macports configure, the
environment variables didn't get passed (as seen in macports' log):
>
> :info:configure in-place build attempt = yes
> :info:configure configure: host=x86_64-apple-darwin11.2.0 args= '--prefix=/opt/local' '--with-csl'
> :info:configure configure: Will build in the x86_64-mac_10.7_lion-darwin11.2.0 subdirectory
> :info:configure configure: +++ Will build in /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk/cslbuild/x86_64-mac_10.7_lion-darwin11.2.0
> :info:configure configure: passcc =
> :info:configure configure: doconfig = /bin/sh /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk/configure '--prefix=/opt/local' '--with-csl' CPPFLAGS="" CFLAGS="" CXXFLAGS="" LDFLAGS="" --with-build="x86_64-mac_10.7_lion-darwin11.2.0" --with-pslbuild="x86_64-mac_10.7_lion-darwin11.2.0"
> :info:configure configure: Absolute path to source directory = /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk
> :info:configure checking build system type... x86_64-apple-darwin11.2.0
> :info:configure checking host system type... x86_64-apple-darwin11.2.0
> :info:configure in-place build attempt = no
> :info:configure configure: host=x86_64-apple-darwin11.2.0 args= '--prefix=/opt/local' '--with-csl' 'CPPFLAGS=' 'CFLAGS=' 'CXXFLAGS=' 'LDFLAGS=' '--with-build=x86_64-mac_10.7_lion-darwin11.2.0' '--with-pslbuild=x86_64-mac_10.7_lion-darwin11.2.0'
> :info:configure configure: Will build in the x86_64-mac_10.7_lion-darwin11.2.0 subdirectory
> :info:configure configure: +++ standard build case, srcdir = /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk = /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk
>
> Amazingly, this compiled on lion, but did not for the fellow who had
that script on his 10.6 machine. So I added the variables like so:
>
> configure {
> system -W ${worksrcpath} \
> "CC=${configure.cc} \
> CFLAGS=\"${configure.cflags} [get_canonical_archflags cc]\" \
> CXX=${configure.cxx} \
> CXXFLAGS=\"${configure.cxxflags} [get_canonical_archflags cxx]\" \
> CPPFLAGS=\"${configure.cppflags}\" \
> LDFLAGS=\"${configure.ldflags} [get_canonical_archflags ld]\" \
> ./configure --prefix=${prefix} --with-csl ; ./configure --with-psl"
> }
>
> Now the correct environment is set, as you can see:
>
> :info:configure configure: Absolute path to source directory = /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk
> :info:configure checking build system type... x86_64-apple-darwin11.2.0
> :info:configure checking host system type... x86_64-apple-darwin11.2.0
> :info:configure in-place build attempt = yes
> :info:configure configure: host=x86_64-apple-darwin11.2.0 args= '--prefix=/opt/local' '--with-csl'
> :info:configure configure: Will build in the x86_64-mac_10.7_lion-darwin11.2.0 subdirectory
> :info:configure configure: +++ Will build in /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk/cslbuild/x86_64-mac_10.7_lion-darwin11.2.0
> :info:configure configure: passcc = CC="/Developer/usr/bin/clang" CPP="" CXX="/Developer/usr/bin/clang++" CXXCPP=""
> :info:configure configure: doconfig = /bin/sh /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk/configure '--prefix=/opt/local' '--with-csl' CPPFLAGS="-I/opt/local/include" CFLAGS="-O2 -arch x86_64" CXXFLAGS="-O2 -arch x86_64" LDFLAGS="-L/opt/local/lib -arch x86_64" CC="/Developer/usr/bin/clang" CPP="" CXX="/Developer/usr/bin/clang++" CXXCPP="" --with-build="x86_64-mac_10.7_lion-darwin11.2.0" --with-pslbuild="x86_64-mac_10.7_lion-darwin11.2.0"
> :info:configure configure: Absolute path to source directory = /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk
> :info:configure checking build system type... x86_64-apple-darwin11.2.0
> :info:configure checking host system type... x86_64-apple-darwin11.2.0
> :info:configure in-place build attempt = no
> :info:configure configure: host=x86_64-apple-darwin11.2.0 args= '--prefix=/opt/local' '--with-csl' 'CPPFLAGS=-I/opt/local/include' 'CFLAGS=-O2 -arch x86_64' 'CXXFLAGS=-O2 -arch x86_64' 'LDFLAGS=-L/opt/local/lib -arch x86_64' 'CC=/Developer/usr/bin/clang' 'CPP=' 'CXX=/Developer/usr/bin/clang++' 'CXXCPP=' '--with-build=x86_64-mac_10.7_lion-darwin11.2.0' '--with-pslbuild=x86_64-mac_10.7_lion-darwin11.2.0'
> :info:configure configure: Will build in the x86_64-mac_10.7_lion-darwin11.2.0 subdirectory
> :info:configure configure: +++ standard build case, srcdir = /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk = /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk
>
> It builds on lion, but with the following errors:
>
> :info:configure configure: Building for Macintosh/Darwin with X
> :info:configure llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
> :info:configure lipo: can't figure out the architecture type of: /var/tmp//ccAr5REE.out
> :info:configure llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
> :info:configure conftest.c:1:19: error: stdio.h: No such file or directory
> :info:configure conftest.c: In function 'main':
> :info:configure conftest.c:3: warning: incompatible implicit declaration of built-in function 'printf'
> :info:configure lipo: can't figure out the architecture type of: /var/tmp//ccjtXcMt.out
> :info:configure llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
> :info:configure conftest.c:1:19: error: stdio.h: No such file or directory
> :info:configure conftest.c: In function 'main':
> :info:configure conftest.c:3: warning: incompatible implicit declaration of built-in function 'printf'
> :info:configure lipo: can't figure out the architecture type of: /var/tmp//ccD75kI3.out
> :info:configure configure: fat binary creation will probably NOT be possible
>
>
> These errors were in the previous log as well. I don't know if this is
because those instructions work for a 10.6 installation, but not 10.7?
And there's still those explicit "gcc" calls, as I pointed out in my
previous message.
Your extract showing "errors" is in fact not terribly helpful to me even
if I wanted to check it! It does not provide context. Is this an extract
from a config.log? You will be aware that configure does all sorts of
things that cause "errors" in that when it is checking for the
availability of something it tries using it, and if the attempt does or
does not succeed it sets its various flags. So from what you send I can
not tell if the messages you send are merely the normal process of
configuration when it checks to see if llvm-gcc-4.2 is installed as one of
the possible compilers of interest, or of it is an Error with a capital
letter. In general when configure is run and something fails one looks in
config.log and can see the exact command that was invoked and the contents
of the file that was being presented for compilation. It is lengthy and
messy and you need (as I say) to distinguish between compilations that
fail merely incidentally because they are checking for some (optional)
feature that is not present on the machine concerned, and errors that are
indications of true disaster.
I have just checked in a new set of configure files. If the person who
invoked configure does so with CC or CXX set (to values other than gcc and
g++) then it skips the Mac code that uses gcc explicitly and tries to
identity which SDK is available. The reasoning there is that if anybody is
going to force selection of some particular C compiler then it becomes
THEIR responsibility to force in values of CFLAGS, LDFLAGS, LIBS and
anything else that could matter, including special flags to select an SDK
or a word length.
That I think purs responsibility more clearly where it has to lie! I hope
I got my changes correct - let me know if I messed up!!!
>
> -Mark
Arthur
|