graphql-libgraphqlparser-ruby icon indicating copy to clipboard operation
graphql-libgraphqlparser-ruby copied to clipboard

`missing libgraphqlparser` when installing

Open srghma opened this issue 8 years ago • 4 comments
trafficstars

Can someone help me? Os: Archlinux

$ gem install graphql-libgraphqlparser                 
Building native extensions.  This could take a while...
ERROR:  Error installing graphql-libgraphqlparser:
        ERROR: Failed to build gem native extension.

    current directory: /home/bjorn/.rvm/gems/ruby-2.4.1@ngrx-todolist/gems/graphql-libgraphqlparser-1.0.0/ext/graphql_libgraphqlparser_ext
/home/bjorn/.rvm/rubies/ruby-2.4.1/bin/ruby -r ./siteconf20170712-22576-98ti83.rb extconf.rb
checking for -lgraphqlparser... no
missing libgraphqlparser
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/bjorn/.rvm/rubies/ruby-2.4.1/bin/$(RUBY_BASE_NAME)
        --with-graphql-dir
        --without-graphql-dir
        --with-graphql-include
        --without-graphql-include=${graphql-dir}/include
        --with-graphql-lib
        --without-graphql-lib=${graphql-dir}/lib
        --with-graphqlparserlib
        --without-graphqlparserlib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/bjorn/.rvm/gems/ruby-2.4.1@ngrx-todolist/extensions/x86_64-linux/2.4.0/graphql-libgraphqlparser-1.0.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/bjorn/.rvm/gems/ruby-2.4.1@ngrx-todolist/gems/graphql-libgraphqlparser-1.0.0 for inspection.
Results logged to /home/bjorn/.rvm/gems/ruby-2.4.1@ngrx-todolist/extensions/x86_64-linux/2.4.0/graphql-libgraphqlparser-1.0.0/gem_make.out


$ cat /home/bjorn/.rvm/gems/ruby-2.4.1@ngrx-todolist/extensions/x86_64-linux/2.4.0/graphql-libgraphqlparser-1.0.0/mkmf.log
have_library: checking for -lgraphqlparser... -------------------- no

"gcc -o conftest -I/home/bjorn/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0/x86_64-linux -I/home/bjorn/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0/ruby/backward -I/home/bjorn/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0 -I.    -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wno-maybe-uninitialized  -fPIC conftest.c  -L. -L/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -Wl,-R/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic     -Wl,-R/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -L/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -lruby  -lpthread -lgmp -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

"gcc -o conftest -I/home/bjorn/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0/x86_64-linux -I/home/bjorn/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0/ruby/backward -I/home/bjorn/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0 -I.    -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wno-maybe-uninitialized  -fPIC conftest.c  -L. -L/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -Wl,-R/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic     -Wl,-R/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -L/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -lruby -lgraphqlparser  -lpthread -lgmp -ldl -lcrypt -lm   -lc"
/usr/bin/ld: cannot find -lgraphqlparser
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2:
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     printf("%p", &t);
 9:   }
10:
11:   return 0;
12: }
13:
14: int t(void) { ; return 0; }
/* end */

--------------------


srghma avatar Jul 12 '17 20:07 srghma

Sorry ... the readme.md is up-to-date for master, but I haven't released a gem version yet.

You can either:

  • Install the master branch from GitHub with:

    gem "graphql-libgraphqlparser", github: "rmosolgo/graphql-libgraphqlparser-ruby", branch: "master"
    
  • Or, install libgraphqlparser yourself: https://github.com/rmosolgo/graphql-libgraphqlparser-ruby#option-2

Does either of those work for you?

rmosolgo avatar Jul 12 '17 21:07 rmosolgo

  1. no
$ bundle install
Fetching https://github.com/rmosolgo/graphql-libgraphqlparser-ruby.git
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 12.0.0
....
Using graphql-libgraphqlparser 1.0.0 from https://github.com/rmosolgo/graphql-libgraphqlparser-ruby.git (at master@8015753)
.....
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/bjorn/.rvm/gems/ruby-2.4.1@ngrx-todolist/bundler/gems/graphql-libgraphqlparser-ruby-80157536a4fc/ext/graphql_libgraphqlparser_ext
/home/bjorn/.rvm/rubies/ruby-2.4.1/bin/ruby -r ./siteconf20170713-4322-tyvcgx.rb extconf.rb
checking for cmake... yes
CMake Error: The source directory
"/home/bjorn/.rvm/gems/ruby-2.4.1@ngrx-todolist/bundler/gems/graphql-libgraphqlparser-ruby-80157536a4fc/ext/libgraphqlparser" does not
appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target 'all'.  Stop.
checking for -lgraphqlparser... no
missing libgraphqlparser
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/bjorn/.rvm/rubies/ruby-2.4.1/bin/$(RUBY_BASE_NAME)
        --with-graphql-dir
        --without-graphql-dir
        --with-graphql-include
        --without-graphql-include=${graphql-dir}/include
        --with-graphql-lib
        --without-graphql-lib=${graphql-dir}/lib
        --with-graphqlparserlib
        --without-graphqlparserlib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/home/bjorn/.rvm/gems/ruby-2.4.1@ngrx-todolist/bundler/gems/extensions/x86_64-linux/2.4.0/graphql-libgraphqlparser-ruby-80157536a4fc/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/home/bjorn/.rvm/gems/ruby-2.4.1@ngrx-todolist/bundler/gems/graphql-libgraphqlparser-ruby-80157536a4fc for inspection.
