[Vm-dev] VM Maker: CMakeVMMakerSqueak-tty.110.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Mar 4 23:24:58 UTC 2015


Timothy M uploaded a new version of CMakeVMMakerSqueak to project VM Maker:
http://source.squeak.org/VMMaker/CMakeVMMakerSqueak-tty.110.mcz

==================== Summary ====================

Name: CMakeVMMakerSqueak-tty.110
Author: tty
Time: 4 March 2015, 5:26:01.402 pm
UUID: c0dd69f6-c808-487f-b7a9-bfb041f9f7f6
Ancestors: CMakeVMMakerSqueak-tty.109

Split the Example Workflow contained in the Start Here help into its own Help Topic. I expect it will need cleaning as I get fresh eyeballs on the content.

=============== Diff against CMakeVMMakerSqueak-tty.109 ===============

Item was added:
+ CMakeVMMakerSqueakHelp subclass: #CMakeVMMakerSqueakExampleWorkflowHelp
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'CMakeVMMakerSqueak-Help'!
+ 
+ !CMakeVMMakerSqueakExampleWorkflowHelp commentStamp: 'tty 2/28/2015 13:25' prior: 0!
+ A CMakeVMMakerSqueakTerseGuideHelp provides a simple walkthrough of a build using the CMakeVMMaker package.
+ 
+ 
+ !

Item was added:
+ ----- Method: CMakeVMMakerSqueakExampleWorkflowHelp class>>bookName (in category 'accessing') -----
+ bookName
+ 	^'Example Workflow'!

Item was added:
+ ----- Method: CMakeVMMakerSqueakExampleWorkflowHelp class>>configureAndGenerate (in category 'pages') -----
+ configureAndGenerate
+ 	^HelpTopic
+ 		title: 'Configure and Generate'
+ 		contents:
+ ' The final step is to instruct the Configuration to configure itself for an available buildType , enable/disable debugging trace messages and generate the output.
+ 
+ SqueakLinux64x86w32CompatBuilder 
+ 	configureA: #Linux32x86SqueakCogV3Config forBuildType: #build;   
+ 	enableMessageTracking: true;
+ 	generateByTemplate.
+ 
+ Running the above cascade provides no feedback to the user. If all went well, there should be a CMake build tree as discussed on the next page.
+ 
+ 
+ 
+ '
+ 
+ 
+ !

Item was added:
+ ----- Method: CMakeVMMakerSqueakExampleWorkflowHelp class>>examiningOutput (in category 'pages') -----
+ examiningOutput
+ 	^HelpTopic
+ 		title: 'Examining Output'
+ 		contents:
+ 'TODO: tty fix apperent but in build directory as it is outputing to /cmake.build.linux64x86w32BitCompatibility/squeak.cog.v3/build/ 
+ and not cmake.build.linux32_64x86
+ 
+ Examining the output requires two queries (both intuitive, via the intention revealing names of the Builder and Configuration)
+ 
+ First, we ask the builder where it has its Configurations put their output:
+ 
+ SqueakLinux64x86w32CompatBuilder buildDirectory 
+ -->  ''cmake.build.linux32_64x86''
+ 
+ 
+ The Linux32x86SqueakCogV3Config writes itself to a directory that matches its [cmake.Platform]/[Language].[VM].[MemoryModel]/[BuildType]
+ 
+ On my system that is:
+ 
+ ~./..../cogVMMaker/oscogvm/cmake.[Platform]/[Language].[VM].[MemoryModel]/build
+ i.e.
+ ~./..../cogVMMaker/oscogvm/cmake.build.linux32_64x86/squeak.cog.v3/build
+ 
+ I open a terminal and navigate to that directory:
+ 
+ cd ~./..../cogVMMaker/oscogvm/cmake.build.linux32_64x86/squeak.cog.v3/build
+ 
+ and list the contents 
+ 
+ bash-4.2$ ls
+ ADPCMCodecPlugin      LICENSE.txt            SurfacePlugin
+ AsynchFilePlugin      LargeIntegers          Utils.cmake
+ B2DPlugin             LocalePlugin           ZipPlugin
+ BMPReadWriterPlugin   MIDIPlugin             build.cmake
+ BitBltPlugin          Matrix2x3Plugin        build.sh
+ CMakeLists.txt        MiscPrimitivePlugin    config.cmake
+ CroquetPlugin         Mpeg3Plugin            config.in
+ DSAPrims              PLUGINS.txt            directories.cmake
+ DropPlugin            Plugins.cmake          sqNamedPrims.h
+ FFTPlugin             SecurityPlugin         testDoubleWordAlignment.c
+ FileCopyPlugin        SerialPlugin           testDoubleWordOrder.c
+ FilePlugin            SocketPlugin           testLanginfoCodeset.c
+ FloatArrayPlugin      SoundCodecPrims        vm-display-X11
+ FloatMathPlugin       SoundGenerationPlugin  vm-display-null
+ JoystickTabletPlugin  SoundPlugin            vm-sound-ALSA
+ Klatt                 StarSqueakPlugin       vm-sound-null
+ ....
+ 
+ 
+ (NOTE TODO tty: build a query to have a configuration return its build directory path.)
+ 
+ '
+ 
+ 
+ !

