[Halld-offline] nightly build errors and warnings
David Lawrence
davidl at jlab.org
Sun Jan 17 09:26:49 EST 2010
Hi Nathan,
I was able to reproduce the error on a RHEL4 machine (also athlon)
running gcc3.4.6. The problem had to do with the call:
loop->GetGeom("//posXYZ[@volume='ForwardEMcal']/@X_Y_Z", fcal_pos);
This is a templated method of JEventLoop which calls a templated method
of JGeometry. It turns out there are to templated methods of JGeometry
which could match the data types of the call being made. One however
needs to imply more to match than the other (according to some obscure
C++ rules) so that it would take precedence. It looks like this was not
implemented correctly in gcc3.4.6, but was in later versions of gcc
which is why the error did not show up there. That makes this one of the
very rare cases where the older gcc version is actually pickier than the
newer gcc version!
The fix was to change the call to something more explicit for which
there is no possible ambiguity. I do this by explicitly passing the
optional 3rd argument to JGeometry::Get which only one template supports:
loop->GetJGeometry()->Get("//posXYZ[@volume='ForwardEMcal']/@X_Y_Z",
fcal_pos, " ");
I realize that this may be more detail than you are interested in, but
I'm CC-ing this to the Hall-D offline list and someone else there may
find it useful.
The change has been checked in, though not thoroughly tested. Please
have a look and see if that fixes your compilation problems.
Regards,
-David
Nathan Sparks wrote:
> Hi David,
>
> I am using Linux_CentOS4-athlon-gcc3.4.6.
>
> Thanks,
> Nathan
>
> ----- Original Message -----
> From: David Lawrence <davidl at jlab.org>
> Date: Friday, January 15, 2010 9:58 am
> Subject: Re: [Halld-offline] nightly build errors and warnings
> To: Nathan Sparks <nsparks at fsu.edu>
>
>
>> Hi Nathan,
>>
>> This may be a problem with different gcc versions. I did my
>> test on
>> Mac OS X 10.5 with gcc4.0.1. I will try it on Linux platform using
>> a
>> different gcc version. In the meantime, can you tell me what OS you
>> are
>> using and what the gcc version number is?
>>
>> Regards,
>> -David
>>
>> Nathan Sparks wrote:
>>
>>> Hello David,
>>>
>>> I am still having build errors. I just did an svn update and
>>>
>> make. Any ideas?
>>
>>> g++ -I. -I.. -I../include -I/d/home/sparks/halld/include -
>>>
>> D_FILE_OFFSET_BITS=64 -I/d/home/sparks/halld/jana_0.6.0/include -
>> I/d/home/sparks/halld/xerces-c-src_2_7_0/include -D_ROOT_ -pthread -
>> m32 -I/d/home/sparks/root/include -I/d/home/sparks/root/include -O2
>> -Wall -c -o DPhoton_factory.o DPhoton_factory.cc
>>
>>> /d/home/sparks/halld/jana_0.6.0/include/JANA/JEventLoop.h: In
>>>
>> member function `bool jana::JEventLoop::GetGeom(std::string, T&)
>> [with T = std::vector<double, std::allocator<double> >]':
>>
>>> DPhoton_factory.cc:54: instantiated from here
>>> /d/home/sparks/halld/jana_0.6.0/include/JANA/JEventLoop.h:536:
>>>
>> error: call of overloaded `Get(std::basic_string<char,
>> std::char_traits<char>, std::allocator<char> >&,
>> std::vector<double, std::allocator<double> >&)' is ambiguous
>>
>>> /d/home/sparks/halld/jana_0.6.0/include/JANA/JGeometry.h:132:
>>>
>> note: candidates are: bool jana::JGeometry::Get(std::string, T&)
>> [with T = std::vector<double, std::allocator<double> >]
>>
>>> /d/home/sparks/halld/jana_0.6.0/include/JANA/JGeometry.h:164:
>>>
>> note: bool jana::JGeometry::Get(std::string,
>> std::vector<T, std::allocator<_CharT> >&, std::string) [with T =
>> double]> make[2]: *** [DPhoton_factory.o] Error 1
>>
>>> make[2]: Leaving directory `/d/home/sparks/halld/src/libraries/PID'
>>> make[1]: *** [PID] Error 2
>>> make[1]: Leaving directory `/d/home/sparks/halld/src/libraries'
>>> make: *** [libraries] Error 2
>>>
>>> Thanks,
>>> Nathan
>>>
>>> ----- Original Message -----
>>> From: David Lawrence <davidl at jlab.org>
>>> Date: Friday, January 15, 2010 9:07 am
>>> Subject: Re: [Halld-offline] nightly build errors and warnings
>>> To: "Mark M. Ito" <marki at jlab.org>
>>> Cc: halld-offline at jlab.org
>>>
>>>
>>>
>>>> That was my fault. It should be fixed now.
>>>>
>>>> -Dave
>>>>
>>>> Mark M. Ito wrote:
>>>>
>>>>
>>>>> There was an error in the build last night:
>>>>>
>>>>> /scratch/gluex/halld_builds/2010-01-
>>>>>
>> 15/halld_ifarml5.log:make[3]:
>>
>>>>>
>>>>>
>>>> ***
>>>>
>>>>
>>>>> [DPhoton_factory.o] Error 1
>>>>> _______________________________________________
>>>>> Halld-offline mailing list
>>>>> Halld-offline at jlab.org
>>>>> https://mailman.jlab.org/mailman/listinfo/halld-offline
>>>>>
>>>>>
>>>>>
>>>> --
>>>>
>>>> -----------------------------------------------------------------
>>>>
>> ---
>>
>>>> ----
>>>> David Lawrence Ph.D.
>>>> Staff Scientist Office: (757)269-5567 [[[ [
>>>>
>> [
>>
>>>> [
>>>> Jefferson Lab Pager: (757)584-5567 [ [ [ [
>>>>
>> [
>>
>>>> [
>>>> http://www.jlab.org/~davidl davidl at jlab.org [[[ [[
>>>>
>> [[
>>
>>>> [[[--------------------------------------------------------------
>>>>
>> ---
>>
>>>> -------
>>>>
>>>>
>>>> _______________________________________________
>>>> Halld-offline mailing list
>>>> Halld-offline at jlab.org
>>>> https://mailman.jlab.org/mailman/listinfo/halld-offline
>>>>
>>>>
>>>>
>> --
>>
>> --------------------------------------------------------------------
>> ----
>> David Lawrence Ph.D.
>> Staff Scientist Office: (757)269-5567 [[[ [ [
>> [
>> Jefferson Lab Pager: (757)584-5567 [ [ [ [ [
>> [
>> http://www.jlab.org/~davidl davidl at jlab.org [[[ [[ [[
>> [[[-----------------------------------------------------------------
>> -------
>>
>>
>>
>>
--
------------------------------------------------------------------------
David Lawrence Ph.D.
Staff Scientist Office: (757)269-5567 [[[ [ [ [
Jefferson Lab Pager: (757)584-5567 [ [ [ [ [ [
http://www.jlab.org/~davidl davidl at jlab.org [[[ [[ [[ [[[
------------------------------------------------------------------------
More information about the Halld-offline
mailing list