MathCode C++ for Windows:
Installation instructions and administration

MathCode C++ Version 1.4.9,

February 26, 2018

Important to remember

When you start MathCode: Remember to close all Mathematica sessions before using MathCode.

Remember to use always the MathCode C++ button available in your Start Menu. (MathCode C++ app group in Windows 8).

This button starts a batch file which sets up correct environment for your C++ compiler, and then starts Mathematica.  

Installation step by step

Please follow these steps for successful MathCode C++ installation.

MathCode C++ : Required C++ Compiler

Further instructions

MathCode C++: Required C++ Compiler

You must either

MathCode C++: Start setup

Run the program you downloaded or found on a CD and follow the on-screen instructions. The See Choose which C++ compiler you will use, it explains how the setup system determines which C++ compiler you will use.

Use the MathCode C++ button in Start menu in order to start MathCode C++.

MathCode C++:  Choose which C++ compiler you will use.

The setup system asks you to select a compiler: Currently these compilers are suggested:

 

  Visual Studio 2013

  Visual Studio 2015

  Visual Studio 2017  

 

If you have Microsoft Visual C++ installed in your machine it will be detected.

 

MathCode C++: Advanced issues

Advanced case: compiler is installed but it is not detected during setup.

During installation you have to click on the Browse button and browse to any other existing directory on your disk. A batch file should exist in this directory. This batch file should set some environment variables for your compiler, but you have to move object files as well.

 

Advanced case: if you want to change the C++ compiler after MathCode C++ installation

 

Please re-install MathCode C++. The setup will detect a new compiler automatically.

 

 

Using a different unsupported compiler

 

The precompiled object files distributed are compiled using (MingW32 version and) Visual C++ versions mentioned above. If you wish to use another compiler, you need to recompile the array library and re-generate code for the standard packages.

 

Recompiling the array library

 

Open a command prompt and  go to the directory MathCode\lib\lightmat\src

Edit compwin.bat . Select there a compiler that matches best your choice, duplicate the entry for it and adjust the Makefile for it if necessary.

type compwin.bat

This will recompile the array library for your current version. You should also change the default compiler as described above.

Regenerating code for standard packages

Open the notebook lib/stdpackages/src/System.nb in Mathematica. Select "Evaluate Notebook" from the "Kernel" menu. This will regenerate compiled code for this package.

Further instructions

Check your Mathematica and Windows version

Mathematica 10.0 and 11.0 are supported.  Versions above 12.0 are not supported. 

Windows7, Windows 8, Windows 10 are supported.

During the installation you will need to specify the location of Mathematica. You should select the Mathematica directory manually. This should be the directory containing the file MathKernel.exe.

Determine your $MachineID

The $Machine ID is needed for registration. It is the identity of the machine you want a license for. To find out your $Machine ID, evaluate the following in Mathematica:

$MachineID

Obtain the license key for purchased license

You should register to get a key file that will enable you to use the software. If you purchased the software you can register it online at the following URL:

/register.html

Please do not use this page for demo (trial) licenses !

When you start installation of MathCode you can click the button Register to register your software.

Within two business days you should receive an e-mail with the key file attached. Save the attachment to a file. Remember where you saved it; you will need to select this location during MathCode F90 installation.

Obtaining license key for demo(trial) license

You apply for demo(trial) license using online demo request form at

/products/mathcode

and click on Download Trial version.

When you start installaion of MathCode you should not click the Register button to register your software.

Within two business days you should receive an e-mail with the key file attached. Save the attachment to a file. Remember where you saved it; you will need to select this location during MathCode F90 installation.

Check for the latest release

Since MathCode relies on many other software products that often change their versions and properties please always download the latest version from the address you get from us together with your key file; currently it is

/products/mathcode

Start setup

Run the program you downloaded  and follow the on-screen instructions.

Running MathCode

Always use the MathCode button in Start Menu

Remember to always use the MathCode C++ button available in your Start Menu. This button starts a batch file which sets up correct environment for your C++ compiler, and then starts Mathematica.

If you start Mathematica without using this button, you will typically get errors during compilation phase since the C++ compiler will not be found.

License management

What are licenses?

For each machine you wish to run MathCode on, you should obtain one key file containing the license. MathCode uses the same $MachineID as Mathematica does to distinguish between machines. A key file is a text file containing a mix of letters and digits. Key files should be put into the Licensing subdirectory of the MathCode installation. The names of the key files do not matter.

Adding a license

When you register for a new MathCode license, you will receive a file that should be put in the Licensing subdirectory of your MathCode installation.

The license index file

MathCode will use an index file index.m in the Licensing directory to speed up license lookups. If a new license is added, index.m is rebuilt automatically as needed.

If you experience problems with the licensing, you can remove the index.m file, forcing MathCode to rebuild it on the next license check.

For a site installation, users might not have write permissions to the Licensing subdirectory. In this case, the system administrator should rebuild the index file by evaluating the following in Mathematica:

Needs["MathCode`"];

RebuildIndex[ToFileName[{$MCRoot,"Licensing"}]];

If index.m didn't exist, you will se an error message about opening it. This error message can safely be ignored.