Skip to content

cc1: error: unknown value 'native' for '-march' during cross compiling #40

@kunlinyu

Description

@kunlinyu

I try to cross compile GKlib but i failed:

sudo apt install g++-aarch64-linux-gnu
git clone git@github.com:KarypisLab/GKlib.git
cd GKlib
mkdir build && cd build
cmake -DCMAKE_CROSSCOMPILING=ON DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_C_COMPILER=/usr/bin/aarch64-linux-gnu-gcc ..
make

then i got "cc1: error: unknown value 'native' for '-march'"

I think the issue relates to this:
https://github.com/KarypisLab/GKlib/blob/master/GKlibSystem.cmake#L41
and relates to this issue:
#22

here is my system information:

Ubuntu:~/GKlib/build (master)$ uname -a
Linux HV 6.8.0-1018-azure #21~22.04.1-Ubuntu SMP Fri Nov  8 00:21:25 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Ubuntu:~/GKlib/build (master)$ cat /etc/issue
Ubuntu 22.04 LTS \n \l

Ubuntu:~/GKlib/build (master)$ /usr/bin/aarch64-linux-gnu-gcc --version
aarch64-linux-gnu-gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions