OpenAADL / polyorb-hi-c

PolyORB-HI/C runtime for Ocarina, supports POSIX, RTEMS, Xenomai, XtratuM RTOS
http://www.openaadl.org
Other
12 stars 48 forks source link

compile error when build ping-local #4

Closed hardfist closed 9 years ago

hardfist commented 9 years ago

when I build some examples in aadlv2,It cause compiler errors.

yj:ping $ pwd
/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv2/ping
yj:ping $ ocarina -b -x scenario-local.aadl 
make generate-asn1-deployment target-objects compile-c-files compile-cpp-files compile-ada-files compile-po-hi ping.o activity.o subprograms.o types.o request.o marshallers.o deployment.o naming.o main.o 
make[1]: Entering directory `/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv2/ping/ping_local/node_a'
make[1]: Nothing to be done for `generate-asn1-deployment'.
make[1]: Nothing to be done for `target-objects'.
gcc -c -I. -I"/usr/local/include/ocarina/runtime/polyorb-hi-c/include" "-I/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv2/ping"  -DTARGET=native  -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE -D__PO_HI_USE_TRANSPORT -I'/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv2/ping/' '/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv2/ping/ping.c' -o ping.o
make[1]: Nothing to be done for `compile-cpp-files'.
make[1]: Nothing to be done for `compile-ada-files'.
for f in po_hi_task.o po_hi_time.o po_hi_protected.o po_hi_main.o po_hi_messages.o po_hi_marshallers.o po_hi_giop.o po_hi_utils.o po_hi_types.o po_hi_monitor.o po_hi_storage.o po_hi_gqueue.o drivers/po_hi_driver_exarm.o drivers/po_hi_driver_keyboard.o drivers/po_hi_driver_exarm_ni_6071e_analog.o drivers/po_hi_driver_exarm_ni_6071e_digital.o drivers/po_hi_driver_usbbrick_spacewire.o drivers/po_hi_driver_linux_serial.o drivers/po_hi_driver_leon_serial.o drivers/po_hi_driver_leon_eth.o drivers/po_hi_driver_serial_common.o drivers/po_hi_driver_sockets.o drivers/po_hi_driver_rtems_ne2000.o drivers/po_hi_driver_rasta_serial.o drivers/po_hi_driver_rasta_common.o drivers/po_hi_driver_rasta_1553.o drivers/po_hi_driver_xc4v_fpga.o drivers/po_hi_driver_rasta_1553_brmlib.o drivers/po_hi_driver_rasta_spacewire.o  po_hi_transport.o ; do \
       c_file="`basename $f .o`.c"; \
       c_file_dirname="`dirname $f`"; \
      if [ -n "$c_file_dirname" ]; then \
         if [ ! -d $c_file_dirname ]; then mkdir -p $c_file_dirname ; fi ; \
          gcc -I. -I"/usr/local/include/ocarina/runtime/polyorb-hi-c/include" "-I/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv2/ping"  -DTARGET=native  -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE -D__PO_HI_USE_TRANSPORT -c -o $f '/usr/local/include/ocarina/runtime/polyorb-hi-c/src/'$c_file_dirname'/'$c_file  || exit 1 ; \
      else \
          gcc -I. -I"/usr/local/include/ocarina/runtime/polyorb-hi-c/include" "-I/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv2/ping"  -DTARGET=native  -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE -D__PO_HI_USE_TRANSPORT -c -o $f '/usr/local/include/ocarina/runtime/polyorb-hi-c/src/'$c_file || exit 1 ; \
      fi ; \
    done
/usr/local/include/ocarina/runtime/polyorb-hi-c/src/./po_hi_transport.c: In function ‘__po_hi_transport_get_model_name’:
/usr/local/include/ocarina/runtime/polyorb-hi-c/src/./po_hi_transport.c:390:14: error: ‘NULL’ undeclared (first use in this function)
       return NULL;
              ^
/usr/local/include/ocarina/runtime/polyorb-hi-c/src/./po_hi_transport.c:390:14: note: each undeclared identifier is reported only once for each function it appears in
/usr/local/include/ocarina/runtime/polyorb-hi-c/src/./po_hi_transport.c: In function ‘__po_hi_transport_get_protocol_configuration’:
/usr/local/include/ocarina/runtime/polyorb-hi-c/src/./po_hi_transport.c:463:11: error: ‘NULL’ undeclared (first use in this function)
    return NULL;
           ^
make[1]: *** [compile-po-hi] Error 1
make[1]: Leaving directory `/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv2/ping/ping_local/node_a'
make: *** [node_a] Error 2
yoogx commented 9 years ago

Can you please confirm you used master repository at its latest version, and give me more details on the gcc version you used? Thanks

hardfist commented 9 years ago

I use Ubuntu 14.04 , my gcc versoin is 4.8.2 I don't know whether I did something wrong,I follow the instructions Thanks for the help

