• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
rewrite fails to compile
#11
Why don't you just install libwiringx-dev from the pilight repository?
 
Reply
#12
The libwiringx-dev from the repository is the cause for the compile error.

Code:
pi@raspb:~ $ apt-cache madison libwiringx-dev
libwiringx-dev | 2.0-222-g713718d | http://apt.pilight.org/ stable/main armhf Packages

pi@raspb:~ $ dpkg -l libwiringx*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                   Version                  Architecture             Description
+++-======================================-========================-========================-===================
ii  libwiringx                             2.0-222-g713718d         armhf                    Cross-platform GPIO Interface
ii  libwiringx-dev                         2.0-222-g713718d         armhf                    Cross-platform GPIO Interface

I have replaced the /usr/lib/libwiringx.so with a version that I have compiled without the visibility hidden flag. Then the pilight rewrite code successfully compiled.

On x86_64 this is not an issue but on armhf the pilight compilation fails with the libwiringx from the repository.
 
Reply
#13
Thanks. Will check that issue.
 
Reply
#14
So i did a fresh rewrite clone, upgraded libwiringx, indeed fixed an issue in IRgpio.c and daemon.c, but didn't have issues with the visibility flag.

Code:
# apt-cache policy libwiringx
libwiringx:
  Installed: 2.0-223-ge1869a9
  Candidate: 2.0-223-ge1869a9
  Version table:
*** 2.0-223-ge1869a9 0
        500 mirror://apt.pilight.org/mirror.txt/ stable/main armhf Packages
        100 /var/lib/dpkg/status
     2.0-222-g713718d 0
        500 mirror://apt.pilight.org/mirror.txt/ stable/main armhf Packages

Code:
# apt-cache policy libwiringx-dev
libwiringx-dev:
  Installed: 2.0-223-ge1869a9
  Candidate: 2.0-223-ge1869a9
  Version table:
*** 2.0-223-ge1869a9 0
        500 mirror://apt.pilight.org/mirror.txt/ stable/main armhf Packages
        100 /var/lib/dpkg/status
     2.0-222-g713718d 0
        500 mirror://apt.pilight.org/mirror.txt/ stable/main armhf Packages

Code:
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --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.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.2 (Raspbian 4.9.2-10)

Code:
Linux raspberrypi 4.4.34+ #930 Wed Nov 23 15:12:30 GMT 2016 armv6l GNU/Linux
 
Reply
#15
The latest commit still contains the same IRgpio but anyway, the daemon still fails to compile.

Code:
[ 79%] Building C object CMakeFiles/pilight-daemon.dir/daemon.c.o
/home/pi/pilight-rewrite/daemon.c: In function ‘receive_parse_code’:
/home/pi/pilight-rewrite/daemon.c:401:26: warning: passing argument 1 of ‘protocol-><U3f00>.parseCode’ from incompatible pointer type
      protocol->parseCode(message);
                          ^
