Sem muito BLÁ BLÁ BLÁ, para compilar a biblioteca e o respectivo exemplo, efetue o download dos fontes utilizando o comando abaixo (git clone), então teremos todo o código-fonte do repositório
GitHub em nosso equipamento de trabalho.
git clone https://github.com/intel/gna
Cloning into 'gna'...
remote: Enumerating objects: 335, done.
remote: Counting objects: 100% (335/335), done.
remote: Compressing objects: 100% (255/255), done.
remote: Total 335 (delta 83), reused 329 (delta 77), pack-reused 0
Receiving objects: 100% (335/335), 405.07 KiB | 3.65 MiB/s, done.
Resolving deltas: 100% (83/83), done.
Agora entre na pasta recém-criada novamente e use o comando cmake e make como no exemplo abaixo.
cmake .
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cabelo/gna/gna-drv-mod.1.2.3/gna
make
Seguindo o exemplo abaixo, entre na pasta samples e use os comandos mkdir, cd e cmake para compilar o exemplo SDK.
cmake .
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/gna/gna-drv-mod.1.2.3/gna/samples
make
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/gna/gna-drv-mod.1.2.3/gna/samples
Scanning dependencies of target sample01
[ 50%] Building CXX object src/sample01/CMakeFiles/sample01.dir/sample01.cpp.o
[100%] Linking CXX executable ../../bin/sample01/sample01
[100%] Built target sample01
Agora testaremos o brinquedo?
cd bin/sample01
./sample01
GNA Hardware Device found: 32
Outputs:
-177 -85 29 28
96 -173 25 252
-160 274 157 -29
48 -60 158 -29
26 -2 -44 -251
-173 -70 -1 -323
99 144 38 -63
20 56 -103 10
Este texto foi escrito por
Official oneAPI Innovator Intel e o membro do openSUSE
Alessandro de Oliveira Faria com base nos tutoriais Intel. Mais informações veja a página oficial:
"O próximo grande salto evolutivo da humanidade será a descoberta de que cooperar é melhor que competir... Pois colaborar atrai amigos, competir atrai inimigos!"