RootTalk


ROOT Discussion Forums

Compiling ROOT with Visual Studio 2008

Discuss installing and running ROOT here. Please post bug reports here.

Moderator: rootdev

Compiling ROOT with Visual Studio 2008

Unread postby gsalo » Mon Nov 03, 2008 5:04

Hi,

I'm trying to compile ROOT (the latest svn version) using Visual Studio 2008 on a 64-bit machine running Vista and I'm having a few problems. The first problem is with the following compile command:

cl -O2 -nologo -FIw32pragma.h -MD -GR -EHsc- -W3 -wd4244 -Iinclude -DR__HAVE_CONFIG -Fobuild/win/bindexplib/bindexplib.o -c build/win/bindexplib/bindexplib.cxx

This generates the error:

bindexplib.cxx
build/win/bindexplib/bindexplib.cxx(58) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

I found windows.h in $ROOTSYS/cint/cint/include (it was not in ./include). If I include this path (or copy the file to $ROOTSYS/include), I get the following:

cl -O2 -nologo -FIw32pragma.h -MD -GR -EHsc- -W3 -wd4244 -Iinclude -Icint/cint/include -DR__HAVE_CONFIG -Fobuild/win/bindexplib/bindexplib.o -c build/win/bindexplib/bindexplib.cxx

bindexplib.cxx
cint/cint/include\windows.h(19) : warning C4068: unknown pragma
cint/cint/include\windows.h(23) : warning C4068: unknown pragma
cint/cint/include\windows.h(24) : fatal error C1189: #error : win32api.dll is not ready. Run 'setup.bat' in %CINTSYSDIR%\lib\win32api directory if you use WinNT/95.

The second problem is as follows:

cl -O2 -nologo -Ibuild/win -FIw32pragma.h -FIsehmap.h -MD -EHsc- -W3 -Iinclude -DR__HAVE_CONFIG -DG__HAVE_CONFIG -DG__NOMAKEINFO -DG__CINTBODY -Icint/cint/inc -Icint/cint/src -Icint/cint/src/dict -I. -Focint/cint/src/g__cfunc.o -c cint/cint/src/g__cfunc.c

which produces:

g__cfunc.c
cint/cint/src/g__cfunc.c : fatal error C1083: Cannot open include file: 'sehmap.h': No such file or directory
make: *** [cint/cint/src/g__cfunc.o] Error 2

If I remove -FIsehmap.h the compile command works. But will this cause a problem later?

Any thoughts?

Thanks,

Glen
gsalo
 
Posts: 17
Joined: Sat Sep 16, 2006 20:27

Unread postby bellenot » Mon Nov 03, 2008 8:40

Hi,

Looks like the Visual C++ environment variables are not properly set... Please execute:
Code: Select all
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat

before trying to compile root.
You can also add this line in cygwin.bat:
Code: Select all
call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"

Right after "@echo off"

And please don't move any file, or change compiler options. The build system supports MSVC++ 7.1, 8.0, and 9.0 without any problem.

Cheers, Bertrand.
User avatar
bellenot
 
Posts: 1667
Joined: Mon Sep 01, 2003 10:57
Location: CERN

Unread postby gsalo » Mon Nov 03, 2008 16:33

Thanks Bertrand! I am now able to compile the root source tree.

However, I'm now having a problem with installation (probably another configuration problem on my end). When I try to install, I get:

...
Installing Emacs Lisp library in /home/glen/root-executable//share/emacs/site-lisp
Installing GDML conversion scripts in /home/glen/root-executable//lib/root
make: *** [install] Error 2

I ran configure with --prefix=/home/glen/root-executable --etcdir=/home/glen/root-executable/etc

If I try make install a second time, I get a many permission denied errors:

...
cp: cannot create regular file `/home/glen/root-executable/etc/vmc/.svn/text-base/Makefile.linuxia64gcc.svn-base': Permission denied
cp: cannot create regular file `/home/glen/root-executable/etc/vmc/.svn/text-base/Makefile.linuxicc.svn-base': Permission denied
cp: cannot create regular file `/home/glen/root-executable/etc/vmc/.svn/text-base/Makefile.linuxx8664gcc.svn-base': Permission denied
...

Even though I get the above error, it looks like everything was built and installed. However, when I try running root (e.g., root -b), the welcome text appears, but I never get the command prompt. Do you have any suggestions?

Thanks for the help!

Glen
gsalo
 
Posts: 17
Joined: Sat Sep 16, 2006 20:27

Unread postby bellenot » Mon Nov 03, 2008 16:48

Hi Glen,

Well, I don't know, I never use "make install" and "configure --with-prefix" on Windows (I'm not even sure it is supported)... I will try and let you know.

Bertrand.
User avatar
bellenot
 
Posts: 1667
Joined: Mon Sep 01, 2003 10:57
Location: CERN

Unread postby gsalo » Tue Nov 04, 2008 5:49

Bertrand,

It turns out the problem (i.e., the ROOT prompt never appears) only exists when I try to run ROOT from a xterm window in cygwin. If I start ROOT in a cygwin command shell it works fine! Do you have any idea why it would not work in the xterm window? I compiled the ROOT source tree in the xterm window.

Thanks again!

Glen
gsalo
 
Posts: 17
Joined: Sat Sep 16, 2006 20:27

Unread postby bellenot » Tue Nov 04, 2008 8:50

Hi Glen,

ROOT compiled with MSVC++ is meant to be run in a command prompt (it is a Win32 binary) nothing to do with a xterm. If you want a X11/Xterm compatibe version, you have to compile it with cygwin gcc (note I would not advise to do so)

Cheers,
Bertrand.
User avatar
bellenot
 
Posts: 1667
Joined: Mon Sep 01, 2003 10:57
Location: CERN

Unread postby cplager » Tue Nov 04, 2008 16:00

bellenot wrote:If you want a X11/Xterm compatibe version, you have to compile it with cygwin gcc (note I would not advise to do so)


I know that this is the general bias that the Root team has, but I think there are many advantages to the cygwin/g++ version of Root (as opposed to VC++). I agree that there are speed differences, but the similarities in the environment (as compared to linux) usually more than make up for them.

Cheers,
Charles
cplager
 
Posts: 410
Joined: Wed Sep 03, 2003 21:03
Location: FNAL


Return to ROOT Support

Who is online

Users browsing this forum: Bing [Bot] and 3 guests