[M3devel] more cm3cg on Raspberry Pi

Jay K jay.krell at cornell.edu
Sun Oct 20 09:54:48 CEST 2013


I commited this.
It does what you want?
Without multiplying out config files or targets in the frontend.
I suppose we should also add like the following:

if not equal($CM3_BUILD_DIR, "")
  BUILD_DIR = $CM3_BUILD_DIR
end

?

Let you set it arbitrarily with an environment variable.

Also, todo, is like I said, CM3_BUILD_DIR_ROOT or such.
We should discuss a bit first perhaps.

 - Jay

Index: m3-sys/cminstall/src/config-no-install/cm3cfg.common
===================================================================
RCS file: /usr/cvs/cm3/m3-sys/cminstall/src/config-no-install/cm3cfg.common,v
retrieving revision 1.71
diff -u -r1.71 cm3cfg.common
--- m3-sys/cminstall/src/config-no-install/cm3cfg.common	22 Sep 2013 04:21:00 -0000	1.71
+++ m3-sys/cminstall/src/config-no-install/cm3cfg.common	20 Oct 2013 07:50:19 -0000
@@ -22,6 +22,14 @@
 
 %-------------------------------------------------------------------
 
+if equal(M3_BACKEND_MODE, "IntegratedC")
+        or equal(M3_BACKEND_MODE, "C")
+        or USE_C_BACKEND_VIA_M3CGCAT
+    readonly BUILD_DIR_C = "c"
+else
+    readonly BUILD_DIR_C = ""
+end
+
 if not defined("PROFILING_P")
     if M3_PROFILING
         readonly PROFILING_P = "p"
@@ -31,7 +39,7 @@
 end
 
 if not defined("BUILD_DIR")
-    readonly BUILD_DIR    = TARGET & PROFILING_P % directory for results
+    readonly BUILD_DIR    = TARGET & PROFILING_P & BUILD_DIR_C % directory for results
 end
 
 %------------------------------------------------------------------------------
Index: scripts/python/pylib.py
===================================================================
RCS file: /usr/cvs/cm3/scripts/python/pylib.py,v
retrieving revision 1.407
diff -u -r1.407 pylib.py
--- scripts/python/pylib.py	19 Oct 2013 08:18:30 -0000	1.407
+++ scripts/python/pylib.py	20 Oct 2013 07:50:19 -0000
@@ -365,6 +365,7 @@
 #-----------------------------------------------------------------------------
 
 _CBackend = "c" in sys.argv
+_BuildDirC = ["", "c"][_CBackend]
 _PossibleCm3Flags = ["boot", "keep", "override", "commands", "verbose", "why"]
 _SkipGccFlags = ["nogcc", "skipgcc", "omitgcc"]
 _PossiblePylibFlags = ["noclean", "nocleangcc", "c"] + _SkipGccFlags + _PossibleCm3Flags
@@ -764,10 +765,11 @@
 
 # other commands
 
+    _BuildDir = ("%(Config)s%(_BuildDirC)s" % vars())
     if os.name == "nt":
-        RealClean = RealClean or "if exist %(Config)s rmdir /q/s %(Config)s"
+        RealClean = RealClean or "if exist %(_BuildDir)s rmdir /q/s %(_BuildDir)s"
     else:
-        RealClean = RealClean or "rm -rf %(Config)s"
+        RealClean = RealClean or "rm -rf %(_BuildDir)s"
 
     RealClean = (RealClean % vars())
 


