Running Wales Group software on Windows 7

From Docswiki
Jump to navigation Jump to search

Running the Wales Group software on Windows 7 has not been thoroughly tested and is not officially supported. However, it is possible. This page describes downloading Cygwin, then using it to build and run the group software. Only the standard GMIN and OPTIM, using gfortran, have been attempted.

Downloading Cygwin

Cygwin is a Windows dynamic-link library (dll) which provides POSIX like functionality, along with a number of tools ported from Linux. Start by downloading the setup tool from here. Choose the appropriate 32-bit or 64-bit tool for you hardware. Run the setup program (you will need administrator privileges).

Installing Cygwin

The setup tool will lead you through the installation of Cygwin, which is pretty simple.

  • Select 'Install from Internet' as the download source.
  • The default install location is C:\cygwin or C:\cygwin64, feel free to leave it at that.
  • Use the recommended All Users installation, unless you have a good reason not to.
  • The local package directory will be used as a storage space in which to put packages between downloading and installation. The default location should be fine.
  • 'Direct Connection' is probably fine for the internet connection.
  • Try to select a mirror geographically near to you, although any should be fine. Later, if you find the download is very slow, try a different mirror.

The package list is very large and you should not install everything. Some packages will be selected automatically. This is the base install, so don't unselect any of them. You can mark a package for installation by using the search bar to find it, then clicking on 'Skip' to change it to the appropriate version number. In addition to the base packages, you should select at least:

  • cmake
  • gcc-fortran
  • gcc-g++
  • make
  • subversion
  • tcsh (for CHARMM only)
  • your favourite text-editor, eg. vim

Click 'Next' and the package list, including dependencies of all the extra packages, will be presented for your approval. When happy, click 'Next' again to start the installation. This may take a few minutes, depending on your hardware and internet speed.

New packages can be selected later by running the setup wizard again. This won't reinstall everything you've already got, unless you tell it to.

Running Cygwin

If you created a desktop icon, double click that to start Cygwin. Otherwise, double-click the 'Cygwin-Terminal' item in the Cygwin installation directory.

What you'll see is the terminal emulator mintty, running bash.

There's a standard Linux-like directory structure, with the root directory being the Cygwin installation directory. You can access the rest of the file system in /cygdrive. For example, the Windows home directory for a user might be at:

/cygdrive/c/Users/John

Downloading the group code

This should be exactly the same as on a Linux machine. Follow the instructions for SVN setup.

Building the group code

This is similar to on a Linux machine. Follow the instructions on Compiling Wales Group codes using cmake, with gfortran (the default) as the compiler.

The cmake warning:

CMake no longer defines WIN32 on Cygwin!

can be ignored, or suppressed using:

CMAKE_LEGACY_CYGWIN_WIN32=0 cmake <path-to-source>

The gfortran warning:

f951: warning: -fPIC ignored for target (all code is position independent) [enabled by default]

can be ignored, or suppressed by removing -fPIC from the CMAKE-Fortran-FLAGS list in the advanced section of ccmake.

Running the group code

This can be done from the Cygwin command line, in which case it's exactly like on a Linux machine.

By default, you won't be able to run the software outside the Cygwin environment. This is because Cygwin puts its dlls, including the all-important cygwin1.dll to which the executables will link, in for example C:\cygwin64\bin, which is not in the Windows path.

If you're feeling in a particularly Windowsy mood, try adding Cygwin's bin directory to the Path:

  • Right click on 'Computer' and select 'Properties'.
  • Click on 'Advanced System Settings'.
  • Click on 'Environment Variables'.
  • Under 'System Variables', highlight 'Path' and click 'Edit...'.
  • Add 'C:\cygwin64\bin' (or whenever you put Cygwin) to the end of the list, remembering that for Windows, entries in such lists are separated by semicola.

Then you'll be able to do Windows things, like running the executable by double-clicking it in Windows explorer (provided files like odata are in the same directory).

You can now also run the Cygwin tools from the Windows command prompt. Try opening a command prompt and typing 'bash'.