DTU•textDTU•logo   IMM•logo

Kaj Madsen - DTU Informatics•Head of Department


 
Forskning•IMM

PC Version of PROFIL/BIAS

Using PROFIL/BIAS on a PC

The original Profil/BIAS package along with documentation can be downloaded from http://www.ti3.tu-harburg.de/ or directly from http://www.ti3.tu-harburg.de/knueppel/profil. The PC version has makefiles for gcc and the Borland C++ compilers. Though, the package is rather old and has not been updated for newer releases of as well gcc and Borland C++. Having a newer version of these compilers therefor requere minor modifications. This document will describe how to use the package with the GNU compiler and the Microsoft Visual C++

Using the GNU compiler gcc/g++
Using Microsoft Visual C++
Installing PROFIL/BIAS

 

Using PROFIL/BIAS with GNU gcc

This will describe how to install a sligthly modified version of the package which compiles using the GNU compiler.

This have been tested on Linux as well as Windows, but I believe (hope) it should work without modifications on any x86 platform having a fairly new version of GNU make, gcc, g++ and ar (gcc and g++ must support the -fpermissive option). At least it works for:

  • Linux (like the E-databar): GNU's make (v. 3.79), gcc (v. 2.95.3) and ar (v. 2.9.5)
  • Windows: using Cygwins GNU make (v. 3.79.1), gcc (v. 2.95.2-6) and ar (v. 2.10.91)
  • Windows: using DJGPPs GNU make (v. 3.79.1), gcc (v. 2.952) and ar (v. 2.9.5)
This is what you need to do, when using Linux or CygWin GNU (when using DJGPP, you need to overwrite any occurence of Makefile with MakefileDJGPP and continue as below):
  • Download the GNU modified PROFIL/BIAS package to a local directory, say xxx/Profil.
  • Unzip the file. You can use WinZip, or if you have unzip, write "unzip GNUProfil.zip" in a terminal/DOS prompt. This will put a lot of files in the xxx/Profil directory, and (hopefully) create a new directory xxx/Profil/BIAS also containing some files.
  • In a terminal/DOS prompt, write "make". Now it should compile and build two libraries, which are placed in xxx/Profil, and called libProfil.a and libBias.a(1)
(1)The make command might not be able to find a copy command, in which case it will produce an error, but continue anyway. In that case, the libBias.a will be placed in the xxx/Profil/BIAS directory, and you need to copy it to xxx/Profil manually.

Now you have two directories, xxx/Profil and xxx/Profil/BIAS, which you need to include in your include path when compiling, and two libraries, libProfil.a and libBias.a, which you need to link to when linking. I will here show how to make this work with the CandidateSet, and especially the SetTest.C.
  • First download the (slightly modified) CandidateSet to a local directory, preferably xxx/CandSet, where xxx is the same directory as before.
  • Unzip the file. As before, you can use WinZip, or if you have unzip, write "unzip GNUCandSet.zip". This will put 5 files in the xxx/CandSet directory.
  • If you have placed CandSet in the xxx/CandSet directory, you actually just need to type "make", and then it will compile the file SetTest.C and build a program, Test.exe. When executed, it will print some test outputs to the screen.
  • Otherwice (and for future Profil/BIAS programs), open the Makefile in a text editor. The following lines may need to be modified.
    • PROFILDIR = ../Profil
      This states where Profil is placed. Here a relative path to the Profil directory is used, it should in some way point to the Profil directory. If using the Profil/Bias in the gdatabar, this would be
      PROFILDIR = /gbar/newton/home3/g04120/g04120/profil
    • PROFILINCDIR = $(PROFILDIR)
      This states where the Profil/BIAS header files are placed, in our case it is just the PROFILDIR, so no more is needed. Again, in the g-databar, this would be
      PROFILINCDIR = $(PROFILDIR)/include
    • PROFILLIBDIR = $(PROFILDIR)
      This states where the Profil/BIAS library files, libProfil.a and libBias.a, are placed, in our case it is again the PROFILDIR, so no more is needed. In the g-databar, this would be
      PROFILLIBDIR = $(PROFILDIR)/lib
    • PROFILLDFLAGS = -lProfil -lBias
      This states which libraries we want to include, which is exactly the two we have made earlier

    The next block of lines describe which compiler and what flags you want to use when compiling and linking. After that, we tell which files to compile and what program to build.
    • PROGRAM = Test.exe
      This is just the name of the program. Use anything you like, though DOS/Windows requires that it has an .exe extension.
    • SRCS = SetTest.C
      This is a list of all source file that should be compiled (in this case only one). If you have more than one, seperate them with a space. You can break the line using \ at the end of the line eg:
      SRCS		= SetTest.C SetTest2.C \                     SetTest3.C SetTest4.C
    • OBJS = SetTest.o
      This is the same as above, just for all of the object files you need to build. For each entry of the type .C in SRCS there should be a matching .o in OBJS

    The last lines are generic and uses the information given above to build your program. The Makefile is processed when typing "
    make". If you have not called it Makefile, you can proces it using "make -f YourMakefileName". Typing "make clean" will delete all object files and the program - not touching all the source file you have written.

