nicholas-ochoa / OpenSC2K

OpenSC2K - An Open Source remake of Sim City 2000 by Maxis
GNU General Public License v3.0
4.98k stars 87 forks source link

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

Closed neoneye closed 6 years ago

neoneye commented 6 years ago

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

> integer@1.0.3 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

> better-sqlite3@4.1.0 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! better-sqlite3@4.1.0 install: `node deps/install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the better-sqlite3@4.1.0 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 <gord@gnu.ai.mit.edu>, 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 commented 6 years ago

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 commented 6 years ago

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

Could you try which libtool and post the output?

neoneye commented 6 years ago

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 commented 6 years ago

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

neoneye commented 6 years ago

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

> integer@1.0.3 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

> better-sqlite3@4.1.0 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

> OpenSC2K@0.0.1 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! OpenSC2K@0.0.1 start: `electron .`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the OpenSC2K@0.0.1 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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Can you post the contents of /Users/neoneye/.npm/_logs/ 2018-02-10T22_13_41_909Z-debug.log

On Feb 11, 2018 1:29 AM, "Simon Strandgaard" notifications@github.com wrote:

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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rage8885/OpenSC2K/issues/33#issuecomment-364711081, or mute the thread https://github.com/notifications/unsubscribe-auth/ACKQrmg4yFHfHIQuOJJnKDIMem6VVOHmks5tTkKDgaJpZM4SA69v .

neoneye commented 6 years ago
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 npm@5.6.0
3 info using node@v9.4.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle OpenSC2K@0.0.1~prestart: OpenSC2K@0.0.1
6 info lifecycle OpenSC2K@0.0.1~start: OpenSC2K@0.0.1
7 verbose lifecycle OpenSC2K@0.0.1~start: unsafe-perm in lifecycle true
8 verbose lifecycle OpenSC2K@0.0.1~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 OpenSC2K@0.0.1~start: CWD: /Users/neoneye/git/OpenSC2K
10 silly lifecycle OpenSC2K@0.0.1~start: Args: [ '-c', 'electron .' ]
11 silly lifecycle OpenSC2K@0.0.1~start: Returned: code: 1  signal: null
12 info lifecycle OpenSC2K@0.0.1~start: Failed to exec start script
13 verbose stack Error: OpenSC2K@0.0.1 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 OpenSC2K@0.0.1
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 OpenSC2K@0.0.1 start: `electron .`
22 error Exit status 1
23 error Failed at the OpenSC2K@0.0.1 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$