Open ryandesign opened 1 week ago
You're right that BUILDING
needs more instructions, at a minimum, and probably there should be more direct support in the configure and make files.
Here's a recipe that should work:
./configure
and make
(but no need to install).make tarm64osx.boot
../configure -m=tarm64osx CFLAGS="-arch arm64" --prefix=/tmp/out
, replacing /tmp/out
with a place where you'd like the result to end up.make kernel
, which builds just the C-implemented kernel for Arm64 without trying to run it. (This will also take advantage of the fact that the earlier make
created bin/zuo
, and that one will be used.)make install
to gather everything into (your replacement for) /tmp/out
.This recipe should work in general, except that more work may be needed to select the right C compiler in the middle step, depending on how the target platform relates to the current one.
Thanks, I'm trying that out.
We are also currently using the configure args --threads --libkernel LZ4=-llz4 ZLIB=-lz
. Should I now be specifying those in the first configure invocation, the second one, or both?
The second configure
is the relevant one for those flags, since I think those are meant to configure the result. They would be fine to use for the first ./configure
to build for the current machine, since you have those libraries installed universal.
I am running macOS 12 on an x86_64 Mac. How can I compile chez scheme for arm64 macOS? I have read the BUILDING document and have not gained an understanding of how to do this. The document refers often to
<machine type>
without explaining whether this refers to the type of the build machine or the type of the machine for which the build is being done. I already have lz4 and zlib installed universal (compiled for both arm64 and x86_64 in the same binary).What I have tried:
Naturally I can't run an arm64 executable on an x86_64 machine. This happens because, if
CFLAGS
is empty, this code setsCFLAGS
to contain-arch arm64
:https://github.com/cisco/ChezScheme/blob/f1ad314a3809074c6f2b986a5db6a84ad88700c1/configure#L810-L811
and, if
CC_FOR_BUILD
is empty, this code setsCC_FOR_BUILD="$CC $CFLAGS"
:https://github.com/cisco/ChezScheme/blob/f1ad314a3809074c6f2b986a5db6a84ad88700c1/configure#L833-L834
So I try setting
CC_FOR_BUILD
myself to a value that does not include-arch
flags which failed:This happens because, if
CC_FOR_BUILD
is set, this code setsenableFrompb=no
.https://github.com/cisco/ChezScheme/blob/f1ad314a3809074c6f2b986a5db6a84ad88700c1/configure#L833-L836
Am I now supposed to add
--pb
or--pbarch
to the configure flags? If so, which one? The descriptions of these flags do not provide any guidance for how one should choose between them.I tried adding
--pbarch
which failed:I tried instead adding
--pb
which failed:pb/bin/pb/scheme
has been compiled for arm64; of course it cannot be executed on an x86_64 machine: