Closed Eugene-Prokhorenko closed 4 years ago
Can you provide an example of the compilation error output? We principally are building and using MGEN in our work on CentOS and Ubuntu systems. Is this with the current MGEN and Protolib 'master' checkouts?
last src on last Gentoo: (I tried to fix thit, but stopped after fixing 30 errors :) )
eug-amd /home/eugene/mgen/mgen5/makefiles # eug-amd /home/eugene/mgen/mgen5/makefiles # make -f Makefile.linux g++ -c -g -DPROTO_DEBUG -DHAVE_GPS -DUNIX -Wall -Wcast-align -fPIC -DLINUX -DHAVE_SCHED -DHAVE_GETLOGIN -DHAVE_LOCKF -DHAVE_DIRFD -DHAVE_ASSERT -D_FILE_OFFSET_BITS=64 -DUNIX -DUSE_SELECT -DUSE_TIMERFD -DHAVE_PSELECT -DHAVE_IPV6 -DHAVE_PCAP -I/usr/X11R6/include -I../makefiles -I../include -I../protolib/include -o ../src/common/mgenApp.o ../src/common/mgenApp.cpp g++ -c -g -DPROTO_DEBUG -DHAVE_GPS -DUNIX -Wall -Wcast-align -fPIC -DLINUX -DHAVE_SCHED -DHAVE_GETLOGIN -DHAVE_LOCKF -DHAVE_DIRFD -DHAVE_ASSERT -D_FILE_OFFSET_BITS=64 -DUNIX -DUSE_SELECT -DUSE_TIMERFD -DHAVE_PSELECT -DHAVE_IPV6 -DHAVE_PCAP -I/usr/X11R6/include -I../makefiles -I../include -I../protolib/include -o ../src/common/mgen.o ../src/common/mgen.cpp g++ -c -g -DPROTO_DEBUG -DHAVE_GPS -DUNIX -Wall -Wcast-align -fPIC -DLINUX -DHAVE_SCHED -DHAVE_GETLOGIN -DHAVE_LOCKF -DHAVE_DIRFD -DHAVE_ASSERT -D_FILE_OFFSET_BITS=64 -DUNIX -DUSE_SELECT -DUSE_TIMERFD -DHAVE_PSELECT -DHAVE_IPV6 -DHAVE_PCAP -I/usr/X11R6/include -I../makefiles -I../include -I../protolib/include -o ../src/common/mgenEvent.o ../src/common/mgenEvent.cpp In file included from /usr/include/pcap/pcap.h:87, from /usr/include/pcap.h:43, from ../include/mgenPattern.h:7, from ../include/mgenEvent.h:5, from ../src/common/mgenEvent.cpp:2: ../protolib/include/protoDispatcher.h:468:37: error: expected identifier before ‘int’ 468 | enum Type {GENERIC, SOCKET, CHANNEL, TIMER, EVENT}; | ^ |
enum Type {GENERIC, SOCKET, CHANNEL, TIMER, EVENT}; | ^ ../protolib/include/protoDispatcher.h:468:43: error: expected unqualified-id before ‘,’ token 468 | enum Type {GENERIC, SOCKET, CHANNEL, TIMER, EVENT}; | ^ ../protolib/include/protoDispatcher.h:469:17: error: ‘Type’ does not name a type 469 | Type GetType() const {return type;} | ^~~~ ../protolib/include/protoDispatcher.h:484:28: error: expected ‘)’ before ‘theType’ 484 | Stream(Type theType); | ~ ^ |
) ../protolib/include/protoDispatcher.h:491:17: error: ‘Type’ does not name a type 491 | Type type; | ^~~~ ../protolib/include/protoDispatcher.h: In member function ‘bool ProtoDispatcher::IsPending()’: ../protolib/include/protoDispatcher.h:248:22: error: ‘stream_table’ was not declared in this scope 248 | !stream_table.IsEmpty()); | ^ |
{priority_boost = state;} | ^ |
SetPriorityBoost ../protolib/include/protoDispatcher.h: In member function ‘bool ProtoDispatcher::IsRunning() const’: ../protolib/include/protoDispatcher.h:279:21: error: ‘run’ was not declared in this scope; did you mean ‘Run’? 279 | {return run;} | ^~~ | Run ../protolib/include/protoDispatcher.h: In member function ‘void ProtoDispatcher::SetPreciseTiming(bool)’: ../protolib/include/protoDispatcher.h:288:14: error: ‘precise_timing’ was not declared in this scope; did you mean ‘SetPreciseTiming’? 288 | {precise_timing = state;} | ^ |
SetPreciseTiming ../protolib/include/protoDispatcher.h: In member function ‘void ProtoDispatcher::SetUserData(const void*)’: ../protolib/include/protoDispatcher.h:291:14: error: ‘user_data’ was not declared in this scope; did you mean ‘userData’? 291 | {user_data = userData;} | ^ |
userData ../protolib/include/protoDispatcher.h: In member function ‘const void* ProtoDispatcher::GetUserData()’: ../protolib/include/protoDispatcher.h:293:21: error: ‘user_data’ was not declared in this scope; did you mean ‘ifr_data’? 293 | {return user_data;} | ^ |
ifr_data ../protolib/include/protoDispatcher.h: In member function ‘bool ProtoDispatcher::IsThreaded()’: ../protolib/include/protoDispatcher.h:355:56: error: ‘thread_id’ was not declared in this scope; did you mean ‘ThreadId’? 355 | bool IsThreaded() {return ((ThreadId)(NULL) != thread_id);} | ^ |
ThreadId ../protolib/include/protoDispatcher.h: In member function ‘void ProtoDispatcher::SetPromptCallback(void ()(const void), const void*)’: ../protolib/include/protoDispatcher.h:387:13: error: ‘prompt_callback’ was not declared in this scope; did you mean ‘PromptCallback’? 387 | prompt_callback = theCallback; | ^ |
PromptCallback ../protolib/include/protoDispatcher.h:388:13: error: ‘prompt_client_data’ was not declared in this scope 388 | prompt_client_data = clientData; | ^ |
{return &exit_status;} | ^ |
ExitStatus ../protolib/include/protoDispatcher.h: In member function ‘bool ProtoDispatcher::IsMyself()’: ../protolib/include/protoDispatcher.h:452:56: error: ‘thread_id’ was not declared in this scope; did you mean ‘ThreadId’? 452 | bool IsMyself() {return (GetCurrentThread() == thread_id);} | ^ |
ThreadId ../protolib/include/protoDispatcher.h: In member function ‘bool ProtoDispatcher::IsInput() const’: ../protolib/include/protoDispatcher.h:471:62: error: ‘NOTIFY_INPUT’ was not declared in this scope 471 | bool IsInput() const {return NotifyFlagIsSet(NOTIFY_INPUT);} |
---|
^ |
bool IsInput() const {return NotifyFlagIsSet(NOTIFY_INPUT);} | ^ |
bool IsOutput() const {return NotifyFlagIsSet(NOTIFY_OUTPUT);} |
---|
^ |
bool IsOutput() const {return NotifyFlagIsSet(NOTIFY_OUTPUT);} | ^ |
class StreamTable : public ProtoTreeTemplate |
^ |
class StreamTable : public ProtoTreeTemplate |
^ ../protolib/include/protoDispatcher.h:504:60: error: ‘Stream’ was not declared in this scope 504 | class StreamList : public ProtoSimpleQueueTemplate |
^ |
class StreamList : public ProtoSimpleQueueTemplate |
^ ../protolib/include/protoDispatcher.h: In constructor ‘StreamList::StreamList()’: ../protolib/include/protoDispatcher.h:507:57: error: ‘Stream’ was not declared in this scope 507 | StreamList() :
ProtoSimpleQueueTemplate |
^ |
StreamList() :
ProtoSimpleQueueTemplate |
^ ../protolib/include/protoDispatcher.h:507:64: error: expected ‘{’ before ‘(’ token 507 | StreamList() :
ProtoSimpleQueueTemplate |
^ ../protolib/include/protoDispatcher.h: At global scope: ../protolib/include/protoDispatcher.h:514:39: error: ‘Stream’ was not declared in this scope 514 | bool UpdateStreamNotification(Stream& stream, NotificationCommand cmd); | ^ |
bool UpdateStreamNotification(Stream& stream, NotificationCommand cmd); | ^ |
strcat ../protolib/include/protoDispatcher.h:514:75: error: expected primary-expression before ‘cmd’ 514 | bool UpdateStreamNotification(Stream& stream, NotificationCommand cmd); |
---|
^~~
../protolib/include/protoDispatcher.h:514:78: error: expression list treated as compound expression in initializer [-fpermissive] 514 | bool UpdateStreamNotification(Stream& stream, NotificationCommand cmd); |
---|
^
../protolib/include/protoDispatcher.h:524:9: error: expected class-name before ‘{’ token 524 | { | ^ ../protolib/include/protoDispatcher.h:535:17: error: ‘Descriptor’ does not name a type 535 | Descriptor GetInputHandle() const | ^ |
Descriptor GetOutputHandle() const | ^ |
{ | ^ ../protolib/include/protoDispatcher.h:567:17: error: ‘Descriptor’ does not name a type 567 | Descriptor GetInputHandle() const | ^ |
Descriptor GetOutputHandle() const | ^ |
{ | ^ ../protolib/include/protoDispatcher.h:598:36: error: ‘Descriptor’ has not been declared 598 | void SetDescriptor(Descriptor theDescriptor) | ^ |
Descriptor GetDescriptor() const | ^ |
Descriptor GetInputHandle() const | ^ |
Descriptor GetOutputHandle() const | ^ |
Descriptor descriptor; | ^ |
{descriptor = theDescriptor;} | ^ |
SetDescriptor ../protolib/include/protoDispatcher.h: At global scope: ../protolib/include/protoDispatcher.h:621:9: error: expected class-name before ‘{’ token 621 | { | ^ ../protolib/include/protoDispatcher.h:629:17: error: ‘Descriptor’ does not name a type 629 | Descriptor GetDescriptor() const | ^ |
Descriptor GetInputHandle() const {return GetDescriptor();} | ^ |
Descriptor GetOutputHandle() const {return GetDescriptor();} | ^ |
{ | ^ ../protolib/include/protoDispatcher.h:656:41: error: expected ‘)’ before ‘theDescriptor’ 656 | GenericStream(Descriptor theDescriptor); | ~ ^ |
) ../protolib/include/protoDispatcher.h:657:17: error: ‘Descriptor’ does not name a type 657 | Descriptor GetDescriptor() {return descriptor;} | ^ |
void SetDescriptor(Descriptor theDescriptor) {descriptor = theDescriptor;} | ^ |
void SetCallback(Callback theCallback, const void clientData = NULL) | ^ |
void OnEvent(Event theEvent) | ^~~~~ ../protolib/include/protoDispatcher.h:670:17: error: ‘Descriptor’ does not name a type 670 | Descriptor GetInputHandle() const | ^ |
Descriptor GetOutputHandle() const | ^ |
Descriptor descriptor; | ^ |
Callback* callback; | ^ |
void SetDescriptor(Descriptor theDescriptor) {descriptor = theDescriptor;} |
---|
^~~~~~
|
SetDescriptor
../protolib/include/protoDispatcher.h: In member function ‘void
GenericStream::SetCallback(int, const void)’:
../protolib/include/protoDispatcher.h:661:21: error: ‘callback’ was not
declared in this scope; did you mean ‘calloc’?
661 | callback = theCallback;
| ^~~~
| calloc
../protolib/include/protoDispatcher.h: In member function ‘void
GenericStream::OnEvent(int)’:
../protolib/include/protoDispatcher.h:665:26: error: ‘callback’ was not
declared in this scope; did you mean ‘calloc’?
665 | {if (callback) callback(descriptor, theEvent,
client_data);}
| ^~~~
| calloc
../protolib/include/protoDispatcher.h:665:45: error: ‘descriptor’ was not
declared in this scope; did you mean ‘SetDescriptor’?
665 | {if (callback) callback(descriptor, theEvent,
client_data);}
| ^~~~~~
| SetDescriptor
../protolib/include/protoDispatcher.h: In member function ‘const char
GenericStream::GetDescriptorPtr() const’:
../protolib/include/protoDispatcher.h:668:44: error: ‘descriptor’ was not
declared in this scope; did you mean ‘SetDescriptor’?
668 | {return ((const char)&descriptor);}
| ^~~~~~
| SetDescriptor
../protolib/include/protoDispatcher.h: At global scope:
../protolib/include/protoDispatcher.h:692:32: error: expected ‘;’ at end
of member declaration
692 | GenericStream FindByDescriptor(Descriptor
descriptor) const
| ^~~~
| ;
../protolib/include/protoDispatcher.h:692:59: error: expected ‘)’ before
‘descriptor’
692 | GenericStream FindByDescriptor(Descriptor
descriptor) const
| ~ ^~~
| )
../protolib/include/protoDispatcher.h: In member function ‘virtual const
char GenericStreamTable::GetKey(const ProtoQueue::Item&) const’:
../protolib/include/protoDispatcher.h:698:67: error: invalid static_cast
from type ‘const ProtoQueue::Item’ to type ‘const GenericStream&’
698 | {return static_cast<const
GenericStream&>(item).GetDescriptorPtr();}
| ^
../protolib/include/protoDispatcher.h: In member function ‘virtual
unsigned int GenericStreamTable::GetKeysize(const ProtoQueue::Item&)
const’:
../protolib/include/protoDispatcher.h:700:37: error: ‘Descriptor’ was not
declared in this scope
700 | {return (sizeof(Descriptor) << 3);}
| ^~~~~~
../protolib/include/protoDispatcher.h: At global scope:
../protolib/include/protoDispatcher.h:705:41: error: ‘Descriptor’ was not
declared in this scope
705 | GenericStream GetGenericStream(Descriptor descriptor);
| ^~~~~~
../protolib/include/protoDispatcher.h:706:42: error: ‘Descriptor’ was not
declared in this scope
706 | GenericStream FindGenericStream(Descriptor descriptor) const
| ^~~~~~
../protolib/include/protoDispatcher.h:720:9: error: ‘WaitStatus’ does not
name a type
720 | WaitStatus wait_status;
| ^~~~~~
../protolib/include/protoDispatcher.h:724:9: error: ‘ThreadId’ does not
name a type
724 | ThreadId thread_id;
| ^~~~
../protolib/include/protoDispatcher.h:729:9: error: ‘Mutex’ does not name
a type
729 | Mutex suspend_mutex;
| ^~~~~
../protolib/include/protoDispatcher.h:730:9: error: ‘Mutex’ does not name
a type
730 | Mutex signal_mutex;
| ^~~~~
../protolib/include/protoDispatcher.h:731:9: error: ‘ThreadId’ does not
name a type
731 | ThreadId thread_master;
| ^~~~
../protolib/include/protoDispatcher.h:734:9: error: ‘Controller’ does not
name a type
734 | Controller controller;
| ^~~~~~
../protolib/include/protoDispatcher.h:739:9: error: ‘PromptCallback’ does
not name a type
739 | PromptCallback prompt_callback;
| ^~~~~~
../protolib/include/protoDispatcher.h:742:34: error: no matching function
for call to ‘EventStream::EventStream()’
742 | EventStream break_stream;
| ^~~~
../protolib/include/protoDispatcher.h:623:17: note: candidate:
‘EventStream::EventStream(ProtoEvent&)’
623 | EventStream(ProtoEvent& theEvent);
| ^~~
../protolib/include/protoDispatcher.h:623:17: note: candidate expects 1
argument, 0 provided
../protolib/include/protoDispatcher.h:620:15: note: candidate: ‘constexpr
EventStream::EventStream(const EventStream&)’
620 | class EventStream : public Stream
| ^~~
../protolib/include/protoDispatcher.h:620:15: note: candidate expects 1
argument, 0 provided
../protolib/include/protoDispatcher.h:798:1: error: expected declaration
before ‘}’ token
798 | }; // end class ProtoDispatcher
| ^
In file included from ../protolib/include/protokit.h:25,
from ../include/mgenEvent.h:8,
from ../src/common/mgenEvent.cpp:2:
../protolib/include/protoApp.h:69:25: error: cannot declare field
‘ProtoApp::dispatcher’ to be of abstract type ‘ProtoDispatcher’
69 | ProtoDispatcher dispatcher;
| ^~~~~~
In file included from ../protolib/include/protokit.h:24,
from ../include/mgenEvent.h:8,
from ../src/common/mgenEvent.cpp:2:
../protolib/include/protoDispatcher.h:196:7: note: because the following
virtual functions are pure within ‘ProtoDispatcher’:
196 | class ProtoDispatcher : public ProtoTimerMgr,
| ^~~~~~~
../protolib/include/protoDispatcher.h:474:36: note: ‘virtual
ProtoDispatcher::Descriptor ProtoDispatcher::GetInputHandle() const’
474 | virtual Descriptor GetInputHandle() const = 0;
| ^~~~~~
../protolib/include/protoDispatcher.h:475:36: note: ‘virtual
ProtoDispatcher::Descriptor ProtoDispatcher::GetOutputHandle() const’
475 | virtual Descriptor GetOutputHandle() const = 0;
| ^~~~~~~
../protolib/include/protoDispatcher.h:488:37: note: ‘virtual const
char ProtoDispatcher::GetKey() const’
488 | virtual const char GetKey() const = 0;
| ^~
../protolib/include/protoDispatcher.h:489:38: note: ‘virtual unsigned
int ProtoDispatcher::GetKeysize() const’
489 | virtual unsigned int GetKeysize() const = 0;
| ^~~~~~
../protolib/include/protoDispatcher.h:772:22: warning: ‘void
DoThreadStart(void)’ declared ‘static’ but never defined
[-Wunused-function]
772 | static void DoThreadStart(void* arg);
| ^~~~~
make: *** [Makefile.common:30: ../src/common/mgenEvent.o] Error 1
eug-amd /home/eugene/mgen/mgen5/makefiles #
On Tue, January 21, 2020 08:38, Brian Adamson wrote:
Can you provide an example of the compilation error output? We principally are building and using MGEN in our work on CentOS and Ubuntu systems. Is this with the current MGEN and Protolib 'master' checkouts?
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/USNavalResearchLaboratory/mgen/issues/2#issuecomment-576514782
I'm not sure what the problem there is ... It looks like it doesn't like the "enum Type { ...};" code at line 468 of protoDispatcher.h ... I'm not having problems building on Ubuntu or CentOS. Which gcc version are you using?
root@ubuntu:/usr/local/src/netperf# gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.4' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4) root@ubuntu:/usr/local/src/netperf#
On Sat, February 8, 2020 03:40, Brian Adamson wrote:
I'm not sure what the problem there is ... It looks like it doesn't like the "enum Type { ...};" code at line 468 of protoDispatcher.h ... I'm not having problems building on Ubuntu or CentOS. Which gcc version are you using?
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/USNavalResearchLaboratory/mgen/issues/2#issuecomment-583661945
Are you following these steps:
git clone https://github.com/USNavalResearchLaboratory/mgen.git cd mgen git clone https://github.com/USNavalResearchLaboratory/protolib.git cd makefiles make -f Makefile.linux mgen
Thank you very much!
The problem was in missing pcap lib :)
Regards, E.
On Sat, February 8, 2020 07:57, Brian Adamson wrote:
Are you following these steps:
git clone https://github.com/USNavalResearchLaboratory/mgen.git cd mgen git clone https://github.com/USNavalResearchLaboratory/protolib.git cd makefiles make -f Makefile.linux mgen
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/USNavalResearchLaboratory/mgen/issues/2#issuecomment-583699812
OK - I am glad you were able to figure that out.
I can't compile mgen on gentoo 17.1 kernel 4.19.72 gcc 9.2.0 Too much errors.