OpenNMT Forum

Ctranslate2 on Raspberry 32bit

I have succesfully complied ctranslate2 on R-Pi 64 bit.
Now, I am trying to complile it for 32bit R-pi.
I am getting error while cmake command…make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/ctranslate2.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Steps I have followed -
git clone https://github.com/OpenNMT/CTranslate2.git

cd CTranslate2

git submodule update --init

cmake -DWITH_MKL=OFF -DWITH_CUDA=OFF -DWITH_OPENBLAS=ON -DWITH_DNNL=OFF -DWITH_ACCELERATE=OFF -DOPENMP_RUNTIME=NONE -DWITH_TESTS=ON -DCMAKE_PREFIX_PATH=/opt/OpenBLAS

make -j4 <— error came.
PLease help in this regard.

Can you post the complete CMake output and error log?

for command make -j4
ERROR:
make -j4
[ 1%] Building CXX object CMakeFiles/ctranslate2.dir/src/layers/common.cc.o
[ 1%] Building CXX object CMakeFiles/ctranslate2.dir/src/layers/decoder.cc.o
[ 1%] Building CXX object CMakeFiles/ctranslate2.dir/src/cpu/primitives.cc.o
[ 1%] Building CXX object CMakeFiles/ctranslate2.dir/src/models/model.cc.o
/home/pi/ctranslate2/CTranslate2/src/cpu/primitives.cc:21:12: fatal error: cblas.h: No such file or directory

include <cblas.h>

        ^~~~~~~~~

compilation terminated.
make[2]: *** [CMakeFiles/ctranslate2.dir/build.make:154: CMakeFiles/ctranslate2.dir/src/cpu/primitives.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs…
make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/ctranslate2.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

command - sudo make install
ERROR–
[ 1%] Building CXX object CMakeFiles/ctranslate2.dir/src/cpu/primitives.cc.o
/home/pi/ctranslate2/CTranslate2/src/cpu/primitives.cc:21:12: fatal error: cblas.h: No such file or directory

include <cblas.h>

        ^~~~~~~~~

compilation terminated.
make[2]: *** [CMakeFiles/ctranslate2.dir/build.make:154: CMakeFiles/ctranslate2.dir/src/cpu/primitives.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/ctranslate2.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Did you correctly install OpenBLAS in this location /opt/OpenBLAS?

yes. I think.
image

Looks like you installed it to /opt, not /opt/OpenBLAS.

OpenBlas
issie is resolved

^~~~~~~~~~~~~~~~~
[ 86%] Building CXX object CMakeFiles/ctranslate2.dir/src/translator.cc.o
[ 87%] Building CXX object CMakeFiles/ctranslate2.dir/src/translator_pool.cc.o
[ 89%] Building CXX object CMakeFiles/ctranslate2.dir/src/types.cc.o
[ 91%] Building CXX object CMakeFiles/ctranslate2.dir/src/utils.cc.o
[ 93%] Building CXX object CMakeFiles/ctranslate2.dir/src/vocabulary.cc.o
[ 94%] Building CXX object CMakeFiles/ctranslate2.dir/src/vocabulary_map.cc.o
[ 96%] Linking CXX shared library libctranslate2.so
[ 96%] Built target ctranslate2
Scanning dependencies of target translate
[ 98%] Building CXX object cli/CMakeFiles/translate.dir/translate.cc.o
[100%] Linking CXX executable translate
/usr/bin/ld: …/libctranslate2.so: undefined reference to ctranslate2::cpu::cpu_supports_avx2()' /usr/bin/ld: ../libctranslate2.so: undefined reference to ctranslate2::cpu::cpu_supports_avx()’
/usr/bin/ld: …/libctranslate2.so: undefined reference to ctranslate2::cpu::cpu_supports_neon()' /usr/bin/ld: ../libctranslate2.so: undefined reference to ctranslate2::cpu::cpu_vendorabi:cxx11
/usr/bin/ld: …/libctranslate2.so: undefined reference to `ctranslate2::cpu::cpu_supports_sse41()’
collect2: error: ld returned 1 exit status
make[2]: *** [cli/CMakeFiles/translate.dir/build.make:86: cli/translate] Error 1
make[1]: *** [CMakeFiles/Makefile2:123: cli/CMakeFiles/translate.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Issue is solved now. Thanks!

1 Like