Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with building from source #36

Open
ghost opened this issue Jun 10, 2016 · 2 comments
Open

Issues with building from source #36

ghost opened this issue Jun 10, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 10, 2016

UPDATE: I have resolved the issue. Due to the naming conventions on the library files in Fedora, the build script will end up failing when trying to compile uinput.c

The solution I found was to just manually compile it myself using this line:
sudo gcc -pthread -shared -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld build/temp.linux-x86_64-2.7/src/uinput.o -L/usr/lib64/libpython2.7.so.1.0 -o build/lib.linux-x86_64-2.7/libuinput.so

This builds it for Python 2.7 on my system. For building it using Python 3, the line should be:
sudo gcc -pthread -shared -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld build/temp.linux-x86_64-2.7/src/uinput.o -L/usr/lib64/libpython3.so -o build/lib.linux-x86_64-2.7/libuinput.so

Is there a way to have this addressed to make compilation on Fedora work out of the box?


Old Post
Hey, I'm currently running Fedora 24-beta, however this issue is present in Fedora 23 as well.

It seems the build scripts aren't set up correctly,(See Edit2) so it won't build properly. Using "sudo python setup.py install" gives the output:

running install
running build
running build_py
running build_ext
building 'libuinput' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c scc/uinput.c -o build/temp.linux-x86_64-2.7/scc/uinput.o
gcc -pthread -shared -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld build/temp.linux-x86_64-2.7/scc/uinput.o -L/usr/lib64 -lpython2.7 -o build/lib.linux-x86_64-2.7/libuinput.so
/bin/ld: cannot find -lpython2.7
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

The issue is also seen here.

Would we be able to get this addressed soon?

Thank you for your time and all the work you've put into this project, btw. :)

EDIT:
I also tried cloning from the repo itself versus using the supplied tars in the documentation, and it has the same typo and issue, as is seen here:

running install
running bdist_egg
running egg_info
creating python_steamcontroller.egg-info
writing requirements to python_steamcontroller.egg-info/requires.txt
writing python_steamcontroller.egg-info/PKG-INFO
writing top-level names to python_steamcontroller.egg-info/top_level.txt
writing dependency_links to python_steamcontroller.egg-info/dependency_links.txt
writing manifest file 'python_steamcontroller.egg-info/SOURCES.txt'
reading manifest file 'python_steamcontroller.egg-info/SOURCES.txt'
writing manifest file 'python_steamcontroller.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/steamcontroller
copying src/events.py -> build/lib.linux-x86_64-2.7/steamcontroller
copying src/cheader.py -> build/lib.linux-x86_64-2.7/steamcontroller
copying src/uinput.py -> build/lib.linux-x86_64-2.7/steamcontroller
copying src/__init__.py -> build/lib.linux-x86_64-2.7/steamcontroller
copying src/tools.py -> build/lib.linux-x86_64-2.7/steamcontroller
copying src/daemon.py -> build/lib.linux-x86_64-2.7/steamcontroller
running build_ext
building 'libuinput' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c src/uinput.c -o build/temp.linux-x86_64-2.7/src/uinput.o
src/uinput.c: In function ‘uinput_key’:
src/uinput.c:148:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(fd, &ev, sizeof(ev));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/uinput.c: In function ‘uinput_abs’:
src/uinput.c:159:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(fd, &ev, sizeof(ev));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/uinput.c: In function ‘uinput_rel’:
src/uinput.c:170:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(fd, &ev, sizeof(ev));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/uinput.c: In function ‘uinput_scan’:
src/uinput.c:181:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(fd, &ev, sizeof(ev));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/uinput.c: In function ‘uinput_set_delay_period’:
src/uinput.c:192:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(fd, &ev, sizeof(ev));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/uinput.c:195:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(fd, &ev, sizeof(ev));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/uinput.c: In function ‘uinput_syn’:
src/uinput.c:206:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(fd, &ev, sizeof(ev));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -pthread -shared -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld build/temp.linux-x86_64-2.7/src/uinput.o -L/usr/lib64 -lpython2.7 -o build/lib.linux-x86_64-2.7/libuinput.so
/bin/ld: cannot find -lpython2.7
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

The issue is this line: gcc -pthread -shared -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld build/temp.linux-x86_64-2.7/src/uinput.o -L/usr/lib64 -lpython2.7 -o build/lib.linux-x86_64-2.7/libuinput.so

There needs to be a space between the L in "-L/usr/lib64 -lpython2.7", and should be "-L /usr/lib64 -lpython2.7", I think.

Edit2: The build scripts seem fine, on second thought. The issue seems to be missing a python library for it to call and load. Unfortunately, I haven't been able to figure out what package I am missing, or if the library is located somewhere else under a different name, or anything of the sort. I will update if I find a solution to the missing library.

@kozec
Copy link
Contributor

kozec commented Jun 11, 2016

By the way, use

    ```
    triple apostrophes
    ```

when you are pasting terminal output, because that is unreadable :)

@ghost
Copy link
Author

ghost commented Jun 11, 2016

Post edited accordingly. Thanks, I'll remember that next time!

Haven't ever submitted an issue to github before, so I wasn't sure off hand how to fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant