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

macOS: libtool: unrecognized option `-static' #33

Closed
neoneye opened this issue Feb 10, 2018 · 9 comments
Closed

macOS: libtool: unrecognized option `-static' #33

neoneye opened this issue Feb 10, 2018 · 9 comments

Comments

@neoneye
Copy link

neoneye commented Feb 10, 2018

Installation

abcdef:simcity2k neoneye$ git clone https://github.com/rage8885/OpenSC2K
Cloning into 'OpenSC2K'...
remote: Counting objects: 2172, done.
remote: Compressing objects: 100% (2056/2056), done.
remote: Total 2172 (delta 134), reused 2129 (delta 111), pack-reused 0
Receiving objects: 100% (2172/2172), 25.82 MiB | 4.40 MiB/s, done.
Resolving deltas: 100% (134/134), done.
abcdef:simcity2k neoneye$ cd OpenSC2K
abcdef:OpenSC2K neoneye$ npm install

> [email protected] install /Users/neoneye/git/simcity2k/OpenSC2K/node_modules/integer
> node tools/install

  CXX(target) Release/obj.target/integer/src/integer.o
  SOLINK_MODULE(target) Release/integer.node

> [email protected] install /Users/neoneye/git/simcity2k/OpenSC2K/node_modules/better-sqlite3
> node deps/install

==> cwd: /Users/neoneye/git/simcity2k/OpenSC2K/node_modules/better-sqlite3
==> /Users/neoneye/git/simcity2k/OpenSC2K/node_modules/lzz-gyp/lzz-compiled/osx -hx hpp -sx cpp -k BETTER_SQLITE3 -d -hl -sl -e ./src/better_sqlite3.lzz
==> cwd: /Users/neoneye/git/simcity2k/OpenSC2K/node_modules/better-sqlite3
==> node-gyp rebuild
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3210000/sqlite3.c
  TOUCH Release/obj.target/deps/action_before_build.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3210000/sqlite3.o
  LIBTOOL-STATIC Release/sqlite3.a
