Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: flatbuffers::flatbuffer_version_string Multiply defined Global Symbol #45686

Closed
fjpolo opened this issue Dec 15, 2020 · 3 comments
Closed
Assignees
Labels
comp:lite TF Lite related issues comp:micro Related to TensorFlow Lite Microcontrollers type:support Support issues

Comments

@fjpolo
Copy link

fjpolo commented Dec 15, 2020

@tensorflow/micro

System information

  • Host OS Platform and Distribution: Windows 10
  • TensorFlow installed from: source
  • Tensorflow version (commit SHA if source): latest
  • Target platform: STM32F407IG using Keil uVision with Compiler v6

Problem

I have been trying to compile the hello_world example generated with TFLite using Keil uVision, and compiler v6 from them. After compiling for a little while, it stops with an error and I get the following output:

Build started: Project: keil_project
*** Using Compiler 'V6.12', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin'
Build target 'hello_world'
compiling common.c...
compiling error_reporter.cc...
compiling tensor_utils.cc...
compiling quantization_util.cc...
compiling op_resolver.cc...
compiling flatbuffer_conversions.cc...
compiling keyword_scrambled_model_data.cc...
compiling debug_log.cc...
compiling kernel_util.cc...
compiling constants.cc...
compiling main.cc...
compiling all_ops_resolver.cc...
compiling model.cc...
compiling output_handler.cc...
compiling activations.cc...
compiling main_functions.cc...
compiling arg_min_max.cc...
compiling add.cc...
compiling ceil.cc...
compiling circular_buffer.cc...
compiling comparisons.cc...
compiling conv.cc...
compiling concatenation.cc...
compiling depthwise_conv.cc...
compiling dequantize.cc...
compiling ethosu.cc...
compiling elementwise.cc...
compiling flexbuffers_generated_data.cc...
compiling detection_postprocess.cc...
compiling floor.cc...
compiling fully_connected.cc...
compiling kernel_runner.cc...
compiling hard_swish.cc...
compiling kernel_util.cc...
compiling logical.cc...
compiling l2norm.cc...
compiling logistic.cc...
compiling maximum_minimum.cc...
compiling neg.cc...
compiling pack.cc...
compiling mul.cc...
compiling pad.cc...
compiling pooling.cc...
compiling prelu.cc...
compiling quantize.cc...
compiling reduce.cc...
compiling resize_nearest_neighbor.cc...
compiling round.cc...
compiling reshape.cc...
compiling split.cc...
compiling softmax.cc...
compiling shape.cc...
compiling split_v.cc...
compiling strided_slice.cc...
compiling sub.cc...
compiling svdf.cc...
compiling svdf_common.cc...
compiling unpack.cc...
compiling tanh.cc...
compiling greedy_memory_planner.cc...
compiling linear_memory_planner.cc...
compiling micro_error_reporter.cc...
compiling memory_helpers.cc...
compiling micro_profiler.cc...
compiling micro_string.cc...
compiling micro_allocator.cc...
compiling micro_time.cc...
compiling micro_interpreter.cc...
compiling micro_utils.cc...
compiling recording_simple_memory_allocator.cc...
compiling recording_micro_allocator.cc...
compiling simple_memory_allocator.cc...
compiling test_conv_model.cc...
compiling retarget_io.c...
compiling test_helpers.cc...
compiling schema_utils.cc...
linking...
.\Objects\hello_world.axf: Warning: L6439W: Multiply defined Global Symbol flatbuffers::flatbuffer_version_string defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(op_resolver.o) rejected in favor of Symbol defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(flatbuffer_conversions.o).
.\Objects\hello_world.axf: Warning: L6439W: Multiply defined Global Symbol flatbuffers::flatbuffer_version_string defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(all_ops_resolver.o) rejected in favor of Symbol defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(flatbuffer_conversions.o).
.\Objects\hello_world.axf: Warning: L6439W: Multiply defined Global Symbol flatbuffers::flatbuffer_version_string defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(main_functions.o) rejected in favor of Symbol defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(flatbuffer_conversions.o).
.\Objects\hello_world.axf: Warning: L6439W: Multiply defined Global Symbol flatbuffers::flatbuffer_version_string defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(add.o) rejected in favor of Symbol defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(flatbuffer_conversions.o).
.\Objects\hello_world.axf: Warning: L6439W: Multiply defined Global Symbol flatbuffers::flatbuffer_version_string defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(mul.o) rejected in favor of Symbol defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(flatbuffer_conversions.o).
.\Objects\hello_world.axf: Warning: L6439W: Multiply defined Global Symbol flatbuffers::flatbuffer_version_string defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(reshape.o) rejected in favor of Symbol defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(flatbuffer_conversions.o).
.\Objects\hello_world.axf: Warning: L6439W: Multiply defined Global Symbol flatbuffers::flatbuffer_version_string defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(shape.o) rejected in favor of Symbol defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(flatbuffer_conversions.o).
.\Objects\hello_world.axf: Warning: L6439W: Multiply defined Global Symbol flatbuffers::flatbuffer_version_string defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(memory_helpers.o) rejected in favor of Symbol defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(flatbuffer_conversions.o).
.\Objects\hello_world.axf: Warning: L6439W: Multiply defined Global Symbol flatbuffers::flatbuffer_version_string defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(micro_allocator.o) rejected in favor of Symbol defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(flatbuffer_conversions.o).
.\Objects\hello_world.axf: Warning: L6439W: Multiply defined Global Symbol flatbuffers::flatbuffer_version_string defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(micro_interpreter.o) rejected in favor of Symbol defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(flatbuffer_conversions.o).
.\Objects\hello_world.axf: Warning: L6439W: Multiply defined Global Symbol flatbuffers::flatbuffer_version_string defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(recording_micro_allocator.o) rejected in favor of Symbol defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(flatbuffer_conversions.o).
.\Objects\hello_world.axf: Warning: L6439W: Multiply defined Global Symbol flatbuffers::flatbuffer_version_string defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(simple_memory_allocator.o) rejected in favor of Symbol defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(flatbuffer_conversions.o).
.\Objects\hello_world.axf: Warning: L6439W: Multiply defined Global Symbol flatbuffers::flatbuffer_version_string defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(test_helpers.o) rejected in favor of Symbol defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(flatbuffer_conversions.o).
.\Objects\hello_world.axf: Warning: L6439W: Multiply defined Global Symbol flatbuffers::flatbuffer_version_string defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(schema_utils.o) rejected in favor of Symbol defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(flatbuffer_conversions.o).
.\Objects\hello_world.axf: Error: L6320W: Ignoring --entry command. Cannot find argument 'Reset_Handler'.
.\Objects\hello_world.axf: Warning: L6320W: Ignoring --first command. Cannot find argument '__Vectors'.
Not enough information to list image symbols.
Not enough information to list load addresses in the image map.
Finished: 2 information, 15 warning and 1 error messages.
".\Objects\hello_world.axf" - 1 Error(s), 15 Warning(s).
Target not created.
Build Time Elapsed: 00:02:12

