I mentioned this in passing in a thread last week, so apologies to anyone who's heard it before: I'd like idle-timer-based power management on my FC4 machine, but can't get sleepd 1.2.14 to compile. Can anyone suggest how to make it work, please?
The details:
If I point my CPATH at the apm.h and acpi.h files provided by my kernel, running "make" in the sleepd directory fails with the series of messages
cc -O2 -Wall -DACPI_APM -c -o sleepd.o sleepd.c In file included from sleepd.c:21: acpi.h:20: error: syntax error before ‘apm_info’ sleepd.c: In function ‘main_loop’: sleepd.c:132: error: ‘apm_info’ undeclared (first use in this function) sleepd.c:132: error: (Each undeclared identifier is reported only once sleepd.c:132: error: for each function it appears in.) sleepd.c:132: error: syntax error before ‘ai’ sleepd.c:177: error: ‘ai’ undeclared (first use in this function) sleepd.c:179: warning: implicit declaration of function ‘apm_read’ sleepd.c: In function ‘main’: sleepd.c:307: warning: implicit declaration of function ‘apm_exists’ make: *** [sleepd.o] Error 1
whereas, if I point CPATH at the acpi.h and apm.h provided by sleepd, "make" fails with the slightly different series of messages
cc -O2 -Wall -DACPI_APM -c -o sleepd.o sleepd.c In file included from ./apm.h:1, from ./apm.h:1, [repeated _many_times] from sleepd.c:20: ./apm.h:1:17: error: #include nested too deeply In file included from sleepd.c:21: acpi.h:20: error: syntax error before ‘apm_info’ sleepd.c: In function ‘main_loop’: sleepd.c:132: error: ‘apm_info’ undeclared (first use in this function) sleepd.c:132: error: (Each undeclared identifier is reported only once sleepd.c:132: error: for each function it appears in.) sleepd.c:132: error: syntax error before ‘ai’ sleepd.c:177: error: ‘ai’ undeclared (first use in this function) sleepd.c:179: warning: implicit declaration of function ‘apm_read’ sleepd.c: In function ‘main’: sleepd.c:307: warning: implicit declaration of function ‘apm_exists’ make: *** [sleepd.o] Error 1
sleepd compiles out of the box on my Debian Testing machine, so it occurred to me to ftp the resulting binaries to where I want them. Unfortunately, once there, the sleepd binary refuses to run, with the error message
sleepd: error while loading shared libraries: libapm.so.1: cannot open shared object file: No such file or directory
sleepd compiles out of the box on my Debian Testing machine, so it occurred to me to ftp the resulting binaries to where I want them. Unfortunately, once there, the sleepd binary refuses to run, with the error message
sleepd: error while loading shared libraries: libapm.so.1: cannot open shared object file: No such file or directory
Have you tried copying libapm.so from you debian box? Probably in /lib. You will probably need to add the necessary symbolic links as well.
Stuart.
Hi Dan
On Thursday 10 November 2005 22:43, Dan Hatton wrote:
I mentioned this in passing in a thread last week, so apologies to anyone who's heard it before: I'd like idle-timer-based power management on my FC4 machine, but can't get sleepd 1.2.14 to compile. Can anyone suggest how to make it work, please?
FC4 - Hrmmm.. Doesn't that release ship with gcc-4. ?
The details:
If I point my CPATH at the apm.h and acpi.h files provided by my kernel, running "make" in the sleepd directory fails with the series of messages
cc -O2 -Wall -DACPI_APM -c -o sleepd.o sleepd.c In file included from sleepd.c:21: acpi.h:20: error: syntax error before ?apm_info? sleepd.c: In function ?main_loop?: sleepd.c:132: error: ?apm_info? undeclared (first use in this function)
Correct me if I'm wrong, but sleepd is a user space application, not a kernel module. Therefore, you should not be using includes from the kernel tree, only the ones from /usr/include/ (and any headers in the sleepd tarball).
whereas, if I point CPATH at the acpi.h and apm.h provided by sleepd, "make" fails with the slightly different series of messages
cc -O2 -Wall -DACPI_APM -c -o sleepd.o sleepd.c In file included from ./apm.h:1, from ./apm.h:1, [repeated _many_times] from sleepd.c:20: ./apm.h:1:17: error: #include nested too deeply In file included from sleepd.c:21: acpi.h:20: error: syntax error before ?apm_info? sleepd.c: In function ?main_loop?: sleepd.c:132: error: ?apm_info? undeclared (first use in this function) sleepd.c:132: error: (Each undeclared identifier is reported only once sleepd.c:132: error: for each function it appears in.) sleepd.c:132: error: syntax error before ?ai? sleepd.c:177: error: ?ai? undeclared (first use in this function) sleepd.c:179: warning: implicit declaration of function ?apm_read? sleepd.c: In function ?main?: sleepd.c:307: warning: implicit declaration of function ?apm_exists? make: *** [sleepd.o] Error 1
Something appears to be screwed here... Downloading and grepping the sleepd sources reveals a couple of problems that may cause "issues"... The first line in sleepd's apm.h reads "#include <apm.h>"... Do you have libapm-devel installed on your system ?
sleepd compiles out of the box on my Debian Testing machine, so it occurred to me to ftp the resulting binaries to where I want them. Unfortunately, once there, the sleepd binary refuses to run, with the error message
sleepd: error while loading shared libraries: libapm.so.1: cannot open shared object file: No such file or directory
Unless a binary is compiled and statically linked to the libraries, building on one system and running on another is a minefield of problems. IF both systems are using the same library versions (e.g. libc6-2.3.5 & libapm-3.2.2), you would probably find it works..
Gimme a shout after you have libapm-devel installed, and we can work on fixing any other problems.
Regards, Paul.
On Fri, 11 Nov 2005, Paul wrote:
On Thursday 10 November 2005 22:43, Dan Hatton wrote:
I mentioned this in passing in a thread last week, so apologies to anyone who's heard it before: I'd like idle-timer-based power management on my FC4 machine, but can't get sleepd 1.2.14 to compile. Can anyone suggest how to make it work, please?
FC4 - Hrmmm.. Doesn't that release ship with gcc-4. ?
4.0.1, to be precise.
Correct me if I'm wrong, but sleepd is a user space application, not a kernel module. Therefore, you should not be using includes from the kernel tree, only the ones from /usr/include/ (and any headers in the sleepd tarball).
OK, so I should be limiting myself to using the apm.h and acpi.h provided by sleepd or the apm.h from libapm-dev.
Something appears to be screwed here... Downloading and grepping the sleepd sources reveals a couple of problems that may cause "issues"... The first line in sleepd's apm.h reads "#include <apm.h>"... Do you have libapm-devel installed on your system ?
There doesn't seem to be an equivalent to libapm-dev on Fedora, so I pulled the apm.h file out of the Debian one, and put it in /usr/include.
Once this was done, "make" failed with
cc -o sleepd sleepd.o acpi.o -lapm /usr/bin/ld: cannot find -lapm collect2: ld returned 1 exit status make: *** [sleepd] Error 1
no matter what combination of CPATH and LIBRARY_PATH I used.
I've got a sort of feeling the arguments of that "cc" command might be in the wrong order. Can anyone confirm this and/or suggest the right order, please?
Hi Dan
On Friday 11 November 2005 14:40, Dan Hatton wrote:
There doesn't seem to be an equivalent to libapm-dev on Fedora, so I pulled the apm.h file out of the Debian one, and put it in /usr/include.
Try apmd-devel - Our friend, google, seems to suggest Fedora uses apmd as a holder for these libs..
Once this was done, "make" failed with
cc -o sleepd sleepd.o acpi.o -lapm /usr/bin/ld: cannot find -lapm collect2: ld returned 1 exit status make: *** [sleepd] Error 1
To be expected - Not only do you need the headers, but also the libapm.*.a & libapm.*.so files - If you try to use the Debian versions, expect a few other dependencies to crop up... It may be easier to find the source rpm for apmd (or libapm) and build that before sleepd.
Regards, Paul.
On Fri, 11 Nov 2005, Paul wrote:
On Friday 11 November 2005 14:40, Dan Hatton wrote:
There doesn't seem to be an equivalent to libapm-dev on Fedora, so I pulled the apm.h file out of the Debian one, and put it in /usr/include.
Try apmd-devel - Our friend, google, seems to suggest Fedora uses apmd as a holder for these libs..
Having expanded my yum configuration's search area somewhat, I found that apmd-debuginfo has an apm.h.
cc -o sleepd sleepd.o acpi.o -lapm /usr/bin/ld: cannot find -lapm collect2: ld returned 1 exit status make: *** [sleepd] Error 1
To be expected - Not only do you need the headers, but also the libapm.*.a & libapm.*.so files - If you try to use the Debian versions, expect a few other dependencies to crop up... It may be easier to find the source rpm for apmd (or libapm) and build that before sleepd.
None of Fedora's binary packages seem to have the libapm.*.so files, so, as you suggested, I recompiled apmd from source (as it happens, I got the source code from a Debian mirror,) which made them appear in /usr/lib without further ado. Once that was done, sleepd magically compiled without problems. Thank you very much.