libtool: unrecognized option `-static'
libtool: Try `libtool --help' for more information.
make: *** [Release/sqlite3.a] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:160:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Darwin 17.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/neoneye/git/simcity2k/OpenSC2K/node_modules/better-sqlite3
gyp ERR! node -v v9.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Error: exit code 1
    at ChildProcess.<anonymous> (/Users/neoneye/git/simcity2k/OpenSC2K/node_modules/lzz-gyp/lib/exec.js:19:12)
    at ChildProcess.emit (events.js:160:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node deps/install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install 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!     /Users/neoneye/.npm/_logs/2018-02-10T12_52_39_039Z-debug.log

Environment

abcdef:OpenSC2K neoneye$ libtool --version
libtool (GNU libtool) 2.4.2
Written by Gordon Matzigkeit <[email protected]>, 1996

Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
abcdef:OpenSC2K neoneye$ npm --version
5.6.0
abcdef:OpenSC2K neoneye$ clang --version
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
abcdef:OpenSC2K neoneye$

Thank you for OpenSC2K

Cool project.

@cursorial
Copy link

Remove your directory and then follow the instructions from the README directly - you missed a few steps:

OS X

  1. git clone https://github.com/rage8885/OpenSC2K or download this repository
  2. cd OpenSC2K
  3. npm install downloads and installs the dependancies
  4. node_modules/.bin/electron-rebuild -f -w better-sqlite3 rebuilds Electron with better-sqlite3 bindings
  5. npm start to run

@cursorial
Copy link

I've just noticed that it failed on the npm install step, sorry.

Could you try which libtool and post the output?

@neoneye
Copy link
Author

neoneye commented Feb 10, 2018

It's a local install of libtool

PROMPT> which libtool
/Users/neoneye/bin/libtool
PROMPT> ls -la /Users/neoneye/bin/libtool
lrwxr-xr-x  1 neoneye  staff  27 Dec 10  2013 /Users/neoneye/bin/libtool -> ../stow/libtool/bin/libtool

I can try install a newer version

@cursorial
Copy link

cursorial commented Feb 10, 2018

Try alias libtool='usr/bin/libtool' and then try to remove OpenSC2K dir, clone again and try to reinstall.

@neoneye
Copy link
Author

neoneye commented Feb 10, 2018

Creating an alias for libtool didn't work. Wild speculation. I suspect that NPM doesn't use bash's aliases. I ended up renamed my local libtool, so that the system wide /usr/bin/libtool is being used. I'm not sure what version of libtool it is, since it's provided by Xcode/clang. It takes no --version parameter.

Now the OpenSC2K compiles and installs.

However running npm start does not work.

abcdef:OpenSC2K neoneye$ npm install

> [email protected] install /Users/neoneye/git/OpenSC2K/node_modules/integer
> node tools/install

  CXX(target) Release/obj.target/integer/src/integer.o
  SOLINK_MODULE(target) Release/integer.node

> [email protected] install /Users/neoneye/git/OpenSC2K/node_modules/better-sqlite3
> node deps/install

==> cwd: /Users/neoneye/git/OpenSC2K/node_modules/better-sqlite3
==> /Users/neoneye/git/OpenSC2K/node_modules/lzz-gyp/lzz-compiled/osx -hx hpp -sx cpp -k BETTER_SQLITE3 -d -hl -sl -e ./src/better_sqlite3.lzz
==> cwd: /Users/neoneye/git/OpenSC2K/node_modules/better-sqlite3
==> node-gyp rebuild
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3210000/sqlite3.c
  TOUCH Release/obj.target/deps/action_before_build.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3210000/sqlite3.o
  LIBTOOL-STATIC Release/sqlite3.a
  CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
  SOLINK_MODULE(target) Release/better_sqlite3.node
  CC(target) Release/obj.target/test_extension/deps/test_extension.o
  SOLINK_MODULE(target) Release/test_extension.node
added 4 packages in 32.698s
abcdef:OpenSC2K neoneye$ node_modules/.bin/electron-rebuild -f -w better-sqlite3
✔ Rebuild Complete
abcdef:OpenSC2K neoneye$ npm start

> [email protected] start /Users/neoneye/git/OpenSC2K
> electron .

/Users/neoneye/git/OpenSC2K/node_modules/electron/index.js:9
  throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
  ^

Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
    at Object.<anonymous> (/Users/neoneye/git/OpenSC2K/node_modules/electron/index.js:9:9)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/neoneye/git/OpenSC2K/node_modules/electron/cli.js:3:16)
    at Module._compile (module.js:660:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `electron .`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start 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!     /Users/neoneye/.npm/_logs/2018-02-10T22_13_41_909Z-debug.log
abcdef:OpenSC2K neoneye$

@cursorial
Copy link

You missed a step between npm install and npm start.

Try:

  1. Remove directory
  2. Clone again, cd into directory
  3. npm install
  4. node_modules/.bin/electron-rebuild -f -w better-sqlite3
  5. npm start

@neoneye
Copy link
Author

neoneye commented Feb 11, 2018

You missed a step between npm install and npm start

I followed all the steps as described, including step 4.

I didn't copy/paste the sequence of rm, git clone, cd, since these steps are kind of trivial.

@cursorial
Copy link

cursorial commented Feb 11, 2018 via email

@neoneye
Copy link
Author

neoneye commented Feb 11, 2018

abcdef:docker_poc neoneye$ cat /Users/neoneye/.npm/_logs/2018-02-10T22_13_41_909Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/neoneye/git/OpenSC2K/node_modules/.bin:/Users/neoneye/.rvm/gems/ruby-2.3.0/bin:/Users/neoneye/.rvm/gems/ruby-2.3.0@global/bin:/Users/neoneye/.rvm/rubies/ruby-2.3.0/bin:/usr/local/opt/libxml2/bin:/usr/local/heroku/bin:/usr/local/apache-maven/apache-maven-3.2.3/bin:/Users/neoneye/bin:/usr/local/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/opt/X11/bin:/usr/local/apache-derby/db-derby-10.11.1.1-bin/bin:/Users/neoneye/.rvm/bin
9 verbose lifecycle [email protected]~start: CWD: /Users/neoneye/git/OpenSC2K
10 silly lifecycle [email protected]~start: Args: [ '-c', 'electron .' ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `electron .`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack     at EventEmitter.emit (events.js:160:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:160:13)
13 verbose stack     at maybeClose (internal/child_process.js:943:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/neoneye/git/OpenSC2K
16 verbose Darwin 17.3.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
18 verbose node v9.4.0
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `electron .`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
abcdef:docker_poc neoneye$

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

3 participants