What I could find out, is that flatbuffer_version_string is defined under flatbuffers.h, and initialised there too, so that every file including flatbuffers.h will define flatbuffer_version_string all over again. But I still cannot find a solution.

Steps

  • Generate hello_world exmaple with MAKE, using the command "make -f tensorflow/lite/micro/tools/make/Makefile generate_projects hello_world"
  • Open keil_project.uvprojx under hello_world/keil.
  • Build .
  • Wait for build to stop with error.
@fjpolo fjpolo added the comp:micro Related to TensorFlow Lite Microcontrollers label Dec 15, 2020
@amahendrakar amahendrakar added comp:lite TF Lite related issues TF 2.5 Issues related to TF 2.5 type:support Support issues and removed TF 2.5 Issues related to TF 2.5 labels Dec 15, 2020
@jvishnuvardhan jvishnuvardhan added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Jan 13, 2021
@wangtz
Copy link
Member

wangtz commented Jan 19, 2021

@petewarden Pete, could you help reassign this bug to someone who's more familiar with Keil generated project?

Thanks,
Tiezhen

@tensorflowbutler tensorflowbutler removed the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Jan 21, 2021
@fjpolo
Copy link
Author

fjpolo commented Mar 3, 2021

Fixed commenting the following lines under flatbuffers.h:

2741 to 2748

//extern volatile attribute((weak)) const char *flatbuffer_version_string;
//volatile attribute((weak)) const char *flatbuffer_version_string =
// "FlatBuffers "
// FLATBUFFERS_STRING(FLATBUFFERS_VERSION_MAJOR) "."
// FLATBUFFERS_STRING(FLATBUFFERS_VERSION_MINOR) "."
// FLATBUFFERS_STRING(FLATBUFFERS_VERSION_REVISION);

//#endif // !defined(_WIN32) && !defined(CYGWIN)

@fjpolo fjpolo closed this as completed Mar 3, 2021
@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:lite TF Lite related issues comp:micro Related to TensorFlow Lite Microcontrollers type:support Support issues
Projects
None yet
Development

No branches or pull requests

6 participants