Re: [protobuf] Important!! please help, protoc command not working on linux x86_64

2017-07-06 Thread deepakagarwal2027
Hello Feng, I found the problem, the problem is the linux version
I am trying to execute on linux 2.6.x, and i think protoc doesnt support 
this

when i run on linux 3.0, its working fine

Thanks for your response

On Friday, July 7, 2017 at 12:01:02 AM UTC+5:30, Feng Xiao wrote:
>
>
>
> On Thu, Jul 6, 2017 at 6:57 AM,  
> wrote:
>
>> Hi All,
>> I downloaded protoc binary (protoc-3.2.0-linux-x86_64.zip 
>> )
>>  
>> for linux from https://github.com/google/protobuf/releases
>> My linux configuration is x86_64 GNU/Linux
>>
>> I placed the precompiled binary in a folder and try to execute the protoc 
>> command
>>
>> $:/opt/protocompiler/bin # ./protoc --version
>> Floating point Exception
>>
>>
>> I really dont understand why this problem is coming, I have to use this 
>> command in ant task to compile my proto files at runtime
>>
>> But it is always giving me the error message "Floating point Exception"
>>
>> Its blocking our production build, will be great help if someone can give 
>> some pointers on it
>>
> Can you try a different version and see if it has the same issue?
>
> Also you can try to build the protoc binary from source.
>  
>
>>
>> Thanks in advance
>>
>>
>>
>>
>>
>> -- 
>> 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.


Re: [protobuf] Proto compiler creating Strong Type Enum

2017-07-06 Thread Abhi
 I am using --structs_out command along with --cpp_outhence it is 
creating struct.h files ...


On Thursday, 6 July 2017 23:39:55 UTC+5:30, Feng Xiao wrote:
>
>
>
> On Wed, Jul 5, 2017 at 9:07 PM, Abhi  
> wrote:
>
>> Hi 
>>
>> I am using proto compiler 3.1 and it's a C++ project.
>>
>> When I compile my proto Its generating myproto.struct.h file along with 
>> myproto.pb.cc and myproto.pb.h.
>>
> I don't think protoc generates .struct.h file. Is it coming from some 
> plugin you are using?
>  
>
>>
>> So the issue is in my myproto.struct.h the enum is created as strong 
>> typed enum and when I compile this file with VS2010 I am getting 
>> compiler error as its not supported in VS2010.
>>
>> Could anyone please let me know how to solve this problem.
>>
>> Please do the needful.
>>
>>
>>
>> enum xyz {}
>>  
>> enum class xyz{}  -->Strong typed enum
>>
>>
>> -- 
>> 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] Re: Proto compiler creating Strong Type Enum

2017-07-06 Thread Abhi


On Thursday, 6 July 2017 09:37:00 UTC+5:30, Abhi wrote:
>
> Hi 
>
> I am using proto compiler 3.1 and it's a C++ project.
>
> When I compile my proto Its generating myproto.struct.h file along with 
> myproto.pb.cc and myproto.pb.h.
>
> So the issue is in my myproto.struct.h the enum is created as strong typed 
> enum and when I compile this file with VS2010 I am getting 
> compiler error as its not supported in VS2010.
>
> Could anyone please let me know how to solve this problem.
>
> Please do the needful.
>
>
>
> enum xyz {}
>  
> enum class xyz{}  -->Strong typed enum
>
>
>

-- 
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] Using GZIP compression with ofstream and ifstream

2017-07-06 Thread sin-chia . vincent-tan
Hi guys,

I am having problem in serialization with GZIP and ofstream and ifstream.
I suspect the problem might be due to misuse of API due to unfamiliarity 
with protobuf because i cant seems to find example working with 
ofstream/fstream with GZIP.
The problem happens when trying to serialize object into file with 
compression.

The code is as below:

