[protobuf] Re: regarding disabling rpath

2018-01-11 Thread Denis Bakhvalov
Hi, I found the solution here:
https://wiki.debian.org/RpathIssue

Here is what helped me to solve this issue:
sed -i -r 's/(runpath_var)=.*$/\1=''/' ./configure
sed -i -r 's/(hardcode_into_libs)=.*$/\1=no/' ./configure
sed -i -r 's/(hardcode_libdir_flag_spec)=.*$/\1=''/' ./configure
sed -i -r 's/(hardcode_libdir_flag_spec_CXX)=.*$/\1=''/' ./configure

Denis

On Thursday, 17 December 2015 20:45:00 UTC+1, Puneet Singh wrote:
>
> Hi ,
> I wish to disable rpath hardcoding from the protobuf build procedure , i 
> tried --disable-rpath , but was not successful.
> doing* ldd /home/apps/PROTOBUF/2.6.1/gnu/lib/libprotoc.so* gives:
>
> linux-vdso.so.1 =>  (0x7fff8edff000)
> libprotobuf.so.9 =>* 
> /home/apps/PROTOBUF/2.6.1/gnu/lib/libprotobuf.so.9 (0x7fd033c0b000)*
> libpthread.so.0 => /lib64/libpthread.so.0 (0x7fd0339ba000)
> libz.so.1 => /lib64/libz.so.1 (0x7fd0337a4000)
> libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x7fd03349e000)
> libm.so.6 => /lib64/libm.so.6 (0x7fd033219000)
> libc.so.6 => /lib64/libc.so.6 (0x7fd032e85000)
> libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x7fd032c6f000)
> /lib64/ld-linux-x86-64.so.2 (0x003785a0)
> even though * /home/apps/PROTOBUF/2.6.1/gnu/lib/* is not in my 
> LD_LIBRARY_PATH. It seems that i need to edit *ltmain.sh*
> Please suggest ,Any help/hint will be very useful.
>
> Regards
> Puneet Singh
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] How to erase particular field with MergeFrom()

2016-05-17 Thread Denis Bakhvalov
Hi Feng Xiao,

Thanks for your reply!

Unfortunately I couldn't find good examples how to use it, so let me ask 
one more question:

Should I put mask as a part of original message:

message RepAndOpt
{
repeated string name = 1;
string surname = 2;

google.protobuf.FieldMask field_mask = 3;
}

or put it as standalone message?

message RepAndOptMask
{
google.protobuf.FieldMask field_mask = 1;
}

I think there is nothing wrong if I will send them separately, right?

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] How to erase particular field with MergeFrom()

2016-05-17 Thread Denis Bakhvalov
Hi Feng Xiao,

Thanks for your reply!

Unfortunately I couldn't find good examples how to use it, so let me ask 
one more question:

Should I put mask as a part of original message:

message RepAndOpt
{
repeated string name = 1;
string surname = 2;

google.protobuf.FieldMask field_mask = 3;
}

or put it as standalone message?

message RepAndOptMask
{
google.protobuf.FieldMask field_mask = 1;
}

I think there is nothing wrong if I will send them separately, right?

понедельник, 16 мая 2016 г., 22:14:33 UTC+2 пользователь Feng Xiao написал:
>
>
>
> On Wed, May 11, 2016 at 5:09 AM, Denis Bakhvalov  > wrote:
>
>> Hi,
>>
>> Suppose I have such message structure:
>>
>>
>> package msg_RepAndOpt;
>>
>> message RepAndOpt{
>> repeated string name = 1;
>> optional string surname = 2;
>> ...
>> // there are lots of others.}
>>
>>
>> And I have two components that have copies of this message:
>>
>>
>> // component1:RepAndOpt A;
>> A.add_name("Name");
>> A.set_surname("Surname");
>> // component2:RepAndOpt B;
>>
>>
>> In my case components modify those messages via transaction mechanism. It 
>> means that if one component changes some field it also sends it to another 
>> component to propagate those changes. Component-receiver is doing merge:
>>
>>
>> // Component2 modifies B and sends it to component1.// Component1 perfoms 
>> merge:
>> A.MergeFrom(B);
>>
>>
>> Now, say, component2 wants to erase field "name". If it will send clear B 
>> message (default construction) than:
>>
>>- - MergeFrom() will not modify A;
>>- - CopyFrom() will erase also other fields.
>>
>> Another way will be to fill B with the contents of A, clear name field 
>> and component1 will use CopyFrom(). But this is not acceptable because 
>> system is really high-loaded and there could be lots of other fields. So, 
>> desired solution to clean name field is:
>>
>>1. 1. Component2 create B message.
>>2. 2. Explicitly stores information that it want to erase only name 
>>field.
>>3. 3. Component1 perform A.MergeFrom(B).
>>4. 4. Result: A::name is cleared but other fields are left untouched.
>>
>> As far as I tested this applies to repeated and optional fields. Is there 
>> any ready-to-use solution or I should modify protobuf implementation?
>>
> I think you can do this using FieldMaskUtil:
>
> https://github.com/google/protobuf/blob/beta-3/src/google/protobuf/util/field_mask_util.h#L111
>
> You create an empty B message along with a FieldMask containing only the 
> field you want to clear, and use FieldMaskUtil::MergeMessageTo(A, 
> field_mask, &B)  to replace the field in A with the value from B.
>
>  
>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Protocol Buffers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to protobuf+u...@googlegroups.com .
>> To post to this group, send email to prot...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] How to erase particular field with MergeFrom()?

2016-05-16 Thread Denis Bakhvalov


Hi,


Suppose I have such message structure:


package msg_RepAndOpt;

message RepAndOpt{
repeated string name = 1;
optional string surname = 2;
...
// there are lots of others.}


And I have two components that have copies of this message:


// component1:RepAndOpt A;
A.add_name("Name");
A.set_surname("Surname");
// component2:RepAndOpt B;


In my case components modify those messages via transaction mechanism. It 
means that if one component changes some field it also sends it to another 
component to propagate those changes. Component-receiver is doing merge:


// Component2 modifies B and sends it to component1.// Component1 perfoms merge:
A.MergeFrom(B);


Now, say, component2 wants to erase field "name". If it will send clear B 
message (default construction) than:

   - MergeFrom() will not modify A;
   - CopyFrom() will erase also other fields.

Another way will be to fill B with the contents of A, clear name field and 
component1 will use CopyFrom(). But this is not acceptable because system 
is really high-loaded and there could be lots of other fields. So, desired 
solution to clean name field is:

   1. Component2 create B message.
   2. Explicitly stores information that it want to erase only name field.
   3. Component1 perform A.MergeFrom(B).
   4. Result: A::name is cleared but other fields are left untouched.

As far as I tested this applies to repeated and optional fields. Is there 
any ready-to-use solution or I should modify protobuf implementation?

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] How to erase particular field with MergeFrom()

2016-05-16 Thread Denis Bakhvalov
Hi,

Suppose I have such message structure:


package msg_RepAndOpt;

message RepAndOpt{
repeated string name = 1;
optional string surname = 2;
...
// there are lots of others.}


And I have two components that have copies of this message:


// component1:RepAndOpt A;
A.add_name("Name");
A.set_surname("Surname");
// component2:RepAndOpt B;


In my case components modify those messages via transaction mechanism. It 
means that if one component changes some field it also sends it to another 
component to propagate those changes. Component-receiver is doing merge:


// Component2 modifies B and sends it to component1.// Component1 perfoms merge:
A.MergeFrom(B);


Now, say, component2 wants to erase field "name". If it will send clear B 
message (default construction) than:

   - - MergeFrom() will not modify A;
   - - CopyFrom() will erase also other fields.

Another way will be to fill B with the contents of A, clear name field and 
component1 will use CopyFrom(). But this is not acceptable because system 
is really high-loaded and there could be lots of other fields. So, desired 
solution to clean name field is:

   1. 1. Component2 create B message.
   2. 2. Explicitly stores information that it want to erase only name 
   field.
   3. 3. Component1 perform A.MergeFrom(B).
   4. 4. Result: A::name is cleared but other fields are left untouched.

As far as I tested this applies to repeated and optional fields. Is there 
any ready-to-use solution or I should modify protobuf implementation?

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.