Results logged to
/home/bjorn/.rvm/gems/ruby-2.4.1@ngrx-todolist/bundler/gems/extensions/x86_64-linux/2.4.0/graphql-libgraphqlparser-ruby-80157536a4fc/gem_make.out

An error occurred while installing graphql-libgraphqlparser (1.0.0), and Bundler cannot continue.

 cat /home/bjorn/.rvm/gems/ruby-2.4.1@ngrx-todolist/bundler/gems/extensions/x86_64-linux/2.4.0/graphql-libgraphqlparser-ruby-80157536a4fc/mkmf.log
find_executable: checking for cmake... -------------------- yes

--------------------

have_library: checking for -lgraphqlparser... -------------------- no

"gcc -o conftest -I/home/bjorn/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0/x86_64-linux -I/home/bjorn/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0/ruby/backward -I/home/bjorn/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0 -I.    -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wno-maybe-uninitialized  -fPIC conftest.c  -L. -L/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -Wl,-R/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic     -Wl,-R/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -L/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -lruby  -lpthread -lgmp -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

"gcc -o conftest -I/home/bjorn/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0/x86_64-linux -I/home/bjorn/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0/ruby/backward -I/home/bjorn/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0 -I.    -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wno-maybe-uninitialized  -fPIC conftest.c  -L. -L/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -Wl,-R/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic     -Wl,-R/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -L/home/bjorn/.rvm/rubies/ruby-2.4.1/lib -lruby -lgraphqlparser  -lpthread -lgmp -ldl -lcrypt -lm   -lc"
/usr/bin/ld: cannot find -lgraphqlparser
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2:
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     printf("%p", &t);
 9:   }
10:
11:   return 0;
12: }
13:
14: int t(void) { ; return 0; }
/* end */

--------------------

  1. dont want to install from source, tried from AUR with no luck (comment below If you are interested.)

srghma avatar Jul 13 '17 06:07 srghma

I'm running into this too, while trying to install on Heroku with version 0.7.0 of libgraphqlparser. Strangely, it works locally.

remote:        Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote:        
remote:        current directory:
remote:        /tmp/build_b07830cdd2d6edf03f2051569bc81168/vendor/bundle/ruby/2.5.0/gems/graphql-libgraphqlparser-1.1.0/ext/graphql_libgraphqlparser_ext
remote:        /tmp/build_b07830cdd2d6edf03f2051569bc81168/vendor/ruby-2.5.0/bin/ruby -r
remote:        ./siteconf20180102-464-1l8ggm1.rb extconf.rb
remote:        --with-graphql-include=/tmp/build_b07830cdd2d6edf03f2051569bc81168/vendor/libgraphqlparser/include/graphqlparser
remote:        --with-graphql-lib=/tmp/build_b07830cdd2d6edf03f2051569bc81168/vendor/libgraphqlparser/lib
remote:        checking for -lgraphqlparser... no
remote:        missing libgraphqlparser
remote:        *** extconf.rb failed ***
remote:        Could not create Makefile due to some reason, probably lack of necessary
remote:        libraries and/or headers.  Check the mkmf.log file for more details.  You may
remote:        need configuration options.
remote:        
remote:        Provided configuration options:
remote:        --with-opt-dir
remote:        --without-opt-dir
remote:        --with-opt-include
remote:        --without-opt-include=${opt-dir}/include
remote:        --with-opt-lib
remote:        --without-opt-lib=${opt-dir}/lib
remote:        --with-make-prog
remote:        --without-make-prog
remote:        --srcdir=.
remote:        --curdir
remote:        --ruby=/tmp/build_b07830cdd2d6edf03f2051569bc81168/vendor/ruby-2.5.0/bin/$(RUBY_BASE_NAME)
remote:        --with-graphql-dir
remote:        --without-graphql-dir
remote:        --with-graphql-include=${graphql-dir}/include
remote:        --with-graphql-lib=${graphql-dir}/lib
remote:        --with-graphqlparserlib
remote:        --without-graphqlparserlib
remote:        
remote:        To see why this extension failed to compile, please check the mkmf.log which can
remote:        be found here:
remote:        
remote:        /tmp/build_b07830cdd2d6edf03f2051569bc81168/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/graphql-libgraphqlparser-1.1.0/mkmf.log
remote:        
remote:        extconf failed, exit code 1
remote:        
remote:        Gem files will remain installed in
remote:        /tmp/build_b07830cdd2d6edf03f2051569bc81168/vendor/bundle/ruby/2.5.0/gems/graphql-libgraphqlparser-1.1.0
remote:        for inspection.
remote:        Results logged to
remote:        /tmp/build_b07830cdd2d6edf03f2051569bc81168/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/graphql-libgraphqlparser-1.1.0/gem_make.out
remote:        
remote:        An error occurred while installing graphql-libgraphqlparser (1.1.0), and Bundler
remote:        cannot continue.
remote:        Make sure that `gem install graphql-libgraphqlparser -v '1.1.0'` succeeds before
remote:        bundling.
remote:        
remote:        In Gemfile:
remote:        graphql-libgraphqlparser
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed

I've tried building libgraphqlparser 0.7.0 with forked versions of both https://github.com/jamesdphillips/heroku-buildpack-libgraphqlparser-prebuilt and https://github.com/goco-inc/heroku-buildpack-libgraphqlparser, and they both seem to have worked fine, so I'm not sure what the issue is...

chanks avatar Jan 02 '18 22:01 chanks

Never mind, I don't think this is a problem with the gem, I think it's my configuration.

chanks avatar Jan 03 '18 19:01 chanks