Item was added:
+ ----- Method: CMakeVMMakerSqueakExampleWorkflowHelp class>>invokeCMake (in category 'pages') -----
+ invokeCMake
+ 	^HelpTopic
+ 		title: 'Invoke cmake'
+ 		contents:
+ 'The next step is to tell CMake to create the native build files.
+ 
+ On linux the commands are:
+ 
+ cmake .                    <----N.B. note the ''dot'' after the cmake
+ make
+ 
+ As a convenience, the commands are duplicated in a generated ''build.sh'' file .  (I have had some wierd issues with running it directly, so I just run the commands therein)
+ bash-4.2$ cat build.sh 
+ #!!/usr/bin/env bash
+ export CC=gcc
+ export CXX=g++
+ cmake .
+ make
+ 
+ 
+ When CMakeVMMakerSqueak is ported to different platforms, then the ''make'' command could be replaced by a different native build system command.
+ 
+ 
+ '!

Item was added:
+ ----- Method: CMakeVMMakerSqueakExampleWorkflowHelp class>>overview (in category 'pages') -----
+ overview
+ 	^HelpTopic
+ 		title: 'Overview'
+ 		contents:
+ 'On a given Platform, a platform specific Builder configures a platform specific Configuration for a buildType and instructs it to  write its CMake output to that Configuration''s build directory.
+ 
+ This terse example shows a typicall use-case of the tools.
+ 
+ In this terse example, I want to build a Cog VM for Squeak with the V3 memory model. on a SlackwareLinux64 with 32 bit Compatability libs platform.  
+ 
+ To do this, I ...
+ 
+ 1. Select the Builder for my platform.  
+ 2. Query the Builder
+ 3  Select a Configuration
+ 4 Instruct  the Configuration (via the Builder) to configure itself for a builtType
+ 5. Instruct the Configuration (via the Builder) to enable message tracking (useful for debugging output)
+ 6. Instruct the Configuration (via the Builder) to generate its CMake output.
+ 7 
+ 8 Invoke the native build system.
+ 9. Test the generated VM.
+ '!

Item was added:
+ ----- Method: CMakeVMMakerSqueakExampleWorkflowHelp class>>pages (in category 'accessing') -----
+ pages
+ 	^#(overview selectBuilder queryBuilder selectConfiguration configureAndGenerate examiningOutput invokeCMake testDrive)!

