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

required dependencies #5

Open
stephengeorgewest opened this issue Jul 23, 2020 · 5 comments
Open

required dependencies #5

stephengeorgewest opened this issue Jul 23, 2020 · 5 comments
Assignees
Labels
PKGBUILD Archlinux build script

Comments

@stephengeorgewest
Copy link

in addition to the listed dependencies, I also had to install libedev-dev and libgmock-dev.

stephen@B450-AORUS-M:~/source/g13/build$ make
[  3%] Building CXX object CMakeFiles/runtests.dir/g13_hotplug.cpp.o
/home/stephen/source/g13/g13_hotplug.cpp:9:10: fatal error: libevdev-1.0/libevdev/libevdev.h: No such file or directory
    9 | #include <libevdev-1.0/libevdev/libevdev.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/runtests.dir/build.make:102: CMakeFiles/runtests.dir/g13_hotplug.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:81: CMakeFiles/runtests.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

stephen@B450-AORUS-M:~/source/g13/build$ sudo apt search libevdev
p   libevdev-dev                                                           - wrapper library for evdev devices - development files                            
p   libevdev-dev:i386                                                      - wrapper library for evdev devices - development files                            
p   libevdev-doc                                                           - wrapper library for evdev devices - development docs                             
v   libevdev-doc:i386                                                      -                                                                                  
p   libevdev-tools                                                         - wrapper library for evdev devices - tools                                        
p   libevdev-tools:i386                                                    - wrapper library for evdev devices - tools                                        
i   libevdev2                                                              - wrapper library for evdev devices                                                
p   libevdev2:i386                                                         - wrapper library for evdev devices                                                
p   python-libevdev-doc                                                    - Python wrapper for libevdev (common documentation)                               
p   python3-libevdev                                                       - Python 3 wrapper for libevdev                                                    

stephen@B450-AORUS-M:~/source/g13/build$ sudo apt install libevdev-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  libevdev-doc
The following NEW packages will be installed:
  libevdev-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 48.6 kB of archives.
After this operation, 286 kB of additional disk space will be used.
Get:1 http://mirrors.xmission.com/ubuntu focal/main amd64 libevdev-dev amd64 1.9.0+dfsg-1 [48.6 kB]
Fetched 48.6 kB in 0s (401 kB/s)        
Selecting previously unselected package libevdev-dev:amd64.
(Reading database ... 396011 files and directories currently installed.)
Preparing to unpack .../libevdev-dev_1.9.0+dfsg-1_amd64.deb ...
Unpacking libevdev-dev:amd64 (1.9.0+dfsg-1) ...
Setting up libevdev-dev:amd64 (1.9.0+dfsg-1) ...
Processing triggers for man-db (2.9.1-1) ...

stephen@B450-AORUS-M:~/source/g13/build$ make
[  3%] Building CXX object CMakeFiles/runtests.dir/g13_hotplug.cpp.o
[  6%] Building CXX object CMakeFiles/runtests.dir/g13_keys.cpp.o
[ 10%] Building CXX object CMakeFiles/runtests.dir/g13_lcd.cpp.o
[ 13%] Building CXX object CMakeFiles/runtests.dir/g13_log.cpp.o
[ 17%] Building CXX object CMakeFiles/runtests.dir/g13_manager.cpp.o
[ 20%] Building CXX object CMakeFiles/runtests.dir/g13_profile.cpp.o
[ 24%] Building CXX object CMakeFiles/runtests.dir/g13_stick.cpp.o
[ 27%] Building CXX object CMakeFiles/runtests.dir/helper.cpp.o
[ 31%] Building CXX object CMakeFiles/runtests.dir/testKeys.cpp.o
/home/stephen/source/g13/testKeys.cpp:14:10: fatal error: gmock/gmock.h: No such file or directory
   14 | #include "gmock/gmock.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/runtests.dir/build.make:206: CMakeFiles/runtests.dir/testKeys.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:81: CMakeFiles/runtests.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

stephen@B450-AORUS-M:~/source/g13/build$ apt search gmock
p   libgmock-dev                                                           - Google's framework for writing C++ tests                                         
p   libgmock-dev:i386                                                      - Google's framework for writing C++ tests                                         

