<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style='font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif;'>Hi Holger,<br><br>Good morning.<br><br><br><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div>I have only seen the CMake generation in Pharo and this single commit  but from my point of view the VM and the CMake code seems very  different:<br><br>* The VM code is Smalltalk code and primarily developed with the  simulator(?). We do not have a CMake simulator and I think it would not  help to build one (the issues to expect are different compiler versions,  flags, include paths, libraries, etc.) <br></div></blockquote> Yes and agreed.<br><br><br><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div><br><br>* The VM code is Smalltalk code as it provides a high level of  abstraction. At least with the CMake generation in the PharoVM the level  of abstraction is string concatenation.</div></blockquote> <br>The Pharo code, yes. I found no benefit in string concatenation, and I found it needlessly confusing....so...I forked the project to use CMakeTemplates instead. <br>CMakeTemplates are wrapper objects around CMake constructs--string concatenation and command output is handled by the template<br><br>If you have ever programmed in Seaside, you know how easy it is to use Templates (The Seaside idiom is Components)&nbsp; to compose web-pages. Templates are&nbsp; objects that wrap CMake commands/etc.<br>Generating valid CMake is now a matter of adding CMakeTemplates to a collection then asking those templates to write their content to a stream.<br>For the programmer, the debugging is very easy and the composing is very intuitive. <br><br>There is no string concatenation on the developer's part.<br><br><br><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div><br>In 2014/2015 I built the PharoVM on FreeBSD and the pain came from fighting with the code in the image and not cmake itself. <br> </div></blockquote> <br>Two points. <br><br>1. the current Smalltalk code is too complicated to maintain for a newbie. I am currently working on a Terse Help Topic for setting up a&nbsp; "linux 64x64 squeak.cog.spur build " component. <br>With the release of the Terse guide, I will be in an "official" alpha release.<br><br>I believe a goal should be to radically trim and normalize the CMake generation part of the framework. The current generation is handled in about 3 places with the bulk in VMGenerator&gt;&gt;generateBytemplate:<br><br>NO PAIN is the goal. <br>CMake DRIVES THE PROCESS is the MOTTO.<br><br><br>2 Here is what I am seeing from my work writing the documentation. There appear to be about&nbsp; generic steps. <br><br>1 Identify your platform and base configuration<br>2. Subclass it.<br>3. Set up directory paths <br>4. Set up Compiler Flags (-g -01 <br>5. Set up Linker flags&nbsp;&nbsp; (now -foo)<br>6. Set up Compiler Directives (-D FOO -D BAR<br>7. Set up librarires<br>8 . Choose plugins<br>9. Generate CMake.<br>10 Debug CMake.<br><br><br>The Generators have debugging tracers in them to identify where the generated CMake code was written from--<br><br>SqueakLinux64x86w32CompatBuilder&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;-Platform specific facade to the configurations<br>&nbsp;&nbsp;&nbsp; configureA: #Linux64x86w32BitSqueakCogSpurConfig forBuildType:#build;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;-each configuration can handle all build types (if they are coded, just set different flags based on #buildType and the code architecture should invoke the correct ones for the build)<br>&nbsp;&nbsp;&nbsp; enableMessageTracking: true;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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br>The command above generates CMake that builds a working CMake build tree parallel to the existing build tree that generates a working squeak.cog.spur vm. <br><br>Once these are setup, and (I hope and think) with the documentation in place, adding an entirely different platform or tweaking an existing platform should be less than 1/2 hour job.<br><br><br><br><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div>Make it possible to generate the source in one directory and compile it in another. <br><a href="https://github.com/pharo-project/pharo-vm/commit/4ee7ca5666b74e0540ad75dd6350db33ffc04e7f" target="_blank">https://github.com/pharo-project/pharo-vm/commit/4ee7ca5666b74e0540ad75dd6350db33ffc04e7f</a> <br><br></div></blockquote> <br>Done. The CMakeVMMaker for squeak generates a parallel structure on the fly to the existing oscogvm tree.<br>for example: build.linux64/foo becomes cmake.build.linux64/foo&nbsp; w/ no changes to the existing stuff.<br>Similarly the "products" directory becomes "cmake.products" again, parallel to the existing structure.<br><br><br><br><br><br><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div>Add/Fix FreeBSD generator and disable X11 backend (not included in the  32bit compat and not necessary for my server deployment). <br><a href="https://github.com/pharo-project/pharo-vm/commit/216f47df008d0f73d24519bc3025ed15f605653f" target="_blank">https://github.com/pharo-project/pharo-vm/commit/216f47df008d0f73d24519bc3025ed15f605653f</a> <br> </div></blockquote> My solution is, subclass an existing 32Bit compat Configuration. Override one method (whatever tells the compiler to not build in X11)<br>Override another that tells what plugins to use. It automatically supports all buildTypes the parent has<br><br><br>I think a good addition would be options to tell a Configuration what additional or new "flags" it should use<br><br><br>Something like:<br><br>SqueakLinux64x86w32CompatBuilder&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; configureA:  #Linux64x86w32BitSqueakCogSpurConfig forBuildType:#build;<br>&nbsp;&nbsp;&nbsp; withoutPlugin: "X11"<br>&nbsp;&nbsp;&nbsp; AddCFlags: #(...)<br>&nbsp;&nbsp;&nbsp; RemoveCFlags: #(...)<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; etc...<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; enableMessageTracking: true;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;   generateByTemplate.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br><br> (This would be an awesome feature) I will add it to my todo list.<br><br><br><br><br><br>cheers,<br><br>tty<br><div class="zmail_extra"><div id="1"><br></div></div></div></body></html>