# MSS Code Factory: A Fractal Programming System

Prev | Documentation Home | Next

## Configuring the Installation

### Windows 10 WSL Ubuntu Setup

Windows Services for Linux with Ubuntu 17.04 is a very handy add-on to the Windows environment stack, allowing me to continue to use my Git Package, Archive, and Build scripts for the pieces that fall under the Linux domain for my project. The Java stack is split between the Windows and WSL environments. I've successfully built the Java code with JDK 9 for 2.8 through 2.10 under this hybrid code stack.

I installed the JDK 9's for both environments -- Oracle JDK 9 for Windows and openjdk-9-jdk-headless for WSL.

Git and ant were installed for both environments. Ant for WSL recommends a whole bunch of extra stuff to go with it, and I installed pretty much all of the recommendations.

There were some extra Windows tools to install to support GPG signing and SSL encryption. Both environments have been configured, though I can't get GPG encryption and SSL encryption to share keys; they use different armored formats.

You'll do a lot of googling for things like "Windows SSL git config" and "Windows Kleopatra Git config", but I'm not going to document the details -- there is plenty of fine documentation out there that I just followed to get things up and running.

I pruned the JavaFX code from 2.8 and 2.9 so they can both be built with openjdk-9-jdk-headless. That means no more CFBam editor. That will only exist for the 2.10 code base.

The build environments used for the projects are as follows:

- MSS Code Factory 8 is built with WSL openjdk-9-jdk-headless
- edu.princeton.wordnet is built with WSL openjdk-9-jdk-headless
- MSS Code Factory 9 source is built with Oracle JDK 9
- MSS Code Factory 10 source is built with Oracle JDK 9

I have a collection of environment scripts in the home-template subdirectory on the web server for you to download easily. There are initialization files for the WSL and Windows home directories there. Don't forget to replace the "dot-" part of the file names with ".". You'll find the patterns "Your Name" and "your@email.address" throughout the files; edit them appropriately. You'll also need to provide your SSL and GPG key ids.

I also have a copy of the jars I depend on for Java builds in the apache.org directory of the download server. Most of these are the versions from Ubuntu 17.04 and the relevant apache.org websites, refreshed only this past fall.

I expect MSSCFHOME to be set to "d:\msscodefactory" under Windows. In theory you could point it somewhere else, but I kind of assume you're on D:. I should probably add an MSSCFDRIVE environment variable that specifies the drive letter and then an MSSCFDIR that is MSSCFDIR without the drive letter. MSSCFHOME would then be set to match. If I then specify "%MSSCFDRIVE%:" in my scripts instead of "d:", I should be able to make the installation location-agnostic, though I do assume exactly one installation per machine.

Correspondingly, MSSCFHOME needs to be set to the /mnt/drive/msscodefactory location matching the Windows directory in your .profile. You'll find the pattern strings "Your Name" and "your@email.address" littering the template files. Edit them accordingly. You'll also need to edit the SSL and GPG key ids according to your keys.

I need to document the system environment variables and PATH elements I expect you to set for the Windows 10 environment. I rely on those in my scripts.

### Ubuntu/Debian amd64 Linux

Download a copy of MSS Code Factory from the SourceForge download servers, and extract it. I recommend the following:

`cd $HOME mkdir msscodefactory cd msscodefactory mkdir runtime-2.9 cd runtime-2.9 unzip net-sourceforge-MSSCodeFactory-2-9-<version>-installer.zip`

I'm going to assume you've extracted it this way as we work through the next steps.

Make sure your JDK_HOME and JAVA_HOME variables point to a valid JDK 8 installation; I use OpenJDK under Debian Linux, with the optional OpenJFX package installed. I have used the Oracle JDK 8 as well, though it causes problems with the build of the CFCore 2.7 project itself due to overly-aggressive optimization. It also causes problems for manufacturing code, because the JIT is overly aggressive about optimization. However, it works fine for delivered projects; you just shouldn't use it for running this tool or building it.

Add the extracted tool's bin directory to your PATH in your $HOME/.profile, and then source your .profile or log out and back in again.

`export PATH="${HOME}/msscodefactory/runtime-2.9/bin:${PATH}"`

Download a .msscfrc template file from the MSS Code Factory 2.9 documentation website, and modify it accoring to your platform's configuration. It should look something like this:

`msscf.cartridgedir=/home/msobkow/msscodefactory/net-sourceforge-MSSCodeFactory-Cartridge-2-9/cpluscartridge-2.9 msscf.cartridgedir1=/home/msobkow/msscodefactory/net-sourceforge-MSSCodeFactory-Cartridge-2-9/javacartridge-2.9 msscf.cartridgedir2=/home/msobkow/msscodefactory/net-sourceforge-MSSCodeFactory-Cartridge-2-9/dbcartridge-2.9 msscf.cartridgedir3=/home/msobkow/msscodefactory/net-sourceforge-MSSCodeFactory-Cartridge-2-9/anycartridge-2.9 msscf.modeldir=/home/msobkow/msscodefactory/net-sourceforge-MarkII-1-1/model-2.9 msscf.modeldir1=/home/msobkow/msscodefactory/net-sourceforge-MSSCodeFactory-2-9/java/model-2.9 msscf.rootgendir=/home/msobkow/msscodefactory`

You'll need to download the net-sourceforge-MSSCodeFactory-Cartridge-2-9 project separately and extract it into an appropriate subdirectory under msscodefactory. As long as the paths are correct in your .msscfrc, the rules will be found. The engine itself will rarely update, but the rules update quite regularly.

You can specify additional model and cartridge paths as "cartridgedir1" or "modeldir1", and they will be searched in the order specified. You'll probably want to create a separate model directory for your projects, and make it the first model directory searched, with the runtime-2.9/model-2.9 directory being the modeldir1 entry that is searched second (that way when you're working with the editor it will save your models to your model directory by default instead of the directories of the tool itself.)

If you want to give it a thorough test, manufacture the CFDbTest project as follows:

`ManufactureCFDbTest210.bash`

If you here the factory beeping due to exceptions being thrown, something is configured wrong. What you should see is a rapid stream of messages about the source code being manufactured.

When the run is done, you should have a source tree for the project created to `$HOME/msscodefactory/net-sourceforge-MSSCodeFactory-CFDbTest-2-10`.

Congratulations! Your installation is ready to use.