R Package `flowCore` is failing to compile due to errors in the RcppArmadillo - r

I am trying to install flowCore on an AWS instance, but I am receiving errors from RcppArmadillo.
The installation command is as follows.
BiocManager::install("flowCore")
The errors in the standard error start here:
In file included from /home/ec2-user/R/x86_64-koji-linux-gnu-library/4.0/RcppArma\
dillo/include/RcppArmadillo.h:29:0,
from pairVectorRcppWrap.h:13,
from flowCore_types.h:12,
from RcppExports.cpp:4:
/home/ec2-user/R/x86_64-koji-linux-gnu-library/4.0/RcppArmadillo/include/RcppArma\
dillo/interface/RcppArmadilloForward.h: At global scope:
/home/ec2-user/R/x86_64-koji-linux-gnu-library/4.0/RcppArmadillo/include/RcppArma\
dillo/interface/RcppArmadilloForward.h:68:51: error: ‘subview_cols’ in namespace \
‘arma’ does not name a template type
template <typename T> SEXP wrap ( const arma::subview_cols<T>& ) ;
/home/ec2-user/R/x86_64-koji-linux-gnu-library/4.0/RcppArmadillo/include/RcppArma\
dillo/interface/RcppArmadilloForward.h:68:63: error: expected ‘,’ or ‘...’ before\
‘<’ token
template <typename T> SEXP wrap ( const arma::subview_cols<T>& ) ;
In file included from /home/ec2-user/R/x86_64-koji-linux-gnu-library/4.0/RcppArma\
dillo/include/RcppArmadillo.h:35:0,
from pairVectorRcppWrap.h:13,
from flowCore_types.h:12,
from RcppExports.cpp:4:
/home/ec2-user/R/x86_64-koji-linux-gnu-library/4.0/RcppArmadillo/include/RcppArma\
dillo/interface/RcppArmadilloWrap.h:57:38: error: ‘subview_cols’ in namespace ‘ar\
ma’ does not name a template type
SEXP arma_subview_wrap( const arma::subview_cols<T>& data, int nrows, int ncols\
){
^~~~~~~~~~~~
/home/ec2-user/R/x86_64-koji-linux-gnu-library/4.0/RcppArmadillo/include/RcppArma\
dillo/interface/RcppArmadilloWrap.h:57:50: error: expected ‘,’ or ‘...’ before ‘<\
’ token
SEXP arma_subview_wrap( const arma::subview_cols<T>& data, int nrows, int ncols\
){
/home/ec2-user/R/x86_64-koji-linux-gnu-library/4.0/RcppArmadillo/include/RcppArma\
dillo/interface/RcppArmadilloWrap.h: In function ‘SEXPREC* Rcpp::RcppArmadillo::a\
rma_subview_wrap(int)’:
/home/ec2-user/R/x86_64-koji-linux-gnu-library/4.0/RcppArmadillo/include/RcppArma\
dillo/interface/RcppArmadilloWrap.h:59:38: error: ‘nrows’ was not declared in thi\
s scope
Rcpp::Matrix<RTYPE> mat( nrows, ncols ) ;
^~~~~
/home/ec2-user/R/x86_64-koji-linux-gnu-library/4.0/RcppArmadillo/include/RcppArma\
dillo/interface/RcppArmadilloWrap.h:59:38: note: suggested alternative: ‘row’
Rcpp::Matrix<RTYPE> mat( nrows, ncols ) ;
and continue for some time.

Related

Error in calculating Rotational Projection Statistics (RoPS) feature using PCL

I'm working on this Rotational Projection Statistics (RoPS) example from the following link.
https://robotica.unileon.es/index.php?title=PCL/OpenNI_tutorial_4:_3D_object_recognition_(descriptors)#RoPS
I'm getting the following error. Does anyone know what's wrong? Thanks
[ 50%] Building CXX object CMakeFiles/project_local_feature_estimation.dir/local_feature_estimation.cpp.o
In file included from /usr/local/include/pcl-1.12/pcl/type_traits.h:40:0,
from /usr/local/include/pcl-1.12/pcl/memory.h:46,
from /usr/local/include/pcl-1.12/pcl/io/pcd_io.h:42,
from /home/jibanul/research/pc_robustness/code/descriptors/rops/local_feature_estimation.cpp:64:
/usr/local/include/pcl-1.12/pcl/point_struct_traits.h: In instantiation of ‘struct pcl::traits::fieldList<pcl::Histogram<135> >’:
/usr/local/include/pcl-1.12/pcl/common/impl/io.hpp:102:3: required from ‘std::vector<pcl::PCLPointField> pcl::getFields() [with PointT = pcl::Histogram<135>]’
/usr/local/include/pcl-1.12/pcl/io/impl/pcd_io.hpp:144:40: required from ‘int pcl::PCDWriter::writeBinary(const string&, const pcl::PointCloud<PointT>&) [with PointT = pcl::Histogram<135>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
/usr/local/include/pcl-1.12/pcl/io/pcd_io.h:558:39: required from ‘int pcl::PCDWriter::write(const string&, const pcl::PointCloud<PointT>&, bool) [with PointT = pcl::Histogram<135>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
/usr/local/include/pcl-1.12/pcl/io/pcd_io.h:722:56: required from ‘int pcl::io::savePCDFileASCII(const string&, const pcl::PointCloud<PointT>&) [with PointT = pcl::Histogram<135>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
/home/jibanul/research/pc_robustness/code/descriptors/rops/local_feature_estimation.cpp:162:58: required from here
/usr/local/include/pcl-1.12/pcl/point_struct_traits.h:195:8: error: invalid use of incomplete type ‘struct pcl::traits::fieldList<pcl::Histogram<135> >’
struct fieldList /** \cond NO_WARN_RECURSIVE */ : fieldList<typename POD<PointT>::type> /** \endcond */
^~~~~~~~~
/usr/local/include/pcl-1.12/pcl/point_struct_traits.h:195:8: note: declaration of ‘struct pcl::traits::fieldList<pcl::Histogram<135> >’
In file included from /usr/local/include/pcl-1.12/pcl/point_struct_traits.h:40:0,
from /usr/local/include/pcl-1.12/pcl/type_traits.h:40,
from /usr/local/include/pcl-1.12/pcl/memory.h:46,
from /usr/local/include/pcl-1.12/pcl/io/pcd_io.h:42,
from /home/jibanul/research/pc_robustness/code/descriptors/rops/local_feature_estimation.cpp:64:
/usr/local/include/pcl-1.12/pcl/point_struct_traits.h:201:3: error: no matching function for call to ‘assertion_failed<false>(mpl_::failed************ (pcl::traits::fieldList<pcl::Histogram<135> >::POINT_TYPE_NOT_PROPERLY_REGISTERED::************)(pcl::Histogram<135>&))’
BOOST_MPL_ASSERT_MSG((!std::is_same<PointT, typename POD<PointT>::type>::value),
^
/usr/include/boost/mpl/assert.hpp:83:5: note: candidate: template<bool C> int mpl_::assertion_failed(typename mpl_::assert<C>::type)
int assertion_failed( typename assert<C>::type );
^~~~~~~~~~~~~~~~
/usr/include/boost/mpl/assert.hpp:83:5: note: template argument deduction/substitution failed:
/usr/local/include/pcl-1.12/pcl/point_struct_traits.h:201:3: note: cannot convert ‘pcl::traits::fieldList<pcl::Histogram<135> >::POINT_TYPE_NOT_PROPERLY_REGISTERED202::assert_arg()’ (type ‘mpl_::failed************ (pcl::traits::fieldList<pcl::Histogram<135> >::POINT_TYPE_NOT_PROPERLY_REGISTERED::************)(pcl::Histogram<135>&)’) to type ‘mpl_::assert<false>::type {aka mpl_::assert<false>}’
BOOST_MPL_ASSERT_MSG((!std::is_same<PointT, typename POD<PointT>::type>::value),
^
In file included from /usr/local/include/pcl-1.12/pcl/common/io.h:538:0,
from /usr/local/include/pcl-1.12/pcl/io/impl/pcd_io.hpp:48,
from /usr/local/include/pcl-1.12/pcl/io/pcd_io.h:789,
from /home/jibanul/research/pc_robustness/code/descriptors/rops/local_feature_estimation.cpp:64:
/usr/local/include/pcl-1.12/pcl/common/impl/io.hpp: In instantiation of ‘std::vector<pcl::PCLPointField> pcl::getFields() [with PointT = pcl::Histogram<135>]’:
/usr/local/include/pcl-1.12/pcl/io/impl/pcd_io.hpp:144:40: required from ‘int pcl::PCDWriter::writeBinary(const string&, const pcl::PointCloud<PointT>&) [with PointT = pcl::Histogram<135>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
/usr/local/include/pcl-1.12/pcl/io/pcd_io.h:558:39: required from ‘int pcl::PCDWriter::write(const string&, const pcl::PointCloud<PointT>&, bool) [with PointT = pcl::Histogram<135>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
/usr/local/include/pcl-1.12/pcl/io/pcd_io.h:722:56: required from ‘int pcl::io::savePCDFileASCII(const string&, const pcl::PointCloud<PointT>&) [with PointT = pcl::Histogram<135>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
/home/jibanul/research/pc_robustness/code/descriptors/rops/local_feature_estimation.cpp:162:58: required from here
/usr/local/include/pcl-1.12/pcl/common/impl/io.hpp:102:3: error: no type named ‘type’ in ‘struct pcl::traits::fieldList<pcl::Histogram<135> >’
pcl::for_each_type<typename pcl::traits::fieldList<PointT>::type>(pcl::detail::FieldAdder<PointT>(fields));
^~~
make[2]: *** [CMakeFiles/project_local_feature_estimation.dir/build.make:76: CMakeFiles/project_local_feature_estimation.dir/local_feature_estimation.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/project_local_feature_estimation.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

ESP32 AsyncWebServer

I currently trying to setup an Async Web Server on the ESP32. But unfortunately I don't get the code to run. I'm usign platform io on windows 10.
#include <Arduino.h>
#include <ESPAsyncWebServer.h>
const char* ssid = "myAP";
const char* password = "123456789";
AsyncWebServer server(80);
setup() and loop() are empty.
If I try to compile the code these message shows up.
compilation terminated.
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\AsyncPrinter.cpp: In constructor 'AsyncPrinter::AsyncPrinter(AsyncClient*, size_t)':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\AsyncPrinter.cpp:48:11: error: 'panic' was not declared in this scope
panic(); //What should we do?
^
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\AsyncPrinter.cpp: In member function 'int AsyncPrinter::connect(IPAddress, uint16_t)':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\AsyncPrinter.cpp:71:11: error: 'panic' was not declared in this scope
panic();
^
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\AsyncPrinter.cpp: In member function 'size_t AsyncPrinter::_sendBuffer()':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\AsyncPrinter.cpp:182:11: error: 'panic' was not declared in this scope
panic(); // Connection should be aborted instead
^
^
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCPbuffer.cpp: In member function 'size_t AsyncTCPbuffer::_handleRxBuffer(uint8_t*, size_t)':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCPbuffer.cpp:469:21: error: 'panic' was not declared in this scope
panic(); //TODO: What action should this be ?
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp: In member function 'bool AsyncClient::operator==(const AsyncClient&)':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp:331:66: error: 'ip_addr_t {aka struct ip_addr}' has no membec
r named 'addr'
return (_pcb != NULL && other._pcb != NULL && (_pcb->remote_ip.addr == other._pcb->remote_ip.addr) && (_pcb->remote_port == other._pcb->remote_port));
^
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp: In member function 'void AsyncClient::_dns_found(const ip_addr*)':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp:707:31: error: 'const struct ip_addr' has no member named 'addr'
connect(IPAddress(ipaddr->addr), _connect_port);
^
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp: In member function 'uint32_t AsyncClient::getRemoteAddress()':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp:837:26: error: 'ip_addr_t {aka struct ip_addr}' has no member named 'addr'
return _pcb->remote_ip.addr;
^
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp: In member function 'uint32_t AsyncClient::getLocalAddress()':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp:849:25: error: 'ip_addr_t {aka struct ip_addr}' has no member named 'addr'
return _pcb->local_ip.addr;
^
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp: In member function 'void AsyncServer::begin()':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp:1122:14: error: 'ip_addr_t {aka struct ip_addr}' has no member named 'addr'
local_addr.addr = (uint32_t) _addr;
^
You're using the wrong async TCP library. The one you're using is for the ESP8266, not the ESP32.
Here's its PlatformIO library registry entry:
https://platformio.org/lib/show/305/ESPAsyncTCP
You're seeing errors because it's trying to call functions that are available on the ESP8266 and not the ESP32.
You want the AsyncTCP library:
https://platformio.org/lib/show/1826/AsyncTCP
You should update your platformio.lib file to include this library instead of ESPAsyncTCP. You may also need to remove the build or library directory to get rid of the old library.
had the same issue, downgrading the core of PlatformIO solved for me the issue.
pip install -U "platformio<4.2.0"

Rcpp not compiling with Intel MIC

I am trying to make this minimal Rcpp/Intel pragma code to work, however running into some pretty big errors which I am struggling to overcome.
Code
This is the full code that I am trying to run - it is a simple text read out showing if the target Xeon Phi device is engaged as per this website: Offload Computations from Servers with an Intel® Xeon Phi™ Processor, and this is based on a sample code found here: Lightning-Fast R Machine Learning Algorithms:
library(Rcpp)
library(inline)
# Create and register a Rcpp plugin
plug <- Rcpp:::Rcpp.plugin.maker(
include.before = "#include <stdint.h>
#include <stdio.h>
#include <omp.h>"
)
registerPlugin("daalNB", plug)
whatCPU <-
'
#pragma omp declare target
void what_cpu()
{
uint32_t eax;
const uint32_t xeon_phi_x100_id = 0x00010;
const uint32_t xeon_phi_x200_id = 0x50070;
__asm volatile("cpuid":"=a"(eax):"a"(1));
uint32_t this_cpu_id = eax & 0xF00F0;
if (this_cpu_id == xeon_phi_x100_id)
printf("This CPU is Intel(R) XeonPhi(TM) x100 Processor!");
else
if (this_cpu_id == xeon_phi_x200_id)
printf("This CPU is Intel(R) XeonPhi(TM) x200 Processor!");
else
printf("This CPU is other Intel(R) Processor.");
}
'
offloadExampleRcpp <-
'
//[[Rcpp::plugins(openmp)]]
printf("Running on host: ");
what_cpu();
#pragma offload target(mic:0)
{
printf("Running on target: ");
what_cpu();
}
'
runOffloadExample <- cxxfunction(sig = signature(), body = offloadExampleRcpp, plugin="daalNB", includes = '
//[[Rcpp::plugins(openmp)]]
#pragma omp declare target
void what_cpu()
{
uint32_t eax;
const uint32_t xeon_phi_x100_id = 0x225d;
const uint32_t xeon_phi_x200_id = 0x50070;
__asm volatile("cpuid":"=a"(eax):"a"(1));
uint32_t this_cpu_id = eax & 0xF00F0;
if (this_cpu_id == xeon_phi_x100_id)
printf("This CPU is Intel(R) XeonPhi(TM) x100 Processor!");
else
if (this_cpu_id == xeon_phi_x200_id)
printf("This CPU is Intel(R) XeonPhi(TM) x200 Processor!");
else
printf("This CPU is other Intel(R) Processor.");
}
', verbose = 2)
runOffloadExample()
What I have tried and Errors:
I have set up the software stack the the Xeon Phi properly, and this can be confirmed by when I compile the .c code (that is wrapped inside Rcpp in the above code) outside of R, using the Intel icc compiler, it is successful; namely I am able to get the exact output as show in the Intel website processor.
It seems however, that when the same .c code is wrapped inside Rcpp, the following errors arise which prevent compilation (this a sample from a much longer readout):
Compilation argument:
/usr/local/lib64/R/bin/R CMD SHLIB file306737f15222.cpp 2> file306737f15222.cpp.err.txt
/opt/intel/compilers_and_libraries_2017.1.132/linux/bin/intel64/icc -I/usr/local/lib64/R/include -DNDEBUG -I"/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I/usr/local/include -fpic -qopenmp -c file306737f15222.cpp -o file306737f15222.o
file306737f15222.cpp(52): warning #2571: variable has not been declared with compatible "target" attribute
BEGIN_RCPP
^
file306737f15222.cpp(63): warning #2570: function has not been declared with compatible "target" attribute
END_RCPP
^
file306737f15222.cpp(63): warning #2570: function has not been declared with compatible "target" attribute
END_RCPP
^
Furthermore, the above error readout is followed by tonnes and tonnes of the below errors (again, I have only included a sample for the sake of brevity, however I believe that the other errors are all related to the same issue as posed in my question):
/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/protection/Shelter.h(34): warning #2570: function has not been declared with compatible "target" attribute
Rcpp_unprotect(nprotected) ;
^
detected during:
instantiation of "Rcpp::Shelter<T>::~Shelter() [with T=SEXP]" at line 323 of "/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/exceptions.h"
instantiation of "SEXP exception_to_condition_template(const Exception &, bool) [with Exception=Rcpp::exception]" at line 339 of "/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/exceptions.h"
/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/protection/Shelter.h(30): warning #2570: function has not been declared with compatible "target" attribute
return Rcpp_protect(x) ;
^
detected during:
instantiation of "SEXP Rcpp::Shelter<T>::operator()(SEXP) [with T=SEXP]" at line 326 of "/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/exceptions.h"
instantiation of "SEXP exception_to_condition_template(const Exception &, bool) [with Exception=Rcpp::exception]" at line 339 of "/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/exceptions.h"
/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/utils/tinyformat/tinyformat.h(218): warning #2570: function has not been declared with compatible "target" attribute
static void invoke(std::ostream& /*out*/, const T& /*value*/) { TINYFORMAT_ASSERT(0); }
^
detected during:
instantiation of "void tinyformat::detail::formatValueAsType<T, fmtT, convertible>::invoke(std::ostream &, const T &) [with T=const char *, fmtT=char, convertible=false]" at line 329
instantiation of "void tinyformat::formatValue(std::ostream &, const char *, const char *, int, const T &) [with T=const char *]" at line 528
instantiation of "void tinyformat::detail::FormatArg::formatImpl<T>(std::ostream &, const char *, const char *, int, const void *) [with T=const char *]" at line 504
instantiation of "tinyformat::detail::FormatArg::FormatArg(const T &) [with T=const char *]" at line 881
instantiation of "tinyformat::detail::FormatListN<N>::FormatListN(const Args &...) [with N=1, Args=<const char *>]" at line 930
instantiation of "tinyformat::detail::FormatListN<<expression>> tinyformat::makeFormatList(const Args &...) [with Args=<const char *>]" at line 966
instantiation of "void tinyformat::format(std::ostream &, const char *, const Args &...) [with Args=<const char *>]" at line 975
instantiation of "std::string tinyformat::format(const char *, const Args &...) [with Args=<const char *>]" at line 226 of "/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/exceptions.h"
instantiation of "Rcpp::not_compatible::not_compatible(const char *, Args &&...) [with Args=<const char *const &>]" at line 37 of "/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/r_cast.h"
Wondering if anyone can help point me to what issues are resulting in the above errors? I recognise that I might be missing something fundamental owing to my in familiarity with C and the Rcpp package and so please excuse this.
Many thanks in advance,

Kaaproject esp8266 build conflicting types

I have installed the ESP8266 SDK and toolchain and try to build the project CDataCollectionDemo which is generated from kaa sandbox. And I get the error like this
/opt/Espressif/esp-rtos-sdk/include/espressif/c_types.h:47:29: error: conflicting types for ‘size_t’
typedef unsigned int size_t;
^
In file included from /opt/Espressif/esp-rtos-sdk/extra_include/string.h:14:0,
from /home/tung/kaa/project/CDataCollectionDemo/targets/esp8266/target.
here is the full output
tung#ubuntu:~/kaa/project/CDataCollectionDemo$ sudo ./build.sh deploy
-- The C compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
==================================
BUILD_TYPE = (Default)
KAA_PLATFORM = posix
KAA_MAX_LOG_LEVEL = 3
==================================
BOOTSTRAP ENABLED
PROFILE ENABLED
USER EXTENSION ENABLED
CONFIGURATION ENABLED
EVENTS ENABLED
LOGGING ENABLED
NOTIFICATION ENABLED
ENCRYPTION ENABLED
KAA WILL BE INSTALLED TO /usr/local
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Could NOT find cppcheck
-- WiFi AP: WiFi SSID
-- WiFi Pass:
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tung/kaa/project/CDataCollectionDemo/build
Scanning dependencies of target target_support
[ 1%] Building C object targets/esp8266/CMakeFiles/target_support.dir/target.c.o
In file included from /opt/Espressif/esp-rtos-sdk/extra_include/sys/config.h:4:0,
from /opt/Espressif/esp-rtos-sdk/extra_include/_ansi.h:16,
from /opt/Espressif/esp-rtos-sdk/extra_include/string.h:10,
from /home/tung/kaa/project/CDataCollectionDemo/targets/esp8266/target.c:17:
/opt/Espressif/esp-rtos-sdk/extra_include/machine/ieeefp.h:277:2: error: #error Endianess not declared!!
#error Endianess not declared!!
^
In file included from /opt/Espressif/esp-rtos-sdk/include/espressif/esp_common.h:9:0,
from /opt/Espressif/esp-rtos-sdk/include/freertos/portmacro.h:73,
from /opt/Espressif/esp-rtos-sdk/include/freertos/portable.h:318,
from /opt/Espressif/esp-rtos-sdk/include/freertos/FreeRTOS.h:87,
from /home/tung/kaa/project/CDataCollectionDemo/targets/esp8266/target.c:19:
/opt/Espressif/esp-rtos-sdk/include/espressif/c_types.h:47:29: error: conflicting types for ‘size_t’
typedef unsigned int size_t;
^
In file included from /opt/Espressif/esp-rtos-sdk/extra_include/string.h:14:0,
from /home/tung/kaa/project/CDataCollectionDemo/targets/esp8266/target.c:17:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h:212:23: note: previous declaration of ‘size_t’ was here
typedef __SIZE_TYPE__ size_t;
^
In file included from /opt/Espressif/esp-rtos-sdk/include/espressif/esp_common.h:10:0,
from /opt/Espressif/esp-rtos-sdk/include/freertos/portmacro.h:73,
from /opt/Espressif/esp-rtos-sdk/include/freertos/portable.h:318,
from /opt/Espressif/esp-rtos-sdk/include/freertos/FreeRTOS.h:87,
from /home/tung/kaa/project/CDataCollectionDemo/targets/esp8266/target.c:19:
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:10:7: error: conflicting types for ‘strncpy’
char *strncpy(char *dst, const char *src, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:12:5: error: conflicting types for ‘strncmp’
int strncmp(const char *s1, const char *s2, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:13:8: error: conflicting types for ‘strlen’
size_t strlen(const char *s);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:16:7: error: conflicting types for ‘strncat’
char *strncat(char *dst, const char *src, size_t count);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:17:8: error: conflicting types for ‘strspn’
size_t strspn(const char *s, const char *accept);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:18:8: error: conflicting types for ‘strcspn’
size_t strcspn(const char *s, const char *reject);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:26:6: error: conflicting types for ‘bzero’
void bzero(void *s, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:28:7: error: conflicting types for ‘memcpy’
void *memcpy(void *dst, const void *src, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:29:7: error: conflicting types for ‘memset’
void *memset(void *dst, int c, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:30:5: error: conflicting types for ‘memcmp’
int memcmp(const void *m1, const void *m2, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:31:7: error: conflicting types for ‘memmove’
void *memmove(void *dst, const void *src, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:37:5: warning: conflicting types for built-in function ‘snprintf’ [enabled by default]
int snprintf(char *buf, unsigned int count, const char *format, ...);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:41:7: warning: conflicting types for built-in function ‘malloc’ [enabled by default]
void *malloc(size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:43:7: warning: conflicting types for built-in function ‘calloc’ [enabled by default]
void *calloc(size_t c, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:45:7: warning: conflicting types for built-in function ‘realloc’ [enabled by default]
void *realloc(void *p, size_t n);
^
make[2]: *** [targets/esp8266/CMakeFiles/target_support.dir/target.c.o] Error 1
make[1]: *** [targets/esp8266/CMakeFiles/target_support.dir/all] Error 2
make: *** [all] Error 2
./build.sh: 52: ./build.sh: ./demo_client: not found
Everything I did follow the kaa documentation, except adding the -DKAA_PLATFORM=esp8266 argument to cmake command in build.sh file. Can you tell me what's problem here and how to fix it. Thank you!
Update
I have added some arguments to cmake command as #MrKoin suggested but still get an error
Cmake arguments
cmake .. \
-DCMAKE_TOOLCHAIN_FILE=../libs/kaa/toolchains/esp8266.cmake \
-DKAA_PLATFORM=esp8266 \
-DCMAKE_BUILD_TYPE=MinSizeRel \
Output
In file included from /home/tung/kaa/project/CDataCollectionDemo/libs/kaa/thirdparty/mbedtls/aes.c:27:0:
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
# include_next <stdint.h>
^
compilation terminated.
make[2]: *** [libs/kaa/tools/kaa_encryption/rsa_key_gen/mbedtls/CMakeFiles/mbedtls.dir/aes.c.obj] Error 1
make[1]: *** [libs/kaa/tools/kaa_encryption/rsa_key_gen/mbedtls/CMakeFiles/mbedtls.dir/all] Error 2
make: *** [all] Error 2
It seems like some libraries missing. What should I do now? Thanks!
Looks like you need to specify cmake toolchain file in cmake arguments:
cmake -DCMAKE_TOOLCHAIN_FILE=../libs/kaa/toolchains/esp8266.cmake \
-DKAA_PLATFORM=esp8266 ..
Please, refer documentation for details.
It might be related to step 5 Install ESP8266 RTOS SDK in the tutorial you referenced from the Kaa website.
Did you run the command sed -i 's:#include "c_types.h"://#include "c_types.h":' $ESP_SDK_HOME/include/lwip/arch/cc.h?
I remember I had a similar (or the same) problem and forgot to execute this command. It comments out an #include which conflicts with the declaration of types elsewhere.
You need to edit the build.sh file,
find build() and change the code:
build() {
mkdir -p "$PROJECT_HOME/build"
cd "$PROJECT_HOME/build"
cmake ..\
-DKAA_TARGET=esp8266\
-DCMAKE_TOOLCHAIN_FILE=../libs/kaa/toolchains/esp8266.cmake \
-DBUILD_TESTING=OFF \
-DKAA_PLATFORM=esp8266 \
-DBUILD_TESTING=OFF \
-DCMAKE_BUILD_TYPE=MinSizeRel
make
}

Compilation issues with ntopng

I am trying to install ntopng on CentOS 5.5. When I run the make command, during the compilation process I am getting an error related to the sqlite library. I have sqlite v3.3.6 installed.
src/../third-party/lsqlite3/lsqlite3.c: In function 'int dbvm_get_name(lua_State*)':
src/../third-party/lsqlite3/lsqlite3.c:344: warning: converting to 'int' from 'lua_Number'
src/../third-party/lsqlite3/lsqlite3.c: In function 'int dbvm_get_type(lua_State*)':
src/../third-party/lsqlite3/lsqlite3.c:352: warning: converting to 'int' from 'lua_Number'
src/../third-party/lsqlite3/lsqlite3.c: In function 'int dbvm_bind_parameter_name(lua_State*)':
src/../third-party/lsqlite3/lsqlite3.c:501: warning: converting to 'int' from 'lua_Number'
src/../third-party/lsqlite3/lsqlite3.c: In function 'int db_create_collation(lua_State*)':
src/../third-party/lsqlite3/lsqlite3.c:1191: error: 'sqlite3_create_collation_v2' was not declared in this scope
src/../third-party/lsqlite3/lsqlite3.c: At global scope:
src/../third-party/lsqlite3/lsqlite3.c:1261: error: 'sqlite3_int64' has not been declared
src/../third-party/lsqlite3/lsqlite3.c: In function 'int db_update_hook(lua_State*)':
src/../third-party/lsqlite3/lsqlite3.c:1311: error: invalid conversion from 'void (*)(void*, int, const char*, const char*, int)' to 'void (*)(void*, int, const char*, const char*, sqlite_int64)'
src/../third-party/lsqlite3/lsqlite3.c:1311: error: initializing argument 2 of 'void* sqlite3_update_hook(sqlite3*, void (*)(void*, int, const char*, const char*, sqlite_int64), void*)'
src/../third-party/lsqlite3/lsqlite3.c: In function 'int db_exec_callback(void*, int, char**, char**)':
src/../third-party/lsqlite3/lsqlite3.c:1617: warning: converting to 'int' from 'lua_Number'
src/../third-party/lsqlite3/lsqlite3.c: At global scope:
src/../third-party/lsqlite3/lsqlite3.c:1979: error: 'SQLITE_CREATE_VTABLE' was not declared in this scope
src/../third-party/lsqlite3/lsqlite3.c:1980: error: 'SQLITE_DROP_VTABLE' was not declared in this scope
src/../third-party/lsqlite3/lsqlite3.c:1981: error: 'SQLITE_FUNCTION' was not declared in this scope
src/../third-party/lsqlite3/lsqlite3.c:1983: error: 'SQLITE_SAVEPOINT' was not declared in this scope
make: *** [src/Lua.o] Error 1
I resolved this issue by installing the latest sqlite package from source -> 3.8.10.2

Resources