OpenRailwayMap icon indicating copy to clipboard operation
OpenRailwayMap copied to clipboard

Compile on Win10 and VS2022 (CE)

Open FrannDzs opened this issue 3 years ago • 5 comments

Hi, I am looking forward to compile the project under Windows 10 64 bit in Visual Studio 2022 Community Edition. How do I configure the environment and compile correctly? Tell me the steps to follow.

Best regards

Franco Paladini

FrannDzs avatar Apr 27 '22 21:04 FrannDzs

Many of the rendering tools (Mapnik) and other utilities are Linux-only or have poor Windows support (I think osmium can run on Windows, but they don't distribute binaries). Installing in a virtual machine is an option if you have decent hardware specs. The database updating does like lots of RAM and threads. I have 48GB RAM and gave the VM 20 GB. I have a 12 core/24 thread processor and allocated 12 cores (threads) to the VM. This allows me to boost the number of threads used in database updates and threads available to the tile renderer.

Running your virtual disks on a SSD is a MUST! The OSM download for the entire planet is around 70 GB and you'll want room for 1 more since the update process creates another 70 GB temporary file before merging. Having room for a second or third copy backup copy is a good idea, I've seen frequent corruption of the planet file (may be a quirk of my setup or Virtual Box). You also need room for the tiles.

I use Virtual Box with Ubuntu 20.04 LTS with great results. I did update to 22.04 but I'm having some issues with the node.js API code. One error was fixed by updating a package, not sure about the other.

You can enable host only networking and view the map in your windows browser while the VM runs in the background.

I have not tried Windows Subsystem for Linux with the full setup. WSL doesn't have a GUI (which may be OK). I did try WSL with some of the osmium tools (which worked) but I found that WSL and Hyper-V broke my other VMs so stopped using it.

JonathanBittner avatar May 03 '22 17:05 JonathanBittner

Many of the rendering tools (Mapnik) and other utilities are Linux-only or have poor Windows support (I think osmium can run on Windows, but they don't distribute binaries). Installing in a virtual machine is an option if you have decent hardware specs. The database updating does like lots of RAM and threads. I have 48GB RAM and gave the VM 20 GB. I have a 12 core/24 thread processor and allocated 12 cores (threads) to the VM. This allows me to boost the number of threads used in database updates and threads available to the tile renderer.

Running your virtual disks on a SSD is a MUST! The OSM download for the entire planet is around 70 GB and you'll want room for 1 more since the update process creates another 70 GB temporary file before merging. Having room for a second or third copy backup copy is a good idea, I've seen frequent corruption of the planet file (may be a quirk of my setup or Virtual Box). You also need rome for the tiles.

I use Virtual Box with Ubuntu 20.04 LTS with great results. I did update to 22.04 but I'm having some issues with the node.js API code. One error was fixed by updating a package, not sure about the other.

You can enable host only networking and view the map in your windows browser while the VM runs in the background.

I have not tried Windows Subsystem for Linux with the full setup. WSL doesn't have a GUI (which may be OK). I did try WSL with some of the osmium tools (which worked) but I found that WSL and Hyper-V broke my other VMs so stopped using it.

Very detailed, excellent response! Thank you. I am bit far from those requirements, sorry.

Now, another question, if I just want to update the language templates how should I proceed? I have been trying to do this since VS 2022 without success. Do I also need a Linux environment?

Best regards

Franco Paladini

FrannDzs avatar May 03 '22 18:05 FrannDzs

Now, another question, if I just want to update the language templates how should I proceed? I have been trying to do this since VS 2022 without success. Do I also need a Linux environment?

Are you talking about the .po files used for localization? I've never worked with them, I imagine it's simple text editing. Though without a setup, you might not be able to test it.

JonathanBittner avatar May 03 '22 23:05 JonathanBittner

Now, another question, if I just want to update the language templates how should I proceed? I have been trying to do this since VS 2022 without success. Do I also need a Linux environment?

Are you talking about the .po files used for localization? I've never worked with them, I imagine it's simple text editing. Though without a setup, you might not be able to test it.

I am referring to the Makefile and scan_legends.py file which are at OpenRailwayMap/tree/master/locals.

How to run that? Do I need Linux? The creation date of the .pot dates back to 2013. I wanted to update the template with that script.

FrannDzs avatar May 04 '22 00:05 FrannDzs

scan_legends.py will run with Python, which can be installed on Windows. There are Windows versions of make that can process the Makefile but I see specific calls to Unix shell commands like rm and there's a tool called msgfmt that's also needed. Might try Cygwin (installs the Unix shell in Windows). Not sure if msgfmt (which is part of GNU gettext package, maybe) is available under Cygwin.

JonathanBittner avatar May 04 '22 02:05 JonathanBittner