Win32 Configuration for Scientific Computing
Ever feel like you couldn't get your work done in Windows? Well, by gum, there is a way. Below are recommendations for a setup under Windows 2000 which will put the libraries and applications you need at your fingertips. This is just one scientist's approach, but maybe it will help you get the job done.Our group regularly cross-compiles all code on Windows and Linux, so the libraries used focus on platform independence. Some parts of applications, however, are very platform-specific, like graphics in X11 or DirectX, and those require platform-specific tools. You will find both listed below.
When porting large bodies of unix code, it may be helpful to use the Cygwin runtime environment. This essentially flops you into a unix-under-win32. We have found that we can develop for both unix and win32 without using Cygwin by judicious platform-specific implementation couched in Design Patterns.
General Suggestions
- All libraries go in C:\program files\libname
- Put batch files in C:\bat. Put this in your path.
- Put utilities in C:\util. Put this in your path after the batch files.
- When you install a library or application, say doxygen-1.1.3, go ahead and make it C:\program files\doxygen-1.1.3, but use the Win2k Resource Kit's linkd utility to make a symbolic link C:\program files\doxygen.
- If an application you use does not like spaces in path names, store libraries in a C:\lib directory instead of using "C:\program files." We used to put anything without a windows installer in lib and all else in "program files," but having everything in "program files" hasn't been any trouble lately.
- Make the command line useful.
- Make several shortcuts to different sizes of command prompts. Small print is useful for long makefile compiles while large print is easier for file manipulation.
- You can open the properties of a shortcut to create a shortcut key, so that when you press Ctrl-Shift-C a command prompt appears on the screen.
- In the command prompt properties, turn on Insert Mode and Quickedit. Make the height of the screen buffer 1000.
- Turn on tab completion by running regedt32 and changing HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar to 9, which is the ASCII code for the tab key.
- In a lab environment, change the Start Menu and Taskbar properties to display a logoff menu.
- Set explorer options to show file extensions, hidden files, and all file types.
- Set the NetTime service to Automatic and give it ntp0.cornell.edu. This is useful for networked programs running on MPI. On the Microsoft developer site are general directions for the Windows Time service.
- Fix the size of the VM and paging file in the image so it can't fragment.
Software to Buy
- MS Visual Studio
- Fully installed. Wouldn't think to mention it, but it isn't currently in
our lab.
- Go ahead and install the system debug libraries. They won't slow your system.
- Remote debugging lets you run the debugger on one machine and the program on another. It requires you put some files in the system directory. We might have something helpful at our profiling and debugging help page.
- There is a help program with Visual Studio. We've had bad experience with version 6.0a crashing and difficulties installing the CDROMS in lab environments. Forget about it. Give yourself a bookmark to MSDN.Microsoft.com and get to know the libraries and search page. They are up-to-date and pretty quick.
- Intel VTune
- Intel reference compiler and tools. This compiler can handle templates Visual C++ cannot. You might need its more standard C++ implementation or its extra optimizations.
- Compaq (sic) Visual Fortran
- This Fortran works well in MS Visual Studio. It's expensive.
- Exceed
- X-server for Win32.
- Win2K resource kit
- The resource kit has a bunch of system administration toys, but there
are also profiling utilities.
- Also install the Unix utils from the kit.
- Are the debugging tools a separate install?
- Install ActivePerl from Win2k resource kit. That way you can do a global search and replace on all the files in a directory with the single command "perl -pi.bak -e 's/stringstart/stringreplace/g' *.cpp"
- Cygwin
- Cygwin is a posix runtime under win32. It should be slower than straight win32, by its nature, but it's useful for straight ports. I list it under software to buy because the current free versions are 1.0b and 2.0. 2.0 isn't fully functional. 1.0 Final is available only on CDROM for a typical Gnu price of about $40. That's what we use.
Free Software
We keep a local repository of these packages with recent versions. It's the sort of thing to have on a read-write CD so people can install at home. There is a folder for each package with the last version date at the end of the name. All of the source should be there, but you will still need to look at the web site to see how to install it. Installation advice sits in the folder under the file README.ajd27. Usually, if something needs to be compiled, we keep a compiled version in our local store.It is a great idea to download all the help documentation you see and put it with the program so people get used to finding help easily.
The information on whether the package has a setup or needs a reboot is collected for the sake of those who use SMS Installer. That information changes version to version, but it's worth trying to track. The applications are in an order in which you could install them. Dependencies have been specified below.
version | Need to read install page | Has setup | Requires reboot | Needs compilation | |
Winzip | 8.0 | no | yes | ? | no |
Any windowed zip will do. | |||||
Info-zip | 2.0.1 | no | no | no | no |
Preferred command-line zip, unzip and gzip | |||||
Acrobat Reader | 4.0 | no | yes | no | no |
To read Portable Document Format, pdf. If you are home with an inkjet, the full Adobe Acrobat is just a great way to print postscript files. It is also a great way to convert figures for use with pdftex and pdflatex. | |||||
Putty - SSH client | 0.48 | no | no | no | no |
This ssh client does not do X11 port-forwarding, but it is very simple to install and use and includes a command-line scp which does not require complex installation. The whole thing can go into your util directory as putty.exe and scp.exe. For a free ssh terminal client complete with X11 port-forwarding, see ttssh. For a straight, complete port of the command-line ssh and scp, try those by Gordon Chaffee. | |||||
Win32 Platform SDK | April 2000 | yes | yes | yes | yes |
These are the most recent header files and programming tools
from Microsoft.
| |||||
WinCVS | 1.0 | no | yes | no | no |
CVS is the Concurrent Versioning System for keeping track of software projects used by a group. Under Windows, the command line version of CVS often fails for binary files. This WinCVS does a better job. | |||||
Gnuplot | 3.7.1 | no | no | no | no |
This is a quick command-line or windowed plotting tool you can call from C, python, or other languages. You should be able to find a compiled win32 binary on the web site. There is a slight trick to use if you want to pipe data to gnuplot under win32. You need to download "windows-stdin.zip" from the contrib directory and compile it to the file pgnuplot.exe which accepts pipes. It accepts limited amounts of data but does work for smaller data sets. It should be possible to convert gnuplot to use pipes under windows, but the current gnuplot source is riddled with #ifdefs which make it a dangerous prospect. | |||||
Ghostview and Ghostscript | 6.0 | yes | yes | ? | no |
View/process postscript files. You need to install both Ghostview and ghostscript. It also writes pdf from ps. | |||||
Miktex | 1.20e | yes | yes | ? | no |
Win32 latex, pdftex, dvips, the works. This is THE TeX program to use. Some settings in the DVI preview require you have ghostscript installed. | |||||
doxygen | 1.2.0 | no | no | no | no |
This reads C++ comments and generates documentation in html, latex, and man pages. Very useful. | |||||
doxbar | 0.1 | yes | no | no | no |
This is a tool for MS Developer Studio which allows you to use doxygen in the IDE. It compiles the documentation into a Windows help file. This requires Doxygen and the HTML Help Workshop. | |||||
Python | 1.5.2 | no | yes | ? | no |
Platform-independent scripting language we use to control our C++ and fortran simulations. | |||||
Python Gnuplot | 1.4 | ? | ? | ? | ? |
Requires gnuplot and python. Interface to allow you to call gnuplot from python. | |||||
wxPython and wxWindows | 2.0 | yes | yes | yes | no |
wxWindows is a window system for python in competition with Tkinter and PythonWin. It has an application framework and is much faster than Tkinter, so we are investigating it despite its idiosyncracies. Install both. | |||||
NumPy | 15.3 | yes | no | no | ? |
Numerical extensions for python | |||||
Scientific Python | 2.0 | yes | no | no | yes |
A bunch of python extensions for scientific computing. | |||||
Win32 Extensions for python | 1.1.3 | yes | ? | ? | ? |
Win32 COM and other such | |||||
PIL | 1.0f | yes | ? | ? | ? |
Python imaging library for 2D images. | |||||
SWIG | 1.1p5 | no | yes | no | yes |
Standard Wrapper Interface Generator - writes interfaces for C code for use in Python, perl, tcl. This tool is what makes it efficient for us to combine python and C in our simulations. It is difficult to find SWIG compiled for Win32 but not difficult to compile yourself. Don't forget to set the SWIG_LIB environment variable. | |||||
pyFort | 3.3 | yes | yes | no | no |
Let's you run F77 and some F90 programs from python. All the files in the package are pure python. Uses distutils to install. | |||||
MinGW | 2.95.2 | yes | ? | ? | ? |
Minimalist gcc for win32. It's a free C++ compiler. The g++ from Cygnus 1.0 out of the box doesn't work well for code on distributed systems, and this "minimal" compiler does a fine job for now. | |||||
Enscript | 1.6.2 | yes | no | no | yes |
Enscript pretty-prints all sorts of source code. It's sorely missing in Win32 and especially Visual Studio. Warren Griffith and I compiled the most recent version and need to see if it's good enough for the official site. You may download the Win32 i386 binaries which we compiled. | |||||
XComp | 3.00 | no | no | no | no |
XComp compares files recursively in directory trees. You can use it to verify an xcopy or check which files you've changed in a source code directory. It is a command-line utility. I recommend installing this in the c:\util directory and renaming xcomp.exe to xcompdox.exe and xcomp32.exe to xcomp.exe. It is finicky about arguments. The first argument must be an exact directory name and the flags must be at the end and all be separated by spaces. "xcomp DigitalMaterial d:\DigitalMaterial /s /f" | |||||
cmdtime | 1.06 | no | no | no | no |
This command line utility sets your computer time from timeservers around the country. It has an excellent interface. | |||||
Programmer's File Editor | 1.01i | no | no | no | no |
Because Wordpad and Notepad aren't appropriate to most programming tasks, it is very useful to find some editor which a) let's you open files from the command line b) doesn't balk at Unix linefeeds c) let's you set tabs. PFE is free, small and fast. You may find another, but find one. You might look on BlockDev or download.com under development tools\editors. |
Libraries
version | Need to read install page | Has setup | Requires reboot | Needs compilation | |
FFTW | 2.1.3 | no | no | no | no |
Excellent fourier transform library. With some digging on their main page, you can fine precompiled Win32 binaries. | |||||
Intel Math Kernel Library | 3.2 | no | yes | ? | no |
This is the BLAS. It's free for download, but you have to register. This is not a 100% complete blas, but it does a fine job, otherwise. If you have trouble, you may need to try ATLAS from NETLIB. See our BLAS summary for details. | |||||
NetCDF | 3.5 | no | no | no | no |
This is a library which facilitates writing platform- and language- independent binary files. It is simpler and less powerful than the Hierarchical Data Format, HDF, which is another good option. You can obtain compiled libraries or compile them yourself. | |||||
Visualization Tookit | 3.12 | yes | yes | no | no |
VTK does fully rendered graphics in an OOP system. It links to C++, Java, Tcl, and Python. Use installers to install in C:\program files\vtk31 and unzip data files to C:\program files\vtkdata because that's where the sample programs expect to find their data. You have to copy the python .py files into the python Lib directory and the python dlls into the python DLL directory to complete the installation. |
My Bat and Util Directories
If you installed the Win32 resource kit and its Unix utilities, then you already have in your path ls.exe, head.exe, tail.exe, etc. The batch files below require editing to conform to your system paths.- C:\Bat
- ens.bat - enscript with 4-space tab defaults
- cprint.bat - enscript with C++ defaults
- pfe.bat - starts Programmer's File Editor from the command line. This simple batch file demonstrates one solution to gaining command-line access to programs not installed in your path. Many applications are installed in "Program Files," but you would like to get to them from the command line. Instead of adding their directory to your path, make a batch file which starts the program with any arguments you give.
- psprint.bat - sends a postscript job to the local postscript-capable printer.
- psprint.bat for home - sends a postscript job through ghostscript so you can print to a non-postscript printer like an inkjet.
- C:\util
- zip, unzip, gzip
- enscript.exe
- xcomp.exe
- gnu make (compiled a recent version)
- ssh and scp on command line
- linkd.exe - equivalent to link -s in unix. Creates a symbolic link to a directory. This works only in Win2k NTFS 5.0 filesystems.
- where.exe - Functions both as "which" to find things in your path and "find" to search for files in a directory.
Questions or comments? Contact Drew Dolgert.