________________________________
> From: jay.krell at cornell.edu 
> To: mika at async.caltech.edu 
> Date: Sat, 19 Oct 2013 20:14:18 +0000 
> CC: m3devel at elegosoft.com 
> Subject: Re: [M3devel] more cm3cg on Raspberry Pi 
> 
> BUILD_DIR I think it is called. Profiling uses it, for example. Let's 
> try that. Later. 
> 
>> From: jay.krell at cornell.edu 
>> To: mika at async.caltech.edu 
>> Date: Sat, 19 Oct 2013 20:03:58 +0000 
>> CC: m3devel at elegosoft.com 
>> Subject: Re: [M3devel] more cm3cg on Raspberry Pi 
>> 
>> Two separate CVS checkouts? 
>> Onerous. 
>> 
>> 
>> Put all the outputs outside the entire source tree? 
>> Yes, that is what I want. 
>> Where is the root of the source tree? 
>> i.e. if you are mixing CVS tree and other trees. 
>> 
>> 
>> In the other system I use..: 
>> There is one large tree with a root, called $BASEDIR. 
>> All outputs go under $OBJECT_ROOT. 
>> The relative path under $BASEDIR is computed, and that is appended 
> to $OBJECT_ROOT and outputs go there. 
>> If you are doing something unusual outside of $BASEDIR, then the 
> full path, changing colons to slash, 
>> is appended to $OBJECT_ROOT. 
>> 
>> 
>> I believe also that really "target" and "output directory" are 
> separate in cm3. 
>> Just that all the config files set them the same. 
>> You can copy ARMEL_LINUX, leave TARGET alone, and there is another 
> variable that is usually assigned from TARGET, but you can assign it 
> anything: "1", "arm.1", "foo". That is likely the way to go. Probably 
> append something, and then clean can optionally append a star. 
>> 
>> ? 
>> 
>> - Jay 
>> 
>> ---------------------------------------- 
>>> To: jay.krell at cornell.edu 
>>> CC: m3devel at elegosoft.com 
>>> Subject: Re: more cm3cg on Raspberry Pi 
>>> Date: Sat, 19 Oct 2013 12:52:55 -0700 
>>> From: mika at async.caltech.edu 
>>> 
>>> 
>>> The gain would be that I could compile my whole tree of non-CM3 software 
>>> (which is a fair fraction of the size of the CM3 tree), as well as the 
>>> CM3 tree itself, with both compilers without having to clean everything 
>>> and start over in between. On a slow machine it can make a difference. 
>>> But sure in the long run I'd probably stick with one or the other, and I 
>>> suspect most people would do too. On the other hand, for as long as 
> there's 
>>> debug work going on on either or both of the compilers in question 
> it seems 
>>> it would be helpful to be able to have both. And yes I get that they 
>>> would have to be installed in different places. But they wouldn't be able 
>>> to step on each other's toes if the derived directories were named 
> differently... 
>>> 
>>> Well not a big deal, really. I now tar and rm and untar to switch. 
>>> 
>>> Jay K writes: 
>>>>Yes=2C maybe. But the C backend works for everything.=0A= 
>>>>We'd have to double the number of targets=2C for little gain.=0A= 
>>>>=0A= 
>>>>You can't install both to the same root either way.=0A= 
>>>>The pkg directories are separate=2C but bin and lib are not.=0A= 
>>>>=0A= 
>>>>Upgrade.py from on to the other should work asis.=0A= 
>>>>=0A= 
>>>>=A0- Jay=0A= 
>>>>=0A= 
>>>>----------------------------------------=0A= 
>>>>> To: jay.krell at cornell.edu=0A= 
>>>>> CC: m3devel at elegosoft.com=0A= 
>>>>> Subject: Re: more cm3cg on Raspberry Pi=0A= 
>>>>> Date: Sat=2C 19 Oct 2013 12:21:35 -0700=0A= 
>>>>> From: mika at async.caltech.edu=0A= 
>>>>>=0A= 
>>>>> Hi Jay=2C=0A= 
>>>>>=0A= 
>>>>> Yes the C backend is certainly convenient and cool. No argument 
> there.=0A= 
>>>>>=0A= 
>>>>> But all this has me thinking about something... if the code 
> generated by= 
>>>>=0A= 
>>>>> the C backend isn't compatible with that generated by cm3cg=2C 
> shouldn't= 
>>>>=0A= 
>>>>> the target names be different=2C so that you could even have both 
> systems= 
>>>>=0A= 
>>>>> installed at the same time. E.g.=2C ARMEL_LINUX_C and ARMEL_LINUX=0A= 
>>>>> (or whatever). Of course it makes it a bit more fiddly to bootstrap=0A= 
>>>>> since you're cross-compiling even though it's actually native..? 
> I haven'= 
>>>>t=0A= 
>>>>> thought through all the ramifications. Is it difficult to change 
> the name= 
>>>>?=0A= 
>>>>> Would it be desirable?=0A= 
>>>>>=0A= 
>>>>> Mika=0A= 
>>>>>=0A= 
>>>>> Jay K writes:=0A= 
>>>>>>Oh=3D2C sorry=3D2C here are things to try=3D0A=3D=0A= 
>>>>>>=3D0A=3D=0A= 
>>>>>>edit m3-sys/m3cc/src/platforms.quake=3D0A=3D=0A= 
>>>>>>look for ARMEL_LINUX=3D2C change the right hand side to 
> arm-linux-gnueabi= 
>>>>hf=3D=0A= 
>>>>>>=3D0A=3D=0A= 
>>>>>>=3D0A=3D=0A= 
>>>>>>and/or in src/m3makefile=3D2C you want to add -with-hard-float or 
> -with-h= 
>>>>ardf=3D=0A= 
>>>>>>loat..no=3D2C wait=3D2C from your other mail:=3D0A=3D=0A= 
>>>>>>=3D0A=3D=0A= 
>>>>>>=3DA0And=3D2C really=3D2C the guide here is what you showed for 
> gcc:=3DA0= 
>>>>=3D0A=3D=0A= 
>>>>>>=3D0A=3D=0A= 
>>>>>>=3DA0Configured with: ../src/configure =3DA0=3D0A=3D=0A= 
>>>>>>=3DA0 =3DA0 -v \=3DA0=3D0A=3D=0A= 
>>>>>>=3DA0 =3DA0 ... =3DA0=3D0A=3D=0A= 
>>>>>>=3DA0 =3DA0 --with-arch=3D3Darmv6 =3DA0=3D0A=3D=0A= 
>>>>>>=3DA0 =3DA0 --with-fpu=3D3Dvfp=3DA0=3D0A=3D=0A= 
>>>>>>=3DA0 =3DA0 --with-float=3D3Dhard =3DA0=3D0A=3D=0A= 
>>>>>>=3DA0 =3DA0 --target=3D3Darm-linux-gnueabihf=3DA0=3D0A=3D=0A= 
>>>>>>=3D0A=3D=0A= 
>>>>>>=3DA0One/some/all of those are relevant.=3DA0=3D0A=3D=0A= 
>>>>>>=3DA0You might as well go ahead and throw them all in for 
> now.=3DA0=3D0A= 
>>>>=3D=0A= 
>>>>>>=3D0A=3D=0A= 
>>>>>>=3DA0Hey -- isn't that C backend convenient? :)=3DA0=3D0A=3D=0A= 
>>>>>>=3D0A=3D=0A= 
>>>>>>=3D0A=3D=0A= 
>>>>>>=3DA0- Jay=3D0A=3D=0A= 
>>>>>>=3D0A=3D=0A= 
>>>>>>----------------------------------------=3D0A=3D=0A= 
>>>>>>> To: jay.krell at cornell.edu=3D0A=3D=0A= 
>>>>>>> CC: m3devel at elegosoft.com=3D0A=3D=0A= 
>>>>>>> Subject: more cm3cg on Raspberry Pi=3D0A=3D=0A= 
>>>>>>> Date: Fri=3D2C 18 Oct 2013 18:26:02 -0700=3D0A=3D=0A= 
>>>>>>> From: mika at async.caltech.edu=3D0A=3D=0A= 
>>>>>>>=3D0A=3D=0A= 
>>>>>>> After setting up for soft float=3D2C I got a lot of these 
> warnings/erro= 
>>>>rs..=3D=0A= 
>>>>>>.=3D0A=3D=0A= 
>>>>>>>=3D0A=3D=0A= 
>>>>>>> new source -> compiling RTHeapInfo.m3=3D0A=3D=0A= 
>>>>>>> RTHeapInfo.ms: Assembler messages:=3D0A=3D=0A= 
>>>>>>> RTHeapInfo.ms:859: rdhi=3D2C rdlo and rm must all be 
> different=3D0A=3D= 
>>>>=0A= 
>>>>>>> RTHeapInfo.ms:907: rdhi=3D2C rdlo and rm must all be 
> different=3D0A=3D= 
>>>>=0A= 
>>>>>>> RTHeapInfo.ms:927: rdhi=3D2C rdlo and rm must all be 
> different=3D0A=3D= 
>>>>=0A= 
>>>>>>> new source -> compiling RTHeapMap.i3=3D0A=3D=0A= 
>>>>>>>=3D0A=3D=0A= 
>>>>>>> This is with the following configuration:=3D0A=3D=0A= 
>>>>>>>=3D0A=3D=0A= 
>>>>>>> in /usr/local/cm3 I have the C-generating compiler installed. 
> It seems = 
>>>>to=3D=0A= 
>>>>>> mostly work=3D2C as discussed.=3D0A=3D=0A= 
>>>>>>>=3D0A=3D=0A= 
>>>>>>> Then I run boot2.sh=3D0A=3D=0A= 
>>>>>>>=3D0A=3D=0A= 
>>>>>>> boot.sh finally ends with the following output=3D2C which 
> doesn't look = 
>>>>quit=3D=0A= 
>>>>>>e right:=3D0A=3D=0A= 
>>>>>>>=3D0A=3D=0A= 
>>>>>>> =3D3D=3D3D package /big/home2/mika/2/cm3-cvs/cm3/m3-sys/mklib 
> =3D3D=3D3= 
>>>>D=3D0A=3D=0A= 
>>>>>>>=3D0A=3D=0A= 
>>>>>>> +++ /usr/local/cm3/bin/cm3 -build 
> -DROOT=3D3D/big/home2/mika/2/cm3-cvs/= 
>>>>cm3 =3D=0A= 
>>>>>>+++=3D0A=3D=0A= 
>>>>>>> --- building in ARMEL_LINUX ---=3D0A=3D=0A= 
>>>>>>>=3D0A=3D=0A= 
>>>>>>> ignoring ../src/m3overrides=3D0A=3D=0A= 
>>>>>>>=3D0A=3D=0A= 
>>>>>>> new source -> compiling Main.m3=3D0A=3D=0A= 
>>>>>>> -> linking mklib=3D0A=3D=0A= 
>>>>>>> =3D3D=3D3D> /big/home2/mika/2/cm3-cvs/cm3/m3-sys/mklib 
> done=3D0A=3D=0A= 
>>>>>>>=3D0A=3D=0A= 
>>>>>>> +++ /usr/local/cm3/bin/cm3 -ship 
> -DROOT=3D3D/big/home2/mika/2/cm3-cvs/c= 
>>>>m3 +=3D=0A= 
>>>>>>++=3D0A=3D=0A= 
>>>>>>> --- shipping from ARMEL_LINUX ---=3D0A=3D=0A= 
>>>>>>>=3D0A=3D=0A= 
>>>>>>> . =3D3D> /usr/local/cm3/pkg/mklib/ARMEL_LINUX=3D0A=3D=0A= 
>>>>>>> .M3EXPORTS .M3WEB=3D0A=3D=0A= 
>>>>>>> ../src =3D3D> /usr/local/cm3/pkg/mklib/src=3D0A=3D=0A= 
>>>>>>> Main.m3=3D0A=3D=0A= 
>>>>>>> . =3D3D> /usr/local/cm3/bin=3D0A=3D=0A= 
>>>>>>> mklib=3D0A=3D=0A= 
>>>>>>> =3D3D=3D3D> /big/home2/mika/2/cm3-cvs/cm3/m3-sys/mklib 
> done=3D0A=3D=0A= 
>>>>>>>=3D0A=3D=0A= 
>>>>>>> 
> /big/home2/mika/2/cm3-cvs/cm3/m3-sys/m3cggen/ARMEL_LINUX/m3cggen> 
> /big/= 
>>>>ho=3D=0A= 
>>>>>>me2/mika/2/cm3-cvs/cm3/m3-sys/m3cc/gcc/gcc/m3cg/m3cg.h=3D0A=3D=0A= 
>>>>>>> mkdir -p /usr/local/cm3/bin=3D0A=3D=0A= 
>>>>>>> cp -Pv /big/home2/mika/2/cm3-cvs/cm3/m3-sys/cm3/ARMEL_LINUX/cm3 
> /usr/lo= 
>>>>ca=3D=0A= 
>>>>>>l/cm3/bin/cm3=3D0A=3D=0A= 
>>>>>>> Traceback (most recent call last):=3D0A=3D=0A= 
>>>>>>> File "./upgrade.py"=3D2C line 72=3D2C in <module>=3D0A=3D=0A= 
>>>>>>> reload(pylib) # compiler host type may have changed and need to 
> recompu= 
>>>>te=3D=0A= 
>>>>>> stuff=3D0A=3D=0A= 
>>>>>>> File 
> "/big/home2/mika/2/cm3-cvs/cm3/scripts/python/pylib.py"=3D2C line = 
>>>>650=3D=0A= 
>>>>>>=3D2C in <module>=3D0A=3D=0A= 
>>>>>>> if Host.endswith("_NT") or Host =3D3D=3D3D "NT386":=3D0A=3D=0A= 
>>>>>>> AttributeError: 'NoneType' object has no attribute 
> 'endswith'=3D0A=3D= 
>>>>=0A= 
>>>>>>> raspberrypi:/big/home2/mika/2/cm3-cvs/cm3/scripts/python#=3D0A=3D=0A= 
>>>>>>>=3D0A=3D=0A= 
>>>>>>> Mika =3D = 		 	   		  


More information about the M3devel mailing list