Zephyr hello world application failed for ESP32 - build

OS: Ubuntu 18.04,64bit (New Installed)
Zephyr Version: 2.2.99
Zephyr SDK Version: 0.11.2
xtensa-esp32-elf-gcc Version: 5.2.0 --build=x86_64-build_pc-linux-gnu
As per getting started guide for Zephyr and esp, we have set environment variable.
export ZEPHYR_TOOLCHAIN_VARIANT="espressif"
export ESPRESSIF_TOOLCHAIN_PATH="/home/swapna/Documents/Workspace/esp/xtensa-esp32-elf"
export ZEPHYR_SDK_INSTALL_DIR="/home/swapna/Documents/Workspace/Zephyr_ESP/zephyr-sdk"
We building hello_world application:
west build -b esp32 samples/hello_world
[84/122] Building ASM object modules/xtensa/CMakeFiles/modules_xtensa_hal.dir/src/hal/cache_asm.S.obj
FAILED: modules/xtensa/CMakeFiles/modules_xtensa_hal.dir/src/hal/cache_asm.S.obj
ccache /home/swapna/Documents/Workspace/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc -DBUILD_VERSION=zephyr-v2.2.0-844-g6c2451c5c0a6 -DKERNEL -D_FORTIFY_SOURCE=2 -D__ZEPHYR__=1 -I/home/swapna/Documents/Workspace/Zephyr_ESP/zp/zephyr/include -Izephyr/include/generated -I/home/swapna/Documents/Workspace/Zephyr_ESP/zp/zephyr/soc/xtensa/esp32 -I/home/swapna/Documents/Workspace/Zephyr_ESP/zp/zephyr/soc/xtensa/esp32/include -I/home/swapna/Documents/Workspace/Zephyr_ESP/zp/modules/hal/esp-idf/zephyr/../components/esp32/include -I/home/swapna/Documents/Workspace/Zephyr_ESP/zp/modules/hal/esp-idf/zephyr/../components/soc/esp32/include -I/home/swapna/Documents/Workspace/Zephyr_ESP/zp/modules/hal/xtensa/include -I/home/swapna/Documents/Workspace/Zephyr_ESP/zp/modules/hal/xtensa/zephyr/soc/esp32 -isystem /home/swapna/Documents/Workspace/Zephyr_ESP/zp/zephyr/lib/libc/minimal/include -isystem /home/swapna/Documents/Workspace/esp/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/include -isystem /home/swapna/Documents/Workspace/esp/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/include-fixed -Os -imacros/home/swapna/Documents/Workspace/Zephyr_ESP/zp/zephyr/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -xassembler-with-cpp -imacros/home/swapna/Documents/Workspace/Zephyr_ESP/zp/zephyr/include/toolchain/zephyr_stdint.h -D_ASMLANGUAGE -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -ffunction-sections -fdata-sections -mlongcalls -nostdinc -MD -MT modules/xtensa/CMakeFiles/modules_xtensa_hal.dir/src/hal/cache_asm.S.obj -MF modules/xtensa/CMakeFiles/modules_xtensa_hal.dir/src/hal/cache_asm.S.obj.d -o modules/xtensa/CMakeFiles/modules_xtensa_hal.dir/src/hal/cache_asm.S.obj -c /home/swapna/Documents/Workspace/Zephyr_ESP/zp/modules/hal/xtensa/src/hal/cache_asm.S
/home/swapna/Documents/Workspace/Zephyr_ESP/zp/modules/hal/xtensa/src/hal/cache_asm.S: Assembler messages:
/home/swapna/Documents/Workspace/Zephyr_ESP/zp/modules/hal/xtensa/src/hal/cache_asm.S:186: Error: unknown opcode or format name 'declfunc'

There is a mistake in environment path.
1. ESPRESSIF_TOOLCHAIN_PATH
Build the esp32's hello world application using esp_guide.
As per the documentation about how to build the toolchain path is set in
$HOME/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/
Changed this setting and tried building again. Again build failed error
Build still getting failed. I checked the issues related to esp32 on the github. Came across with this.
So, I modified in the code as per the changes mentioned in the commit. And Voila!! It worked. Successfully build and flashed on esp32.

Here is updated version of the environment setup:
https://docs.zephyrproject.org/latest/boards/xtensa/esp32/doc/index.html
You can now use west espressif install and west espressif update to manage toolchain. Still, you need to provide path to toolchain binaries in environmental variables, i.e add this to your ~/.profile:
export ESPRESSIF_TOOLCHAIN_PATH="${HOME}/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf"
export PATH=$PATH:$ESPRESSIF_TOOLCHAIN_PATH/bin