stephen@B450-AORUS-M:~/source/g13/build$ sudo apt install libgmock-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  googletest libgtest-dev
The following NEW packages will be installed:
  googletest libgmock-dev libgtest-dev
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,326 kB of archives.
After this operation, 22.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.xmission.com/ubuntu focal/universe amd64 googletest all 1.10.0-2 [623 kB]
Get:2 http://mirrors.xmission.com/ubuntu focal/universe amd64 libgtest-dev amd64 1.10.0-2 [1,583 kB]
Get:3 http://mirrors.xmission.com/ubuntu focal/universe amd64 libgmock-dev amd64 1.10.0-2 [119 kB]
Fetched 2,326 kB in 1s (4,252 kB/s)    
Selecting previously unselected package googletest.
(Reading database ... 396022 files and directories currently installed.)
Preparing to unpack .../googletest_1.10.0-2_all.deb ...
Unpacking googletest (1.10.0-2) ...
Selecting previously unselected package libgtest-dev:amd64.
Preparing to unpack .../libgtest-dev_1.10.0-2_amd64.deb ...
Unpacking libgtest-dev:amd64 (1.10.0-2) ...
Selecting previously unselected package libgmock-dev:amd64.
Preparing to unpack .../libgmock-dev_1.10.0-2_amd64.deb ...
Unpacking libgmock-dev:amd64 (1.10.0-2) ...
Setting up googletest (1.10.0-2) ...
Setting up libgtest-dev:amd64 (1.10.0-2) ...
Setting up libgmock-dev:amd64 (1.10.0-2) ...

