188 lines · plain
1The cpupower package consists of the following elements:2 3requirements4------------5 6On x86 pciutils is needed at runtime (-lpci).7For compilation pciutils-devel (pci/pci.h) and a gcc version8providing cpuid.h is needed.9For both it's not explicitly checked for (yet).10 11 12libcpupower13----------14 15"libcpupower" is a library which offers a unified access method for userspace16tools and programs to the cpufreq core and drivers in the Linux kernel. This17allows for code reduction in userspace tools, a clean implementation of18the interaction to the cpufreq core, and support for both the sysfs and proc19interfaces [depending on configuration, see below].20 21 22compilation and installation23----------------------------24 25There are 2 output directories - one for the build output and another for26the installation of the build results, that is the utility, library,27man pages, etc...28 29default directory30-----------------31 32In the case of default directory, build and install process requires no33additional parameters:34 35build36-----37 38$ make39 40The output directory for the 'make' command is the current directory and41its subdirs in the kernel tree:42tools/power/cpupower43 44install45-------46 47$ sudo make install48 49'make install' command puts targets to default system dirs:50 51-----------------------------------------------------------------------52| Installing file | System dir |53-----------------------------------------------------------------------54| libcpupower | /usr/lib |55-----------------------------------------------------------------------56| cpupower | /usr/bin |57-----------------------------------------------------------------------58| cpufreq-bench_plot.sh | /usr/bin |59-----------------------------------------------------------------------60| man pages | /usr/man |61-----------------------------------------------------------------------62 63To put it in other words it makes build results available system-wide,64enabling any user to simply start using it without any additional steps65 66custom directory67----------------68 69There are 2 make's command-line variables 'O' and 'DESTDIR' that setup70appropriate dirs:71'O' - build directory72'DESTDIR' - installation directory. This variable could also be setup in73the 'CONFIGURATION' block of the "Makefile"74 75build76-----77 78$ make O=<your_custom_build_catalog>79 80Example:81$ make O=/home/hedin/prj/cpupower/build82 83install84-------85 86$ make O=<your_custom_build_catalog> DESTDIR=<your_custom_install_catalog>87 88Example:89$ make O=/home/hedin/prj/cpupower/build DESTDIR=/home/hedin/prj/cpupower \90> install91 92Notice that both variables 'O' and 'DESTDIR' have been provided. The reason93is that the build results are saved in the custom output dir defined by 'O'94variable. So, this dir is the source for the installation step. If only95'DESTDIR' were provided then the 'install' target would assume that the96build directory is the current one, build everything there and install97from the current dir.98 99The files will be installed to the following dirs:100 101-----------------------------------------------------------------------102| Installing file | System dir |103-----------------------------------------------------------------------104| libcpupower | ${DESTDIR}/usr/lib |105-----------------------------------------------------------------------106| cpupower | ${DESTDIR}/usr/bin |107-----------------------------------------------------------------------108| cpufreq-bench_plot.sh | ${DESTDIR}/usr/bin |109-----------------------------------------------------------------------110| man pages | ${DESTDIR}/usr/man |111-----------------------------------------------------------------------112 113If you look at the table for the default 'make' output dirs you will114notice that the only difference with the non-default case is the115${DESTDIR} prefix. So, the structure of the output dirs remains the same116regardles of the root output directory.117 118 119clean and uninstall120-------------------121 122'clean' target is intended for cleanup the build catalog from build results123'uninstall' target is intended for removing installed files from the124installation directory125 126default directory127-----------------128 129This case is a straightforward one:130$ make clean131$ make uninstall132 133custom directory134----------------135 136Use 'O' command line variable to remove previously built files from the137build dir:138$ make O=<your_custom_build_catalog> clean139 140Example:141$ make O=/home/hedin/prj/cpupower/build clean142 143Use 'DESTDIR' command line variable to uninstall previously installed files144from the given dir:145$ make DESTDIR=<your_custom_install_catalog>146 147Example:148make DESTDIR=/home/hedin/prj/cpupower uninstall149 150 151running the tool152----------------153 154default directory155-----------------156 157$ sudo cpupower158 159custom directory160----------------161 162When it comes to run the utility from the custom build catalog things163become a little bit complicated as 'just run' approach doesn't work.164Assuming that the current dir is '<your_custom_install_catalog>/usr',165issuing the following command:166 167$ sudo ./bin/cpupower168will produce the following error output:169./bin/cpupower: error while loading shared libraries: libcpupower.so.1:170cannot open shared object file: No such file or directory171 172The issue is that binary cannot find the 'libcpupower' library. So, we173shall point to the lib dir:174sudo LD_LIBRARY_PATH=lib64/ ./bin/cpupower175 176 177THANKS178------179Many thanks to Mattia Dongili who wrote the autotoolization and180libtoolization, the manpages and the italian language file for cpupower;181to Dave Jones for his feedback and his dump_psb tool; to Bruno Ducrot for his182powernow-k8-decode and intel_gsic tools as well as the french language file;183and to various others commenting on the previous (pre-)releases of 184cpupower.185 186 187 Dominik Brodowski188