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

Can't install on Linux ARM #37

Closed
tsantor opened this issue Feb 2, 2018 · 19 comments
Closed

Can't install on Linux ARM #37

tsantor opened this issue Feb 2, 2018 · 19 comments

Comments

@tsantor
Copy link

tsantor commented Feb 2, 2018

I tried installing the library

Downloading prebuild for platform: iohook-v0.1.11-node-v57-linux-arm
Prebuild for current platform (iohook-v0.1.11-node-v57-linux-arm) not found!
Try to compile for your platform:
# cd node_modules/iohook;
# npm run compile

However, while there is a node_modules folder there is no iohook folder where I can try to run npm run compile.

Worth nothing this is on Ubuntu 14.04 running on a UDOO Quad as well as Raspbian Jessie and Raspbian Stretch running on a Raspberry Pi 3.

@tsantor tsantor changed the title Can't install on ARM Linux Can't install on Linux ARM Feb 2, 2018
@WilixLead
Copy link
Member

At this moment iohook not yet compiled to arm. But I believe at can be compiled without any problems.
If you don't see iohook directory in your node_modules after install, try check your npm installation or my be you try install it globally?
Try clone this repo and run npm run compile, should work

@tsantor
Copy link
Author

tsantor commented Feb 9, 2018

When I clone the repo and cd into the directory and run npm run compile I get the following:

npm ERR! missing script: compile

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/udooer/.npm/_logs/2018-02-09T23_26_22_312Z-debug.log

@WilixLead
Copy link
Member

Sorry. We just update command name.
You should try npm run build

@tsantor
Copy link
Author

tsantor commented Feb 13, 2018

Appreciate your willingness to help, but running that command I get:

> iohook@0.1.11 build /home/udooer/noteblockjs/node_modules/iohook
> cmake-js compile

