google-coral / libedgetpu

Source code for the userspace level runtime driver for Coral.ai devices.
Apache License 2.0
184 stars 64 forks source link

Makefile is not compatible with tf 2.16.1 #72

Open mwprado opened 2 months ago

mwprado commented 2 months ago

If you try compile using make, shows there isn't common.c file. In Tf 2.16.1 there is only common.cc .

google-coral-bot[bot] commented 2 months ago

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

FeeJai commented 1 month ago

got the same issue here.

mwprado commented 1 month ago

got the same issue here.

I fixed makefile:

new_makefile.patch.txt

mwprado commented 1 month ago

@feranick common_internal.cc needs be relocated to LIBEDGETPU_CCSRCS variable as my patch set it.

jagiella commented 1 month ago

@feranick without the patch provided by @mwprado it won't compile, even with the newest commit of the main branch.

Additionally, it is important to mention, that the documentation is misleading (not to say wrong) in respect to the build dependencies: On ubuntu / debian systems the provided package for libflatbuffers-dev uses a different scheme for version numbers. The current versions are v2.0.8 (debian bookworm / ubuntu 24.04), but tensorflow requests v23.x.y. So builds will never work, eventhough the documention suggests, it would.

It would be great to change the documentation and add instructions to build and install the matching flatbuffer version which tensorflow requires.

Please add to makefile_build documentation

For example for tensorflow 2.16.1 you require to build and install libflatbuffers 23.5.26:

git clone https://github.com/google/flatbuffers.git
cd flatbuffers/
git checkout v23.5.26
mkdir build && cd build
cmake .. -DFLATBUFFERS_BUILD_SHAREDLIB=ON -DFLATBUFFERS_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
make -j$(nproc)
sudo make install

Please add to main documentation

And in order to make debian packages using the Makefile-only approach you need to build both versions of the library first (std, max) before the packaging routine can successfully been run:

TFROOT=<Directory of Tensorflow>/ make -f makefile_build/Makefile -j$(nproc)
debuild -us -uc -tc -b -a amd64 -d
feranick commented 1 month ago

@jagiella I am not sure why you are tagging me on this. I am not a Google developer and have no access to the main repo. Feel free to create an actual patch, make a PR against the main repo and hope that it gets merged.

I maintain a separate fork that is updated: https://github.com/feranick/libedgetpu/

with a PR to the main repo: https://github.com/google-coral/libedgetpu/pull/70