Giter Site home page Giter Site logo

Installation about node-osrm HOT 10 CLOSED

project-osrm avatar project-osrm commented on June 30, 2024
Installation

from node-osrm.

Comments (10)

springmeyer avatar springmeyer commented on June 30, 2024

Options:

  1. Project-OSRM gets installed somewhere predictable (like /usr/local) and then starts offering a script like osrm-config that can be queried for build details or provides pkg-config compatible files to declare where it is and how to build against it. The CMAKE scripts Project-OSRM uses may have this ability but I've not seen it - @DennisOSRM will know.

  2. Project-OSRM gets built in place wherever you choose and npm install osrm will require a flag like --osrm=/usr/local be passed.

  3. Project-OSRM enables libOSRM to be built as a static library and then node-OSRM is packaged fully standalone and can be installed without needing to build against Project-OSRM

Option 1 Is the most traditional route and would require work in both Project-OSRM build scripts and node-OSRM builds scripts. Option 2 Is something I've tried and gave up on because of challenges with gyp and relative paths (I could return to this but would prefer not). Option 3 Is a great solution for non-developers but not a full solution.

from node-osrm.

willwhite avatar willwhite commented on June 30, 2024

For deployment and testing we will need to add node-osrm to a package.json file so I'm not sure option 2 will work in that case. Options 1 sounds like the most promising. What all is involved with that work?

from node-osrm.

DennisOSRM avatar DennisOSRM commented on June 30, 2024

The cmake script doesn't have the pkg-config functionality built-in.

from node-osrm.

DennisOSRM avatar DennisOSRM commented on June 30, 2024

Project-OSRM/osrm-backend@c3396fa partially implements this. Files are installed, and pkg-config follows shortly.

from node-osrm.

springmeyer avatar springmeyer commented on June 30, 2024

Now that the command line programs and libOSRM are installed the next (final?) thing needed are headers: Project-OSRM/osrm-backend#842

from node-osrm.

DennisOSRM avatar DennisOSRM commented on June 30, 2024

This is now implemented with Project-OSRM/osrm-backend@991c9f2 and 118058e

Works reasonably well:

$ make clean; make
rm -f lib/_osrm.node
rm -f *.osrm*
./node_modules/.bin/node-gyp configure
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info spawn python
gyp info spawn args [ '/Users/dennisluxen/Coding/node-osrm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/dennisluxen/Coding/node-osrm/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/dennisluxen/Coding/node-osrm/common.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/dennisluxen/Coding/node-osrm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/dennisluxen/.node-gyp/0.10.22/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/dennisluxen/.node-gyp/0.10.22',
gyp info spawn args   '-Dmodule_root_dir=/Users/dennisluxen/Coding/node-osrm',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok 
./node_modules/.bin/node-gyp build
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/osrm/src/node_osrm.o
  SOLINK_MODULE(target) Release/osrm.node
ld: warning: option -s is obsolete and being ignored
ld: warning: option -s is obsolete and being ignored
  SOLINK_MODULE(target) Release/osrm.node: Finished
  COPY ../lib/osrm.node
  TOUCH Release/obj.target/action_after_build.stamp
gyp info ok 

and

$ make test
npm test

> [email protected] test /Users/dennisluxen/Coding/node-osrm
> mocha -R spec

  osrm
    ✓ should throw if new keyword is not used 
    ✓ should throw if invalid args are passed 
    - should throw if ini file is blank
    - should throw if ini file does not exist
    - should throw if files referenced by ini do not exist
    - should throw if ini references corrupt files
    ✓ should be initialized 
    ✓ should throw if insufficient coordinates given 
    ◦ should return results for berlin using sync api: . 10% . 20% . 30% . 40% . 50% . 60% . 70% . 80% . 90% . 100%
    ✓ should return results for berlin using sync api (603ms)
    ◦ should return results for berlin using sync api and shared memory: . 10% . 20% . 30% . 40% . 50% . 60% . 70% . 80% . 90% . 100%
    ✓ should return results for berlin using sync api and shared memory (600ms)

  6 passing (1s)
  4 pending

from node-osrm.

ianshward avatar ianshward commented on June 30, 2024

In master I'm looking at the README and it says to install node-osrm do:

git clone https://github.com/DennisOSRM/node-osrm.git
cd node-osrm
npm install

however, this does not build the binary. If I run make before or after running npm install, it is built. Is the plan to only have to run npm install?

from node-osrm.

ianshward avatar ianshward commented on June 30, 2024

Ah, I see this uses node-pre-gyp now, so I think maybe all that's missing is:

@springmeyer does this sound right?

from node-osrm.

springmeyer avatar springmeyer commented on June 30, 2024

@ianshward - yes, exactly

Okay, this is basically done - thanks everyone for the work to get there.

  • OSRM core (in develop branch) now provides a static lib and an awesome pkg-config file.
  • node-osrm now uses pkg-config to predictably build against OSRM no matter where it was installed
  • Binaries for users not wishing to develop node-osrm are close to ready and their completion will be tracked at #30

from node-osrm.

springmeyer avatar springmeyer commented on June 30, 2024

@ianshward - install/developer section now fixed up in readme, thanks for catching that: https://github.com/DennisOSRM/node-osrm/blob/master/README.md#installing

from node-osrm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.