[ghemical-devel] build instructions for the win32 target

Tommi Hassinen thassine at messi.uku.fi
Wed Jan 31 04:14:46 EST 2007


On Tue, 30 Jan 2007, Donald Ephraim Curtis wrote:

> Tommi,
>
> I was wondering what you are using to build the ghemical w32 package,
> such as which compiler, what libraries you're pulling, etc.  Did you

Hello Donald,

what I'm using here is the MS development environment (Visual Studio) 2003 
version (v7.1).

> actually port the interface to a w32 dialog or did you setup something
> with the GTK+ w32 packages?

It has no connection to GTK+, even though here:

 	http://www.gimp.org/~tml/gimp/win32/

is documentation and packages about GTK+ ported to windows. I tried to 
study this option for a while but it looked too complicated for me.

So I decided to completely re-build the program using the win32 API. I 
used to know it 10 years ago before I got interested in UNIX, and while 
the win32 API has been extended in the meantime, the basics are still the 
same and no-one is really forced to use the newer features (that are a lot 
more complicated than the basic stuff).

The principle how win32 API and GTK+ works are actually the same : an 
application program displays a window and registers some callback 
functions using which it receives information about user's mouse clicks 
and keyboard events. The details are different but most of the work is 
already there now and the new stuff that is needed is mostly dialog boxes. 
The dialogs can more or less be copy/pasted from earlier ones so it's not 
very difficult to finish the program.

I have not put the Visual Studio IDE files into svn, but I can make them 
available for download. Please take a look here:

 	http://www.uku.fi/~thassine/projects/download/msvc7/

Now the build instructions follow. You will need liboglappth, libghemical 
and ghemical (svn trunk versions). You will also need cygwin, since I have 
used some simple bash scripts (or you can read the script and do the 
operations manually ; these are mostly just copying files).

First un-tar liboglappth and into that directory un-tar 
msvc7_libO-20070131.tgz ; that is:

 	tar zxvvf liboglappth-xx.tgz	// or checkout a copy from svn!
 	cd liboglappth
 	tar zxvvf msvc7_libO-20070131.tgz

a subdirectory msvc7_libO is created and there you will find the 
msvc7_libO.sln IDE file. Just open it and you should be able to compile 
the library. The result is a static libarary msvc7_libO.lib which appears 
into "debug" or "release" subdirectory depending on which configuration 
you had chosen.

When this is ready you should copy all header files from the library into 
a "oglappth" subdirectory of the Visual Studio include directory (this is 
needed later when compiling ghemical which expects to find these files). 
In my system the full directory path is

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\oglappth

Also make sure you have

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\GL

there and you have gl.h glu.h and (especially) glut.h there ; if you don't 
have glut.h then find a glut package from the net and copy it.

Ok, then un-tar libghemical and into that directory un-tar 
msvc7_libG-20070131.tgz ; you should make sure that the source tree is 
./configure'd without --enable-mopac7 or --enable-mpqc ; you can run 
./configure either in cygwin or in a linux/unix system.

Then again find msvc7_libG.sln IDE file and compile it. You will get a 
msvc7_libG.lib static libarary file as a result.

Again copy all header files except libghemicalconfig*.h into

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ghemical

just as before in the earlier case.

Then un-tar ghemical source tree. You should ./configure it without 
--enable-openbabel before trying anything else. You also have to comment 
out lines

 	#define ENABLE_GTK

and

 	#define ENABLE_THREADS

at ghemicalconfig2.h file. Un-tar msvc7_app-20070131.tgza and go into 
msvc7_app subdirectory and then run either

 	get_libs_debug.sh

or

 	get_libs_release.sh

script ; it will just copy the static library files that you built earlier 
into their correct places (do this every time you re-build those 
libraries). Please note that you should always use the same configuration 
(either debug or release) in every project or you will end up in 
trouble. Then find msvc7_app.sln and compile it...

If you get ghemical.exe, congratulations!  :)

You can now run the program, but it expects to find a registry key that 
tells it where to find all those installed data/parameter files that 
ghemical needs. If you have installed a ghemical package of mine the 
registry key and the files will be already in their correct places.

Regards,

 	Tommi



More information about the ghemical-devel mailing list