Center for Communications and Digital Signal Processing (CCDSP)

CCDSP Silicon DSP Corporation CCDSP Tech Blog

Notes on Developing with Capsim on MSYS2 64 Bit

Capsim 64 Bit MSYS2 Announcement

CapsimTMK Installation and User Guides


This guide show how to add all the tools to 64 Bit MSYS2 to develop blocks in Capsim and Create Custom Capsim Executables.

After thsi you will have a nice MSYS2 environment for developing 64 bit C Code in general.

Go to:

and download msys2-x86_64_....

The 64 bit version.

Install MSYS2 64 Bit.


Go to Programs (Windows Start) and select 64 Bit MSYS2.

Your home directory will be (where usename is your Windows 7 or 10 username):


Which on a C drive is:


You can override this by setting the HOME environment variable to a different location. (Control Panel System Advanced Environment Variables)

For developing new blocks and subroutines you need to do the following:

1- Install gcc:
pacman -Sy gcc

If you get an error. Close window. Start msys 64 bit and use:
pacman -Sy --force gcc

2- Install the tool chain:
pacman -Sy mingw-w64-x86_64-toolchain base-devel

3- Install perl:
pacman -Sy perl

4- Java Installation:
Java is required by Capsim TMK development. We also provide a nice graphical block diagram viewer in Java as well as Plotting capability
Java with Saxon is used to convert XML blocks into C code.
Installation is as follows:
Install 64 bit Java JDK for Windows ( you can also just install the JRE but JDK allows for java application development).
Using Windows Explorer find out where Java was installed. For example:

C:\Program Files\Java\jdk1.8.0_66\bin

Now this is a Windows type path. You need to add the Java bin path to MSYS2's PATH:

So you would do the following in the MSYS window.

export PATH=$PATH:/c/Program\ Files/Java/jdk1.8.0_66/bin

Note the UNIX paths. Much better. Also the "\" escape of the space in "Program Files"

5- Instead of updating the PATH every time you can set it in the .bash_profiles directory in your HOME directory
so it will be updated when you start an MSYS2 terminal.

6- Also add other environment variables such as CAPSIM and LD_LIBRARY_PATH etc.

7- Test java by typing "java". Also test perl by typing "perl --version" at the terminal.

8- install bison:
pacman -Sy bison
Bison is a bunch of tools ( e.g. yacc, awk etc). Since we support equation parsing in Capsim, we need yacc.

9- Get a graphical editor. We like TextPad . You can set Textxpad's exe in the PATH. Or use JEDIT(Use Windows Install EXE).

10- Get vim the editor for UNIX.
pacman -Sy vim
11- If you are used to vi set this alias in your .bash_profile file: alias vi=vim

12- Install make:
pacman -Sy make

13- Install JPEG
pacman -S mingw-w64-x86_64-libjpeg-turbo

14- Install winpty

Click here for this very imporatnt step.

--- BUILDING CAPSIM From Source Files ---

Note this is not necessary since we supply all the libraries and binaries. But good to know.

1- set CAPSIM environemnt variable. Point to the directory CAPSIM_TMK, that is
cd to CAPSIM_TMK. Use the command pwm to get the present working directroy. Then set Capsim using:
export CAPSIM=the_directory
Add this command to you .bash_profile so it is run when you start an 64 Bit MSYS2 Console.

2- cd $CAPSIM
3- cd KERNEL
4- type:
This will create libkrn.a and copy it to LIBS folder
5- cd ../SUBS
6- Type:
This will create libsubs.a an dcopy it to LIBS.
7- A big step. Create the blocks library:
cd ../BLOCKS
make -f blocks.mak

This will take a while. All XML blocks are converted to C Code (using saxon.jar amd blockgen.xls in the TOOLS folder )
Then the C files are compiled.
The archive libblock.a is created.

8- cd to the WORK directory.
9- Do this once:
10- Then type:

11- Capsim will be created.

12- You might get a complaint about missing tcl dll. Just copy it to your directroy:
cp $CAPSIM/LIBS/tcl84.dll .

13- To run type:
winpty ./capsim -b

This brings up the intercative mode.

14- For TCL type:
winpty ./capsim -c
The '%' prompt will appear indicating the TCL shell is working.
type help
to run a test type:
source test.tcl

then type:

A good command is
display a

Use Control C to exit. (You can also type exit, but if you do it twice you also exit the terminal!).

For updates on this document visit:

© 2007-2017 Silicon DSP Corporation