gemma.cpp
gemma.cpp copied to clipboard
make error on orangepi 5 (arm)
I'm facing an issue when compiling on orangepi, Debian BookWorm.
I installed first some dependencies :
sudo apt install libhighwayhash-dev libhighwayhash0
But I have such errors ( after command "make gemma", or "make -j4 gemma") :
/home/orangepi/gemma/gemma.cpp/./ops.h:210:13: error: ‘Mul’ was not declared in this scope 210 | return Mul(v, cdf); | ~~~^~~~~~~~
OR :
/home/orangepi/gemma/gemma.cpp/./ops.h:580:40: error: capture by copy of SVE type ‘V’ {aka ‘__SVFloat32_t’} 580 | hn::Transform(d, x, mask_pos, [&sum, max](D d, V v) {
make --version -> GNU Make 4.3 for aarch64-unknown-linux-gnu
I also tried with cmake, with no luck. Thanks.
I think this is related to the namespace issue, which should be resolved in this commit on the dev branch:
https://github.com/google/gemma.cpp/commit/4a0d23f47ee36370e8db429648f58af6fdb9f953
Might try with the dev branch or alternatively I'll be sync'ing dev to main later today after some checking.
All right. I'll have a look later, thank you.
Similar question in Oracle arm server (CPU: 4x ARM Neoverse-N1). I have errors like ops.h:581:40: error: capture by copy of SVE type ‘V’ {aka ‘__SVFloat32_t’}
or ops.h:582:41: error: ‘max’ is not captured
, and it still happend in dev
branch.
solved.
install clang 17 or above
bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
Put it as an alternative to c++
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-18 60
re-run cmake -B build
sudo apt install libhighwayhash-dev libhighwayhash0
FYI highwayhash is not a dependency, but highway is.
For the lambda issue, unfortunately compilers differ in what they permit. Clang indeed seems more permissive. I am changing the code so we do not require such a recent compiler.
the update-alternatives trick did the job. Many thanks. My command list (for my orangepi 5, Debian Bookworm) is :
cmake -B build
sudo apt install clang-16 libclang-rt-16-dev
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-16 60
cd build
make
sudo update-alternatives --remove c++ /usr/bin/clang++-16