Related

R installation of package `later` fails

Software info:
Linux Kernel: 4.14.83-1-MANJARO
R: 3.5.1
Rcpp: 1.0.0
g++ g++ (GCC) 8.2.1 20180831
I'm trying to install the later package from CRAN, but it fails due to a compilation error and I can't figure out whether there is something wrong with my own configuration or the package. The installation stops after the call
g++ -I"/usr/include/R/" -DNDEBUG -pthread -DTHREADS_H_SUPPORT=1 -I"/home/karpfen/R-libs/Rcpp/include" -I"/usr/lib/R/library/BH/include" -D_FORTIFY_SOURCE=2 -fopenmp -fpic -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -c timestamp_win32.cpp -o timestamp_win32.o
with the error message
make: *** No rule to make target '-fopenmp', needed by 'later.so'. Stop.
Rcpp and other packages depending on it work as expected. Is there anything that I could be doing wrong here? I tried reinstalling R + packages already, but no changes here.
Edit:
The first few lines of the installation output are
* installing *source* package ‘later’ ...
** package ‘later’ successfully unpacked and MD5 sums checked
Running configure script
Using CC=gcc
Using CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt
Using CPPFLAGS=-D_FORTIFY_SOURCE=2
C11-style threads.h support detected.
Edit2:
System information (from /etc/lsb-release)
DISTRIB_ID=ManjaroLinux
DISTRIB_RELEASE=18.0.0
DISTRIB_CODENAME=Illyria
DISTRIB_DESCRIPTION="Manjaro Linux"

How to force Bazel to use gcc?

Ubuntu 17.10
GCC Version: 5.4
Bazel Version: 0.9.0
TensorFlow: r1.5
CUDA 8.0 / cuDNN 6 / GTX 1080 Ti
How do I make Bazel use gcc for building TensorFlow from source?
While building, its running into compiler errors like:
error: 'errno' was not declared in this scope
while (nanosleep(&ts, &ts) != 0 && errno == EINTR) {}
Setting --verbose_failures flag, it shows that its not using /usr/bin/gcc-5 or /usr/bin/gcc for compiling
external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections -g0 -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK '-march=native' '-std=c++11' -g0 -MD -MF
Searching online, I found that the path to gcc and CC, CXX variables must be set in tools/cpp/CROSSTOOL. But where exactly is tools/cpp/CROSSTOOL?? How do I force bazel to use gcc-5?
I know next to nothing about cuda and tensorflow, but tensorflow doesn't use the same C++ toolchain that bazel autoconfigures when compiling with cuda, so the CC env variable trick won't work. The file crosstool_wrapper_driver_is_not_gcc is just a shell wrapper that could in theory still call your gcc (or it will be cuda). I'd run bazel with --subcommands to see the complete invocation of the failing action, then reproduce without bazel, and then go from there.

While installing on OSX Sierra via gcc-6, keep having "FATAL:/opt/local/bin/../libexec/as/x86_64/as: I don't understand 'm' flag!" error

Environment info
Operating System:
macOS 10.12.2 (16C68)
Compiler:
gcc-6
Steps to reproduce
I've installed gcc-6 and modified config.mk as required into
export CC = gcc-6
export CXX = g++-6
But keep having this error:
g++-6 -c -std=c++0x -Wall -Wno-unknown-pragmas -Iinclude -Idmlc-core/include -Irabit/include -O3 -funroll-loops -msse2 -fPIC -fopenmp src/learner.cc -o build/learner.o
FATAL:/opt/local/bin/../libexec/as/x86_64/as: I don't understand 'm' flag!
What have you tried?
Reinstall XCode
Reinstall gcc
Run make clean_all && make -4j
But still went wrong. Any idea?
I had this issue when using macports-installed gnu assembler. You could try forcing the use of as that comes with Xcode, or simply temporarily removing /opt/local/bin from your path.
I solved by uninstalling MacPorts:
sudo port -f uninstall installed

pylab install error gcc windows 10