$: git clone https://github.com/OpenAADL/ocarina.git
$: cd ocarina
$ git clone https://github.com/OpenAADL/polyorb-hi-c.git resources/runtime/polyorb-hi-c
$ support/reconfig 
$ ./configure
$ make
$ sudo make install
$ sudo make examples
everything is fine but last step
********  SCENARIO_FILE = ./scenario-local.aadl  *********
ocarina -b -x './scenario-local.aadl';
Inserting : node_a / node_a_local.ref

make[11]: Entering directory `/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv1/ping/ping_local/node_a'
/usr/bin/make generate-asn1-deployment target-objects compile-c-files compile-cpp-files compile-ada-files compile-po-hi ping.o activity.o subprograms.o types.o request.o marshallers.o deployment.o naming.o main.o 
make[12]: Entering directory `/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv1/ping/ping_local/node_a'
make[12]: Nothing to be done for `generate-asn1-deployment'.
make[12]: Nothing to be done for `target-objects'.
gcc -c -I. -I"/usr/local/include/ocarina/runtime/polyorb-hi-c/include" "-I/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv1/ping"  -DTARGET=native  -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE -D__PO_HI_USE_TRANSPORT -I'/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv1/ping/' '/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv1/ping/ping.c' -o ping.o
make[12]: Nothing to be done for `compile-cpp-files'.
make[12]: Nothing to be done for `compile-ada-files'.
for f in po_hi_task.o po_hi_time.o po_hi_protected.o po_hi_main.o po_hi_messages.o po_hi_marshallers.o po_hi_giop.o po_hi_utils.o po_hi_types.o po_hi_monitor.o po_hi_storage.o po_hi_gqueue.o drivers/po_hi_driver_exarm.o drivers/po_hi_driver_keyboard.o drivers/po_hi_driver_exarm_ni_6071e_analog.o drivers/po_hi_driver_exarm_ni_6071e_digital.o drivers/po_hi_driver_usbbrick_spacewire.o drivers/po_hi_driver_linux_serial.o drivers/po_hi_driver_leon_serial.o drivers/po_hi_driver_leon_eth.o drivers/po_hi_driver_serial_common.o drivers/po_hi_driver_sockets.o drivers/po_hi_driver_rtems_ne2000.o drivers/po_hi_driver_rasta_serial.o drivers/po_hi_driver_rasta_common.o drivers/po_hi_driver_rasta_1553.o drivers/po_hi_driver_xc4v_fpga.o drivers/po_hi_driver_rasta_1553_brmlib.o drivers/po_hi_driver_rasta_spacewire.o  po_hi_transport.o ; do \
       c_file="`basename $f .o`.c"; \
       c_file_dirname="`dirname $f`"; \
      if [ -n "$c_file_dirname" ]; then \
         if [ ! -d $c_file_dirname ]; then mkdir -p $c_file_dirname ; fi ; \
          gcc -I. -I"/usr/local/include/ocarina/runtime/polyorb-hi-c/include" "-I/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv1/ping"  -DTARGET=native  -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE -D__PO_HI_USE_TRANSPORT -c -o $f '/usr/local/include/ocarina/runtime/polyorb-hi-c/src/'$c_file_dirname'/'$c_file  || exit 1 ; \
      else \
          gcc -I. -I"/usr/local/include/ocarina/runtime/polyorb-hi-c/include" "-I/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv1/ping"  -DTARGET=native  -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE -D__PO_HI_USE_TRANSPORT -c -o $f '/usr/local/include/ocarina/runtime/polyorb-hi-c/src/'$c_file || exit 1 ; \
      fi ; \
    done
/usr/local/include/ocarina/runtime/polyorb-hi-c/src/./po_hi_transport.c: In function ‘__po_hi_transport_get_model_name’:
/usr/local/include/ocarina/runtime/polyorb-hi-c/src/./po_hi_transport.c:390:14: error: ‘NULL’ undeclared (first use in this function)
       return NULL;
              ^
/usr/local/include/ocarina/runtime/polyorb-hi-c/src/./po_hi_transport.c:390:14: note: each undeclared identifier is reported only once for each function it appears in
/usr/local/include/ocarina/runtime/polyorb-hi-c/src/./po_hi_transport.c: In function ‘__po_hi_transport_get_protocol_configuration’:
/usr/local/include/ocarina/runtime/polyorb-hi-c/src/./po_hi_transport.c:463:11: error: ‘NULL’ undeclared (first use in this function)
    return NULL;
           ^
make[12]: *** [compile-po-hi] Error 1
make[12]: Leaving directory `/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv1/ping/ping_local/node_a'
make[11]: *** [node_a] Error 2
make[11]: Leaving directory `/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv1/ping/ping_local/node_a'
Backends: fatal error : /usr/bin/make died unexpectedly

Then I try build examples by scenario files the rma examples is fine but ping-local example cause following compiler error

