parallella / parallella-utils

Library of various community contributed Parallella board admin scripts and programs
Other
39 stars 19 forks source link

Can't build thermald without missing misc/epiphany.h #7

Closed hewittc closed 7 years ago

hewittc commented 8 years ago

Was there a missing file in the last push?

cc -Wall -g     thermald.c   -lm -o thermald
thermald.c:13:27: fatal error: misc/epiphany.h: No such file or directory
compilation terminated.
<builtin>: recipe for target 'thermald' failed
make: *** [thermald] Error 1

The epiphany.h included with ESDK 2016.3 doesn't seem to include the required definitions:

cc -Wall -g     thermald.c   -lm -o thermald
thermald.c: In function 'disallow_mesh_access':
thermald.c:77:17: error: 'E_IOCTL_THERMAL_DISALLOW' undeclared (first use in this function)
  rc = ioctl(fd, E_IOCTL_THERMAL_DISALLOW);
                 ^
thermald.c:77:17: note: each undeclared identifier is reported only once for each function it appears in
thermald.c: In function 'allow_mesh_access':
thermald.c:95:17: error: 'E_IOCTL_THERMAL_ALLOW' undeclared (first use in this function)
  rc = ioctl(fd, E_IOCTL_THERMAL_ALLOW);
                 ^
<builtin>: recipe for target 'thermald' failed
make: *** [thermald] Error 1
olajep commented 8 years ago

Should be fixed here, could you please test it? https://github.com/parallella/parallella-utils/commit/34704d0364f946f1d76d006378909df4b02c8ea9

Thanks, Ola

hewittc commented 8 years ago

Thanks for the quick reply! I had to comment out the missing misc/epiphany.h include, but I think we need E_IO as well for successful macro expansion.

cc -Wall -g     thermald.c   -lm -o thermald
thermald.c: In function 'disallow_mesh_access':
thermald.c:17:34: warning: implicit declaration of function 'E_IO' [-Wimplicit-function-declaration]
 #define E_IOCTL_THERMAL_DISALLOW E_IO(0x06)
                                  ^
thermald.c:83:17: note: in expansion of macro 'E_IOCTL_THERMAL_DISALLOW'
  rc = ioctl(fd, E_IOCTL_THERMAL_DISALLOW);
                 ^
/tmp/ccfXfeib.o: In function `disallow_mesh_access':
/home/chris/src/parallella-utils/thermald/thermald.c:83: undefined reference to `E_IO'
/tmp/ccfXfeib.o: In function `allow_mesh_access':
/home/chris/src/parallella-utils/thermald/thermald.c:101: undefined reference to `E_IO'
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'thermald' failed
make: *** [thermald] Error 1
olajep commented 8 years ago

I'm not following now: This file does exist in the Pubuntu 2016.3 image, right? /usr/include/misc/epiphany.h

The master branch is not compatible with Pubuntu / ESDK 2015.1 Will create a separate branch for the latest working commit w/ esdk-2015.1 tomorrow

hewittc commented 8 years ago

My mistake! I am using ESDK 2016.3, except under Arch Linux ARM, and I am trying to reproduce a lot of the things which come with Pubuntu. Is there another repository to track the files under /usr/include/misc/? I assumed incorrectly that they would have either been included in the ESDK or reside in this repository.

olajep commented 8 years ago

The header files comes from building parallella-linux There's a script here you can look at: https://github.com/parallella/pubuntu/blob/master/bootfs-and-kernel.sh

hewittc commented 8 years ago

Thanks. I see now at parallella-linux/drivers/misc/epiphany.h. Once I included that I was able to build a working thermald successfully, even without https://github.com/parallella/parallella-utils/commit/34704d0364f946f1d76d006378909df4b02c8ea9. Maybe it's worth reverting the change. Consider this issue closed!