phillipberndt/fakexrandr

Error building on centos7

Closed this issue · 18 comments

Hello,
I'm unable tu build / install fakexrandr on centos 7 :
[cbassaget@localhost ~]$ cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

[root@localhost fakexrandr]# ./configure
XRandR version is 1.4.2
The path to the real XRandR library is /lib64/libXrandr.so.2

ERROR: Failed to find a suitable directory for the fakeXrandr library

You must place the library into the library search path, in a directory preceeding
/lib64. In your system, this leaves the following candidates:
/usr/lib64/atlas, /usr/lib64/mysql, /usr/lib64/qt-3.3/lib, /lib,
None of these contains `local', therefore I won't autoconfigure the installation to one
of these directories. Either add a high-priority directory in /usr/local using the ldconfig
mechanism (See /etc/ld.so.conf.d/ on most systems) or manually create config.h.

Is that because libXrandr.so is in /lib64 ? (/lib64 is a symlink to /usr/lib64).

/lib64 and /ussr/lib64 are in ldconfig.

Regards,
Cédric

Have you tried

None of these contains `local', therefore I won't autoconfigure the installation to one
of these directories. Either add a high-priority directory in /usr/local using the ldconfig
mechanism (See /etc/ld.so.conf.d/ on most systems) or manually create config.h.

?

Especially: Does the /etc/ld.so.conf.d directory exist in centos? I could alter the script such that it offers to automate the necessary changes.

Hi Phillip,
/etc/ld.so.conf.d exists in centos

Regards,
Cédric

Should I just copy libxrandr.so in a temp directory like /lib64/local ? Would that work ?

No. To work around, you'll have to follow the recommendation from the error
message: Create a new directory for libraries /usr/local/lib/fakexrandr add
a new file in /etc/ld.so.conf.d with a name that comes up first in
alphabetic order, e.g. aaaaa.conf, place the path of the new directory into
a single line in that file, then run configure again. It should then use
this directory.

Thanks Phil, your trick worked.
Need to fix a aproblem with ctypes now : The GUI requires ctypes to be able to open libX11.so and an X Display

..and that doesn't work? Any error messages? Are you trying to run the tool
as a normal user from within a x11 session?

Rico29 notifications@github.com schrieb am Fr., 8. Jan. 2016, 14:34:

Thanks Phil, your trick worked.
Need to fix a aproblem with ctypes now : The GUI requires ctypes to be
able to open libX11.so and an X Display


Reply to this email directly or view it on GitHub
#28 (comment)
.

No, that does not work.
I'm trying to run fakexrandr-manage as a normal user within an X11 session.
I've got the same error message when running as root :

[user@localhost ~]$ fakexrandr-manage
The GUI requires ctypes to be able to open libX11.so and an X Display

I'm running Python 2.7.5.
Thanks for your help.
Regards

Then your python installation seems to lack ctypes.. Either install it or
try using the command line version; just append "help" to the command.

Hello Phillip,

I tried to test python's ctype installation, and it seems to be OK :

[cb@localhost tmp]$ cat testlib.c
#include <stdio.h>
void myprint(void);
void myprint()
{
printf("hello world\n");
}

[cb@localhost tmp]$ gcc -shared -Wl,-soname,testlib -o testlib.so -fPIC testlib.c

[cb@localhost tmp]$ cat testlib.py
import ctypes

testlib = ctypes.CDLL('/tmp/testlib.so')
testlib.myprint()

[cb@localhost tmp]$ python testlib.py
hello world.

I also tried to configure fakexrandr-manage without GUI but did not manage to make it work.
Can you please provide me a sample config dump ?

Regards,
Cédric

show-available shows you valid configurations for your system. You'll just need to replace SPLITS="N" with some splits, following the documentation, e.g. SPLITS="H 500 N N" will split once horizontally at 500px.

Another thing, to get a better error message, could you please patch fakexrandr-manage: Line 45 reads try:, and line 64 except:, both inside the block with the comment "Code to open Xlib via ctypes". Please replace the first by if True: and the second line by if False:. You should see a more verbose error message then. (But make sure to take a backup -- the management script will stop working if you perform these changes!)