Item was added:
+ ----- Method: CMakeVMMakerSqueakExampleWorkflowHelp class>>queryBuilder (in category 'pages') -----
+ queryBuilder
+ 	^HelpTopic
+ 		title: 'Query the Builder'
+ 		contents:
+ 'I can query the Builder for information on available Configurations and BuildTypes
+ 
+ SqueakLinux64x86w32CompatBuilder 
+ 	availableBuildConfigurations.
+ 
+ SqueakLinux64x86w32CompatBuilder 
+ 	allBuildTypes.
+ 
+ SqueakLinux64x86w32CompatBuilder 
+ 	availableBuildTypesFor:(SqueakLinux64x86w32CompatBuilder availableBuildConfigurations at:1).
+ 
+ SqueakLinux64x86w32CompatBuilder 
+ 	buildDirectory.
+ 
+ The ''queries'' protocol of the SqueakCMakeVMMakerAbstractBuilder contains additional queries.
+ 
+ SqueakCMakeVMMakerAbstractBuilder class browse.
+ '
+ 
+ 
+ !

Item was added:
+ ----- Method: CMakeVMMakerSqueakExampleWorkflowHelp class>>selectBuilder (in category 'pages') -----
+ selectBuilder
+ 	^HelpTopic
+ 		title: 'Select a Builder'
+ 		contents:
+ 'I select the appropriate Builder from the CMakeVMMakerSqueak-Builder category for my platform; in my case it is the SqueakLinux64x86w32CompatBuilder.
+ 
+ 
+ SqueakLinux64x86w32CompatBuilder browseHierarchy.
+ 
+ SqueakCMakeVMMakerAbstractBuilder browseHierarchy.
+ 
+ '!

Item was added:
+ ----- Method: CMakeVMMakerSqueakExampleWorkflowHelp class>>selectConfiguration (in category 'pages') -----
+ selectConfiguration
+ 	^HelpTopic
+ 		title: 'Select a Configuration'
+ 		contents:
+ 'The Configuration Linux64x86w32BitSqueakCogV3Config is available for my platform. (i.e. a developer has done the work of encapsulating the custom CMake for us).
+ 
+ As stated before, I can view what Configurations are available for a platform by asking the platform Builder what it has available:
+ 
+ SqueakLinux64x86w32CompatBuilder 
+ 	availableBuildConfigurations.
+ 
+ As of this writing the Linux64x86w32BitSqueakCogV3Config is available and I decide on it.
+ 
+ Note that the class name of the Configuration is intention-revealing. It is a Configuration for the Linux 64 platform with 32 Bit compatibility libs that encapsulates the CMake required to build the Squeak Cog V3 virtual machine. From this convention, The organization of configurations is straight-forward:
+ 
+ CPlatformConfigForSqueak  browseHierarchy
+ 
+ Linux64x86w32BitSqueakCogV3Config browseHierarchy
+ '
+ 
+ 
+ !

Item was added:
+ ----- Method: CMakeVMMakerSqueakExampleWorkflowHelp class>>testDrive (in category 'pages') -----
+ testDrive
+ 	^HelpTopic
+ 		title: 'Test Driving the VM'
+ 		contents:
+ 'The Cog svn tree contains a directory named ''products'' where it stores its make output.
+ 
+ The CMakeVMMakerSqueak system mirrors that with a cmake.products directory that is created at the same level.
+ 
+ 
+ The newly generated VM is stored in a subdirectory of ''cmake.products" that mimics the [Language][VM][MemoryModel] naming convention of the Configuration
+ 
+ Since I built a #Linux32x86SqueakCogV3Config the cog vm is placed in the cmake.products/squeak.cog.v3  directory.
+ 
+ TODO: Add a message name showing where this is customized.
+ '!

Item was changed:
  ----- Method: CMakeVMMakerSqueakHelp class>>pages (in category 'accessing') -----
  pages
+ 	^#( CMakeVMMakerSqueakStartHereHelp CMakeVMMakerSqueakExampleWorkflowHelp CMakeVMMakerSqueakDeveloperHelp )!
- 	^#( CMakeVMMakerSqueakStartHereHelp CMakeVMMakerSqueakDeveloperHelp )!

