TPCCLIB development using C in Windows
This page gives instructions on setting up the necessary tools for compiling TPCCLIB in the Windows environment, for use in the Windows computers. Alternatively, Windows and Linux binaries can be compiled in WSL in Windows.
Installing C compiler
C libraries and programs can be compiled using GNU C compiler (gcc) in Windows.
Install either TDM-GCC,
MinGW-w64, or gcc including make and openMP from
Equation Solution.
If you plan to distribute the executables, TDM-GCC and Equation Solution gcc are easier options,
because they link all libraries statically by default; that leads to increased executable size, but
prevents errors like cannot find xxx.dll
when trying to use the programs on another
computer. Compiler and make from Equation Solution seems to work well with the
bash of Git for Windows, while TDM-GCC works with standard Windows
command prompt window.
If you have a previous installation of GCC compiler on your computer, uninstall those and remove all related environment settings before installing a new compiler and toolchain package to your computer, otherwise you may encounter spurious errors when trying to compile your C code.
Installing build, test, and packaging tool CMake
CMake is an open-source, cross-platform tool which is required to build, test, and package the TPCCLIB software. Download and install the binary package from http://cmake.org.
Installing bash shell
Bash command line interpreter system facilitates porting open-source software to MS Windows. TPCCLIB test routines are written as bash scripts, which can be executed in Linux and macOS, but usage of bash scripts in Windows requires installation of bash shell. It is not needed to run Windows executables compiled from TPCCLIB source codes.
It is possible to install MSYS using
MinGW installer,
but the easiest option is to install Git for Windows,
which provides Git bash, UNIX like tools such as grep
, and of course git
,
which can be then used to easily clone the
TPCCLIB source codes.
Some tools, such as rsync
, can be installed from MinGW/MSYS.
In Turku PET Centre: If you are installing Git for Windows in Turku PET Centre, create
first a new environment variable 'HOME', pointing to a folder on a local drive which you want to be
your home directory for Git bash; in TPC the home directory would be the very slow
M:
drive by default.
Compiling
Documentation for TPCCLIB gives instructions for compiling the C libraries and executables.
In order to use the compiled programs Windows must be told where to find the program files by adding the directory of compiled executables into the search path. Also the test procedure requires this setting.
Doxygen
TPCCLIB documentation is included in the TPCCLIB source codes, and to reproduce the HTML version of the documentation you must install Doxygen documentation system. To include diagrams and graphs in Doxygen documents install also the dot tool.
Doxygen can be used from either Windows command prompt window or from Git bash.
See also:
- Software development in TPC
- TPCCLIB development in Linux
- PET software
- List of TPCCLIB software
- Command-line interface (CLI)
- Windows Subsystem for Linux
Tags: C language, Software, Windows, bash, Shell, CLI, TPCCLIB
Updated at: 2023-12-11
Written by: Vesa Oikonen