So I recently installed Theano on a python 2.7 environment within Anaconda 3, on windows 10. Theano passed theano.test() at least. I am using example code from deeplearning.net. I heva sucessfully run the first block on the linked page which defines a Theano function. When I go to install pylab via pip install pylab so that I can use skimage for the second block, my installer quits while doing some gcc call for the portion that looks like it says "shared geometry". One thing I noticed right away is the -DEBUG flag is misspelled -DDEBUG. Could this be the cause? Does it have something to do with msvcr90.dll and if so what is that and what do I need to do about it? Also, probably important, I'm using a slightly (6 months or so) outdated TDM-GCC which is 4.9 something. Here is the line in question, as well as a few others that might be interesting:
`copying skimage\_shared\tests\__init__.py -> build\lib.win-amd64-2.7\skimage\_shared\tests
running build_ext
Looking for python27.dll
Cannot build msvcr library: "msvcr90d.dll" not found
customize Mingw32CCompiler
customize Mingw32CCompiler using build_ext
building 'skimage._shared.geometry' extension
compiling C sources
C compiler: gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\skimage
creating build\temp.win-amd64-2.7\Release\skimage\_shared
compile options: '-DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x0900 -I"C:\Users\USE DIS\Anaconda3\envs\py27\lib\site-packages\numpy\core\include" -I"C:\Users\USE DIS\Anaconda3\envs\py27\include" -I"C:\Users\USE DIS\Anaconda3\envs\py27\PC" -c'
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x0900 -I"C:\Users\USE DIS\Anaconda3\envs\py27\lib\site-packages\numpy\core\include" -I"C:\Users\USE DIS\Anaconda3\envs\py27\include" -I"C:\Users\USE DIS\Anaconda3\envs\py27\PC" -c skimage\_shared\geometry.c -o build\temp.win-amd64-2.7\Release\skimage\_shared\geometry.o
Found executable C:\Users\USE DIS\Anaconda3\envs\py27\Scripts\gcc.bat
'C:\Users\USE' is not recognized as an internal or external command,
operable program or batch file.
error: Command "gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x0900 -I"C:\Users\USE DIS\Anaconda3\envs\py27\lib\site-packages\numpy\core\include" -I"C:\Users\USE DIS\Anaconda3\envs\py27\include" -I"C:\Users\USE DIS\Anaconda3\envs\py27\PC" -c skimage\_shared\geometry.c -o build\temp.win-amd64-2.7\Release\skimage\_shared\geometry.o" failed with exit status 1
----------------------------------------

How to build Qt 5.1 for QNX target (arm)

new update
I think I should edit the title now.
To make sure I got a clean environment, I
download qt5.1.1 src code from qt-prject.
export QNX_TARGET, QNX_HOST, AND add QNX_HOST into PATH.
then Run the script
./configure -opensource -confirm-license -xplatform qnx-armv7le-qcc -v
so in here, -opensource -confirm-license just avoid the Q&A -v is to show full message.
a lot of error message.
Creating qmake...
make: Nothing to be done for `first'.
Running configuration tests...
Determining architecture... ()
qcc -Vgcc_ntoarmv7le -c -Wno-psabi -lang-c++ -g -Wall -W -fPIE -DQT_NO_CLIPBOARD -I../../mkspecs/qnx-armv7le-qcc -I. -I/opt/qnx650/target/qnx6/usr/include -I/opt/qnx650/target/qnx6/usr/include/freetype2 -o arch.o arch.cpp
Unable to determine architecture!
Could not determine the target architecture!
Turn on verbose messaging (-v) to see the final report.
Determining architecture... ()
g++ -c -pipe -g -Wall -W -fPIE -I../../mkspecs/linux-g++ -I. -o arch.o arch.cpp
g++ -o arch arch.o { test -n "" && DESTDIR="" || DESTDIR=.; } && test $(gdb --version | sed -e 's,[^0-9]\+\([0-9]\)\.\([0-9]\).*,\1\2,;q') -gt 72 && gdb --nx --batch --quiet -ex 'set confirm off' -ex "save gdb-index $DESTDIR" -ex quit 'arch' && test -f arch.gdb-index && objcopy --add-section '.gdb_index=arch.gdb-index' --set-section-flags '.gdb_index=readonly' 'arch' 'arch' && rm -f arch.gdb-index || true
Found architecture in binary
CFG_HOST_ARCH="x86_64"
CFG_HOST_CPUFEATURES=" mmx sse sse2"
System architecture: 'unknown'
Host architecture: 'x86_64'
C++11 auto-detection... ()
qcc -Vgcc_ntoarmv7le -c -Wno-psabi -lang-c++ -O2 -Wc,-std=gnu++0x -Wall -W -fPIE-DQT_NO_CLIPBOARD -I../../../mkspecs/qnx-armv7le-qcc -I. -I/opt/qnx650/target/qnx6/usr/include -I/opt/qnx650/target/qnx6/usr/include/freetype2 -o c++11.o c++11.cpp
C++11 disabled.
floatmath auto-detection... ()
qcc -Vgcc_ntoarmv7le -c -Wno-psabi -lang-c++ -O2 -Wall -W -fPIE -DQT_NO_CLIPBOARD-I../../../mkspecs/qnx-armv7le-qcc -I. -I/opt/qnx650/target/qnx6/usr/include -I/opt/qnx650/target/qnx6/usr/include/freetype2 -o floatmath.o floatmath.cpp
qcc -Vgcc_ntoarmv7le -c -Wno-psabi -lang-c++ -O2 -Wall -W -fPIE -DQT_NO_CLIPBOARD -I../../../mkspecs/qnx-armv7le-qcc -I. -I/opt/qnx650/target/qnx6/usr/include -I/opt/qnx650/target/qnx6/usr/include/freetype2 -o freetype.o freetype.cpp
FreeType disabled.
STL auto-detection... ()
qcc -Vgcc_ntoarmv7le -c -Wno-psabi -lang-c++ -O2 -Wall -W -fPIE -DQT_NO_CLIPBOARD -I../../../mkspecs/qnx-armv7le-qcc -I. -I/opt/qnx650/target/qnx6/usr/include -I/opt/qnx650/target/qnx6/usr/include/freetype2 -o stltest.o stltest.cpp
STL disabled.
STL functionality check failed! Cannot build Qt with this STL library.
Turn on verbose messaging (-v) to /home/pasadeveloper/qt-everywhere-opensourcesrc-5.1.1/qtbase/configure to see the final report.
UPDATE:
I am working on QNX for ARM, target is an arm platform device.
Thing is getting weird. in Env Var, I put
$QNX_CONFIGURATION=/etc/qnx
$QNX_JAVAHOME=/opt/qnx650/_jvm
$QNX_TARGET=/opt/qnx650/target/qnx6
$QNX_HOST=/opt/qnx650/host/linux/x86
but when I do qmake qmake.conf mkspecs/qnx-armv7le-qcc folder
it returns an error message Project ERROR: QNX_TARGET environment variable not set
Have no clue what is going on now.
not just qmake qmake.conf
I try to build qt 5.1.2 at another host, ubuntu 12.04-64bit.
also get the same error message. Project ERROR: QNX_TARGET environment variable not set
I was working at Qt development under linux(FYI Ubuntu 12.04 -64bits), but I need to compile this program to binary for QNX.
I install QNX MOmentics IDE which provide QNX-gcc for me.
but I can't find the qmake-qnx.
Under the QT/gcc_64/mkspecs/qnx-armv7le-qcc, there is a file call qmake.conf. I guess this is where I can generate my qmake-qnx. after I run qmake -o Makefile qmake.conf, there is a Makefile generated.
However, when I run make, error occured.
qcc -Vgcc_ntoarmv7le -lang-c++ -Wl,-rpath-link,/opt/qnx650/target/qnx6/armle-v7/lib -Wl,-rpath-link,/opt/qnx650/target/qnx6/armle-v7/usr/lib -Wl,-O1 -Wl,-O1 -Wl,-rpath,/home/pasadeveloper/Qt5.1.0/5.1.0/gcc_64 -Wl,-rpath,/home/pasadeveloper/Qt5.1.0/5.1.0/gcc_64/lib -o qmake -L/opt/qnx650/target/qnx6/armle-v7/lib -L/opt/qnx650/target/qnx6/armle-v7/usr/lib -lm -L/home/pasadeveloper/Qt5.1.0//5.1.0/gcc_64/lib -lQt5Gui -lQt5Core -lGL -lpthread
cc: no files to process
make: *** [qmake] Error 1
pasadeveloper#ubuntu:~/Qt5.1.0/5.1.0/gcc_64/mkspecs/qnx-armv7le-qcc$
You do not "generate" your qmake-qnx like that. You are supposed to use the native qmake for generating proper makefiles for your target to aid the cross-compilation. Also, running qmake qmake.conf in the relevant mkspecs folder is wrong because that is not a project file as you may think.
When building Qt itself for instance, you should be using the proper mkspecs files for the target in which case, it is the one you also mentioned above if it is built for that particular arm qnx variant, called qnx-armv7le-qcc.
Here is the exact command you need to run after downloading the relevant Qt sources, like 5.1.1:
./configure -opensource -confirm-license -xplatform qnx-armv7le-qcc -v
For this QNX version, the bottom line is, if you do not have SP1 and libscreen, it will not work. The QPA plugin would link against it. This library provides the API to the graphics server on newer QNX variants. You need to talk to your QNX representatives.
Here you can find further information about the topic.
$QNX_TARGET=/opt/qnx650/target/qnx6
is probably not doing what you want. In shell scripts, you don't put a "$" in front of a variable when you are defining the variable, only when you access the variable:
X=hello
echo $X