[M3devel] building CM3 on a Raspberry Pi?
mika at async.caltech.edu
mika at async.caltech.edu
Mon Oct 14 18:01:34 CEST 2013
[sorry for sending so many small messages..]
I get the same error about c-family/c-pragma.h if I add
M3_BACKEND_MODE = "C"
to the bottom of the ARMEL_LINUX config in config-no-install and re-run boot1.py ...
Jay K writes:
>--_dddec029-8cf2-4528-8c46-8d0a40bef349_
>Content-Type: text/plain; charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
> Porting to new systems is pretty easy. =20
> I had ARMEL_LINUX pretty far along. =20
> I forgot how far. =20
> I did have to add sort of support for 128bit integers in the gcc backend.=
> Sort of. =20
>=20
>
> > ../gcc-4.7/configure: not found=20
>
>=20
> Make sure you cvs upd -dAP so you get new directories.=20
>
>=20
> We should switch to the C backend though. It is just a one line change =20
> in the config file. Look at the Darwin config files. =20
> It is not experimental. =20
> It has been essentially working for over a year (since September 2012)=20
> and it is in very good shape now.=20
> I have used it for a number of architectures and operating systems alread=
>y=2C=20
> like I think every Solaris architecture=2C Linux=2C Darwin=2C NT.=20
> I'd like to see more people use it=2C and I'd like to drop the gcc backen=
>d entirely.=20
> This is an important step in leaving Modula-3 very portable and easier to=
> support.=20
>=20
>
> - Jay
>
>=20
>> To: m3devel at elegosoft.com
>> Date: Sun=2C 13 Oct 2013 13:35:01 -0700
>> From: mika at async.caltech.edu
>> Subject: [M3devel] building CM3 on a Raspberry Pi?
>>=20
>>=20
>> Hi everyone (mostly Jay)=2C
>>=20
>> Last time I tried to port CM3 to a new architecture I really got nowhere.
>>=20
>> I thought it might be time to try again. I have a Raspberry Pi=2C forty-=
>dollar computer.
>>=20
>> It has "Raspbian" installed on it.
>>=20
>> The following output is probably relevant:
>>=20
>> pi at raspberrypi ~ $ uname -a
>> Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6=
>l GNU/Linux
>>=20
>> pi at raspberrypi ~ $ gcc -v
>> Using built-in specs.
>> COLLECT_GCC=3Dgcc
>> COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper
>> Target: arm-linux-gnueabihf
>> Configured with: ../src/configure -v --with-pkgversion=3D'Debian 4.6.3-14=
>+rpi1' --with-bugurl=3Dfile:///usr/share/doc/gcc-4.6/README.Bugs --enable-l=
>anguages=3Dc=2Cc++=2Cfortran=2Cobjc=2Cobj-c++ --prefix=3D/usr --program-suf=
>fix=3D-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --li=
>bexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dposix --w=
>ith-gxx-include-dir=3D/usr/include/c++/4.6 --libdir=3D/usr/lib --enable-nls=
> --with-sysroot=3D/ --enable-clocale=3Dgnu --enable-libstdcxx-debug --enabl=
>e-libstdcxx-time=3Dyes --enable-gnu-unique-object --enable-plugin --enable-=
>objc-gc --disable-sjlj-exceptions --with-arch=3Darmv6 --with-fpu=3Dvfp --wi=
>th-float=3Dhard --enable-checking=3Drelease --build=3Darm-linux-gnueabihf -=
>-host=3Darm-linux-gnueabihf --target=3Darm-linux-gnueabihf
>> Thread model: posix
>> gcc version 4.6.3 (Debian 4.6.3-14+rpi1)=20
>>=20
>>=20
>> Further=2C in the CM3 tree there is something called "ARMEL_LINUX".
>> I thought=2C from reading some old messages on this mailing list=2C that =
>doing
>> the following on my "big" system would result in something interesting:
>>=20
>> 1. CVS updating to the latest version of the tree
>>=20
>> 2. cd to scripts/python
>>=20
>> 3. ./boot1.py ARMEL_LINUX
>>=20
>> but all it did was mess up the cm3.cfg on my host system (FreeBSD4) and e=
>rror out very quickly...
>>=20
>> ...
>> rm -f /usr/local/cm3/bin/IA64_LINUX
>> rm -f /usr/local/cm3/bin/NT.common
>> rm -f /usr/local/cm3/bin/SPARC32_SOLARIS.common
>> cp -Pv /big/home2/mika/2/cm3-cvs/cm3/m3-sys/cminstall/src/config-no-insta=
>ll/cm3.cfg /usr/local/cm3/bin/cm3.cfg
>> =3D=3D package /big/home2/mika/2/cm3-cvs/cm3/m3-win/import-libs =3D=3D
>>=20
>> +++ /usr/local/cm3/bin/cm3 -build -override -DROOT=3D/big/home2/mika/=
>2/cm3-cvs/cm3 -boot -keep -DM3CC_TARGET=3DARMEL_LINUX +++
>> --- building in ARMEL_LINUX ---
>>=20
>> =3D=3D> /big/home2/mika/2/cm3-cvs/cm3/m3-win/import-libs done
>>=20
>> =3D=3D package /big/home2/mika/2/cm3-cvs/cm3/m3-sys/m3cc =3D=3D
>>=20
>> +++ /usr/local/cm3/bin/cm3 -build -override -DROOT=3D/big/home2/mika/=
>2/cm3-cvs/cm3 -boot -keep -DM3CC_TARGET=3DARMEL_LINUX +++
>> --- building in ARMEL_LINUX ---
>>=20
>> type make
>> make is /home/mika/cm3-build-bin//make
>> make --version | grep "GNU Make"
>> GNU Make 3.82
>> GNU_MAKE is make
>> cd ../FreeBSD4-ARMEL_LINUX && MAKE=3D"make -j4 " AUTOCONF=3D: AUTOMAK=
>E=3D: LEX=3D'touch lex.yy.c' MAKEINFO=3D: ../gcc-4.7/configure -with-sy=
>sroot -target=3Darm-linux-gnueabi -srcdir=3D../gcc-4.7 -disable-bootstrap -=
>disable-intl -disable-libgomp -disable-libmudflap -disable-libssp -disable-=
>nls -enable-languages=3Dm3cg -disable-fixincludes -disable-libgcc -disable-=
>decimal-float -disable-fixed-point -disable-tls
>> cd ../FreeBSD4-ARMEL_LINUX && MAKE=3D"make -j4 " AUTOCONF=3D: AUTOMAK=
>E=3D: LEX=3D'touch lex.yy.c' MAKEINFO=3D: ../gcc-4.7/configure -with-sy=
>sroot -target=3Darm-linux-gnueabi -srcdir=3D../gcc-4.7 -disable-bootstrap -=
>disable-intl -disable-libgomp -disable-libmudflap -disable-libssp -disable-=
>nls -enable-languages=3Dm3cg -disable-fixincludes -disable-libgcc -disable-=
>decimal-float -disable-fixed-point -disable-tls
>> ../gcc-4.7/configure: not found
>> "/big/home2/mika/2/cm3-cvs/cm3/m3-sys/m3cc/src/m3makefile"=2C line 339: q=
>uake runtime error: exit 127: cd ../FreeBSD4-ARMEL_LINUX && MAKE=3D"make =
>-j4 " AUTOCONF=3D: AUTOMAKE=3D: LEX=3D'touch lex.yy.c' MAKEINFO=3D: ../gc=
>c-4.7/configure -with-sysroot -target=3Darm-linux-gnueabi -srcdir=3D../=
>gcc-4.7 -disable-bootstrap -disable-intl -disable-libgomp -disable-libmudfl=
>ap -disable-libssp -disable-nls -enable-languages=3Dm3cg -disable-fixinclud=
>es -disable-libgcc -disable-decimal-float -disable-fixed-point -disable-tls
>>=20
>> --procedure-- -line- -file---
>> exec -- <builtin>
>> m3cc_Run 339 /big/home2/mika/2/cm3-cvs/cm3/m3-sys/m3cc/src/m3ma=
>kefile
>> include_dir 537 /big/home2/mika/2/cm3-cvs/cm3/m3-sys/m3cc/src/m3ma=
>kefile
>> 9 /big/home2/mika/2/cm3-cvs/cm3/m3-sys/m3cc/ARMEL_LI=
>NUX/m3make.args
>>=20
>> Fatal Error: package build failed
>> *** execution of [<function _BuildLocalFunction at 0x82d55a4>] failed **=
>*
>> (238)rover:~/cm3-cvs-anon/cm3/scripts/python>
>>=20
>>=20
>> So I'm not really sure what state porting of CM3 is in. I think it
>> would be really interesting to have it running on the Raspberry Pi=2C
>> partly because Modula-3 and Python are in many ways similar but Modula-3
>> code tends to be many times more efficient (at least in runtime) and
>> the computer is slow by modern standards.
>>=20
>> A few questions...
>>=20
>> Is ARMEL_LINUX a real port? Does it work? Has it worked for anyone? =20
>>=20
>> Am I going about it the right way per latest recommendations---that is=2C
>> trying to cross-compile from an existing CM3 installation on 32-bit
>> i386 system?
>>=20
>> Clearly just running ./boot1.py ARMEL_LINUX on the FreeBSD system is
>> not the right approach... maybe someone knows what is?
>>=20
>> Do I maybe need to upgrade the host CM3 to the head first? (Sounds
>> like a whole other can of worms but ok...)
>>=20
>> The Pi I think is more than powerful enough to compile everything
>> natively. When I started with Modula-3=2C I had a 120-MHz Pentium on
>> my desk with 128 MB of RAM=2C and that was considered a powerful
>> system at the time. This is a 700 MHz ARM with 512 MB of RAM.
>> So I'm not against compiling stuff natively (in fact I think it makes
>> things easier)=2C but cross-compiling is fine too if that gets me to
>> the goal easier.
>>=20
>> I am happy to try C generating compilers but I would prefer to keep
>> things as un-experimental as possible for now=2C because I have some
>> control applications I'd like to try to build without having to debug
>> lots and lots of software first.
>>=20
>> Finally I think it would be *really* cool if we had a distribution of
>> Modula-3 that was polished enough to be distributable to Raspberry Pi
>> users. Just based on the gross characteristics of the two systems=2C
>> I think the Pi and Modula-3 ought to be a very good match for each
>> other. Basically=2C the Pi is a full-featured but slow hardware system
>> with good networking facilities. It could use a safe=2C modern=2C effici=
>ent
>> systems programming language running on it. Most things on it nowadays
>> are written in Python from what i understand.
>>=20
>> Mika
> =
>
>--_dddec029-8cf2-4528-8c46-8d0a40bef349_
>Content-Type: text/html; charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
><html>
><head>
><style><!--
>.hmmessage P
>{
>margin:0px=3B
>padding:0px
>}
>body.hmmessage
>{
>font-size: 12pt=3B
>font-family:Calibri
>}
>--></style></head>
><body class=3D'hmmessage'><div dir=3D'ltr'> =3B Porting to new systems =
>is pretty easy. =3B <br> =3B I had ARMEL_LINUX pretty far along.&nb=
>sp=3B <br> =3B I forgot how far. =3B <BR> =3B =3BI did have=
> to =3Badd sort of support for 128bit integers in the =3Bgcc backen=
>d. Sort of. =3B <BR> =3B<BR><br> =3B>=3B ../gcc-4.7/configure=
>: not found <BR><br> =3B<BR> =3B Make sure you cvs upd -dAP so you =
>get new directories. <BR><br> =3B<BR> =3B We should switch to the C=
> backend though. It is just a one line change =3B <br> =3B =3B =
>in the config file. Look at the Darwin config files. =3B <br> =3B I=
>t is not experimental. =3B <br> =3B It has been essentially working=
> for over a year (since September 2012) <br> =3B =3B and it is in v=
>ery good shape now. <br> =3B I have used it for a number of architectur=
>es and operating systems already=2C <br> =3B like I think every Solaris=
> architecture=2C Linux=2C Darwin=2C NT. <br> =3B I'd like to see more p=
>eople use it=2C and I'd like to drop the gcc backend entirely. <br> =3B=
> This is an important step in leaving Modula-3 very portable and easier to =
>support. <BR> =3B<BR><br> =3B- Jay<br><br> =3B<BR><div>>=3B T=
>o: m3devel at elegosoft.com<br>>=3B Date: Sun=2C 13 Oct 2013 13:35:01 -0700<=
>br>>=3B From: mika at async.caltech.edu<br>>=3B Subject: [M3devel] buildin=
>g CM3 on a Raspberry Pi?<br>>=3B <br>>=3B <br>>=3B Hi everyone (mostl=
>y Jay)=2C<br>>=3B <br>>=3B Last time I tried to port CM3 to a new archi=
>tecture I really got nowhere.<br>>=3B <br>>=3B I thought it might be ti=
>me to try again. I have a Raspberry Pi=2C forty-dollar computer.<br>>=3B=
> <br>>=3B It has "Raspbian" installed on it.<br>>=3B <br>>=3B The fol=
>lowing output is probably relevant:<br>>=3B <br>>=3B pi at raspberrypi ~ $=
> uname -a<br>>=3B Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42=
>:08 BST 2013 armv6l GNU/Linux<br>>=3B <br>>=3B pi at raspberrypi ~ $ gcc -=
>v<br>>=3B Using built-in specs.<br>>=3B COLLECT_GCC=3Dgcc<br>>=3B COL=
>LECT_LTO_WRAPPER=3D/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper<br>>=
>=3B Target: arm-linux-gnueabihf<br>>=3B Configured with: ../src/configure=
> -v --with-pkgversion=3D'Debian 4.6.3-14+rpi1' --with-bugurl=3Dfile:///usr/=
>share/doc/gcc-4.6/README.Bugs --enable-languages=3Dc=2Cc++=2Cfortran=2Cobjc=
>=2Cobj-c++ --prefix=3D/usr --program-suffix=3D-4.6 --enable-shared --enable=
>-linker-build-id --with-system-zlib --libexecdir=3D/usr/lib --without-inclu=
>ded-gettext --enable-threads=3Dposix --with-gxx-include-dir=3D/usr/include/=
>c++/4.6 --libdir=3D/usr/lib --enable-nls --with-sysroot=3D/ --enable-clocal=
>e=3Dgnu --enable-libstdcxx-debug --enable-libstdcxx-time=3Dyes --enable-gnu=
>-unique-object --enable-plugin --enable-objc-gc --disable-sjlj-exceptions -=
>-with-arch=3Darmv6 --with-fpu=3Dvfp --with-float=3Dhard --enable-checking=
>=3Drelease --build=3Darm-linux-gnueabihf --host=3Darm-linux-gnueabihf --tar=
>get=3Darm-linux-gnueabihf<br>>=3B Thread model: posix<br>>=3B gcc versi=
>on 4.6.3 (Debian 4.6.3-14+rpi1) <br>>=3B <br>>=3B <br>>=3B Further=2C=
> in the CM3 tree there is something called "ARMEL_LINUX".<br>>=3B I thoug=
>ht=2C from reading some old messages on this mailing list=2C that doing<br>=
>>=3B the following on my "big" system would result in something interesti=
>ng:<br>>=3B <br>>=3B 1. CVS updating to the latest version of the tree<=
>br>>=3B <br>>=3B 2. cd to scripts/python<br>>=3B <br>>=3B 3. ./boot=
>1.py ARMEL_LINUX<br>>=3B <br>>=3B but all it did was mess up the cm3.cf=
>g on my host system (FreeBSD4) and error out very quickly...<br>>=3B <br>=
>>=3B ...<br>>=3B rm -f /usr/local/cm3/bin/IA64_LINUX<br>>=3B rm -f /u=
>sr/local/cm3/bin/NT.common<br>>=3B rm -f /usr/local/cm3/bin/SPARC32_SOLAR=
>IS.common<br>>=3B cp -Pv /big/home2/mika/2/cm3-cvs/cm3/m3-sys/cminstall/s=
>rc/config-no-install/cm3.cfg /usr/local/cm3/bin/cm3.cfg<br>>=3B =3D=3D pa=
>ckage /big/home2/mika/2/cm3-cvs/cm3/m3-win/import-libs =3D=3D<br>>=3B <br=
>>>=3B +++ /usr/local/cm3/bin/cm3 -build -override -DROOT=3D/big/home2=
>/mika/2/cm3-cvs/cm3 -boot -keep -DM3CC_TARGET=3DARMEL_LINUX +++<br>>=3B -=
>-- building in ARMEL_LINUX ---<br>>=3B <br>>=3B =3D=3D>=3B /big/home=
>2/mika/2/cm3-cvs/cm3/m3-win/import-libs done<br>>=3B <br>>=3B =3D=3D pa=
>ckage /big/home2/mika/2/cm3-cvs/cm3/m3-sys/m3cc =3D=3D<br>>=3B <br>>=3B=
> +++ /usr/local/cm3/bin/cm3 -build -override -DROOT=3D/big/home2/mika/2=
>/cm3-cvs/cm3 -boot -keep -DM3CC_TARGET=3DARMEL_LINUX +++<br>>=3B --- buil=
>ding in ARMEL_LINUX ---<br>>=3B <br>>=3B type make<br>>=3B make is /h=
>ome/mika/cm3-build-bin//make<br>>=3B make --version | grep "GNU Make"<br>=
>>=3B GNU Make 3.82<br>>=3B GNU_MAKE is make<br>>=3B cd ../FreeBSD4-AR=
>MEL_LINUX &=3B&=3B MAKE=3D"make -j4 " AUTOCONF=3D: AUTOMAKE=3D: L=
>EX=3D'touch lex.yy.c' MAKEINFO=3D: ../gcc-4.7/configure -with-sysroot -=
>target=3Darm-linux-gnueabi -srcdir=3D../gcc-4.7 -disable-bootstrap -disable=
>-intl -disable-libgomp -disable-libmudflap -disable-libssp -disable-nls -en=
>able-languages=3Dm3cg -disable-fixincludes -disable-libgcc -disable-decimal=
>-float -disable-fixed-point -disable-tls<br>>=3B cd ../FreeBSD4-ARMEL_LIN=
>UX &=3B&=3B MAKE=3D"make -j4 " AUTOCONF=3D: AUTOMAKE=3D: LEX=3D't=
>ouch lex.yy.c' MAKEINFO=3D: ../gcc-4.7/configure -with-sysroot -target=
>=3Darm-linux-gnueabi -srcdir=3D../gcc-4.7 -disable-bootstrap -disable-intl =
>-disable-libgomp -disable-libmudflap -disable-libssp -disable-nls -enable-l=
>anguages=3Dm3cg -disable-fixincludes -disable-libgcc -disable-decimal-float=
> -disable-fixed-point -disable-tls<br>>=3B ../gcc-4.7/configure: not foun=
>d<br>>=3B "/big/home2/mika/2/cm3-cvs/cm3/m3-sys/m3cc/src/m3makefile"=2C l=
>ine 339: quake runtime error: exit 127: cd ../FreeBSD4-ARMEL_LINUX &=3B&=
>amp=3B MAKE=3D"make -j4 " AUTOCONF=3D: AUTOMAKE=3D: LEX=3D'touch lex.yy=
>.c' MAKEINFO=3D: ../gcc-4.7/configure -with-sysroot -target=3Darm-linux=
>-gnueabi -srcdir=3D../gcc-4.7 -disable-bootstrap -disable-intl -disable-lib=
>gomp -disable-libmudflap -disable-libssp -disable-nls -enable-languages=3Dm=
>3cg -disable-fixincludes -disable-libgcc -disable-decimal-float -disable-fi=
>xed-point -disable-tls<br>>=3B <br>>=3B --procedure-- -line- -file---=
><br>>=3B exec -- <=3Bbuiltin>=3B<br>>=3B m3cc_Run =
> 339 /big/home2/mika/2/cm3-cvs/cm3/m3-sys/m3cc/src/m3makefile<br>>=
>=3B include_dir 537 /big/home2/mika/2/cm3-cvs/cm3/m3-sys/m3cc/src/m3=
>makefile<br>>=3B 9 /big/home2/mika/2/cm3-cvs/cm3/m3-=
>sys/m3cc/ARMEL_LINUX/m3make.args<br>>=3B <br>>=3B Fatal Error: package =
>build failed<br>>=3B *** execution of [<=3Bfunction _BuildLocalFunctio=
>n at 0x82d55a4>=3B] failed ***<br>>=3B (238)rover:~/cm3-cvs-anon/cm3/sc=
>ripts/python>=3B<br>>=3B <br>>=3B <br>>=3B So I'm not really sure w=
>hat state porting of CM3 is in. I think it<br>>=3B would be really inter=
>esting to have it running on the Raspberry Pi=2C<br>>=3B partly because M=
>odula-3 and Python are in many ways similar but Modula-3<br>>=3B code ten=
>ds to be many times more efficient (at least in runtime) and<br>>=3B the =
>computer is slow by modern standards.<br>>=3B <br>>=3B A few questions.=
>..<br>>=3B <br>>=3B Is ARMEL_LINUX a real port? Does it work? Has it =
>worked for anyone? <br>>=3B <br>>=3B Am I going about it the right way=
> per latest recommendations---that is=2C<br>>=3B trying to cross-compile =
>from an existing CM3 installation on 32-bit<br>>=3B i386 system?<br>>=
>=3B <br>>=3B Clearly just running ./boot1.py ARMEL_LINUX on the FreeBSD s=
>ystem is<br>>=3B not the right approach... maybe someone knows what is?<b=
>r>>=3B <br>>=3B Do I maybe need to upgrade the host CM3 to the head fir=
>st? (Sounds<br>>=3B like a whole other can of worms but ok...)<br>>=3B=
> <br>>=3B The Pi I think is more than powerful enough to compile everythi=
>ng<br>>=3B natively. When I started with Modula-3=2C I had a 120-MHz Pen=
>tium on<br>>=3B my desk with 128 MB of RAM=2C and that was considered a p=
>owerful<br>>=3B system at the time. This is a 700 MHz ARM with 512 MB of=
> RAM.<br>>=3B So I'm not against compiling stuff natively (in fact I thin=
>k it makes<br>>=3B things easier)=2C but cross-compiling is fine too if t=
>hat gets me to<br>>=3B the goal easier.<br>>=3B <br>>=3B I am happy t=
>o try C generating compilers but I would prefer to keep<br>>=3B things as=
> un-experimental as possible for now=2C because I have some<br>>=3B contr=
>ol applications I'd like to try to build without having to debug<br>>=3B =
>lots and lots of software first.<br>>=3B <br>>=3B Finally I think it wo=
>uld be *really* cool if we had a distribution of<br>>=3B Modula-3 that wa=
>s polished enough to be distributable to Raspberry Pi<br>>=3B users. Jus=
>t based on the gross characteristics of the two systems=2C<br>>=3B I thin=
>k the Pi and Modula-3 ought to be a very good match for each<br>>=3B othe=
>r. Basically=2C the Pi is a full-featured but slow hardware system<br>>=
>=3B with good networking facilities. It could use a safe=2C modern=2C effi=
>cient<br>>=3B systems programming language running on it. Most things on=
> it nowadays<br>>=3B are written in Python from what i understand.<br>>=
>=3B <br>>=3B Mika<br></div> </div></body>
></html>=
>
>--_dddec029-8cf2-4528-8c46-8d0a40bef349_--
More information about the M3devel
mailing list