#include 
#include 
#include 
#include 
#include 
#include 
#include "Scene.pb.h"
#include 
#include 
int const _MIN = 0;
int const _MAX = 255;
unsigned int const _SIZE = 6520;
unsigned int const _COMPRESSION_LEVEL = 10;
void randWithinUnsignedCharSize(uint8_t * buffer, unsigned int size)
{
for (size_t i = 0; i < size; ++i)
{
buffer[i] = _MIN + (rand() % static_cast(_MAX - _MIN + 1));
}
}
using namespace google::protobuf::io;
int main()
{
GOOGLE_PROTOBUF_VERIFY_VERSION;
Recipe::Scene * scene = new Recipe::Scene();
uint8_t * imageData = new uint8_t[_SIZE];
randWithinUnsignedCharSize(imageData, _SIZE);
for (size_t i = 0; i < _SIZE; i++)
{
scene->add_imagedata(imageData[i]);
}
std::cout << "scene->imagedata_size() " << scene->imagedata_size() << 
std::endl;
{
std::ofstream output("scene.art", std::ofstream::out | std::ofstream::trunc 
| std::ofstream::binary);
OstreamOutputStream outputFileStream();
GzipOutputStream::Options options;
options.format = GzipOutputStream::GZIP;
options.compression_level = _COMPRESSION_LEVEL;
GzipOutputStream gzipOutputStream(, options);
if (!scene->SerializeToZeroCopyStream()) { *//problem 
happens here*
std::cerr << "Failed to write scene." << std::endl;
return -1;
}
}
Recipe::Scene * scene1 = new Recipe::Scene();
{
std::ifstream input("scene.art", std::ifstream::in | std::ifstream::binary);
IstreamInputStream inputFileStream();
GzipInputStream gzipInputStream();
if (!scene1->ParseFromZeroCopyStream()) {
std::cerr << "Failed to parse scene." << std::endl;
return -1;
}
}
std::cout << "scene1->imagedata_size() " << scene1->imagedata_size() 
<

Re: [protobuf] Important!! please help, protoc command not working on linux x86_64

2017-07-06 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Jul 6, 2017 at 6:57 AM,  wrote:

> Hi All,
> I downloaded protoc binary (protoc-3.2.0-linux-x86_64.zip
> )
> for linux from https://github.com/google/protobuf/releases
> My linux configuration is x86_64 GNU/Linux
>
> I placed the precompiled binary in a folder and try to execute the protoc
> command
>
> $:/opt/protocompiler/bin # ./protoc --version
> Floating point Exception
>
>
> I really dont understand why this problem is coming, I have to use this
> command in ant task to compile my proto files at runtime
>
> But it is always giving me the error message "Floating point Exception"
>
> Its blocking our production build, will be great help if someone can give
> some pointers on it
>
Can you try a different version and see if it has the same issue?

Also you can try to build the protoc binary from source.


>
> Thanks in advance
>
>
>
>
>
> --
> 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.
>

-- 
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] Proto compiler creating Strong Type Enum

2017-07-06 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Jul 5, 2017 at 9:07 PM, Abhi  wrote:

> Hi
>
> I am using proto compiler 3.1 and it's a C++ project.
>
> When I compile my proto Its generating myproto.struct.h file along with
> myproto.pb.cc and myproto.pb.h.
>
I don't think protoc generates .struct.h file. Is it coming from some
plugin you are using?


>
> So the issue is in my myproto.struct.h the enum is created as strong typed
> enum and when I compile this file with VS2010 I am getting
> compiler error as its not supported in VS2010.
>
> Could anyone please let me know how to solve this problem.
>
> Please do the needful.
>
>
>
> enum xyz {}
>
> enum class xyz{}  -->Strong typed enum
>
>
> --
> 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.
>

-- 
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] Important!! please help, protoc command not working on linux x86_64

2017-07-06 Thread deepakagarwal2027
Hi All,
I downloaded protoc binary (protoc-3.2.0-linux-x86_64.zip 
)
 
for linux from https://github.com/google/protobuf/releases
My linux configuration is x86_64 GNU/Linux

I placed the precompiled binary in a folder and try to execute the protoc 
command

$:/opt/protocompiler/bin # ./protoc --version
Floating point Exception


