HELP: Need idiots guide to building root with cygwin

[quote=“nausheen”]I just tried to start root from the just the usual command prompt with[/quote]What do you mean? How did you start root previously?
And I have no idea of what is cygcheck … (Google should probably know)

[color=#FF0000]EDIT:[/color] Sorry, cygcheck is part of ROOT (thanks Philippe). But still, I don’t know why it is complaining… I’ll try to reproduce it. BTW, do you have several versions of ROOT?

Cheers, Bertrand.

I would first start cygwin and then start either x11 with startx and then root, or start root -b without the display.

Now I didnt start cygwin, so I cant have x11, and then just typed

root -b

and the only error it gave me was the cygcheck one.

I did have different versions of root, but I deleted them all and restarted my computer…

I meant I just opened a command prompt and typed

root -b

without running cygwin/x11 first

Thanks,

Nausheen

Well, everything works fine for me, by starting X and running ROOT in a xterm, or simply from a cygwin terminal (without X). My $ROOTSYS is set to /home/bellenot/root, $ROOTSYS/bin is in $PATH, and $ROOTSYS/lib is in $LD_LIBRARY_PATH…
Are you sure to not use a native Win32 build? Are you sure that the root you are using (/cygdrive/c/root) is the right one? (e.g. check that root_exe.exe is really in $ROOTSYS/bin)

I will delete everything and install it again to see if it works.

Thanks

Nausheen

Hi,

I tried deleting and re-installing but couldn’t get things to work. So I went back to the Win32 version, which as I mentioned before I have always used before.

In any case, so I decided to try to get the Makefile for ExootAnalysis to compile. I had to changed some flags compared to the Makefile in the test directory, namely, I had to add the option -Fo to get the object files in the directories where I wanted them:

	@$(CXX) $(CXXFLAGS) -Fo$@ -c $<

whee CXX and CXXFLAGS are as defined in Makefile.arch in the test directoy:

ifeq ($(ARCH),win32)
# Windows with the VC++ compiler
VC_MAJOR     := $(shell unset VS_UNICODE_OUTPUT; cl.exe 2>&1 | awk '{ if (NR==1) print $$(NF-2) }' | \
                cut -d'.' -f1)
ObjSuf        = obj
SrcSuf        = cxx
ExeSuf        = .exe
DllSuf        = dll
OutPutOpt     = -out:
CXX           = cl
ifeq (debug,$(findstring debug,$(ROOTBUILD)))
CXXOPT        = -Z7
LDOPT         = -debug
else
ifneq ($(findstring debug, $(strip $(shell $(RC) --config))),)
CXXOPT        = -Z7
LDOPT         = -debug
else
CXXOPT        = -O2
LDOPT         = -opt:ref
endif
endif
ROOTINCDIR   := -I$(shell cygpath -m `$(RC) --incdir`)
CXXFLAGS      = $(CXXOPT) $(ROOTINCDIR) -FIw32pragma.h
LD            = link
LDFLAGS       = $(LDOPT) 
SOFLAGS       = -DLL

EXPLLINKLIBS  = $(ROOTLIBS) $(ROOTGLIBS)
ifneq (,$(findstring $(VC_MAJOR),14 15))
MT_EXE        = mt -manifest $@.manifest -outputresource:$@\;1; rm -f $@.manifest
MT_DLL        = mt -manifest $@.manifest -outputresource:$@\;2; rm -f $@.manifest
else
MT_EXE        =
MT_DLL        =
endif
endif

But also added:

CXXFLAGS += -MD -EHsc -GR -I'c:\root\include' -I. -I'c:\root\lib\ExRootAnalysis\tcl' -I'c:\root\lib\ExRootAnalysis\mcfio' -I'c:\root\lib\ExRootAnalysis\stdhep' -I'c:\root\lib\ExRootAnalysis\CDFCones' -I'c:\root\lib\ExRootAnalysis\CDFCones\CDFcode'
LIBS = $(ROOTLIBS) $(SYSLIBS) MSVCRT.LIB
GLIBS = $(ROOTGLIBS) $(SYSLIBS)
EVENTLIB =lib/libExRootAnalysis.lib

Now all the files compile correctly, but when trying to build the dll I get errors:

ExRootAnalysisDict.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall TObject::DoError(int,char const *,char const *,char *)const " (?DoError@TObject@@UBEXHPBD0PAD@Z)
ModulesDict.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall TObject::DoError(int,char const *,char const *,char *)const " (?DoError@TObject@@UBEXHPBD0PAD@Z)
lib/libExRootAnalysis.dll : fatal error LNK1120: 1 unresolved externals
Makefile:888: recipe for target `lib/libExRootAnalysis.dll' failed
make: *** [lib/libExRootAnalysis.dll] Error 96
e]0;/cygdrive/c/root/ExRootAnalysisa
e[32mNausheen@Nausheen-Laptop e[33m/cygdrive/c/root/ExRootAnalysise[0m
$ exit
exit

When I look at the output from the makefile, specifically while building the libraries, I see that in fact TObject::DoError was found, but with a different set of numbers after the @, I have no idea what that means:

 Found "protected: virtual void __thiscall TObject::DoError(int,char const *,char const *,char *)const " (?DoError@TObject@@MBEXHPBD0PAD@Z)
        Referenced in MadGraphClassFilter.obj
        Referenced in MadGraphConeJetFinder.obj
        Referenced in MadGraphKtJetFinder.obj
        Referenced in ExRootTask.obj
        Referenced in ExRootTreeReader.obj
        Referenced in ExRootTreeWriter.obj
        Referenced in MadGraphAnalysis.obj
        Referenced in ExRootAnalysis.obj
        Referenced in ExRootConfReader.obj
        Referenced in ExRootFactory.obj
        Referenced in ExRootModule.obj
        Loaded libCore.lib(libCore.dll)

The relevant code in the Makefile is (I added -verbose to the lib command to see what was going on):

$(SHARED): $(DICT_OBJ) $(SOURCE_OBJ) $(TCL_OBJ)
		@mkdir -p $(@D)
		@echo ">> Building shared $@"
ifeq ($(ARCH),aix)
		@/usr/ibmcxx/bin/makeC++SharedLib $(OutPutOpt) $@ $(LIBS) -p 0 $^
else
ifeq ($(ARCH),aix5)
		@/usr/vacpp/bin/makeC++SharedLib $(OutPutOpt) $@ $(LIBS) -p 0 $^
else
ifeq ($(PLATFORM),macosx)
# We need to make both the .dylib and the .so
		@$(LD) $(SOFLAGS)$@ $^ $(OutPutOpt) $@
		@$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ $(LIBS) $(OutPutOpt) $(subst .$(DllSuf),.so,$@)
else
ifeq ($(PLATFORM),win32)
#		@bindexplib $* $^ > $*.def
		@bindexplib $* $^ > $*.def 
		@echo ">> build shared platform $@"
		@echo ">> $^ "
		@echo ">> $* "
#		@lib -MACHINE:X86 $^ -def:$*.def  $(EVENTLIB) $(OutPutOpt) > $@
		@lib -nologo -verbose -MACHINE:X86 $^ -implib:$*.lib -def:$*.def  $(OutPutOpt)$(EVENTLIB) $(GLIBS)
		@echo ">> build shared platform $@ done libstuff"
		@$(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(GLIBS) $(OutPutOpt)$@
		@echo ">> build shared platform $@"
		$(MT_DLL)
else
		@echo ">>diff plat  build shared platform $@"
		@$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) >  $@ $(EXPLLINKLIBS)
		@$(MT_DLL)
endif
endif
endif
endif

I dont seem to be able to upload my makefile or the makefile.arch. I am attaching the output from the Makefile as a txt file…

Thank you a million in advance… I must be doing something dumb… I know…
makelog.txt (268 KB)

Hi,

Could you try to re-generate the dictionaries (ExRootAnalysisDict.cc and ModulesDict.cc) and try again?
If it doesn’t work, could you post your source and makefile in a zip file, so I can take a look and try to see what’s wrong?

Cheers, Bertrand.

Hi,

I just did that, and got the same error…

All the source etc is too big to attach here even zipped, it is about 6MB… Is there any other way for me to send it to you?

I am attaching the new out put from the makefile, as you can see, I regenerated the Dict files and still get the same errors…
makelog2.txt (268 KB)

You can put it somewhere on the web, or extract the relevant classes and post them, or send them directly [u][color=#0000FF]to me[/color][/u]

Cheers, Bertrand.

Hi,

I just emailed them to you. I also put them in my public folder in Dropbox in case there is an issue with the attachment to the email:

dl.dropbox.com/u/4902185/ExRootAnalysis.zip

Thanks,

Nausheen