Comments (10)
Options:
-
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 providespkg-config
compatible files to declare where it is and how to build against it. The CMAKE scriptsProject-OSRM
uses may have this ability but I've not seen it - @DennisOSRM will know. -
Project-OSRM gets built in place wherever you choose and
npm install osrm
will require a flag like--osrm=/usr/local
be passed. -
Project-OSRM enables
libOSRM
to be built as a static library and thennode-OSRM
is packaged fully standalone and can be installed without needing to build againstProject-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.
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.
The cmake script doesn't have the pkg-config functionality built-in.
from node-osrm.
Project-OSRM/osrm-backend@c3396fa partially implements this. Files are installed, and pkg-config follows shortly.
from node-osrm.
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.
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.
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.
Ah, I see this uses node-pre-gyp now, so I think maybe all that's missing is:
- add "developing" instructions to the readme, like those on osmium's readme https://github.com/osmcode/node-osmium#developing
- create binaries for node-osrm for node v0.10 + debian and get them up on S3.
@springmeyer does this sound right?
from node-osrm.
@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.
@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)
- Odd failure on linux with coverage build HOT 1
- Architecture optimized binaries HOT 1
- Un-mute logging in debug mode HOT 1
- osrm-extract error - attempt to call global 'canonicalizeStringList' (a nil value) HOT 4
- Installing via npm fails to build from source HOT 16
- Bundle osrm-components with node-osrm HOT 5
- Bundle osrm-unlock-all and other tools HOT 4
- Add support for geometries parameter polyline6
- macOS compilation issue with current osrm-backend master HOT 3
- cannot build never than v5.3.3 node-osrm from source HOT 11
- Wrap: Trip with Fixed Start and End points (TFSE) HOT 1
- Can't install node-osrm after install osrm-backend HOT 5
- Failing `annotations` tests HOT 1
- Wrap: Allow annotations parameter to accept specific fields HOT 7
- Expose `generate_hints` Parameter
- Installation issues with node v4.2.6, npm v3.5.2 HOT 2
- Precompiled binaries fail on alpine linux HOT 3
- Deprecate repository HOT 1
- How to use it or run it HOT 2
- dlopen failed: "/node_modules/osrm/lib/binding/node_osrm.node" has bad ELF magic HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-osrm.