I really dont understand why this problem is coming, I have to use this 
command in ant task to compile my proto files at runtime

But it is always giving me the error message "Floating point Exception"

Its blocking our production build, will be great help if someone can give 
some pointers on it

Thanks in advance





-- 
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] protobuf compile on powerpc-ibm-os400 without xlC

2017-07-06 Thread Giancarlo Baracchino
Hello
I'm trying to compile "Protocol Buffers 3.3.0", downloaded from the release 
section, under platform powerpc-ibm-os400 that has a CPU set based on AIX 
5.3.
As long as I haven't installed yet the xlC v9 I'm trying to build without 
it, using gcc, so I launched 
./configure
everything went fine until I launched 

make

make  all-recursive
Making all in .
La destinazione "all-am" è aggiornata.
Making all in src
depbase=`echo google/protobuf/compiler/main.o | sed 
's|[^/]*$|.deps/&|;s|\.o$||'`; g++ -std=c++11 -DHAVE_CONFIG_H -I. -I..  
-DHAVE_PTHREAD=1  -Wall -Wno-sign-compare -O2 -g -DNDEBUG -MT 
google/protobuf/compiler/main.o -MD -MP -MF $depbase.Tpo -c -o 
google/protobuf/compiler/main.o google/protobuf/compiler/main.cc && mv -f 
$depbase.Tpo $depbase.Po
depbase=`echo google/protobuf/stubs/atomicops_internals_x86_gcc.lo | 
sed 's|[^/]*$|.deps/&|;s|\.lo$||'`; /bin/sh ../libtool  --tag=CXX
--mode=compile g++ -std=c++11 -DHAVE_CONFIG_H  -I. -I..  
-DHAVE_PTHREAD=1  -Wall -Wno-sign-compare -O2 -g -DNDEBUG -MT 
google/protobuf/stubs/atomicops_internals_x86_gcc.lo -MD -MP -MF 
$depbase.Tpo -c -o google/protobuf/stubs/atomicops_internals_x86_gcc.lo 
google/protobuf/stubs/atomicops_internals_x86_gcc.cc && mv -f $depbase.Tpo 
$depbase.Plo
libtool: compile:  g++ -std=c++11 -DHAVE_CONFIG_H -I. -I.. -DHAVE_PTHREAD=1 
-Wall -Wno-sign-compare -O2 -g -DNDEBUG -MT 
google/protobuf/stubs/atomicops_internals_x86_gcc.lo -MD -MP -MF 
google/protobuf/stubs/.deps/atomicops_internals_x86_gcc.Tpo -c 
google/protobuf/stubs/atomicops_internals_x86_gcc.cc -o 
google/protobuf/stubs/atomicops_internals_x86_gcc.o
depbase=`echo google/protobuf/stubs/atomicops_internals_x86_msvc.lo | 
sed 's|[^/]*$|.deps/&|;s|\.lo$||'`; /bin/sh ../libtool  --tag=CXX
--mode=compile g++ -std=c++11 -DHAVE_CONFIG_H  -I. -I..  
-DHAVE_PTHREAD=1  -Wall -Wno-sign-compare -O2 -g -DNDEBUG -MT 
google/protobuf/stubs/atomicops_internals_x86_msvc.lo -MD -MP -MF 
$depbase.Tpo -c -o google/protobuf/stubs/atomicops_internals_x86_msvc.lo 
google/protobuf/stubs/atomicops_internals_x86_msvc.cc && mv -f $depbase.Tpo 
$depbase.Plo
libtool: compile:  g++ -std=c++11 -DHAVE_CONFIG_H -I. -I.. -DHAVE_PTHREAD=1 
-Wall -Wno-sign-compare -O2 -g -DNDEBUG -MT 
google/protobuf/stubs/atomicops_internals_x86_msvc.lo -MD -MP -MF 
google/protobuf/stubs/.deps/atomicops_internals_x86_msvc.Tpo -c 
google/protobuf/stubs/atomicops_internals_x86_msvc.cc -o 
google/protobuf/stubs/atomicops_internals_x86_msvc.o
depbase=`echo google/protobuf/stubs/bytestream.lo | sed 
's|[^/]*$|.deps/&|;s|\.lo$||'`; /bin/sh ../libtool  --tag=CXX
--mode=compile g++ -std=c++11 -DHAVE_CONFIG_H  -I. -I..  
-DHAVE_PTHREAD=1  -Wall -Wno-sign-compare -O2 -g -DNDEBUG -MT 
google/protobuf/stubs/bytestream.lo -MD -MP -MF $depbase.Tpo -c -o 
google/protobuf/stubs/bytestream.lo google/protobuf/stubs/bytestream.cc && 
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  g++ -std=c++11 -DHAVE_CONFIG_H -I. -I.. -DHAVE_PTHREAD=1 
-Wall -Wno-sign-compare -O2 -g -DNDEBUG -MT 
google/protobuf/stubs/bytestream.lo -MD -MP -MF 
google/protobuf/stubs/.deps/bytestream.Tpo -c 
google/protobuf/stubs/bytestream.cc -o google/protobuf/stubs/bytestream.o
depbase=`echo google/protobuf/stubs/common.lo | sed 
's|[^/]*$|.deps/&|;s|\.lo$||'`; /bin/sh ../libtool  --tag=CXX
--mode=compile g++ -std=c++11 -DHAVE_CONFIG_H  -I. -I..  
-DHAVE_PTHREAD=1  -Wall -Wno-sign-compare -O2 -g -DNDEBUG -MT 
google/protobuf/stubs/common.lo -MD -MP -MF $depbase.Tpo -c -o 
google/protobuf/stubs/common.lo google/protobuf/stubs/common.cc && mv -f 
$depbase.Tpo $depbase.Plo
libtool: compile:  g++ -std=c++11 -DHAVE_CONFIG_H -I. -I.. -DHAVE_PTHREAD=1 
-Wall -Wno-sign-compare -O2 -g -DNDEBUG -MT google/protobuf/stubs/common.lo 
-MD -MP -MF google/protobuf/stubs/.deps/common.Tpo -c 
google/protobuf/stubs/common.cc -o google/protobuf/stubs/common.o 

