Skip to content
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

Need your help in cross compiling for arm. #1256

Open
Shubham8KS opened this issue Jan 31, 2024 · 8 comments
Open

Need your help in cross compiling for arm. #1256

Shubham8KS opened this issue Jan 31, 2024 · 8 comments

Comments

@Shubham8KS
Copy link

Shubham8KS commented Jan 31, 2024

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
Copy link
Member

jkoan commented Feb 11, 2024

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
Copy link
Member

jkoan commented Apr 13, 2024

Still relevant? Did it work?

@Shubham8KS
Copy link
Author

Shubham8KS commented Apr 14, 2024 via email

@OLFDB
Copy link
Contributor

OLFDB commented Jun 23, 2024

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
Copy link
Author

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
Copy link
Contributor

OLFDB commented Jun 24, 2024

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
Copy link
Author

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
Copy link
Contributor

OLFDB commented Jun 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants