navit-gps / navit

The open source (GPL v2) turn-by-turn navigation software for many OS
http://www.navit-project.org
Other
540 stars 173 forks source link

Need your help in cross compiling for arm. #1256

Open Shubham8KS opened 5 months ago

Shubham8KS commented 5 months ago

I have successfully compiled and run Navit-0.5.6 on Ubuntu 20.04. Now, I need assistance in running it on Arm, but I'm encountering an error during cross-compilation. Let me outline the steps I've taken:

  1. Install Required Tools: $ sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf

  2. Obtain Source Code: $ git clone https://github.com/navit-gps/navit.git $ cd navit $ mkdir build $ cd build $ CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ cmake ..

While the cmake command runs successfully, I encounter a "static assertion failed" error when I run make -j4. The error originates from /usr/include/glib-2.0/glib/gmacros.h:738:31, specifically:

define G_STATIC_ASSERT(expr) _Static_assert (expr, "Expression evaluates to false")

IMG-20240131-WA0002 IMG-20240131-WA0001 IMG-20240131-WA0003 IMG-20240131-WA0004

I've attempted using CFLAGS and CXXFLAGS, but the error persists:

$ CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ CFLAGS="-march=armv7-a" CXXFLAGS="-march=armv7-a" cmake ..

I've also tried using the Linaro 2019 toolchain, encountering the same issue.

I appreciate your assistance in resolving this problem.

jkoan commented 4 months ago

Try setting the environment variable PKG_CONFIG_LIBDIR to an empty string. It seems that your host system library path is used, which will not work.

jkoan commented 2 months ago

Still relevant? Did it work?

Shubham8KS commented 2 months ago

It's still relevant, but what you said didn't help.

On Sat, Apr 13, 2024, 22:05 jkoan @.***> wrote:

Still relevant? Did it work?

— Reply to this email directly, view it on GitHub https://github.com/navit-gps/navit/issues/1256#issuecomment-2053695890, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJDKN6BP3Y6DBKQNJYS6SJ3Y5FNEPAVCNFSM6AAAAABCTJYDHWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJTGY4TKOBZGA . You are receiving this because you authored the thread.Message ID: @.***>

OLFDB commented 1 week ago

This is definitely a problem in your environment. I just tried with a new Ubuntu 22.04.2 using your commandline and it built fine. Have you cleaned the build folder before trying with PKG_CONFIG_LIBDIR="" ?

Shubham8KS commented 1 week ago

Can you please tell me the steps you performed for cross compilation in Ubuntu 22.04.2 for ARM? And which ARM toolchain did you use? Which versions did you use? Need your help.

OLFDB commented 1 week ago

Fresh install in Parallels VM

sudo apt install git git clone https://github.com/navit-gps/navit.git sudo apt-get install build-essentials sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf cd navit mkdir build cd build CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ cmake .. make -j4

Shubham8KS commented 1 week ago

I successfully cross-compiled for the AM3358 ARM processor by following the steps you mentioned. However, when I attempted to run it in arago-project 21.06, I encountered the following errors:

error: navit:graphics_new: Failed to load graphics plugin gtk_drawing_area. error: navit:event_add_timeout: Can't find event system method add_timeout. Event. error: navit:vehicle_new:invalid source 'gpsd://localhost': unknown type 'gpsd' error: navit:navit_init:FATAL: No graphics subsystem available.

ErrorWeston

OLFDB commented 6 days ago

I'm not familiar with cross compilation for arm, but you'll need to have the needed libraries for arm installed in your cross compile environment.

Standard graphics plugin for navit on Linux is gtk_drawing_area. Download sources for GTK and all required dependencies and build for and install them in your cross compile enviromnment.

For the vehicle gpsd is default on Linux. You need to build and install the gpsd library as well.