stephen@B450-AORUS-M:~/source/g13/build$ make
[  3%] Building CXX object CMakeFiles/runtests.dir/testKeys.cpp.o
[  6%] Linking CXX executable runtests
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libgtest.a(gtest-all.cc.o): undefined reference to symbol 'pthread_getspecific@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/runtests.dir/build.make:249: runtests] Error 1
make[1]: *** [CMakeFiles/Makefile2:81: CMakeFiles/runtests.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

stephen@B450-AORUS-M:~/source/g13/build$ cd ..

stephen@B450-AORUS-M:~/source/g13$ cmake -B build -S .
-- Configuring done
-- Generating done
-- Build files have been written to: /home/stephen/source/g13/build

stephen@B450-AORUS-M:~/source/g13$ cd build/

stephen@B450-AORUS-M:~/source/g13/build$ make
[  3%] Linking CXX executable runtests
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libgtest.a(gtest-all.cc.o): undefined reference to symbol 'pthread_getspecific@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/runtests.dir/build.make:249: runtests] Error 1
make[1]: *** [CMakeFiles/Makefile2:81: CMakeFiles/runtests.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

stephen@B450-AORUS-M:~/source/g13/build$ ls
CMakeCache.txt  CMakeFiles  cmake_install.cmake  Makefile

stephen@B450-AORUS-M:~/source/g13/build$ cd ..

stephen@B450-AORUS-M:~/source/g13$ nano CMakeLists.txt 

stephen@B450-AORUS-M:~/source/g13$ cmake -B build -S .
-- Configuring done
CMake Error at CMakeLists.txt:51 (add_executable):
  CXX_STANDARD is set to invalid value '17;-std=c++17 -pthread'


CMake Error at CMakeLists.txt:12 (add_executable):
  CXX_STANDARD is set to invalid value '17;-std=c++17 -pthread'


CMake Error at CMakeLists.txt:9 (add_executable):
  CXX_STANDARD is set to invalid value '17;-std=c++17 -pthread'


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

stephen@B450-AORUS-M:~/source/g13$ nano CMakeLists.txt

stephen@B450-AORUS-M:~/source/g13$ cmake -B build -S .
-- Configuring done
-- Generating done
-- Build files have been written to: /home/stephen/source/g13/build

$stephen@B450-AORUS-M:~/source/g13/build$ make
[  3%] Building CXX object CMakeFiles/runtests.dir/g13_action.cpp.o
[  6%] Building CXX object CMakeFiles/runtests.dir/g13_device.cpp.o
[ 10%] Building CXX object CMakeFiles/runtests.dir/g13_fonts.cpp.o
[ 13%] Building CXX object CMakeFiles/runtests.dir/g13_hotplug.cpp.o
[ 17%] Building CXX object CMakeFiles/runtests.dir/g13_keys.cpp.o
[ 20%] Building CXX object CMakeFiles/runtests.dir/g13_lcd.cpp.o
[ 24%] Building CXX object CMakeFiles/runtests.dir/g13_log.cpp.o
[ 27%] Building CXX object CMakeFiles/runtests.dir/g13_manager.cpp.o
[ 31%] Building CXX object CMakeFiles/runtests.dir/g13_profile.cpp.o
[ 34%] Building CXX object CMakeFiles/runtests.dir/g13_stick.cpp.o
[ 37%] Building CXX object CMakeFiles/runtests.dir/helper.cpp.o
[ 41%] Building CXX object CMakeFiles/runtests.dir/testKeys.cpp.o
[ 44%] Linking CXX executable runtests
[ 44%] Built target runtests
Scanning dependencies of target version
[ 48%] Checking version header ...
GIT_VERSION = 1.0.4-dirty
#define GIT_VERSION "1.0.4-dirty"
[ 48%] Built target version
Scanning dependencies of target g13d
[ 51%] Building CXX object CMakeFiles/g13d.dir/g13_action.cpp.o
[ 55%] Building CXX object CMakeFiles/g13d.dir/g13_device.cpp.o
[ 58%] Building CXX object CMakeFiles/g13d.dir/g13_fonts.cpp.o
[ 62%] Building CXX object CMakeFiles/g13d.dir/g13_hotplug.cpp.o
[ 65%] Building CXX object CMakeFiles/g13d.dir/g13_keys.cpp.o
[ 68%] Building CXX object CMakeFiles/g13d.dir/g13_lcd.cpp.o
[ 72%] Building CXX object CMakeFiles/g13d.dir/g13_log.cpp.o
[ 75%] Building CXX object CMakeFiles/g13d.dir/g13_main.cpp.o
[ 79%] Building CXX object CMakeFiles/g13d.dir/g13_manager.cpp.o
[ 82%] Building CXX object CMakeFiles/g13d.dir/g13_profile.cpp.o
[ 86%] Building CXX object CMakeFiles/g13d.dir/g13_stick.cpp.o
[ 89%] Building CXX object CMakeFiles/g13d.dir/helper.cpp.o
[ 93%] Linking CXX executable g13d
[ 93%] Built target g13d
Scanning dependencies of target pbm2lpbm
[ 96%] Building CXX object CMakeFiles/pbm2lpbm.dir/pbm2lpbm.cpp.o
[100%] Linking CXX executable pbm2lpbm
[100%] Built target pbm2lpbm

stephen@B450-AORUS-M:~/source/g13/build$ ls
CMakeCache.txt  CMakeFiles  cmake_install.cmake  g13d  Makefile  pbm2lpbm  runtests

stephen@B450-AORUS-M:~/source/g13/build$ ./g13d 
1595478557 INFO  : g13d v1.0.4-dirty Jul 22 2020 22:23:53
1595478557 INFO  : Known keys on G13:
1595478557 INFO  : BD DOWN G1 G10 G11 G12 G13 G14 G15 G16 G17 G18 G19 G2 G20 G21 G22 G3 G4 G5 G6 G7 G8 G9 L1 L2 L3 L4 LEFT LIGHT LIGHT2 LIGHT_STATE M1 M2 M3 MISC_TOGGLE MR TOP UNDEF1 UNDEF3
1595478557 INFO  : Known keys to map to:
1595478557 INFO  : 0 1 2 3 4 5 6 7 8 9 A APOSTROPHE B BACKSLASH BACKSPACE C CAPSLOCK COMMA D DELETE DOT DOWN E END ENTER EQUAL ESC F F1 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 F2 F20 F21 F22 F23 F24 F3 F4 F5 F6 F7 F8 F9 G GRAVE H HOME I INSERT J K KP0 KP1 KP2 KP3 KP4 KP5 KP6 KP7 KP8 KP9 KPASTERISK KPDOT KPMINUS KPPLUS KPSLASH L LEFT LEFTALT LEFTBRACE LEFTCTRL LEFTSHIFT M MEXTRA MINUS MLEFT MMIDDLE MRIGHT MSIDE N NEXTSONG NUMLOCK O P PAGEDOWN PAGEUP PLAYPAUSE PREVIOUSSONG Q R RIGHT RIGHTALT RIGHTBRACE RIGHTCTRL RIGHTSHIFT S SCROLLLOCK SEMICOLON SLASH SPACE T TAB U UP V W X Y Z
1595478557 INFO  : USB device found during enumeration
1595478557 INFO  : USB device connected
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/001/045: Permission denied
libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes.
1595478557 ERROR  : Error opening G13 device: Access denied (insufficient permissions)
1595478557 INFO  : Waiting for device to show up ...
^C1595478570 INFO  : Caught signal 2 (Interrupt)
1595478570 ERROR  : Error: System call interrupted (perhaps due to signal)
1595478570 INFO  : Cleaning up
1595478570 INFO  : Exit

stephen@B450-AORUS-M:~/source/g13/build$ sudo !!
sudo ./g13d 
1595478665 INFO  : g13d v1.0.4-dirty Jul 22 2020 22:23:53
1595478665 INFO  : Known keys on G13:
1595478665 INFO  : BD DOWN G1 G10 G11 G12 G13 G14 G15 G16 G17 G18 G19 G2 G20 G21 G22 G3 G4 G5 G6 G7 G8 G9 L1 L2 L3 L4 LEFT LIGHT LIGHT2 LIGHT_STATE M1 M2 M3 MISC_TOGGLE MR TOP UNDEF1 UNDEF3
1595478665 INFO  : Known keys to map to:
1595478665 INFO  : 0 1 2 3 4 5 6 7 8 9 A APOSTROPHE B BACKSLASH BACKSPACE C CAPSLOCK COMMA D DELETE DOT DOWN E END ENTER EQUAL ESC F F1 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 F2 F20 F21 F22 F23 F24 F3 F4 F5 F6 F7 F8 F9 G GRAVE H HOME I INSERT J K KP0 KP1 KP2 KP3 KP4 KP5 KP6 KP7 KP8 KP9 KPASTERISK KPDOT KPMINUS KPPLUS KPSLASH L LEFT LEFTALT LEFTBRACE LEFTCTRL LEFTSHIFT M MEXTRA MINUS MLEFT MMIDDLE MRIGHT MSIDE N NEXTSONG NUMLOCK O P PAGEDOWN PAGEUP PLAYPAUSE PREVIOUSSONG Q R RIGHT RIGHTALT RIGHTBRACE RIGHTCTRL RIGHTSHIFT S SCROLLLOCK SEMICOLON SLASH SPACE T TAB U UP V W X Y Z
1595478665 INFO  : USB device found during enumeration
1595478665 INFO  : USB device connected
1595478665 INFO  : Setting up device 
1595478666 ERROR  : Error when transferring image: Operation timed out, 0 bytes written
1595478666 INFO  : Active Stick zones 
               STICK_UP   { 0 x 0.1 / 1 x 0.3 }   SEND KEYS: UP
             STICK_DOWN   { 0 x 0.7 / 1 x 0.9 }   SEND KEYS: DOWN
             STICK_LEFT   { 0 x 0 / 0.2 x 1 }   SEND KEYS: LEFT
            STICK_RIGHT   { 0.8 x 0 / 1 x 1 }   SEND KEYS: RIGHT
           STICK_PAGEUP   { 0 x 0 / 1 x 0.1 }   SEND KEYS: PAGEUP
         STICK_PAGEDOWN   { 0 x 0.9 / 1 x 1 }   SEND KEYS: PAGEDOWN
@khampf khampf self-assigned this Jul 23, 2020
@khampf khampf added the PKGBUILD Archlinux build script label Jul 23, 2020
@khampf
Copy link
Owner

khampf commented Jul 23, 2020

Make all makes the tests which requires gmock, I think I skip building those in the PKGBUILD on Arch but I will make a note of it

@lyndametref
Copy link

@stephengeorgewest could you please write which corrections you have made to the CMakeLists.txt file??

@stephengeorgewest
Copy link
Author

@lyndametref I didn't change anything, I just installed the extra libraries via APT. I think I was just suggesting that extra dependencies could be listed in the readme. I think I was just following the Readme.md -> Installation -> "building from source" directions. I have the pull request with the suggestions: stephengeorgewest@4f91d8d I'm not sure if that is the best way to handle the issue. Well, I didn't do that pull request right. It is going into the wrong repository. If I made other changes, they are lost, because my hard drive died.

@stephengeorgewest
Copy link
Author

@lyndametref oh, looking back at that giant thing I pasted in, I did nano a few times. I don't know what I changed. Probably changed that CXX_STANDARD line? CXX_STANDARD is set to invalid value '17;-std=c++17 -pthread'... -pthread doesn't exist in the file now. maybe it should have been -lpthread. I probably found scheckmedia/CameraControllerApi#2 after I saw the error "undefined reference to symbol 'pthread_getspecific@@GLIBC_2.2.5'"

@ameuret
Copy link

ameuret commented Apr 15, 2021

I also ran into the same missing dependency for gmock. On Ubuntu it's in package libgmock-dev.

Otherwise, adding -pthread to CMAKE_CXX_FLAGS in CMakeLists.txt

set(CMAKE_CXX_FLAGS "-std=c++17 -pthread")

worked nicely.

Poldovico pushed a commit to Poldovico/g13 that referenced this issue Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PKGBUILD Archlinux build script
Projects
None yet
Development

No branches or pull requests

4 participants