Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
1,262 Views

upm: Pull request to add support for ELEMENTZ IR sensor failing Travis build.

Hi All,

I have created a Pull request to add support for Elementz IR Proximity sensor in UPM. The link for the Pull request is : https://github.com/intel-iot-devkit/upm/pull/536

The Pull request is failing the Travis build with the following errors:

Scanning dependencies of target elementzir-example-cxx

[ 78%] Building CXX object examples/c++/CMakeFiles/elementzir-example-cxx.dir/elementzir.cxx.o

Linking CXX executable ../elementzir-example-cxx

../../src/elementzir/libupm-elementzir.so.1.1.0: undefined reference to `mraa_gpio_init_raw'

../../src/elementzir/libupm-elementzir.so.1.1.0: undefined reference to `mraa_gpio_dir'

../../src/elementzir/libupm-elementzir.so.1.1.0: undefined reference to `mraa_gpio_read'

../../src/elementzir/libupm-elementzir.so.1.1.0: undefined reference to `mraa_result_print'

../../src/elementzir/libupm-elementzir.so.1.1.0: undefined reference to `mraa_gpio_close'

collect2: error: ld returned 1 exit status

make[2]: *** [examples/elementzir-example-cxx] Error 1

make[1]: *** [examples/c++/CMakeFiles/elementzir-example-cxx.dir/all] Error 2

make: *** [all] Error 2

The command "cd $UPM_ROOT && mkdir $UPM_BUILD && cd $_ && cmake -DNODE_ROOT_DIR:PATH="${NODE_ROOT_DIR}" -DBUILDSWIGJAVA=$BUILDJAVA -DBUILDEXAMPLES=ON -DBUILDTESTS=ON -DBUILDFTI=ON .. && sudo make install && sudo ldconfig && ctest --output-on-failure -E examplenames_js" exited with 2.

Done. Your build exited with 1.

I have tested it on Raspberry Pi 2 Model B V1.1 and I was able to compile the it successfully and I was also able to execute its example to test it. To compile the example i.e. elementzir.cxx in upm/examples/c++, I have to link it to the mraa library explicitly. I followed these steps to compile and run the example:

1)export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

2)g++ elementzir.cxx -o elementzir -lupm-elementzir -lmraa -I/usr/local/include/upm

3)./elementzir

Please help me to understand why my Pull request is failing the travis build and how I can resolve it.

Thanks

0 Kudos
3 Replies
Highlighted
Community Manager
6 Views

Hi Niti_Rohilla,

 

 

Thanks for reaching out.

 

 

To be honest, I think that this problem is out of our support. So, I recommend you to contact UPM to help you: https://github.com/intel-iot-devkit/upm

 

 

Personally, I don't have to much experience developing for UPM, but I was trying to understand your issue to help you, and you are getting issues with these lines:

 

 

../../src/elementzir/libupm-elementzir.so.1.1.0: undefined reference to `mraa_gpio_init_raw' ../../src/elementzir/libupm-elementzir.so.1.1.0: undefined reference to `mraa_gpio_dir' ../../src/elementzir/libupm-elementzir.so.1.1.0: undefined reference to `mraa_gpio_read' ../../src/elementzir/libupm-elementzir.so.1.1.0: undefined reference to `mraa_result_print' ../../src/elementzir/libupm-elementzir.so.1.1.0: undefined reference to `mraa_gpio_close'

 

 

It looks that it is an issue using MRAA in the libupm-elementzir.so.1.1.0. If I'm not wrong you are using C++, and those functions are on C, so please check the C++ API: https://iotdk.intel.com/docs/master/mraa/classmraa_1_1_gpio.html, but it is just my idea.

 

 

I also found this thread that can be helpful for you: https://communities.intel.com/thread/57152 https://communities.intel.com/thread/57152

 

 

I hope you find this information useful.

 

 

Have a nice day.

 

 

Regards,

 

Leonardo R.
0 Kudos
Highlighted
Beginner
6 Views

Thanks Leonardo R. for reply.

It was an issue in the linking of libmraa with UPM. I was able to resolve this issue by setting it in CMakeLists.txt file.

0 Kudos
Highlighted
Community Manager
6 Views

Hi Niti_Rohilla,

 

 

That's great, it is good to know that you fixed it.

 

 

Thank you for letting us know.

 

 

Have a nice day.

 

 

Regards,

 

Leonardo R.
0 Kudos