jveitchmichaelis / deeplabel

A cross-platform desktop image annotation tool for machine learning
205 stars 39 forks source link

Compiling fails with missing port_def.inc on ubuntu #34

Closed vladaman closed 2 years ago

vladaman commented 2 years ago

I tried to compile deeplabel and it fails with missing include file. Is there any particular protobuf dev version needed?

:/tmp/deeplabel$ sudo apt install git build-essential qt5-default libprotobuf-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libprotobuf-dev is already the newest version (3.6.1.3-2ubuntu5).
build-essential is already the newest version (12.8ubuntu1.1).
git is already the newest version (1:2.25.1-1ubuntu3.2).
qt5-default is already the newest version (5.12.8+dfsg-0ubuntu2.1).
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.

:/tmp/deeplabel$ make -j4
g++ -c -pipe -O2 -std=gnu++1z -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_TESTLIB_LIB -DQT_CONCURRENT_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/tmp/deeplabel"' -I. -isystem /usr/local/include/opencv4 -Isrc -IQtAwesome/QtAwesome -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtTest -isystem /usr/include/x86_64-linux-gnu/qt5/QtConcurrent -isystem /usr/include/x86_64-linux-gnu/qt5/QtXml -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I.moc -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o .obj/main.o src/main.cpp
g++ -c -pipe -O2 -std=gnu++1z -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_TESTLIB_LIB -DQT_CONCURRENT_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/tmp/deeplabel"' -I. -isystem /usr/local/include/opencv4 -Isrc -IQtAwesome/QtAwesome -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtTest -isystem /usr/include/x86_64-linux-gnu/qt5/QtConcurrent -isystem /usr/include/x86_64-linux-gnu/qt5/QtXml -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I.moc -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o .obj/mainwindow.o src/mainwindow.cpp
g++ -c -pipe -O2 -std=gnu++1z -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_TESTLIB_LIB -DQT_CONCURRENT_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/tmp/deeplabel"' -I. -isystem /usr/local/include/opencv4 -Isrc -IQtAwesome/QtAwesome -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtTest -isystem /usr/include/x86_64-linux-gnu/qt5/QtConcurrent -isystem /usr/include/x86_64-linux-gnu/qt5/QtXml -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I.moc -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o .obj/exportdialog.o src/exportdialog.cpp
g++ -c -pipe -O2 -std=gnu++1z -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_TESTLIB_LIB -DQT_CONCURRENT_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/tmp/deeplabel"' -I. -isystem /usr/local/include/opencv4 -Isrc -IQtAwesome/QtAwesome -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtTest -isystem /usr/include/x86_64-linux-gnu/qt5/QtConcurrent -isystem /usr/include/x86_64-linux-gnu/qt5/QtXml -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I.moc -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o .obj/multitracker.o src/multitracker.cpp
In file included from src/tfrecordexporter.h:6,
                 from src/exporter.h:9,
                 from src/mainwindow.h:19,
                 from src/mainwindow.cpp:1:
src/proto/example.pb.h:10:10: fatal error: google/protobuf/port_def.inc: No such file or directory
   10 | #include <google/protobuf/port_def.inc>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from src/tfrecordexporter.h:6,
                 from src/exporter.h:9,
                 from src/mainwindow.h:19,
                 from src/main.cpp:1:
src/proto/example.pb.h:10:10: fatal error: google/protobuf/port_def.inc: No such file or directory
   10 | #include <google/protobuf/port_def.inc>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:844: .obj/mainwindow.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Makefile:807: .obj/main.o] Error 1
jveitchmichaelis commented 2 years ago

Hi,

What version do you have? I don't know exactly what the minimum is but anything recent should work. I had a quick Google and it looks like some older releases didn't include that file, possibly by mistake? You may need to install from source rather than via package manager. In the github action everything is installed from apt:

https://github.com/jveitchmichaelis/deeplabel/blob/master/.github/workflows/build_ubuntu.yml

Thanks!

On Thu, 7 Apr 2022 at 12:29, Vladimir Vlach @.***> wrote:

I tried to compile deeplabel and it fails with missing include file. Is there any particular protobuf dev version needed?

