-
Notifications
You must be signed in to change notification settings - Fork 165
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
Trouble installing on Win Server 2012 #202
Comments
Hi @dstrawberrygirl - thanks for the report. What node-mapnik are you trying to build? Can you make sure you are using the latest release: v1.2.3? My hunch is that what you are hitting was fixed in dd8c929#diff-71e2bf615b78255a0b69da384a16851d |
I'll add that I see now you are just running So what I recommend is to:
git clone https://github.com/mapnik/node-mapnik.git
cd node-mapnik
It is located at "~.node-gyp\NODE_VERSION\common.gypi"
'VCCLCompilerTool': {
'ExceptionHandling': 1,
'RuntimeTypeInfo':'true',
'RuntimeLibrary': '2' # /MD http://stackoverflow.com/questions/757418/should-i-compile-with-md-or-mt
} The reason is that these overrides are not working (last I checked): Line 61 in 05b10a1
Run
|
That sounds very promising! I just saw the npm install was grabbing 0.7.25 and was about to reply when I saw your latest message. I'll grab from github and give this a go as soon as I can, thanks! |
Oh, odd. That is my fault. Should be fixed now since I just tagged a new v1.x series. The gocha is that 1.x requires libprotobuf (which v0.7.x does not). Pretty sure I packageds libprotobuf with the Mapnik v2.2.0 SDK, but if not here are build instructions: https://github.com/mapnik/mapnik-packaging/blob/master/windows/building_mapnik_dependencies.md#protobuf |
I'm still having no luck with the npm install so I've tried to do the manual process of compiling all prerequisites, but after a day of working slowly through the list I'm just hitting more and more errors, each taking significant time to resolve. I got as far as libpq - nmake /f win32.mak resulted in numerous missing file errors, and I have left it at that. Is there a more simple way to achieve this? Is there just a folder of files I can put on a server without having to rebuild everything? |
Ooof, sorry. The idea is that you should be able to compile node-mapnik against the Mapnik v2.2.0 Windows SDK mentioned at http://mapnik.org/download/ which includes all key deps. All you should need to your compiler toolchain ready. If that is not easy to get working, let me know and I can post a binary of node-mapnik that works with Mapnik v2.2.0 and visual studio 2010 early next week. |
+1 for a binary of node-mapnik. |
@BergWerkGIS It will be 32 only bit for now - that work? |
@BergWerkGIS also, in relation to your error at http://gis.stackexchange.com/questions/81539/install-node-mapnik-on-windows, what VS Studio C++ compiler version are you using? |
@springmeyer Sure, anything that would get me up and running on Windows would be great. Good point about VS version: On the first machine I tried, 2008, 2010, 2012 and 2013, but I haven't checked which version was actually used. |
By removing
|
@BergWerkGIS - great work. Can you add the |
After Error messages, when adding back
C:\dev2\node-mapnik\npm-debug.log:
Error, when I try to use a shapefile as datasource:
index.js:
wien.xml:
Contents of
Any idea what's missing? |
If you are using node-mapnik master, I removed auto-plugin registration, so you need |
Oh yeah! That did it. Finally back to VS2013 and NodeTools for VS. Thanks! |
@BergWerkGIS - that is great news. I'm still planning binaries, but have not found the time. In fact, I'm curious whether you might be interesting in taking on producing binaries. I could mentor you through the steps needed. It would basically be 1) learning node-pre-gyp, 2) drafting up a script to build node-mapnik against a few different node versions like is done here, and 3) a quick .bat to copy all dependent libraries (and input plugins, etc) into |
@springmeyer |
@springmeyer
Can you give any hints? |
Great progress. The cb() never called error is a node bug in v0.8.x versions than can be triggered when installing packages from git urls. So I think to workaround we should modify the node-mapnik package json to actually point to a node-pre-gyp tag so it does not pull from github. Can you try that? |
@springmeyer npm-debug.log:
|
Hmm. I think you are right. Maybe try upgrading to the latest npm while sticking with the modiste version of node itself. So the trick will be to override nodists version of npm. |
@springmeyer x64 build does not work, but I suppose you suspected that already (since mapnik sdk is x86):
Which additional files would be needed for step 3): "a quick .bat to copy all dependent libraries (and input plugins, etc) into |
Great that upgrading npm fixed this! Regarding 64 bit Mapnik. Right, the existing SDK only comes as 32 bit. We really need to provide a 64 bit one. Maybe this is also something you would be capable of working on? How about we catch up through LinkedIn on this. I am free on Tuesday, so will be in touch. Regarding step 3. I think all the dependent libs in the SDK lib folder will be needed. If they are dropped in the same directory as the 'mapnik.node' module then the build should be portable across systems. As far as input plugins these also need to be copied but can be anywhere, they just need to be referenced with a relative path in the 'mapnik_settings.js'. I think my scripts to do this on windows love in the tilemill/platforms/windows/package.bat but I'll need to check on Monday. The node-Mapnik/scripts directory has a work in progress scripts like this for Linux and osx. On Feb 2, 2014, at 10:25 AM, Wilhelm Berg [email protected] wrote:
|
Is there any new info on this? I'm also struggling with installing node-mapnik on Windows 8.1. I was able to successfully run the c++ and python mapnik demos, so all the paths are correctly set up. I'm using python 2.7 32bit. Also I have protobuf compiled at When I run
|
hi @calin-s - nice job making it this far. We are very close to providing official binaries for windows - at most a week or so away. That said the problem you are encountering is a result of a workaround for a bug in the binding.gyp logic on windows. Right now the path to the |
hey @springmeyer thanks for the encouragement, I was starting to feel very stupid. I'm up and running now, thanks!! One quick, unrelated question: my best bet for learning how to use it is, I guess, to check out the tests and sample code (https://github.com/mapnik/node-mapnik/blob/master/test and https://github.com/mapnik/node-mapnik-sample-code), since there isn't any API site with the exact methods you can use, right? And considering that I would like to skip python for now because I'm only trying to render some PostGIS data into a slippy map, and node.js is something I'm more familiar with. |
@calin-s great you got things working. Correct on learning resources. But I plan to write API docs: #235. The bindings are robust and supported - definitely a solid replacement to python, but yeah, I need to write some docs. If you get inspired as you learn feel free to add the https://github.com/mapnik/node-mapnik/wiki/API and ask me questions if you need help. |
@springmeyer nice, I'll go for it, and try to contribute to the API if I can. I suppose you're preferred contact method is by email, so I'll do that if absolutely necessary :) |
My preferred method actually is github issues. |
Ok thanks. |
yay, as of node-mapnik 1.4.8 we are now officially providing windows binaries - updated docs in 59d4a9f. |
I've downloaded Mapnik v2.2.0 SDK and have VC++ 2008, 2010 and 2012 now installed on my server. The Mapnik demos work without issues, but when I try installing node-mapnik (npm install mapnik on the command line) I get errors during node-gyp rebuild compiling one of the files. The first few errors are as follows:
..\src\mapnik_palette.cpp(90): error C2079: 'str' uses undefined class 'std::ba
sic_ostringstream<_Elem,_Traits,_Alloc>' [c:\Tools\node_modules\mapnik\build_m
apnik.vcxproj]
with
[
_Elem=char,
_Traits=std::char_traits,
_Alloc=std::allocator
]
..\src\mapnik_palette.cpp(90): error C2440: 'initializing' : cannot convert fro
m 'const char [1]' to 'int' [c:\Tools\node_modules\mapnik\build_mapnik.vcxproj
]
There is no context in which this conversion is possible
..\src\mapnik_palette.cpp(91): error C2297: '<<' : illegal, right operand has t
ype 'const char [10]' [c:\Tools\node_modules\mapnik\build_mapnik.vcxproj]
(Similar errors continue throughout the rest of that script, I can provide the whole console output if needed).
The rest of the source seems to compile with just warnings, but when mapnik_palette.cpp appears in the list I get a slew of red. I'm hoping it's something simple.
Any advice would be very much appreciated.
Thanks,
Chris
The text was updated successfully, but these errors were encountered: