ddollar / heroku-buildpack-apt

120 stars 327 forks source link

Problem installing libgd2-xpm-dev #32

Closed drPavka closed 9 years ago

drPavka commented 9 years ago

Hi I try to install node-gd https://www.npmjs.com/package/node-gd package It needs libgd library I use heroku-buildpack-multi with heroku-buildpack-apt

cat .buildpacks https://github.com/ddollar/heroku-buildpack-apt https://github.com/heroku/heroku-buildpack-nodejs

cat Aptfile libgd2-xpm-dev

And when deploying I have

_usr/bin/ld: /tmp/build_fa2bb26f8b6349e151cc62491a86b973/.apt/usr/lib/x86_64-linux-gnu/libgd.a(gd.o): relocation R_X86_64PC32 against symbol `gdImageColorClosestAlpha' can not be used when making a shared object; recompile with -fPIC

error May be somebody has any ideas about this?

remote: -----> Fetching custom git buildpack... done
remote: -----> Multipack app detected
remote: =====> Downloading Buildpack: https://github.com/ddollar/heroku-buildpack-apt
remote: =====> Detected Framework: Apt
remote: -----> Updating apt caches
remote:        Ign http://archive.ubuntu.com trusty InRelease
remote:        Ign http://archive.ubuntu.com trusty-security InRelease
remote:        Ign http://archive.ubuntu.com trusty-updates InRelease
remote:        Hit http://archive.ubuntu.com trusty Release.gpg
remote:        Get:1 http://archive.ubuntu.com trusty-security Release.gpg [933 B]
remote:        Get:2 http://archive.ubuntu.com trusty-updates Release.gpg [933 B]
remote:        Hit http://archive.ubuntu.com trusty Release
remote:        Get:3 http://archive.ubuntu.com trusty-security Release [63.5 kB]
remote:        Get:4 http://archive.ubuntu.com trusty-updates Release [63.5 kB]
remote:        Hit http://archive.ubuntu.com trusty/main amd64 Packages
remote:        Hit http://archive.ubuntu.com trusty/universe amd64 Packages
remote:        Hit http://archive.ubuntu.com trusty/main Translation-en
remote:        Hit http://archive.ubuntu.com trusty/universe Translation-en
remote:        Get:5 http://archive.ubuntu.com trusty-security/main amd64 Packages [320 kB]
remote:        Get:6 http://archive.ubuntu.com trusty-security/main Translation-en [172 kB]
remote:        Get:7 http://archive.ubuntu.com trusty-updates/main amd64 Packages [594 kB]
remote:        Get:8 http://archive.ubuntu.com trusty-updates/main Translation-en [286 kB]
remote:        Ign http://archive.ubuntu.com trusty/main Translation-en_US
remote:        Ign http://archive.ubuntu.com trusty/universe Translation-en_US
remote:        Fetched 1,501 kB in 2s (612 kB/s)
remote:        Reading package lists...
remote: -----> Fetching .debs for libgd-dev
remote:        Reading package lists...
remote:        Building dependency tree...
remote:        The following extra packages will be installed:
remote:          libvpx-dev libxpm-dev
remote:        The following NEW packages will be installed:
remote:          libgd-dev libvpx-dev libxpm-dev
remote:        0 upgraded, 3 newly installed, 0 to remove and 90 not upgraded.
remote:        Need to get 0 B/1,021 kB of archives.
remote:        After this operation, 3,829 kB of additional disk space will be used.
remote:        Download complete and in download only mode
remote: -----> Fetching .debs for libgif-dev
remote:        Reading package lists...
remote:        Building dependency tree...
remote:        The following NEW packages will be installed:
remote:          libgif-dev
remote:        0 upgraded, 1 newly installed, 0 to remove and 90 not upgraded.
remote:        Need to get 20.3 kB of archives.
remote:        After this operation, 119 kB of additional disk space will be used.
remote:        Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libgif-dev amd64 4.1.6-11 [20.3 kB]
remote:        Fetched 20.3 kB in 0s (87.7 kB/s)
remote:        Download complete and in download only mode
remote: -----> Installing libgd2-xpm-dev_2.1.0-3_all.deb
remote: -----> Installing libgd-dev_2.1.0-3_amd64.deb
remote: -----> Installing libgif-dev_4.1.6-11_amd64.deb
remote: -----> Installing libvpx-dev_1.3.0-2_amd64.deb
remote: -----> Installing libxpm-dev_1%3a3.5.10-1_amd64.deb
remote: -----> Writing profile script
remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs
remote: =====> Detected Framework: Node.js
remote: 
remote: -----> Creating runtime environment
remote:        
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NPM_CONFIG_PRODUCTION=true
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote: 
remote: -----> Installing binaries
remote:        engines.node (package.json):  0.12.7
remote:        engines.npm (package.json):   2.13.2
remote:        
remote:        Downloading and installing node 0.12.7...
remote:        Downloading and installing npm 2.13.2 (replacing version 2.11.3)...
remote: 
remote: -----> Restoring cache
remote:        Skipping cache (new runtime signature)
remote: 
remote: -----> Building dependencies
remote:        Pruning any extraneous modules
remote:        Installing node modules (package.json)
remote:        
remote:        > node-gd@0.5.3 install /tmp/build_fa2bb26f8b6349e151cc62491a86b973/node_modules/node-gd
remote:        > node-gyp rebuild
remote:        
remote:        make: Entering directory `/tmp/build_fa2bb26f8b6349e151cc62491a86b973/node_modules/node-gd/build'
remote:          CXX(target) Release/obj.target/node_gd/cpp/node-gd.o
remote:          SOLINK_MODULE(target) Release/obj.target/node_gd.node
remote:        /usr/bin/ld: /tmp/build_fa2bb26f8b6349e151cc62491a86b973/.apt/usr/lib/x86_64-linux-gnu/libgd.a(gd.o): relocation R_X86_64_PC32 against symbol `gdImageColorClosestAlpha' can not be used when making a shared object; recompile with -fPIC
remote:        /usr/bin/ld: final link failed: Bad value
remote:        collect2: error: ld returned 1 exit status
remote:        make: *** [Release/obj.target/node_gd.node] Error 1
remote:        make: Leaving directory `/tmp/build_fa2bb26f8b6349e151cc62491a86b973/node_modules/node-gd/build'
remote:        gyp ERR! build error 
remote:        gyp ERR! stack Error: `make` failed with exit code: 2
remote:        gyp ERR! stack     at ChildProcess.onExit (/tmp/build_fa2bb26f8b6349e151cc62491a86b973/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
remote:        gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
remote:        gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
remote:        gyp ERR! System Linux 3.13.0-49-generic
remote:        gyp ERR! command "node" "/tmp/build_fa2bb26f8b6349e151cc62491a86b973/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
remote:        gyp ERR! cwd /tmp/build_fa2bb26f8b6349e151cc62491a86b973/node_modules/node-gd
remote:        gyp ERR! node -v v0.12.7
remote:        gyp ERR! node-gyp -v v2.0.2
remote:        gyp ERR! not ok 
rhardih commented 9 years ago

@drPavka did you manage to find a fix for this? I'm seeing the same error.

remote:        /usr/bin/ld: /tmp/build_e4e210166c93225593c1fa67d5a756e7/.apt/usr/lib/x86_64-linux-gnu/libgd.a(gd.o): relocation R_X86_64_PC32 against symbol `gdImageColorClosestAlpha' can not be used when making a shared object; recompile with -fPIC
remote:        /usr/bin/ld: final link failed: Bad value
remote:        collect2: error: ld returned 1 exit status
remote:        rake aborted!
remote:        CompilationError: error executing "gcc -shared   -fPIC  -O3 -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -L. -fstack-protector -rdynamic -Wl,-export-dynamic -I /tmp/build_e4e210166c93225593c1fa67d5a756e7/vendor/ruby-2.2.3/include/ruby-2.2.0 -I /tmp/build_e4e210166c93225593c1fa67d5a756e7/vendor/ruby-2.2.3/include/ruby-2.2.0/x86_64-linux -I /tmp/build_e4e210166c93225593c1fa67d5a756e7/vendor/ruby-2.2.3/include -L/tmp/build_e4e210166c93225593c1fa67d5a756e7/vendor/ruby-2.2.3/lib -o \"/app/.ruby_inline/ruby-2.2.0/Inline_FastImage_bbac2b6030874ea47494fd3952895412.so\" \"/app/.ruby_inline/ruby-2.2.0/Inline_FastImage_bbac2b6030874ea47494fd3952895412.c\" -lgd ": pid 438 exit 1
remote:        Renamed /app/.ruby_inline/ruby-2.2.0/Inline_FastImage_bbac2b6030874ea47494fd3952895412.c to /app/.ruby_inline/ruby-2.2.0/Inline_FastImage_bbac2b6030874ea47494fd3952895412.c.bad
drPavka commented 9 years ago

No I spend couple of days trying to compile it

and then moved to openshift :)

rhardih commented 9 years ago

I actually managed to get a usable version of libgd by installing the libgd3 package instead.

drPavka commented 9 years ago

Hmm

thanks I will try