When using Profil/BIAS in the G-databar: If you for any reason find that the gnucci scripts is somewhat limiting, it is easy to change the makefile above to use the G-bar Profil/BIAS. Eg. replacing the Makefile with this Makefile would build the SetTest.C by just typing "make" at a command prompt, now using the G-bar Profil/BIAS

The difference between this Profil/BIAS package and the UNIX version from the PROFIL/BIAS homepage is mainly in the Makefiles. The only source file that has been modified, is
BIAS/Bias0.c

Written 25/2-2001 by Jesper Grooss


 

Using PROFIL/BIAS with Microsoft Visual C++

This describes how you can install a slightly modified version of the package which compiles under Visual C++. I cannot guarantee that the package is 100% reliable under Visual C++ but it should work well enough for the projects in course 04210. If you run into strange problems you should try to run your program on some of the machines in the G-databar.

To install the package, you must first download. the compressed tar file. To uncompress type gunzip profil.tar.gz and to extract, type tar -xvf profil.tar. You have now created directory profil with subdirectories BIAS and TEST in your home directory. Copy these to a floppy and install on your PC at home (preferably to directories C:\PROFIL, C:\PROFIL\TEST and C:\PROFIL\BIAS. If you want to install the package somewhere else, you must modify the makefiles accordingly.

The main difference between the Unix version in the G-databar and the DOS version is the filenames:

tabular9

You need to change #include directives such as

#include "Interval.h"
#include "Functions.h"
#include "SetClass.C"

to

#include "ival.h"
#include "func.h"
#include "setclass.cpp"

(see TEST\NAMES). Remember to rename your .C programs to .cpp also.


 

Installing PROFIL/BIAS

If you have version 4.0 of Visual C++ you can skip the next section.

1. Compilation

The pre-compiled library files propably won't work with older versions of Visual C++ so you must re-compile them. They haven't been tested with more recent versions of Visual C++, they might work (try it!) but again they might not.

First you must enter the MS-DOS prompt. Make sure that Visual C++ is properly set up by typing VCVARS32 x86. If DOS fails to locate this .BAT file you must go to the Visual C++ directory (typically \MSDEV) and type CD BIN and type VCVARS32 x86 again.

If you didn't install BIAS in C:\PROFIL\BIAS you need to modify the INCLUDE path in the makefile accordingly. Go to the BIAS directory and type nmake

Switch to the PROFIL directory C:\PROFIL (again remember to modify the INCLUDE path in the makefile if needed) and type nmake

2. Linking

Start up the IDE environment and create a new project test (select Console application to create a DOS application).

Click on Insert / Files into project from the menubar, add the above files. Click on Tools / Options / Directories and add C:\PROFIL and C:\PROFIL\BIAS. Click on Build / Settings / Link and select category General add C:\PROFIL\BIAS\BIAS.LIB and C:\PROFIL\PROF.LIB to the list of library modules. You should now be able to compile and run as usual. Note that directory TEST contains the files setclass.cpp and settest.cpp which allow you to test the installation.

Please report problems to Steinn.Gudmundsson@uni-c.dk