Item was removed:
- ----- Method: CMakeVMMakerSqueakStartHereHelp class>>exampleWorkFlow (in category 'pages') -----
- exampleWorkFlow
- 	^HelpTopic
- 		title: 'Example Workflow'
- 		contents:
- 'I want to build a Cog VM for Squeak with the V3 memory model. on a SlackwareLinux64 with 32 bit Compatability libs platform.  
- 
- To do this, I ...
- 
- 1. Choose the Builder for my platform.  
- 2. Choose the Configuration I need for my [Platform][Language][VM][Memory Model] 
- 3. Choose a Build Type for the Configuration. 
- 4. Write the CMake output.
- 
- So, here we go.
- 
- I choose the appropriate Builder from the CMakeVMMakerSqueak-Builder category for my platform; in my case it is the SqueakLinux64x86w32CompatBuilder.
- SqueakLinux64x86w32CompatBuilder browse.
- 
- I can query the Builder for available Configurations and BuildTypes for that Configuration and where it will put its output by sending the following messages: (presented here with output from my system below the message send)
- 
- SqueakLinux64x86w32CompatBuilder availableBuildConfigurations.  
- --> a SortedCollection(#Linux64x86w32BitSqueakCogV3Config)
- 
- SqueakLinux64x86w32CompatBuilder allBuildTypes.  
- --> an OrderedCollection(#build #buildAssert #buildAssertITimerHeartbeat #buildDebug #buildDebugITimerHeartbeat #buildITimerHeartbeat #buildMultiThreaded #buildMultiThreadedAssert #buildMultiThreadedDebug #buildNone)
- 
- SqueakLinux64x86w32CompatBuilder availableBuildTypesFor:(SqueakLinux64x86w32CompatBuilder availableBuildConfigurations at:1).
- --> an OrderedCollection(#build)
- 
- SqueakLinux64x86w32CompatBuilder buildDirectory 
- -->  ''cmake.build.linux32_64x86''
- 
- The availableBuildConfigurations message shows I have a Linux64x86w32BitSqueakCogV3Config available.  (As additional Configurations and their buildTypes are added to the system they will show up in these queries). 
- 
- 
- The allBuildTypes message shows the universe of possible build types:  
- --> an OrderedCollection(#build #buildAssert #buildAssertITimerHeartbeat #buildDebug #buildDebugITimerHeartbeat #buildITimerHeartbeat #buildMultiThreaded #buildMultiThreadedAssert #buildMultiThreadedDebug #buildNone)
- 
- Out of the universe of allBuildTypes, The availableBuildTypes message shows me that (at the time of this writing) the Linux64x86w32BitSqueakCogV3Config only supports one build type:
- -->  an OrderedCollection(#build)
- 
- Now that I know what is possible, I  instruct the Builder to ask the Linux64x86w32BitSqueakCogV3Config Configuration to configure itself for the buildType: #build ,  enable trace messages in the CMake files to make troubleshooting easier and generate the CMake build tree: 
- 
- SqueakLinux64x86w32CompatBuilder 
- 	configureA: #Linux32x86SqueakCogV3Config forBuildType: #build;   
- 	enableMessageTracking: true;
- 	generateByTemplate.
- 
- (FYI the above provides no user feedback)
- 
- The Linux32x86SqueakCogV3Config writes itself to a directory that matches its [cmake.Platform]/[Language].[VM].[MemoryModel]/[BuildType]
- 
- On my system that is:
- 
- /home/tty/usr/src/smalltalk/CMake.oscog/cogVMMaker/oscogvm/cmake.[Platform]/[Language].[VM].[MemoryModel]/build
- i.e.
- /home/tty/usr/src/smalltalk/CMake.oscog/cogVMMaker/oscogvm/cmake.build.linux32_64x86/squeak.cog.v3/build
- 
- I open a terminal and navigate to that directory:
- 
- cd /home/tty/usr/src/smalltalk/CMake.oscog/cogVMMaker/oscogvm/cmake.build.linux32_64x86/squeak.cog.v3/build
- 
- I run the commands in the generated ''build.sh'' file.  (I have had some wierd issues with running it directly, so I just run the commands therein)
- bash-4.2$ cat build.sh 
- #!!/usr/bin/env bash
- export CC=gcc
- export CXX=g++
- cmake .
- make
- 
- If things work, you will have a working VM in the products directory on my system I see:
- 
- bash-4.2$ ls /home/tty/usr/src/smalltalk/CMake.oscog/cogVMMaker/oscogvm/cmake.products/squeak.cog.v3/
- cog  vm-display-X11  vm-display-null  vm-sound-ALSA  vm-sound-null
- 
- I test the VM
- 
- bash-4.2$ cd /home/tty/usr/src/smalltalk/CMake.oscog/cogVMMaker/oscogvm/cmake.products/squeak.cog.v3/
- 
- bash-4.2$ ./cog -version
- . #1 Tue Dec  9 13:17:50 EST 2014 gcc 4.8.2 [Production VM]
- CoInterpreter VMMaker.oscog-eem.973 uuid: 1c182b73-874c-48f7-a4f4-61255efdc565 Dec  9 2014
- StackToRegisterMappingCogit VMMaker.oscog-eem.972 uuid: 741005af-763d-4a93-918d-014972c404ef Dec  9 2014
- VM: r3164 http://www.squeakvm.org/svn/squeak/branches/Cog Date: 2014-12-06 20:38:11 -0500
- Plugins: r3131 http://squeakvm.org/svn/squeak/trunk/platforms/Cross/plugins
- Linux flipper 3.10.17 #2 SMP Wed Oct 23 16:34:38 CDT 2013 x86_64 AMD Phenom(tm) II X4 965 Processor AuthenticAMD GNU/Linux
- plugin path: /home/tty/usr/src/smalltalk/CMake.oscog/cogVMMaker/oscogvm/cmake.products/squeak.cog.v3/ [default: /home/tty/usr/src/smalltalk/CMake.oscog/cogVMMaker/oscogvm/cmake.products/squeak.cog.v3/]
- 
- And, that''s about it.'!

Item was added:
+ ----- Method: CMakeVMMakerSqueakStartHereHelp class>>nextSteps (in category 'pages') -----
+ nextSteps
+ 	^HelpTopic
+ 		title: 'Next Steps'
+ 		contents:
+ 'The next Help Topic entitled "Example Workflow" will walk you through an example workflow as executed on a GNU Linux system with the standard development tools. Macintosh and Windows dev tools will differ (N.B. tty The primary difference is that they have not been written yet (:  ).
+ 
+ The Help Topic entitled "Developer Guide" will explain the design of and how to add and modify the components of the CMakeVMMakerSqueak system.
+ 
+ 
+ '!

Item was changed:
  ----- Method: CMakeVMMakerSqueakStartHereHelp class>>pages (in category 'accessing') -----
  pages
+ 	^#(overview requirements nextSteps)!
- 	^#(overview requirements exampleWorkFlow)!

Item was changed:
  ----- Method: CMakeVMMakerSqueakStartHereHelp class>>requirements (in category 'pages') -----
  requirements
  	^HelpTopic
  		title: 'Requirements'
  		contents:
  'CMakeVMakerSqueak (as of 2014.12.09) depends on the Pharo package CMakeVMMaker. A (possibly out-of-sync) Monticello version is available at:
  
  MCHttpRepository
  	location: ''http://source.squeak.org/VMMaker''
  	user: ''''
  	password: ''''
  
  CMakeVMMakerSqueak is available at:
  
  MCHttpRepository
  	location: ''http://source.squeak.org/VMMaker''
  	user: ''''
  	password: ''''
  
  CMake is available from http://www.cmake.org. The version of CMake used as of 2014.12.09 is 2.8.12  
  
  CMake provides a cmake_minimum_required(..) command, so newer versions should be ok.
  
+ The next Help Topic entitled "Example Workflow" will walk you through an example workflow  is presented on a GNU Linux system with the standard development tools. Macintosh and Windows dev tools will differ.
+ 
+ 
+ '!
- The Example Workflow is presented on a GNU Linux system with the standard development tools. Macintosh and Windows dev tools will differ.'!



More information about the Vm-dev mailing list