/home/pi/pilight-rewrite/daemon.c:401:26: note: expected ‘char **’ but argument is of type ‘char *’
/home/pi/pilight-rewrite/daemon.c: In function ‘send_queue’:
/home/pi/pilight-rewrite/daemon.c:644:36: warning: passing argument 2 of ‘protocol->createCode’ from incompatible pointer type
     if(protocol->createCode(jcode, message) == 0 && main_loop == 1) {
                                    ^
/home/pi/pilight-rewrite/daemon.c:644:36: note: expected ‘char **’ but argument is of type ‘char *’
/home/pi/pilight-rewrite/daemon.c: In function ‘start_pilight’:
/home/pi/pilight-rewrite/daemon.c:1668:3: warning: implicit declaration of function ‘platform_iterate_name’ [-Wimplicit-function-declaration]
   while((tmp = platform_iterate_name(z++)) != NULL) {
   ^
/home/pi/pilight-rewrite/daemon.c:1668:14: warning: assignment makes pointer from integer without a cast
   while((tmp = platform_iterate_name(z++)) != NULL) {
              ^
Linking C executable pilight-daemon
CMakeFiles/pilight-daemon.dir/daemon.c.o: In function `start_pilight':
/home/pi/pilight-rewrite/daemon.c:1668: undefined reference to `platform_iterate_name'
collect2: error: ld returned 1 exit status
CMakeFiles/pilight-daemon.dir/build.make:90: recipe for target 'pilight-daemon' failed
make[2]: *** [pilight-daemon] Error 1
CMakeFiles/Makefile2:200: recipe for target 'CMakeFiles/pilight-daemon.dir/all' failed
make[1]: *** [CMakeFiles/pilight-daemon.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2

You should be able to reproduce the compile error with this code snippet:

test_libwiringx.c
Code:
#include <stdio.h>
#include <wiringx.h>
int main(void) {
        printf("\n\tThe following GPIO platforms are supported:\n");
        char *tmp = NULL;
        int z = 0;
        wiringXSetup("", NULL);
        printf("\t- none\n");
        while((tmp = platform_iterate_name(z++)) != NULL) {
                printf("\t- %s\n", tmp);
        }
        printf("\n");

}

Code:
$ gcc test_libwiringx.c -lwiringx
test_libwiringx.c: In function ‘main’:
test_libwiringx.c:9:13: warning: assignment makes pointer from integer without a cast
  while((tmp = platform_iterate_name(z++)) != NULL) {
             ^
/tmp/ccOPC6LH.o: In function `main':
test_libwiringx.c:(.text+0x58): undefined reference to `platform_iterate_name'
collect2: error: ld returned 1 exit status

And find that it compiles when linking against the wiringx without visibility hidden flag.
Code:
$ gcc test_libwiringx.c -L /usr/local/src/wiringX/build/ -lwiringx
test_libwiringx.c: In function ‘main’:
test_libwiringx.c:9:13: warning: assignment makes pointer from integer without a cast
  while((tmp = platform_iterate_name(z++)) != NULL) {
             ^
$ ./a.out

        The following GPIO platforms are supported:
ERROR: The  is an unsupported or unknown platform
        supported wiringX platforms are:
        - odroidxu4
        - odroidc2
        - odroidc1
        - raspberrypi3
        - raspberrypi2
        - raspberrypizero
        - raspberrypi1b+
        - raspberrypi1b2
        - raspberrypi1b1
        - hummingboard_edge_dq
        - hummingboard_gate_dq
        - hummingboard_edge_sdl
        - hummingboard_gate_sdl
        - hummingboard_base_dq
        - hummingboard_pro_dq
        - hummingboard_base_sdl
        - hummingboard_pro_sdl
        - orangepipc+
        - bananapim2
        - bananapi1
        - pcduino1

        - none
./a.out: symbol lookup error: ./a.out: undefined symbol: platform_iterate_name

Code:
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --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.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.2 (Raspbian 4.9.2-10)

I did update to the latest libwiringx from the reposistory.

Code:
$ apt-cache policy libwiringx
libwiringx:
  Installed: 2.0-223-ge1869a9
  Candidate: 2.0-223-ge1869a9
  Version table:
*** 2.0-223-ge1869a9 0
        500 http://apt.pilight.org/ stable/main armhf Packages
        100 /var/lib/dpkg/status
     2.0-222-g713718d 0
        500 http://apt.pilight.org/ stable/main armhf Packages
Code:
$ apt-cache policy libwiringx-dev
libwiringx-dev:
  Installed: 2.0-223-ge1869a9
  Candidate: 2.0-223-ge1869a9
  Version table:
*** 2.0-223-ge1869a9 0
        500 http://apt.pilight.org/ stable/main armhf Packages
        100 /var/lib/dpkg/status
     2.0-222-g713718d 0
        500 http://apt.pilight.org/ stable/main armhf Packages
 
Reply
#16
AHA, the issue is that you want to use a non-API function of wiringX. The actual code block should be:
Code:
#if defined(__arm__) || defined(__mips__)
        printf("\n\tThe following GPIO platforms are supported:\n");
        char **out = NULL;
        int z = 0, i = wiringXSupportedPlatforms(&out);

        printf("\t- none\n");
        for(z=0;z<i;z++) {
            printf("\t- %s\n", out[z]);
            free(out[z]);
        }
        free(out);
        printf("\n");
#endif
 
Reply
#17
IRgpio still fails in the rewrite branch as of today (commit acd440ce83f8d628ae22e4fc5501cf8e9d9a02b2).
Looks to me like the the code that would call client_callback is commented never used anyway and 'eventpool_fd_t' isn't defined anywhere.


daemon also still fails to compile with
Code:
/home/pi/pilight-rewrite/daemon.c:1668: undefined reference to `platform_iterate_name'
I replaced the failing code with what you posted above - works fine - why didn't you pushed it into the repo?
EDIT: I've read in another post that the daemon isn't ported yet, so ignore the above.

Compiling platform:
raspberrypi zero w 1.1
gcc version 6.3.0 20170516 (Raspbian 6.3.0-18+rpi1)
cmake version 3.7.2
libwiringx 2.0-223-ge1869a9
libwiringx-dev 2.0-223-ge1869a9


PS:
2 More problems:

1:
disabling IR via setup.sh does nothing until I add

Code:
if(${IR} MATCHES "OFF")
    list(REMOVE_ITEM ${PROJECT_NAME}_headers "${PROJECT_SOURCE_DIR}/IRgpio.h")
    list(REMOVE_ITEM ${PROJECT_NAME}_sources "${PROJECT_SOURCE_DIR}/IRgpio.c")
endif()
to pilight/libs/pilight/hardware/CMakeExclude.txt
But I'm not sure this is where you would want it.

2:
Disabling WEBSERVER & WEBSERVER_SSL also fails the compile with
Code:
In file included from /root/pilight/libs/pilight/core/http.c:47:0:
/root/pilight/libs/pilight/core/webserver.h:45:14: error: ‘WEBSERVER_CHUNK_SIZE’ undeclared here (not in a function)
  char buffer[WEBSERVER_CHUNK_SIZE];
 
Reply
#18
Your PS problems have been fixed. Thanks for reporting!
 
Reply
#19
tried to compile rewrite (cloned via git today):

[ 89%] Building C object CMakeFiles/pilight.dir/libs/pilight/hardware/none.c.o
[ 89%] Built target pilight
Scanning dependencies of target pilight_shared
[ 90%] Linking C shared library libpilight.so
[ 90%] Built target pilight_shared
Scanning dependencies of target pilight-sha256
[ 91%] Building C object CMakeFiles/pilight-sha256.dir/sha256.c.o
[ 91%] Linking C executable pilight-sha256
[ 91%] Built target pilight-sha256
Scanning dependencies of target pilight-daemon
[ 92%] Building C object CMakeFiles/pilight-daemon.dir/daemon.c.o
/home/pi/pilight/daemon.c: In function ‘receive_parse_code’:
/home/pi/pilight/daemon.c:401:26: warning: passing argument 1 of ‘protocol-><Uee40>.parseCode’ from incompatible pointer type
protocol->parseCode(message);
^
/home/pi/pilight/daemon.c:401:26: note: expected ‘char **’ but argument is of type ‘char *’
/home/pi/pilight/daemon.c: In function ‘send_queue’:
/home/pi/pilight/daemon.c:644:36: warning: passing argument 2 of ‘protocol->createCode’ from incompatible pointer type
if(protocol->createCode(jcode, message) == 0 && main_loop == 1) {
^
/home/pi/pilight/daemon.c:644:36: note: expected ‘char **’ but argument is of type ‘char *’
/home/pi/pilight/daemon.c: In function ‘start_pilight’:
/home/pi/pilight/daemon.c:1668:3: warning: implicit declaration of function ‘platform_iterate_name’ [-Wimplicit-function-declaration]
while((tmp = platform_iterate_name(z++)) != NULL) {
^
/home/pi/pilight/daemon.c:1668:14: warning: assignment makes pointer from integer without a cast
while((tmp = platform_iterate_name(z++)) != NULL) {
^
[ 92%] Linking C executable pilight-daemon
CMakeFiles/pilight-daemon.dir/daemon.c.o: In function `start_pilight':
/home/pi/pilight/daemon.c:1668: undefined reference to `platform_iterate_name'
collect2: error: ld returned 1 exit status
CMakeFiles/pilight-daemon.dir/build.make:98: recipe for target 'pilight-daemon' failed
make[2]: *** [pilight-daemon] Error 1
CMakeFiles/Makefile2:173: recipe for target 'CMakeFiles/pilight-daemon.dir/all' failed
make[1]: *** [CMakeFiles/pilight-daemon.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

Werner
 
Reply
#20
Please use code tags. Secondly, that issue was already discussed in this thread.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  program protocol missing in rewrite Niek 1 613 10-07-2017, 08:55 PM
Last Post: curlymo
  daemon crashes in rewrite ma-ca 1 782 08-05-2017, 03:40 PM
Last Post: curlymo
  dim action fails in rewrite ma-ca 1 633 08-04-2017, 05:16 PM
Last Post: curlymo
  pilight rewrite branch fails to compile ebk 0 918 06-30-2017, 01:07 PM
Last Post: ebk
  Rewrite development status TopdRob 1 1,309 12-10-2016, 10:31 PM
Last Post: curlymo
  [fixed] bug fix for ds18b20.c rewrite branch beaming 1 1,248 05-13-2016, 06:27 AM
Last Post: curlymo
  HowTo Move your 3rd party code code from development to rewrite wo_rasp 0 1,115 03-15-2016, 02:10 PM
Last Post: wo_rasp

Forum Jump:


Browsing: 1 Guest(s)