The FILM tarball is at pdb-pc-6:/home/alexy/cs/film-.tar.gz Follow this procedure to build the film system on a virginal machine: 0. Make sure you have a supported version of gcc/g++ Currently, the supported version is either 2.95.3 or 3.3. In the examples below, we use 3.3. Generally, it's possible to have two subdirectories, whose names differ only in 2.95.3 or 3.3, alongside, and we shall use 3.3 in examples below, but by substituting the other one can have both simultaneously. Important consideration here is that C++ ABIs (class members' name mangling of symbols for linking) are incompatible, so you must link C++ libraries made with the same version of g++ only. That includes the ORB libraries and the CIF libraries, too. Make sure you never mix libraries from different versions of g++ (unless they are after 3.2 and ABI compatibility mode is set, which is another story, but not between 2.95.3 and 3.x!)... We refer to the string gcc_2.95.3 or gcc_3.3 as $(CCV) in FILM make files and here below. If you don't have a supported gcc version on your machine, go get it from http://gcc.gnu.org/ and build it. I recommend installing each version of gcc into a separate directory, specified at the configure stage. In short, create a build directory, configure the installation path prefix, and make bootstrap: mkdir -p /src/gcc cd !$ tar zxf /net/gcc-3.3.tar.gz mkdir gcc-3.3-build cd !$ ../gcc-3.3/configure --prefix=/opt/gcc/3.3 --enable-threads make bootstrap # become root make install Enabling threads is required to facilitate multi-threaded exception handling, arising in the ORBs. 1. Get and build the Options library by Brad Appleton Description: http://www.cmcrossroads.com/bradapp/ftp/src/libs/C++/Options.html The file is http://www.cmcrossroads.com/bradapp/ftp/src/libs/C++/Options.tar.gz The Options package allows film/da driver to have a --help option listing all the options. You need to apply a patch in order to use it with current GCCs. We build, patch, and install Options as follows: cd /src mkdir Options-gcc_3.3 cd !$ tar zxf /net/Options.tar.gz tar zxOf film-.tar.gz cs/misc/Options.patch > Options.patch patch -p1 < Options.patch Before building, you need to edit the Makefile and set LOCAL, INCDIR and LIBDIR correctly. We install the header as ~/lib/C/Options.h, and keep compiler-dependent libraries in subdirectories like ~/lib/C/gcc_3.3, so we set LOCAL=$(HOME)/lib/C INCDIR=$(LOCAL) LIBDIR=$(LOCAL)/gcc_3.3 Now, do the usual make make install Don't forget to adjust the variables pointing to Options in FILM make files, as shown in (6)! 2. Get and build one of the supported ORBs. Currently, MICO 2.3.10 and omniORB 4.0.2 are supported. MICO: http://www.mico.org/ omniORB: http://omniorb.sourceforge.net/ get the latest version, and follow the instructions, with the following specifics: 1.1 Make sure you specify the g++ from 0 when you build it. This can be achieved by setting PATH: export PATH=/opt/gcc/3.3/bin:$PATH 1.2 When doing configure, give a prefix such that MICO goes into its own installation directory. I recommend the following: configure --prefix=/opt/orb// where is either mico or omni, and is the orb's version such as 2.3.10 or 4.0.2. For omniORB, not all Corba Services are built by default. You need to edit the file omniORB-4.0.2/src/services/mklib/libdefs.mk as follows: replace # All the interfaces: #COS_INTERFACES = $(COS_ALL_INT) # Or just the Notification interfaces: COS_INTERFACES = $(TIMEBASE_INT) $(COS_EVT_INT) $(COS_NFY_INT) $(COS_LCB_INT) by # All the interfaces: COS_INTERFACES = $(COS_ALL_INT) # Or just the Notification interfaces: #COS_INTERFACES = $(TIMEBASE_INT) $(COS_EVT_INT) $(COS_NFY_INT) $(COS_LCB_INT) If you want to run the python client, you need to install both omniORB and omniORBpy. For the latter, use the same prefix as for the former, and follow the instructions set forth in README.client.python. 3. Install DB2 client. 3.1 Add xdb2inst1 to /etc/services. NB: as root. Edit the /etc/services and add the line xdb2inst1 9988/tcp # db2 3.2 Create the group db2adm1 and the user db2inst1 with that group. NB: as root. (On Red Hat systems, these commands are in /usr/sbin/, prepend that below if it's not on your root's path:) groupadd db2adm1 useradd -g db2adm1 db2inst1 3.3 Get DB2 distribution and install the client software Get the file db81eeux.zip Copy it to your machine, unpack and run the installer. Choose the client only. Keep the default username as is, db2inst1. 3.4 Set the environment variable DB2INSTANCE to be db2inst1. In bash: export DB2INSTANCE=db2inst1 In tcsh: setenv DB2INSTANCE db2inst1 We show shell commands in bash syntax. Do a similar substitution for tcsh or ksh or others. 3.5 Add the DB2 library directory to the linker's path: export LD_LIBRARY_PATH=/opt/IBM/db2/V8.1/lib:$LD_LIBRARY_PATH This is also done in mk/Extern.mk; adjust the setting if you change the default DB2 libraries location. 3.6 Add the DB2 binary directory to your executables path, or call db2 below with the full path: export PATH=/opt/IBM/db2/V8.1/bin:$PATH 3.7 Catalog the remote node and database. Currently, we're using the ndb4 database on pdb-bioshark-4. Enter the db2 client shell: db2 Say (case is unimportant): catalog tcpip node red remote pdb-bioshark-4.rutgers.edu server xdb2inst1 catalog database ndb4 at node red catalog database pdb1 at node red 4. The tarball unpacks into a subdirectory cs. We have it in ~/cs, and refer to it as such. cd ~ tar zxf /path/to/film-.tar.gz You can install it elsewhere and make adjustments below. From now on, we'll call the directory resulting from unpacking the tarball as film/. 5. Create a directory where you'll have the cif tools we'll call it ciftools/. The following CIF tools are required for FILM: cif-loader cif-builder NDB cif parser and their supporting packages as ditributed by PDB. This FILM release is built with cif-builder-v3, and currently you need a different cif-loader version according to the gcc version you're using: cifobj-loader-v5 for gcc 2.95.3 cifobj-loader-v6 -"- 3.3 Other CIF libraries come from ndbview-opengl-v1 Install these three packages under ciftools/, and create symlinks to them in that directory as follows: cifobj-builder.gcc_3.3 cifobj-loader.gcc_3.3 ndbview.gcc_3.3 E.g., cd ~/ciftools ln -s cifobj-builder-v3-prod cifobj-builder-v3-prod.gcc_3.3 ln -s cifobj-loader-v6-prod cifobj-loader.gcc_3.3 ln -s ndbview-opengl-v1-prod ndbview.gcc_3.3 6. Adjust the following things in the make files: film/mk/Switch.mk, film/some/mk/Switch.mk: GCC_VERSION It should be either 2.95.3 or 3.3. Just uncomment one and comment out the other. film/mk/some/Switch.mk: ORB_TYPE It should be either MICO or OMNI. Just uncomment one and comment out the other. film/some/mk/Orb.mk: -- ORBs location: ORB_BASE = /opt/orb/$(ORB_NAME)/$(ORB_VERSION)-$(CCV) should point to your ORBs, and will automatically if those are installed as in (2). Note that you should follow this convention when installing all ORBs on your system, or you'll have to fix the make files further. film/mk/Extern.mk: film/some/mk/Extern.mk: -- Brad Appleton's Options LIB_CXX = $(HOME_DIR)/lib/C LIB_CXX_INCLUDE = -I$(LIB_CXX) LIB_CXX_CCV = $(LIB_CXX)/$(CCV) LDFLAGS += -L$(LIB_CXX_CCV) LIBOPTIONS = -loptions -- ciftools/, per (5): CIFOBJ_DIR_BASE = /path/to/ciftools -- DB2, not moveable as of V8.1, should be the same: DB2_DIR = /opt/IBM/db2/V8.1 # or elsewhere (unlikely) 7. DB2 database logins Since the server needs to use CLI and db2 client to access the backend, it has to know the login information. For now, we store it as plain text in a header file. Since this is a bad idea for security, we call the files bad. See the example files, film/bad.h film/some/bad.h and modify them according to your own database logins. 8. Build everything! Now, in film/, say ./build.sh 9. Launch the Naming Service First, you need to tell the ORB where the Naming Service is. It's done in an ORB-specific manner. -- For MICO, in your home directory, create file ~/.micorc: -ORBNamingAddr inet:hostname.com:2809 -- for omniORB, edit /etc/omniORB.cfg, the line with InitRef: InitRef = NameService=corbaname::hostname The default port for Corba Naming Service is 2809, so it's not necessary in omniORB; if you wish to run on a non-standard port, add it as in InitRef = NameService=corbaname::hostname.com:2810 Now, you can launch the actual naming service daemon, and it will now where to listen to! -- For MICO, is is called nsd: /path/to/mico/bin/nsd -ORBIIOPAddr inet:hostname:2809 & where the inet:host:port address is the same as per 8. -- For omniORB, it's called omniNames: /path/to/omni/bin/omniNames 10. Run the server! Since the server requires many libraries to link in at run time, we simplified launching it from an xterm by creating most of the command line with make runs Now copy and paste it, and add parameters after the word server as follows: -d tells which database, as cataloged under that db2 database alias to use as the backend The other thing which can differ is into which Naming Service to inject our server's information. If it's different from the defaults from (9), e.g. you're using an existing Naming Service, you can supply its location in the following ORB-specific manner: -- For MICO: -ORBNamingAddr inet:hostname.com:port -- For omniORB: -ORBInitRef NameService=corbaname::hostname.com:port (If the port is 2809, it can be omitted for omniORB.) NOTE! If you run the server on a cluster, where the advertised address is on a public networking interface, but the default interface is the local one, you have to supply the server's interface and port as an additonal explicit option, as follows: -- For MICO: -ORBIIOPAddr inet:hostname.com:app_port -- For omniORB (NB: verify!): -ORBendPoint giop:tcp:hostname.com:app_port where app_port should be different from the Naming Service's! E.g., if you run the Naming Service on its standard corbaloc port 2809, you can run one instance of the server, for one -d database, on 2811, and another, for another -d database, on 2812, or any other two available ports different from 2809 and each other. 12. Test a client with a PDB ID: ./main PD0299 You'd need to specify the same options for Naming Service as in (10) in case you're using a non-default location for it (specified in (9)). With omniORBpy, you can also build and run a python client now, as specified in README.client.python.