protocol buffers - How to get Google Protobuf working in Matlab? -


so if 1 want use google protocol buffers in matlab , using windows computer best way since matlab not in list of supported languages?

i haven't seen answer on , thought solution bit obscure going post how matlab_out using protoc.exe

a how google protocol buffer matlab out, using resources internet include zip file containing done.

  1. unzip protobuf-‘version#’.zip (looks like: protobuf-#.#.#)

  2. open file protobuf-#.#.# -> src

  3. choose favorite editor (notepad++ good) , change makefile.am (do not include quotes)

a. under “nobase_include_headers =” , below “$(gzheaders)

add line “farsounder/protobuf/compiler/matlab/matlab_generator.h \” (note slash)

b. under “libprotoc_la_libadd = $(pthread_libs) libprotobuf.la

add lines
farsounder/protobuf/compiler/matlab/matlab_generator.cc \

farsounder/protobuf/compiler/matlab/matlab_plugin.cc \

c. save file , exit out

  1. while still in src directory go ->google ->protobuf->compiler , change main.cc

a. under “#include <google/protobuf/compiler/java/java_generator.h>

add line “#include <farsounder/protobuf/compiler/matlab/matlab_generator.h>

b. in main function add lines “// proto2 matlab farsounder::protobuf::compiler::matlab::matlabgenerator matlab_generator; cli.registergenerator("--matlab_out", &matlab_generator, "generate matlab m files.");

c. save file , exit out

  1. unzip protobuf-matlab
  2. open file protobuf-matlab ->src , copy farsounder directory protobuf-#.#.# -> src directory
  3. go protobuf-#.#.# directory , -> vsprojects , open protobuf.sln in visual studio, believe version should work
  4. there should popup wants convert solution file more updated version, go ahead , that
  5. if not see solutions explorer open using ctrl+alt+l
  6. open new windows explorer , go protobuf-#.#.# ->src->farsounder->protobuf->compiler->matlab, in visual studio using solutions explorer expand libprotoc->header files, in windows explorer copy matlab_generator.h file , paste header files directory
  7. still in solutions explorer go source files directory , copy in matlab_generator.cc
  8. contract libprotoc , right click on protoc , click on properties
  9. under configuration properties->linker->general, edit enable incremental linking no
  10. under configuration properties->linker->input, edit additional dependencies a. add lines “release\libprotobuf.lib” , underneath “release\libprotoc.lib” b. click ok on additional dependencies window , ok on protoc property page
  11. change build type release
  12. right-click on libprotobuf , select build, once completed right-click on libprotoc , select build
  13. once completed right-click on protoc , select build, should provide protoc.exe under protobuf-#.#.# ->vsprojects->release, allow create matlab .m files using matlab_out command

help find protobuf-#.#.# , protobuf-matlab:

follow these links:

https://code.google.com/p/protobuf-matlab/source/browse/
download zip file

https://github.com/google/protobuf/releases

download source code

extra help, using protoc.exe

  1. copy , paste created protoc.exe .proto file is
  2. run cmd , change directory protoc.exe , .proto file is
  3. run command (lets pretend name of .proto file “afunprotofile”) “protoc –matlab_out=./ -i./ afunprotofile.proto

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -