Building mapnik 3.0 in raspberry pi - raspberry-pi

I have the latest version of postgis (2.1.8) in my raspberry pi. I could not use the default mapnik version (2.0) available in raspberry pi packages because the newer postgis does not have the functions that the old mapnik looks for.
So, I tried to compile the latest version of mapnik (3.0) . The configure was successful finding all required dependencies. But when I do make, it fails for insufficient memory. Then I increased the swap to 2GB. It still fails for insufficient memory.
I am wondering if there is a way to compile mapnik at smaller steps that do not require so much memory at once.

Legacy PostGIS functions without a ST_ prefix can be loaded on top of any PostGIS database by loading the legacy.sql enabler script that shipped with PostGIS, in the contrib share folder. Run it like this:
psql -d [yourdatabase] -f legacy.sql
Find more on legacy.sql in Chapter 2 of the PostGIS manual.

Related

How to cross-build a debian package for Raspberry Pi OS 64 bit

I have a working debian package that I'd like to backport to the current version of Raspberry Pi OS 64 bit (not 32-bit Raspbian).
Confusingly, while Debian itself seems to be robust about enabling cross-builds in their own package, there seems to be much less official documentation about how raspberry Pi OS (64 bit) packages are built¹.
Since I'm relatively certain this should be possible, I ask:
How to take a debian .dsc / debian rules, and build, on an x86_64, a 64 bit Raspberry Pi OS 64-bit compatible image
without using QEMU to actually build the image on arm64, without access to an actual RPi,
using an existing debian package that is known to work on sid on aarch64, and should be backportable,
making sure it's actually built against the correct set of Raspbian dependencies.
I'm guess this is a rather standard thing, I just don't know how to do it. I'm happy with using containers and similar technology, as I can easily integrate that with CI.
I do not plan to use an Arm64 VM, as the software in question takes about an hour to build and test, on an x86_64 server, natively.
¹I've talked to plugwash of Raspbian fame, and as earlier versions of this question showed: there's significant confusion about the heredity of Raspbian OS 64 bit: It's not Raspbian nor based on it. But people including Wikipedia and the RPi Foundation themselves conflate Raspberry Pi OS and Raspbian ("Raspberry Pi OS, formerly Raspbian"), which is 32 bit only.
RaspberryPi documentation here has explained how to build the x64 kernel from the source. What you want is in a way exactly like that.
Notice this line on the Kernel building page:
sudo apt install crossbuild-essential-arm64
This command on your Linux host machine installs a compiler that runs on an AMD64 machine but produces a binary that runs on an ARM machine.
And this line tells the compiler to actually build the source for that architecture:
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs
Image modules dtbs are specific to your project. they may differ.
As for your Debian package, there is no way that you can transform an AMD64 package into an ARM one. Your package for the RaspberryPi if doesn't exist in an official or some third-party repository, must be built from the source.
Find the source code of your package and build it very similarly to RaspberryOS.
If your Package has dependencies it gets a little more complicated. First, install the dependency on your RaspberryPi. Then you should set up a sysroot on your host machine which is basically a mirror image of the preinstalled packages on RaspberryPi. Then for compiling your package you should give the sysroot address to cross compiler so that it can find dependencies.
There is another way too, you can put the source code of your package on your RaspberryPi and build it locally which can take a very long time based on the source code. Just to have a sense, Qt source code without WebEngine module took 48h for me. But Qt is big.
In conclusion, if your package binary is not on any repository you must compile it from the source.
Cross-compilation of different projects and executables are very similar to each other. To have a clear understanding of the process it can be beneficial to look for some other projects that were ported to RaspberryPi OS. Things like Qt, TagLib for android, and ...
First, I would take a look here:
https://github.com/Truelite/qt5custom for inspiration. I checked and those scritps work. However, you might have problems going completely „qemuless”; e.g. in case of QT some libraries needed to be added to host machine sysroot and qemu was simply the easiest way to add them properly: it seems to me that multiarch Debian has some deficiencies in the field of cross-compilation and the simplest way to overcome them is to pretend it’s the native one.

Ensure standard library linked to boost matches mongo C++ driver's

I want to install MongoDB C++ client. I read in its manual that:
On systems offering multiple C++ standard libraries, you must ensure
that the standard library linked into boost matches that linked into
the driver.
My O.S is ubuntu 14.04.
Does the above quote applies to my system?
How do I ensure which standard library is linked into the boost which I installed apt-get install libboost-all-dev?
In case libboost-all-dev is not linked against c++11, do I need to build from source?
My application is going to be using multi threading, do I need to make sure boost, mongodb C++ client and other libraries are linked using some multi threaded flag?
Ubuntu is not a system that is offering multiple C++ standard libraries. e.g. in ubuntu you would use GPLish libstdc++ and don't need the libc++.
I don't know how to tell whether the boost package for ubuntu was linked with c++11 but it must have since once I matched my mongo to be linked with c++11 it - mongo stopped crashing.
So if you are using ubuntu and want to use mongo legacy c++ driver you should build mongo with the c++11 flag.
for example:
scons --c++11 install

OSM2PGSQL for CentOS 6

I am trying to load the data from planet osm files to postgres database installed on CentOS server. Is there any available binary for CentOS which i can be used. I am not well conversant with C and C++ hence cannot build it from source. Need binary which i can use directly for loading data into postgres on CentOS.
Please help.
There is a long and extensive osm2pgsql wiki page in the OSM wiki which also explains how to build it from source. You don't need any C or C++ knowledge to build packages from source, basic Linux knowledge should be enough.

MongoDB PowerPC installation for Squeeze

Im trying to install MongoDB on Debian Squeeze but I keep on getting an error: Error unable to located package, this I think is because I'm running on powerpc, and on the internet Im only getting client-based installations for MongoDB. I was wondering if there is a server installation of MongoDB for Debian Squeeze PowerPC
PowerPC is not officially supported by 10gen as it requires an Intel processor. While there have been some attempts to make it work -- they're not official.
One is here, but it's very out of date (it's version is 1.8, and the current MongoDB version is 2.2).
The only supported way is to install the MongoDB on an Intel chipset, and use a driver for your favorite programming language to connect to the Database. Those apparently work on PowerPCs, etc. for many languages (according to the docs, but I've never tried it).

Installing postgis in mac

I am trying to install postgis in mac. But I am not sure if I should compile it from the source code or install the binary. When I tried to install the binary it says that I need to install postgresql 9.1 which I already have. What should I do? Are there any clear instructions for installing in mac
When I run into trouble I usually install from source. This gives the configuration and compilers a better chance to tailor everything to your computer. You must have the development libraries for postgresql installed however to make this work with postgis.