Assembler:   
/tmp//ccvfq7lA.s: line 2417: Error In Syntax 
/tmp//ccvfq7lA.s: line 2419: Error In Syntax 
/tmp//ccvfq7lA.s: line 4970: Error In Syntax 
/tmp//ccvfq7lA.s: line 4972: Error In Syntax 
/tmp//ccvfq7lA.s: line 6615: Error In Syntax 
/tmp//ccvfq7lA.s: line 6617: Error In Syntax 
/tmp//ccvfq7lA.s: line 6794: Error In Syntax 
/tmp//ccvfq7lA.s: line 6796: Error In Syntax 
/tmp//ccvfq7lA.s: line 7045: Error In Syntax  
/tmp//ccvfq7lA.s: line 7047: Error In Syntax  
/tmp//ccvfq7lA.s: line 7598: Error In Syntax  
/tmp//ccvfq7lA.s: line 7600: Error In Syntax  
make: 1254-004 Il codice errore per l'ultimo comando è 1. 
  
  
Here it is attached the config.log out of configure.

-- 
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] Re: Proto compiler creating Strong Type Enum

2017-07-06 Thread Abhi
Thanks Marc

On Thursday, 6 July 2017 09:37:00 UTC+5:30, Abhi wrote:
>
> Hi 
>
> I am using proto compiler 3.1 and it's a C++ project.
>
> When I compile my proto Its generating myproto.struct.h file along with 
> myproto.pb.cc and myproto.pb.h.
>
> So the issue is in my myproto.struct.h the enum is created as strong typed 
> enum and when I compile this file with VS2010 I am getting 
> compiler error as its not supported in VS2010.
>
> Could anyone please let me know how to solve this problem.
>
> Please do the needful.
>
>
>
> enum xyz {}
>  
> enum class xyz{}  -->Strong typed enum
>
>
>