:/tmp/deeplabel$ sudo apt install git build-essential qt5-default libprotobuf-dev Reading package lists... Done Building dependency tree Reading state information... Done libprotobuf-dev is already the newest version (3.6.1.3-2ubuntu5). build-essential is already the newest version (12.8ubuntu1.1). git is already the newest version (1:2.25.1-1ubuntu3.2). qt5-default is already the newest version (5.12.8+dfsg-0ubuntu2.1). 0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.

:/tmp/deeplabel$ make -j4 g++ -c -pipe -O2 -std=gnu++1z -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_TESTLIB_LIB -DQT_CONCURRENT_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/tmp/deeplabel"' -I. -isystem /usr/local/include/opencv4 -Isrc -IQtAwesome/QtAwesome -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtTest -isystem /usr/include/x86_64-linux-gnu/qt5/QtConcurrent -isystem /usr/include/x86_64-linux-gnu/qt5/QtXml -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I.moc -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o .obj/main.o src/main.cpp g++ -c -pipe -O2 -std=gnu++1z -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_TESTLIB_LIB -DQT_CONCURRENT_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/tmp/deeplabel"' -I. -isystem /usr/local/include/opencv4 -Isrc -IQtAwesome/QtAwesome -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtTest -isystem /usr/include/x86_64-linux-gnu/qt5/QtConcurrent -isystem /usr/include/x86_64-linux-gnu/qt5/QtXml -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I.moc -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o .obj/mainwindow.o src/mainwindow.cpp g++ -c -pipe -O2 -std=gnu++1z -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_TESTLIB_LIB -DQT_CONCURRENT_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/tmp/deeplabel"' -I. -isystem /usr/local/include/opencv4 -Isrc -IQtAwesome/QtAwesome -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtTest -isystem /usr/include/x86_64-linux-gnu/qt5/QtConcurrent -isystem /usr/include/x86_64-linux-gnu/qt5/QtXml -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I.moc -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o .obj/exportdialog.o src/exportdialog.cpp g++ -c -pipe -O2 -std=gnu++1z -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_TESTLIB_LIB -DQT_CONCURRENT_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/tmp/deeplabel"' -I. -isystem /usr/local/include/opencv4 -Isrc -IQtAwesome/QtAwesome -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtTest -isystem /usr/include/x86_64-linux-gnu/qt5/QtConcurrent -isystem /usr/include/x86_64-linux-gnu/qt5/QtXml -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I.moc -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o .obj/multitracker.o src/multitracker.cpp In file included from src/tfrecordexporter.h:6, from src/exporter.h:9, from src/mainwindow.h:19, from src/mainwindow.cpp:1: src/proto/example.pb.h:10:10: fatal error: google/protobuf/port_def.inc: No such file or directory 10 | #include <google/protobuf/port_def.inc> | ^~~~~~~~~~ compilation terminated. In file included from src/tfrecordexporter.h:6, from src/exporter.h:9, from src/mainwindow.h:19, from src/main.cpp:1: src/proto/example.pb.h:10:10: fatal error: google/protobuf/port_def.inc: No such file or directory 10 | #include <google/protobuf/port_def.inc> | ^~~~~~~~~~ compilation terminated. make: [Makefile:844: .obj/mainwindow.o] Error 1 make: Waiting for unfinished jobs.... make: *** [Makefile:807: .obj/main.o] Error 1

— Reply to this email directly, view it on GitHub https://github.com/jveitchmichaelis/deeplabel/issues/34, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYDMJ3EIFP74CFU5M3KMJ3VD22G5ANCNFSM5SY4VSCQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

vladaman commented 2 years ago

Thanks! I've made a progress and this step was missing in doc I think compared to workflow: protoc --proto_path ./src/proto --cpp_out ./src/proto feature.proto example.proto

jveitchmichaelis commented 2 years ago

Great, though this is actually in the readme - it may be not obvious:

https://github.com/jveitchmichaelis/deeplabel/blob/f2b1f0697ab17b2c0d1df03b100c58022dff4598/README.md?plain=1#L245

I've moved the instructions around and added a link to the action for reference.