Re: [ROOT] Problem running root under Windows 98.

From: Valeri Fine (Faine) (fine@bnl.gov)
Date: Mon Feb 26 2001 - 18:21:11 MET


Hello Rene



> Hi Ray,
> Did you set the variables ROOTSYS,PATH, etc as described at:
>      http://root.cern.ch/root/Version300.html
> namely:
> 
> 
>      When running from the MSDOS prompt, you must set the following environment
> variables, eg in your autoexec.bat:
>      (Restart the system if you set these variables for the first time). 
> 
>         set TEMP=c:\temp
>         set HOME=c:\your top directory
>         set TMPDIR=c:\temp
>         set ROOTSYS=c:\root  (the directory where you installed Root)
>         set PATH=%PATH%;%ROOTSYS%\bin
> 

 I do not think it is correct for Windows NT unless one is only user of his/her PC and knows 
 exactly his/her environment (for example your computer is not a member of any  NT domain).

  The simplest way to set root manually is to 

   1. rename root.exe to root_exe.exe 
   2. create a root.bat file as follows:

root.cmd:
       @echo off1
        if "%TEMP%". == "".     set TEMP=c:\temp
        set HOME=c:\your top directory
        if "%TMPDIR%". == "".     set TMPDIR=%TEMP%
        if "%ROOTSYS%". == "".  set ROOTSYS=c:\root  (the directory where you installed Root)
        set PATH=%PATH%;"%ROOTSYS%\bin"
        cmd /k "%ROOTSYS%/bin/root.exe"  %1  %2  %3 %4  %5  %6  %7  %8 %9 


   3. Create an NT shortcut for ROOT.BAT in your desktop.

   4. Append ROOT.EXE icon to ROOT.BAT shortcut 

   5. Click that icon to start ROOT.


 If one wants using ROOT SDK, I mean one wants to compile and link his /her own ROOT-based
application I'd advice to add to extra  env.variables, namely:

   set INCLUDE="%ROOTSYS%\include";%INCLUDE&
   set LIB="%ROOTSYS%\lib";%INCLUDE&


Another issues,  the main problem the NT users reported is due the "space"
within the directory name where ROOT is installed (for example "Program Files").

This problem is solved by quoting the ROOTSYS variables above.

There is no Windows special here. I wonder the UNIX user would face the 
same problem just they install any application under the directory with the 
space within name.

 One can fund the further explanation on ROOTTALK.

One comment. There is no need to set the HOME under Windows NT.
Windows NT does define HOMEDRIVE and HOMESHARE and HOMEPATH variables.
To take in account all possible combination in account one needs a smart script 
(This has been discussed as well)  If provided ROOT does use very these variables 
to find the the user's  "home" directory as follows:

   HOME = %HOMEDRIVE%/%HOMEPATH%

  I think the piece of the real code says this better:

  const char *h = 0;
   if (!(h = ::getenv("home"))) h = ::getenv("HOME");
 
   if (h) strcpy(mydir,h);
   else {
      // for Windows NT HOME might be defined as either $(HOMESHARE)/$(HOMEPATH)
      //                                         or     $(HOMEDRIVE)/$(HOMEPATH)
     h = ::getenv("HOMESHARE");
     if (!h)  h = ::getenv("HOMEDRIVE");
     if (h) {
         strcpy(mydir,h);
         h=::getenv("HOMEPATH");
         if(h) strcat(mydir,h);
     }
   }
   return mydir;

  Hope this helps
                                    Valeri



> Rene Brun
> 
> 
> Raymond Beuselinck wrote:
> > 
> > Hi,
> > 
> > I searched in the roottalk archive for the problem I have encountered and I see
> > that it has been discussed before, but there did not seem to be any clear
> > resolution as far as I could see.
> > 
> > I installed root version 2.25/03 on my NT desktop at work which seems to work
> > fine if I set the ROOTSYS variable and add %ROOTSYS%\bin to my PATH.
> > 
> > I installed exactly the same version on my laptop which is running Windows 98
> > and find that root does not work correctly unless I am running it from the
> > directory containing the binaries.  The problem is not in finding root.exe but
> > in finding the .dll files which are in that directory.
> > 
> > There was some discussion in roottalk about .rootrc files and setting the
> > dynamic path correctly but I could not find a definitive answer to tell me how
> > to make root work sensibly under win98, i.e.
> > 
> > 1. What should the necessary configuration file be called ?
> > 2. Which directory should it be in ?
> > 3. What must it contain to be able to find the .dll files from anywhere ?
> > 
> > The zip file containing the windows 95/98/NT version has a file called
> > system.rootrc  (not just .rootrc)  located in the top level directory
> > ( %ROOTSYS% ) which contains the following lines:
> > 
> > # Path used by dynamic loader to find shared libraries and macros
> > # Paths are different for Unix and Windows. The example shows the defaults
> > # for all ROOT applications for either Unix or Windows.
> > Unix.*.Root.DynamicPath:    .:$(ROOTSYS)/lib
> > Unix.*.Root.MacroPath:      .:$(ROOTSYS)/macros
> > WinNT.*.Root.DynamicPath:   ./;$(ROOTSYS)/bin;$(PATH)
> > WinNT.*.Root.MacroPath:     ./;$(ROOTSYS)/macros
> > 
> > Should this work for Windows 98 ?  (I am not even certain that it is looked at
> > by the root executable.)  If not, then how must I change it to make it work ?
> > I should point out that I am also just beginning to try to learn how to use
> > root so don't even have any past experience from other platforms to help me.
> > 
> > Thanks for any help you can give.
> > 
> > Ray Beuselinck,
> > Imperial College, London.
> 



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:38 MET