-- 
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] Re: Protocol Buffers 2.6.0 or 2.6.0 Unable to build on AIX 5.3x6 xlC compiler using gmake

2017-07-06 Thread Giancarlo Baracchino
Does anyone succeded in compiling protobuf on AIX 5.3?
We are also interested into this topic.



Il giorno giovedì 27 ottobre 2016 19:29:54 UTC+2, 翟桂锋 ha scritto:
>
> Having the same issue on version 2.6.1 & AIX 7.1.
> Can anyone provide a patch to fix it?
>
> 在 2016年7月13日星期三 UTC+8上午8:12:41,Feng Xiao写道:
>>
>>
>>
>> On Tue, Jul 12, 2016 at 3:20 PM, Alban Lefebvre  
>> wrote:
>>
>>> Having the same issue here.
>>> Will version 2.6 be supporting AIX platform?
>>>
>> We can't fix the problem in the already released versions. Could you try 
>> if the problem is fixed in the newer 3.0.0-beta-3 version?
>>  
>>
>>>
>>>
>>> On Wednesday, July 22, 2015 at 5:17:01 PM UTC-4, Dannis Yang wrote:

 Per install instruction, I run ./configure CXX=xlC successfully but 
 immediate gmake failed as following:

 bash-2.05a# gmake
 gmake  all-recursive
 gmake[1]: Entering directory `/home/dyang/protobuf/protobuf-2.6.1'
 Making all in .
 gmake[2]: Entering directory `/home/dyang/protobuf/protobuf-2.6.1'
 gmake[2]: Leaving directory `/home/dyang/protobuf/protobuf-2.6.1'
 Making all in src
 gmake[2]: Entering directory `/home/dyang/protobuf/protobuf-2.6.1/src'
 source='google/protobuf/stubs/atomicops_internals_x86_gcc.cc' 
 object='google/protobuf/stubs/atomicops_internals_x86_gcc.
 lo' libtool=yes \
 DEPDIR=.deps depmode=xlc /bin/sh ../depcomp \
 /bin/sh ../libtool  --tag=CXX   --mode=compile xlC -DHAVE_CONFIG_H -I. 
 -I..-D_THREAD_SAFE   -DNDEBUG -c -o google/pr
 otobuf/stubs/atomicops_internals_x86_gcc.lo 
 google/protobuf/stubs/atomicops_internals_x86_gcc.cc
 libtool: compile:  xlC -DHAVE_CONFIG_H -I. -I.. -D_THREAD_SAFE -DNDEBUG 
 -c google/protobuf/stubs/atomicops_internals_x86
 _gcc.cc 
 -Wp,-qmakedep=gcc,-MFgoogle/protobuf/stubs/.deps/atomicops_internals_x86_gcc.TPlo
  
  -DPIC -o google/protobuf/stub
 s/.libs/atomicops_internals_x86_gcc.o
 "./google/protobuf/stubs/atomicops.h", line 214.1: 1540-0825 (W) The 
 character "#" is not allowed.
 "./google/protobuf/stubs/platform_macros.h", line 90.1: 1540-0825 (W) 
 The character "#" is not allowed.
 "./google/protobuf/stubs/platform_macros.h", line 90.1: 1540-0040 (S) 
 The text ""Host platform was not detected as suppo
 rted by protobuf"" is unexpected.  "error" may be undeclared or 
 ambiguous.
 gmake[2]: *** [google/protobuf/stubs/atomicops_internals_x86_gcc.lo] 
 Error 1
 gmake[2]: Leaving directory `/home/dyang/protobuf/protobuf-2.6.1/src'
 gmake[1]: *** [all-recursive] Error 1
 gmake[1]: Leaving directory `/home/dyang/protobuf/protobuf-2.6.1'
 gmake: *** [all] Error 2

 Has anyone successfully built Protocol Buffers on AIX? 

 Thank you

>>> -- 
>>> 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.