The output from locate libX11.so and locate libXrandr.so could also help.

Problem seems to be solved.

I guess you should add "/usr/lib64/" in your directory list (line 48).

[root@localhost ~]# locate libX11.so
/usr/lib64/libX11.so
/usr/lib64/libX11.so.6
/usr/lib64/libX11.so.6.3.0

[root@localhost ~]# locate libXrandr.so
/usr/lib64/libXrandr.so
/usr/lib64/libXrandr.so.2
/usr/lib64/libXrandr.so.2.2.0
/usr/local/lib64/fakexrandr/libXrandr.so
/usr/local/lib64/fakexrandr/libXrandr.so.2
/usr/local/src/fakexrandr/libXrandr.so
/usr/local/src/fakexrandr/libXrandr.so.2

Regards,
Cédric

Thanks, done.

Dear Philipberndt,
Could you please help me with this issue. I tried installing and following the steps above but now i get this message:

----------------------------------------------------------------------------------------------->>>>
/usr/local/lib64/fakexrandr # make install
TARGET_DIR=sed -nre 's/#define FAKEXRANDR_INSTALL_DIR "([^"]+)"/\1/p' config.h;
[ -d $TARGET_DIR ] || exit 1;
install libXrandr.so $TARGET_DIR;
ln -s libXrandr.so $TARGET_DIR/libXrandr.so.2 || true;
ln -s libXrandr.so $TARGET_DIR/libXinerama.so.1 || true;
ldconfig
ln: failed to create symbolic link '/usr/local/lib/fakexrandr/libXrandr.so.2': File exists
ln: failed to create symbolic link '/usr/local/lib/fakexrandr/libXinerama.so.1': File exists
ldconfig: File /usr/local/lib/fakexrandr/libXrandr.so.2 is empty, not checked.
ldconfig: File /usr/local/lib/fakexrandr/libXinerama.so.1 is empty, not checked.
ldconfig: File /usr/local/lib/fakexrandr/libXrandr.so is empty, not checked.
install fakexrandr-manage.py /usr/bin/fakexrandr-manage
----------------------------------------------------------------------------------------------------<<<<
fakexrandr-manager does launch but when i close it, it doesn't ask me if i want to save the configuration and when i reboot the settings aren't respected.

Thanks in advance for your help!

KR

ldconfig: File /usr/local/lib/fakexrandr/libXrandr.so is empty, not checked.

This sounds as if something went wrong during compilation. Try to completely uninstall fakexrandr, that is, remove the files from /usr/local/lib/fakexrandr, clear your working directory (redownload everything) and then retry.

fakexrandr-manager does launch but when i close it, it doesn't ask me if i want to save the configuration and when i reboot the settings aren't respected.

Does it show any error messages in the terminal if you run it from one?

2 new errors:

  1. ------------------------------->>>>
    usr/local/lib64/fakexrandr # make
    ./configure
    Package xrandr was not found in the pkg-config search path.
    Perhaps you should add the directory containing `xrandr.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'xrandr' found
    make: *** [Makefile:7: config.h] Error 1
    -------------------------<<<

What i did is create empty config.h file in directory but then when i execute "make" i get error 2:

  1. ----------------------------------->
    /usr/local/lib64/fakexrandr # make
    ./make_skeleton.py > skeleton.h || { rm -f skeleton.h; exit 1; }
    sh: gcc: command not found
    cc -O2 -fPIC -shared -o libXrandr.so libXrandr.c -ldl
    make: cc: Command not found
    make: *** [Makefile:13: libXrandr.so] Error 127
    ------------------------------------------<<<<<

thnx for your help

What i did is create empty config.h file in directory but then when i execute "make" i get error 2:

You should install the libXrandr-devel package.

sh: gcc: command not found

..and sudo yum group install "Development Tools" .

This is actually a very nice help that would gain to be included in the Readme file