C/C++ compilation on Windows
- Details Hits: 15509
There are multiple posibilities to develop C/C++ applications on windows and then running them on the cluster. The preferred method is using an IDE (Eclipse http://www.eclipse.org or Netbeans http://www.netbeans.org) locally and transfer your project to the cluster.
It is hard to do this when you can not compile your program using GCC.
You should install CYGWIN or MINGW for that.
Cygwin
If you need to use MPI or OpenMP i suggest to install cygwin. You can get the latest version from http://www.cygwin.com/.
Download the setup.exe file, select download and install, if you are in romania the ftp://ftp.iasi.roedu.net mirror works fine.
Packages to select:
- automake
- autoconf
- gcc, g++, gfortran
- gcc4, g4++, gfortran4
- make
- ddd
After you finish, you can install (build) OpenMPI from here: http://www.open-mpi.org/software/ompi/v1.3/. That's it: you're ready to go.
Some troubleshooting
The reason i opted for MinGW was an error i could not shake when running eclipse and C++. Eclipse did not know of
#include ctime
for example. I found the workaround. In the project build, right click on the project -> Properties -> Cygwin C++ Compiler -> Directories
Include paths -I "C:\Tools\Cygwin\usr\include", "C:\Tools\Cygwin\lib\gcc\i686-pc-cygwin\3.4.4\include\c++"
right click on the project -> Properties -> Cygwin C++ Linker-> Libraries
Library search path -L "C:\Tools\Cygwin\usr\lib"
And done.
MinGW
I had problems compiling c++ apps on cygwin (did not find the package for ctime). The alternative is MinGW. This is a smaller install that works only with gcc 3.4.5 and g++. It's smaller and the C++ app just compiled.
Eclipse
You can download the last C/C++ version from here: http://www.eclipse.org/downloads/
All you need is Java. You should also install Subclipse. http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA
Another thing you can do is mount your home directory from the cluster locally. This is done by using a VPN to the Cluster site and "Attach Network Drive ..." from windows explorer. (not covered in this article).