info TOOL Using Unix Makefiles generator.
info TOOL Using c++11 compiler standard.
info DIST Downloading distribution files.
http DIST 	- http://nodejs.org/dist/v8.9.4/SHASUMS256.txt
http DIST 	- http://nodejs.org/dist/v8.9.4/node-v8.9.4-headers.tar.gz
info CMD CONFIGURE
WARN invalid config loglevel="notice"
info RUN cmake "/home/udooer/noteblockjs/node_modules/iohook" --no-warn-unused-cli -G"Unix Makefiles" -DCMAKE_JS_VERSION="3.6.1" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_LIBRARY_OUTPUT_DIRECTORY="/home/udooer/noteblockjs/node_modules/iohook/build/Release" -DCMAKE_JS_INC="/home/udooer/.cmake-js/node-arm/v8.9.4/include/node;/home/udooer/noteblockjs/node_modules/iohook/node_modules/nan" -DNODE_RUNTIME="node" -DNODE_RUNTIMEVERSION="8.9.4" -DNODE_ARCH="arm" -DCMAKE_CXX_FLAGS="-std=c++11"
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/udooer/noteblockjs/node_modules/iohook/build
info CMD BUILD
info RUN cmake --build "/home/udooer/noteblockjs/node_modules/iohook/build" --config Release
Scanning dependencies of target prepare_iuhook
./bootstrap.sh: 3: [: Linux: unexpected operator
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: creating directory config
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
configure.ac:76: error: possibly undefined macro: AC_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:99: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
autoreconf: /usr/bin/autoconf failed with exit status: 1
make[2]: *** [CMakeFiles/prepare_iuhook] Error 1
make[1]: *** [CMakeFiles/prepare_iuhook.dir/all] Error 2
make: *** [all] Error 2
info REP Build has been failed, trying to do a full rebuild.
info CMD CLEAN
info RUN cmake -E remove_directory "/home/udooer/noteblockjs/node_modules/iohook/build"
info CMD CONFIGURE
info RUN cmake "/home/udooer/noteblockjs/node_modules/iohook" --no-warn-unused-cli -G"Unix Makefiles" -DCMAKE_JS_VERSION="3.6.1" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_LIBRARY_OUTPUT_DIRECTORY="/home/udooer/noteblockjs/node_modules/iohook/build/Release" -DCMAKE_JS_INC="/home/udooer/.cmake-js/node-arm/v8.9.4/include/node;/home/udooer/noteblockjs/node_modules/iohook/node_modules/nan" -DNODE_RUNTIME="node" -DNODE_RUNTIMEVERSION="8.9.4" -DNODE_ARCH="arm" -DCMAKE_CXX_FLAGS="-std=c++11"
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/udooer/noteblockjs/node_modules/iohook/build
info CMD BUILD
info RUN cmake --build "/home/udooer/noteblockjs/node_modules/iohook/build" --config Release
Scanning dependencies of target prepare_iuhook
./bootstrap.sh: 3: [: Linux: unexpected operator
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
configure.ac:76: error: possibly undefined macro: AC_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:99: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
autoreconf: /usr/bin/autoconf failed with exit status: 1
make[2]: *** [CMakeFiles/prepare_iuhook] Error 1
make[1]: *** [CMakeFiles/prepare_iuhook.dir/all] Error 2
make: *** [all] Error 2
ERR! OMG Process terminated: 2
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iohook@0.1.11 build: `cmake-js compile`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the iohook@0.1.11 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/udooer/.npm/_logs/2018-02-13T17_44_31_923Z-debug.log

@WilixLead
Copy link
Member

Looks like you need install libtool before compile

@tsantor
Copy link
Author

tsantor commented Feb 14, 2018

Thanks. I installed that along with all other packages it subsequently complained about.

sudo apt-get install libtool
sudo apt-get install libxkbcommon-x11-dev libxkbcommon-x11
sudo apt-get install libxkbcommon-dev
sudo apt-get install libxinerama-dev libxinerama1
sudo apt-get install libxt-dev
sudo apt-get install libxtst-dev
sudo apt-get install libxcb-xkb-dev

Now I get this:

> iohook@0.1.11 build /home/udooer/noteblock-js/node_modules/iohook
> cmake-js compile

info TOOL Using Unix Makefiles generator.
info TOOL Using c++11 compiler standard.
info CMD BUILD
info RUN cmake --build "/home/udooer/noteblock-js/node_modules/iohook/build" --config Release
./bootstrap.sh: 3: [: Linux: unexpected operator
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
libtoolize: copying file `config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking target system type... armv7l-unknown-linux-gnueabihf
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking for gcc option to accept ISO C99... -std=gnu99
checking for an ANSI C-conforming const... yes
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for stdint.h... (cached) yes
checking for uint64_t... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc -std=gnu99... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 805306365
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert armv7l-unknown-linux-gnueabihf file names to armv7l-unknown-linux-gnueabihf format... func_convert_file_noop
checking how to convert armv7l-unknown-linux-gnueabihf file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc -std=gnu99 object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc -std=gnu99 supports -fno-rtti -fno-exceptions... no
checking for gcc -std=gnu99 option to produce PIC... -fPIC -DPIC
checking if gcc -std=gnu99 PIC flag -fPIC -DPIC works... yes
checking if gcc -std=gnu99 static flag -static works... yes
checking if gcc -std=gnu99 supports -c -o file.o... yes
checking if gcc -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the gcc -std=gnu99 linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking operating system... armv7l-unknown-linux-gnueabihf (Linux Compatible)
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for X11... yes
checking for XTST... yes
checking for XRecordQueryVersion in -lXtst... yes
checking for X11/extensions/record.h... yes
checking for XT... yes
checking for XTestQueryExtension in -lXtst... yes
checking for X11/extensions/XTest.h... yes
checking for XINERAMA... yes
checking for X11_XCB... yes
checking for XKBCOMMON... yes
checking for XKBCOMMON_X11... yes
checking for XKBFILE... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating pc/uiohook.pc
config.status: creating Makefile
config.status: creating include/config.h
config.status: executing depfiles commands
config.status: executing libtool commands
[  0%] Built target prepare_iuhook
Scanning dependencies of target uiohook
[ 16%] Building C object CMakeFiles/uiohook.dir/libuiohook/src/logger.c.o
[ 33%] Building C object CMakeFiles/uiohook.dir/libuiohook/src/x11/system_properties.c.o
/home/udooer/noteblock-js/node_modules/iohook/libuiohook/src/x11/system_properties.c: In function ‘hook_create_screen_info’:
/home/udooer/noteblock-js/node_modules/iohook/libuiohook/src/x11/system_properties.c:152:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < xine_count; i++) {
     ^
/home/udooer/noteblock-js/node_modules/iohook/libuiohook/src/x11/system_properties.c:152:5: note: use option -std=c99 or -std=gnu99 to compile your code
make[2]: *** [CMakeFiles/uiohook.dir/libuiohook/src/x11/system_properties.c.o] Error 1
make[1]: *** [CMakeFiles/uiohook.dir/all] Error 2
make: *** [all] Error 2
info REP Build has been failed, trying to do a full rebuild.
info CMD CLEAN
info RUN cmake -E remove_directory "/home/udooer/noteblock-js/node_modules/iohook/build"
info CMD CONFIGURE
WARN invalid config loglevel="notice"
info RUN cmake "/home/udooer/noteblock-js/node_modules/iohook" --no-warn-unused-cli -G"Unix Makefiles" -DCMAKE_JS_VERSION="3.6.1" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_LIBRARY_OUTPUT_DIRECTORY="/home/udooer/noteblock-js/node_modules/iohook/build/Release" -DCMAKE_JS_INC="/home/udooer/.cmake-js/node-arm/v8.9.4/include/node;/home/udooer/noteblock-js/node_modules/iohook/node_modules/nan" -DNODE_RUNTIME="node" -DNODE_RUNTIMEVERSION="8.9.4" -DNODE_ARCH="arm" -DCMAKE_CXX_FLAGS="-std=c++11"
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/udooer/noteblock-js/node_modules/iohook/build
info CMD BUILD
info RUN cmake --build "/home/udooer/noteblock-js/node_modules/iohook/build" --config Release
Scanning dependencies of target prepare_iuhook
./bootstrap.sh: 3: [: Linux: unexpected operator
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
libtoolize: copying file `config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking target system type... armv7l-unknown-linux-gnueabihf
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking for gcc option to accept ISO C99... -std=gnu99
checking for an ANSI C-conforming const... yes
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for stdint.h... (cached) yes
checking for uint64_t... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc -std=gnu99... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 805306365
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert armv7l-unknown-linux-gnueabihf file names to armv7l-unknown-linux-gnueabihf format... func_convert_file_noop
checking how to convert armv7l-unknown-linux-gnueabihf file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc -std=gnu99 object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc -std=gnu99 supports -fno-rtti -fno-exceptions... no
checking for gcc -std=gnu99 option to produce PIC... -fPIC -DPIC
checking if gcc -std=gnu99 PIC flag -fPIC -DPIC works... yes
checking if gcc -std=gnu99 static flag -static works... yes
checking if gcc -std=gnu99 supports -c -o file.o... yes
checking if gcc -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the gcc -std=gnu99 linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking operating system... armv7l-unknown-linux-gnueabihf (Linux Compatible)
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for X11... yes
checking for XTST... yes
checking for XRecordQueryVersion in -lXtst... yes
checking for X11/extensions/record.h... yes
checking for XT... yes
checking for XTestQueryExtension in -lXtst... yes
checking for X11/extensions/XTest.h... yes
checking for XINERAMA... yes
checking for X11_XCB... yes
checking for XKBCOMMON... yes
checking for XKBCOMMON_X11... yes
checking for XKBFILE... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating pc/uiohook.pc
config.status: creating Makefile
config.status: creating include/config.h
config.status: include/config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
[  0%] Built target prepare_iuhook
Scanning dependencies of target uiohook
[ 16%] Building C object CMakeFiles/uiohook.dir/libuiohook/src/logger.c.o
[ 33%] Building C object CMakeFiles/uiohook.dir/libuiohook/src/x11/system_properties.c.o
/home/udooer/noteblock-js/node_modules/iohook/libuiohook/src/x11/system_properties.c: In function ‘hook_create_screen_info’:
/home/udooer/noteblock-js/node_modules/iohook/libuiohook/src/x11/system_properties.c:152:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < xine_count; i++) {
     ^
/home/udooer/noteblock-js/node_modules/iohook/libuiohook/src/x11/system_properties.c:152:5: note: use option -std=c99 or -std=gnu99 to compile your code
make[2]: *** [CMakeFiles/uiohook.dir/libuiohook/src/x11/system_properties.c.o] Error 1
make[1]: *** [CMakeFiles/uiohook.dir/all] Error 2
make: *** [all] Error 2
ERR! OMG Process terminated: 2
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iohook@0.1.11 build: `cmake-js compile`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the iohook@0.1.11 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/udooer/.npm/_logs/2018-02-14T19_39_06_292Z-debug.log

@WilixLead
Copy link
Member

Hm. It is strange. In CMakeLists.txt I see checking of compiler version

cmake_minimum_required(VERSION 2.8)
macro(use_c99)
  if (CMAKE_VERSION VERSION_LESS "3.1")
    if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
      set (CMAKE_C_FLAGS "--std=gnu99 ${CMAKE_C_FLAGS}")
    endif ()
  else ()
    set (CMAKE_C_STANDARD 99)
  endif ()
endmacro(use_c99)

Please check your cmake version. Also It may be related to arm version of libuihook, I need to try update to latest version.

@tsantor
Copy link
Author

tsantor commented Feb 15, 2018

My cmake version is 2.8.12.2.

Don't find anything regarding libuihook. Appreciate all the help. Really need this package working on ARM.

@tsantor
Copy link
Author

tsantor commented Feb 16, 2018

Any other recommendations to get this package working on ARM?

@WilixLead
Copy link
Member

Try add to line 15 in file CMakeLists.txt (after use_c99())
set (CMAKE_C_FLAGS "--std=gnu99 ${CMAKE_C_FLAGS}")
or
set (CMAKE_C_STANDARD 99)

For be sure if c99 used

@tsantor
Copy link
Author

tsantor commented Feb 20, 2018

Ok, so I added set (CMAKE_C_FLAGS "--std=gnu99 ${CMAKE_C_FLAGS}") after the use_c99() line. Then ran npm run build. I got the following:

> iohook@0.1.11 build /home/udooer/noteblock-js/node_modules/iohook
> cmake-js compile

info TOOL Using Unix Makefiles generator.
info TOOL Using c++11 compiler standard.
info CMD BUILD
info RUN cmake --build "/home/udooer/noteblock-js/node_modules/iohook/build" --config Release
./bootstrap.sh: 3: [: Linux: unexpected operator
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
libtoolize: copying file `config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking target system type... armv7l-unknown-linux-gnueabihf
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking for gcc option to accept ISO C99... -std=gnu99
checking for an ANSI C-conforming const... yes
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for stdint.h... (cached) yes
checking for uint64_t... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc -std=gnu99... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 805306365
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert armv7l-unknown-linux-gnueabihf file names to armv7l-unknown-linux-gnueabihf format... func_convert_file_noop
checking how to convert armv7l-unknown-linux-gnueabihf file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc -std=gnu99 object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc -std=gnu99 supports -fno-rtti -fno-exceptions... no
checking for gcc -std=gnu99 option to produce PIC... -fPIC -DPIC
checking if gcc -std=gnu99 PIC flag -fPIC -DPIC works... yes
checking if gcc -std=gnu99 static flag -static works... yes
checking if gcc -std=gnu99 supports -c -o file.o... yes
checking if gcc -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the gcc -std=gnu99 linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking operating system... armv7l-unknown-linux-gnueabihf (Linux Compatible)
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for X11... yes
checking for XTST... yes
checking for XRecordQueryVersion in -lXtst... yes
checking for X11/extensions/record.h... yes
checking for XT... yes
checking for XTestQueryExtension in -lXtst... yes
checking for X11/extensions/XTest.h... yes
checking for XINERAMA... yes
checking for X11_XCB... yes
checking for XKBCOMMON... yes
checking for XKBCOMMON_X11... yes
checking for XKBFILE... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating pc/uiohook.pc
config.status: creating Makefile
config.status: creating include/config.h
config.status: include/config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
[  0%] Built target prepare_iuhook
[ 83%] Built target uiohook
[100%] Built target iohook

No errors that I see, however, when running your usage example I get:

module.js:540
    throw err;
    ^

Error: Cannot find module '/home/udooer/noteblock-js/node_modules/iohook/builds/node-v57-linux-arm/build/Release/iohook.node'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/udooer/noteblock-js/node_modules/iohook/index.js:18:21)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)

@WilixLead
Copy link
Member

Thats great news. Looks like node can't find module. Please check directories under
/home/udooer/noteblock-js/node_modules/iohook/
One of them should contain iohook.node or other called *.node files

@tsantor
Copy link
Author

tsantor commented Feb 20, 2018

Ok, so we're getting there. I found it and copied it to where it was looking for it in the error message above:

cp /home/udooer/noteblock-js/node_modules/iohook/build/Release/iohook.node /home/udooer/noteblock-js/node_modules/iohook/builds/node-v57-linux-arm/build/Release/iohook.node

Now the usage example you provide works when run from the terminal on the actual machine with a monitor, keyboard and mouse!

However, when disconnecting the monitor and keyboard and SSHing into the UDOO, I get this when running your usage example:

on_library_load [456]: XOpenDisplay failure!
load_input_helper [1907]: XkbGetKeyboard failed to locate a valid keyboard!
PID 7608 received SIGSEGV for address: 0x94
Error: Couldn't find per display information

With that said, when I have a mouse, keyboard (USB button as keyboard) and monitor on the Quad and attempt to run the usage example on the local terminal it all works, but when I run the example over ssh I get the above errors. Also, the intent is for this to be run on an UDOO Quad without a monitor or mouse connected, just the USB button.

UPDATE:
Doing the reverse and SSHing into my Mac from the UDOO, I am able to run the usage example remotely and press the USB button connected to the mac and get the keyup event. However, doing the opposite and SSHing into my UDOO and running the usage example provides the above error.

@WilixLead
Copy link
Member

Interesting case :) But I think need redirect this question to libuiohook.
iohook use this lib as crossplatform c++ implementation.
So, they implement lowlevel functions. Just try ask they :)

@cerw
Copy link

cerw commented Mar 2, 2018

Having same problem :(

@tsantor
Copy link
Author

tsantor commented Mar 2, 2018

Considering this is no longer an iohook issue I have moved the conversation over to libuihook. @WilixLead thanks for your help getting it to compile and run on Linux ARM.

The new issue is here

@tsantor tsantor closed this as completed Mar 2, 2018
@cerw
Copy link

cerw commented Mar 4, 2018

I meant i cannot get it to compile on ARM
I get the latest master into node_modules/iohook
apply the change in this Issue and I always get this:
npm run build

[ 75%] Built target uiohook
[ 87%] Building CXX object CMakeFiles/iohook.dir/src/iohook.cc.o
In file included from /home/pi/socket/node_modules/iohook/src/iohook.cc:1:0:
/home/pi/socket/node_modules/iohook/src/iohook.h:3:17: fatal error: nan.h: No such file or directory
 #include <nan.h>
                 ^
compilation terminated.
CMakeFiles/iohook.dir/build.make:62: recipe for target 'CMakeFiles/iohook.dir/src/iohook.cc.o' failed
make[2]: *** [CMake

@SKorfanty
Copy link

Same issue here..

CMakeFiles/iohook.dir/build.make:62: recipe for target 'CMakeFiles/iohook.dir/src/iohook.cc.o' failed make[2]: *** [CMakeFiles/iohook.dir/src/iohook.cc.o] Error 1 CMakeFiles/Makefile2:136: recipe for target 'CMakeFiles/iohook.dir/all' failed make[1]: *** [CMakeFiles/iohook.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2 ERR! OMG Process terminated: 2 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! iohook@0.2.0 build: cmake-js compile`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the iohook@0.2.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
`

@MoffKalast
Copy link

Uhh, I'm just gonna assume this is a lost cause on arm.

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

5 participants