$ ocarina -b -x scenario-local.aadl
Inserting : node_a / node_a.ref
software.aadl:31:03: Warning: source_language is not a list while the corresponding property name at programming_properties.aadl:61:02 is a list.
software.aadl:31:03: Warning: The value of source_language has been converted into a list.
software.aadl:40:03: Warning: source_language is not a list while the corresponding property name at programming_properties.aadl:61:02 is a list.
software.aadl:40:03: Warning: The value of source_language has been converted into a list.
Backends: warning : ping_local already exists
Backends: warning : node_a already exists

/usr/bin/make generate-asn1-deployment target-objects compile-c-files compile-cpp-files compile-ada-files compile-po-hi ping.o activity.o subprograms.o types.o request.o marshallers.o deployment.o naming.o main.o 
make[1]: Entering directory `/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv2/ping/ping_local/node_a'
make[1]: Nothing to be done for `generate-asn1-deployment'.
make[1]: Nothing to be done for `target-objects'.
gcc -c -I. -I"/usr/local/include/ocarina/runtime/polyorb-hi-c/include" "-I/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv2/ping"  -DTARGET=native  -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE -D__PO_HI_USE_TRANSPORT -I'/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv2/ping/' '/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv2/ping/ping.c' -o ping.o
make[1]: Nothing to be done for `compile-cpp-files'.
make[1]: Nothing to be done for `compile-ada-files'.
for f in po_hi_task.o po_hi_time.o po_hi_protected.o po_hi_main.o po_hi_messages.o po_hi_marshallers.o po_hi_giop.o po_hi_utils.o po_hi_types.o po_hi_monitor.o po_hi_storage.o po_hi_gqueue.o drivers/po_hi_driver_exarm.o drivers/po_hi_driver_keyboard.o drivers/po_hi_driver_exarm_ni_6071e_analog.o drivers/po_hi_driver_exarm_ni_6071e_digital.o drivers/po_hi_driver_usbbrick_spacewire.o drivers/po_hi_driver_linux_serial.o drivers/po_hi_driver_leon_serial.o drivers/po_hi_driver_leon_eth.o drivers/po_hi_driver_serial_common.o drivers/po_hi_driver_sockets.o drivers/po_hi_driver_rtems_ne2000.o drivers/po_hi_driver_rasta_serial.o drivers/po_hi_driver_rasta_common.o drivers/po_hi_driver_rasta_1553.o drivers/po_hi_driver_xc4v_fpga.o drivers/po_hi_driver_rasta_1553_brmlib.o drivers/po_hi_driver_rasta_spacewire.o  po_hi_transport.o ; do \
       c_file="`basename $f .o`.c"; \
       c_file_dirname="`dirname $f`"; \
      if [ -n "$c_file_dirname" ]; then \
         if [ ! -d $c_file_dirname ]; then mkdir -p $c_file_dirname ; fi ; \
          gcc -I. -I"/usr/local/include/ocarina/runtime/polyorb-hi-c/include" "-I/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv2/ping"  -DTARGET=native  -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE -D__PO_HI_USE_TRANSPORT -c -o $f '/usr/local/include/ocarina/runtime/polyorb-hi-c/src/'$c_file_dirname'/'$c_file  || exit 1 ; \
      else \
          gcc -I. -I"/usr/local/include/ocarina/runtime/polyorb-hi-c/include" "-I/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv2/ping"  -DTARGET=native  -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE -D__PO_HI_USE_TRANSPORT -c -o $f '/usr/local/include/ocarina/runtime/polyorb-hi-c/src/'$c_file || exit 1 ; \
      fi ; \
    done
/usr/local/include/ocarina/runtime/polyorb-hi-c/src/./po_hi_transport.c: In function ‘__po_hi_transport_get_model_name’:
/usr/local/include/ocarina/runtime/polyorb-hi-c/src/./po_hi_transport.c:390:14: error: ‘NULL’ undeclared (first use in this function)
       return NULL;
              ^
/usr/local/include/ocarina/runtime/polyorb-hi-c/src/./po_hi_transport.c:390:14: note: each undeclared identifier is reported only once for each function it appears in
/usr/local/include/ocarina/runtime/polyorb-hi-c/src/./po_hi_transport.c: In function ‘__po_hi_transport_get_protocol_configuration’:
/usr/local/include/ocarina/runtime/polyorb-hi-c/src/./po_hi_transport.c:463:11: error: ‘NULL’ undeclared (first use in this function)
    return NULL;
           ^
make[1]: *** [compile-po-hi] Error 1
make[1]: Leaving directory `/home/yj/git/ocarina/resources/runtime/polyorb-hi-c/examples/aadlv2/ping/ping_local/node_a'
make: *** [node_a] Error 2
Backends: fatal error : /usr/bin/make died unexpectedly
yoogx commented 9 years ago

Thanks for the detailed report, it appears debian/ubuntu default gcc has some stricter settings on. I do my test on CentOS with gcc 4.8 or 4.9 compiled locally. Patch has been pushed, let me know if further updates are required. Thanks

hardfist commented 9 years ago

It works ,Thanks for the help