FWIW, these are the steps I use (some of them aren't really needed, but it works, so I do it every time):
mkdir ~/E310 ###This is the directory that will be a mount point for your remote E310 sshfs -o allow_root [email protected]:/ ~/E310 ###Your E310's / directory now starts at ~/E310 on your host mkdir ~/E310/home/root/localinstall PREFIX=/opt/gnuradio/test PREFIX_E310=~/E310/home/root/localinstall cd ~/Downloads get your oecore .sh file mine is renamed, so yours will be different chmod +x oecore-x86_64-armv7ahf-neon-toolchain-nodistro.0_rocko_with_qt.sh sh ./oecore-x86_64-armv7ahf-neon-toolchain-nodistro.0_rocko_with_qt.sh -y -d $PREFIX cd $PREFIX source ./environment-setup-armv7ahf-neon-oe-linux-gnueabi echo $CC ###This is just to verify that we have the cross-compile tools setup right. You see armv7 in some of the values mkdir src && cd src (in the next step I am building for RFNoC, most likely you can leave that out if you don't care for it) git clone --recursive -b rfnoc-devel https://github.com/EttusResearch/uhd.git cd uhd git submodule foreach --recursive git checkout rfnoc-devel cd host/ && mkdir arm-build && cd arm-build cmake -DCMAKE_TOOLCHAIN_FILE=../host/cmake/Toolchains/oe-sdk_cross.cmake -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_E300=ON -DENABLE_B100=OFF -DENABLE_X300=OFF -DENABLE_B200=OFF -DENABLE_USRP1=OFF -DENABLE_USRP2=OFF -DENABLE_N300=OFF -DENABLE_OCTOCLOCK=OFF -DENABLE_N230=OFF -DENABLE_DOXYGEN=OFF -DENABLE_MANUAL=OFF -DENABLE_MAN_PAGES=OFF .. make -j32 make install DESTDIR=$PREFIX make install DESTDIR=$PREFIX/sysroots/armv7ahf-neon-oe-linux-gnueabi make install DESTDIR=$PREFIX_E310 (This next step is something I do so I can source the new environment on the E310 when I am ready to use it) printf "LOCALPREFIX=~/localinstall/usr export PATH=\$LOCALPREFIX/bin:\$PATH export LD_LOAD_LIBRARY=\$LOCALPREFIX/lib:\$LD_LOAD_LIBRARY export LD_LIBRARY_PATH=\$LOCALPREFIX/lib:\$LD_LIBRARY_PATH export PYTHONPATH=\$LOCALPREFIX/lib/python2.7/site-packages:\$PYTHONPATH export PKG_CONFIG_PATH=\$LOCALPREFIX/lib/pkgconfig:\$PKG_CONFIG_PATH export GRC_BLOCKS_PATH=\$LOCALPREFIX/share/gnuradio/grc/blocks:\$GRC_BLOCKS_PATH export UHD_RFNOC_DIR=\$LOCALPREFIX/share/uhd/rfnoc/ export UHD_IMAGES_DIR=\$LOCALPREFIX/share/uhd/images" > $PREFIX_E310/../setup_env.sh chmod +x $PREFIX_E310/../setup_env.sh (use the fefault version if you want, this is just what I am currently using) cd $PREFIX/src git clone -b v3.7.12.0 --recursive https://github.com/gnuradio/gnuradio.git cd gnuradio && mkdir arm-build && cd arm-build cmake -Wno-dev -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchains/oe-sdk_cross.cmake -DENABLE_GR_WXGUI=OFF -DENABLE_GR_VOCODER=OFF -DENABLE_GR_DTV=OFF -DENABLE_GR_ATSC=OFF -DENABLE_DOXYGEN=OFF -DCMAKE_INSTALL_PREFIX=/usr ../ make -j32 make install DESTDIR=$PREFIX make install DESTDIR=$PREFIX/sysroots/armv7ahf-neon-oe-linux-gnueabi make install DESTDIR=$PREFIX_E310 (the next one is for if you want RFNoC) cd $PREFIX/src git clone -b master https://github.com/EttusResearch/gr-ettus.git cd gr-ettus/ && mkdir arm-build && cd arm-build cmake -Wno-dev -DCMAKE_TOOLCHAIN_FILE=$PREFIX/src/gnuradio/cmake/Toolchains/oe-sdk_cross.cmake -DENABLE_DOXYGEN=OFF -DCMAKE_INSTALL_PREFIX=/usr .. make -j32 make install DESTDIR=$PREFIX make install DESTDIR=$PREFIX/sysroots/armv7ahf-neon-oe-linux-gnueabi make install DESTDIR=$PREFIX_E310 Now, whenever you have a project that you want to cross-compile for the E310: d $PREFIX/src git clone <https://github.com/myawesomeproject/myawesomeproject> https://github.com/myawesomeproject/myawesomeproject.git cd myawesomeproject/ && mkdir arm-build && cd arm-build cmake -Wno-dev -DCMAKE_TOOLCHAIN_FILE=$PREFIX/src/gnuradio/cmake/Toolchains/oe-sdk_cross.cmake -DENABLE_DOXYGEN=OFF -DCMAKE_INSTALL_PREFIX=/usr .. make -j32 make install DESTDIR=$PREFIX make install DESTDIR=$PREFIX/sysroots/armv7ahf-neon-oe-linux-gnueabi make install DESTDIR=$PREFIX_E310 ________________________________ From: USRP-users <[email protected]> on behalf of Martin K via USRP-users <[email protected]> Sent: Wednesday, April 3, 2019 11:23 AM To: usrp-users Subject: [USRP-users] E310 environment I am trying to follow the instructions at https://files.ettus.com/manual/page_usrp_e3x0.html I have a fresh installation of Ubuntu (either 16.04 or 18.04) When I get to the point of setting up the cross compilation environment, I get a fatal error. This is some sort of Python issue, for which I am not a Python developer, I have no idea what I should be doing to fix this. My goal is to compile my custom C++ code against UHD for the E310. If there is a better solution please let me know. Thank you. $ . e3xx/environment-setup-armv7ahf-vfp-neon-oe-linux-gnueabi $ CC Fatal Python error: Py_Initialize: Unable to get the locale encoding ModuleNotFoundError: No module named 'encodings' Current thread 0x00007f05861ce740 (most recent call first): Aborted (core dumped) -- Martin K. _______________________________________________ USRP-users mailing list [email protected] http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
_______________________________________________ USRP-users mailing list [email protected] http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
