Personal tools
You are here: Home / cmgui / Wiki / Windows instructions using Cygwin
Log in

Forgot your password?

Windows instructions using Cygwin

The most popular offerings of the GNU toolchain (compilers, linkers, runtimes) under windows are cygwin and mingw. We commonly build cmgui for windows within the cygwin environment so we can use all the unix utilities we know and love. However, we never build cygwin binaries which would would have an undesirable dependency on the cygwin1.dll, cygwin's emulation layer over windows. Instead we build MinGW binaries which work directly with windows runtime libraries, i.e. msvcrt. To achieve this, we note that MinGW is installed with cygwin and mingw binaries are built by passing the -mno-cygwin (''no cygwin'') switch to the GNU compilers and linker: the cmgui makefiles do this automatically under cygwin. This means that all additional libraries like wxwidgets, mesa etc. need to be built for mingw; if you do not consistently build for MinGW, you will receive a large number of linker errors at the end of compilation!

The following description was written towards the end of 2005 and is kept for posterity. You are probably better off looking at the more up to date Peter's notes on building cmgui

<h2>Step 0: Install Cygwin</h2> Cygwin is a Linux-like environment for Windows. Once installed you can start up a shell and use all the usual linux commands (assuming you opted to install the relevant packages). It is recommended you install Cygwin if you wish to build cmgui on a windows machine as it makes the process much simpler. For instructions see Installing Cygwin.

<h2>Step 1: Build perl</h2> You need MSYS(which requires MinGW). Get MSYS and MinGW at "", You need a working system perl(not specific to cmgui), which could come from Cygwin. (Note MinGW can be installed with Cygwin).

Start a shell using the icon created by the MSYS installer, change to the directory in which you want to create the perl build subdirectory. Check out the perl cvs module from CMISS CVS, and change into the perl/build subdirectory. Run "unset SHELL" and "export SYSNAME=win32". Also be sure to set CMISS_ROOT to the directory into which you are checking out everything into. Then run "perl". This will produce the perl binary required in $(CMISS_ROOT)/perl/lib/CORE/libperl.a <h2>Step 2: Build perl_interpreter</h2> After building perl, run MinGW as above, and set the environment variables as above. Checkout the perl_interpreter, and go into the perl_interpreter directory, and type make OPT=1 INCLUDE_PERL=1. <h2>Step 3: Build cmgui</h2> checkout image_libraries, linear_solvers, cm, and cmgui into the same directory(the same as the one you checked out the perl_interpreter into). From the cygwin(not MSYS) shell, go into the directory where you checked everything out, and type: <pre> export CMISS_ROOT=`pwd` export SYSNAME=win32 cd image_libraries make cd .. cd linear_solvers make cd .. cd cmgui make -f cmgui.make cmgui-static-lib </pre>