<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 26, 2021, 7:54 PM Chris Johns <<a href="mailto:chrisj@rtems.org">chrisj@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 30/4/21 1:15 am, <a href="mailto:dufault@hda.com" target="_blank" rel="noreferrer">dufault@hda.com</a> wrote:<br>
> <br>
> <br>
>> On Apr 30, 2021, at 05:03 , <a href="mailto:dufault@hda.com" target="_blank" rel="noreferrer">dufault@hda.com</a> wrote:<br>
>><br>
>> Can I override what to use as "cmake" in RSB to specify "cmake3"?<br>
>><br>
>>> On Apr 30, 2021, at 04:41 , Peter Dufault <<a href="mailto:dufault@hda.com" target="_blank" rel="noreferrer">dufault@hda.com</a>> wrote:<br>
>>><br>
>>> I verified my environment is squeaky-clean with a simple path and no environment variables set that affect RTEMS or "make".<br>
>><br>
> <br>
> I need help figuring out how to setup rtems-source-builder, SOEM, and cmake. I got it to "work" but it's mis-configured. At first it is not finding header files (is it looking at the Linux headers?), then it installs SOEM in the wrong place, etc. I can get the build and install to "work" by re-running commands in a shell script - the second time a command is run it behaves differently.<br>
> <br>
> - *Notes*<br>
> -- This started when I updated SOEM and needed to change to "cmake3".<br>
> -- After the following convoluted process the testing I've done on the results are OK.<br>
> <br>
> - To simplify my path I make it simple except I add a directory with only a "cmake" bash script: "cmake3 $*" in order to pick up cmake3.<br>
<br>
Maybe the --macros argument can help. Create a file `xyz.txt` containing ...<br>
<br>
__cmake: exe, optional, 'cmake3'<br>
<br>
then try running with `--macros=xyz.txt` If the recipe for the build using cmake<br>
uses `%{__cmake}` then this may work. I have not tested any of this. :)<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">This may be a stupid question but can you build it by hand? </div><div dir="auto"><br></div><div dir="auto">--joel</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Chris<br>
<br>
> <br>
> - The first time I run "sb-set-builder" the SOEM build fails because it can't find <net/bpf.h>. This is just after it compiled a C file that includes <net/if.h>. I'm not sure where it is looking for the headers, I'd expect it would fail earlier if it was trying to use Linux headers, it's all the way to the last file.<br>
> <br>
> - I then run the do-build script sb-set-builder created and it builds SOEM *but it installs it in the wrong place*.<br>
> -- The do-build script is in "${GITDIR}/rtems/rtems-source-builder/rtems/build/soem-powerpc-rtems6-1/do-build"<br>
> -- "do-build" installs SOEM in in "${GITDIR}/rtems-source-builder/rtems/build/tmp/soem-powerpc-rtems6-1-root-dufault/opt/flatland/opt/rtems-6" instead of "/opt/flatland/opt/rtems-6".<br>
> <br>
> - I then go to the generated directory "${GITDIR}/rtems/rtems-source-builder/rtems/build/soem-powerpc-rtems6-1/build-xc" and type "make install" The make succeeds, and *it installs SOEM in the correct place* and SOEM is "successfully" built and installed.<br>
> <br>
> - The last nit is that when I try to build the SOEM examples I need to export LDFLAGS="-lrtemsdefaultconfig -lm" to get the SOEM examples to configure. *Note* this was an issue before I switched to cmake3, this one is not new.<br>
> <br>
> <br>
> I hope this gives someone enough clues to suggest what must be done to set source builder up correctly. For reference here's the script.<br>
> <br>
> #!/bin/sh<br>
> set -e<br>
> # Script to get SOEM to build and install "properly". I just need to be insistent.<br>
> <br>
> HERE=$(pwd)<br>
> # Clean up environment rsb-overrides only has a cmake shell script that is "cmake $*".<br>
> export PATH=${HOME}/bin/rsb-overrides:/usr/bin:/usr/sbin:/bin:/sbin<br>
> unset LD_IBRARY_PATH<br>
> <br>
> export RTEMS_GIT=/home/dufault/development/rtems<br>
> export RTEMS_VER=6<br>
> export RTEMS_SB=${RTEMS_GIT}/rtems-source-builder<br>
> export RTEMS_SB_BUILD=${RTEMS_SB}/rtems/build<br>
> export RTEMS_TOOLS=/opt/flatland/opt/rtems-${RTEMS_VER}<br>
> export RTEMS_ARCH=powerpc<br>
> export RTEMS_BSP=beatnik<br>
> # "soem-rtems" fetches waf-2.0.4.<br>
> SOEM_WAF=waf-2.0.4<br>
> <br>
> SOEM_TIDY_UP="\<br>
> ${RTEMS_TOOLS}/share/rtems/rsb/soem-${RTEMS_ARCH}-rtems${RTEMS_VER}-1.txt \<br>
> ${RTEMS_TOOLS}/share/rtems/rsb/soem-${RTEMS_ARCH}-rtems${RTEMS_VER}-1.xml \<br>
> ${RTEMS_TOOLS}/${RTEMS_ARCH}-rtems${RTEMS_VER}/${RTEMS_BSP}/lib/share/soem \<br>
> ${RTEMS_TOOLS}/${RTEMS_ARCH}-rtems${RTEMS_VER}/${RTEMS_BSP}/lib/include/soem"<br>
> <br>
> <br>
> # We have this setup: ${RTEMS_GIT}<br>
> # |-- soem-rtems<br>
> # |-- rtems<br>
> # |-- rtems-source-builder<br>
> <br>
> # First tidy-up so we always start in the same state.<br>
> rm -rf ${RTEMS_SB_BUILD} ${SOEM_TIDY_UP}<br>
> cd ${RTEMS_GIT}/soem-rtems<br>
> if [ ! -e ${SOEM_WAF} ]; then<br>
> wget -P . <a href="https://waf.io/$%7BSOEM_WAF%7D" rel="noreferrer noreferrer" target="_blank">https://waf.io/${SOEM_WAF}</a><br>
> chmod u+x ${SOEM_WAF}<br>
> git submodule init<br>
> git submodule update<br>
> else<br>
> ./${SOEM_WAF} distclean<br>
> fi<br>
> <br>
> cd ${RTEMS_SB}/rtems<br>
> <br>
> RTEMS_SB_DEBUG="--no-clean --jobs=1"<br>
> <br>
> # Now configure to build SOEM.<br>
> # This will fail with:<br>
> # ${RTEMS_SB_BUILD}soem-${RTEMS_ARCH}-rtems${RTEMS_VER}-1/soem/oshw/rtems/nicdrv.c:37:10:<br>
> # fatal error: net/bpf.h: No such file or directory<br>
> <br>
> if ${RTEMS_SB}/source-builder/sb-set-builder \<br>
> --log=log_${RTEMS_ARCH}_soem \<br>
> --prefix=${RTEMS_TOOLS} \<br>
> --with-tools=${RTEMS_TOOLS} \<br>
> --host=${RTEMS_ARCH}-rtems${RTEMS_VER} \<br>
> --with-rtems-bsp=${RTEMS_BSP} \<br>
> ${RTEMS_SB_DEBUG} \<br>
> net/soem ; \<br>
> then<br>
> echo 2>&1 "*************************"<br>
> echo 2>&1 "************************* Success with sb-set-builder for net/soem? But I expect failure!"<br>
> echo 2>&1 "*************************"<br>
> exit 1<br>
> else<br>
> echo "*************************"<br>
> echo "************************* sb-set-builder failed because it can't find <net/bpf.h>. Build again..."<br>
> echo "*************************"<br>
> fi<br>
> <br>
> # Now we can manually do the build to finish the build.<br>
> # This won't quite work either, because it installs SOEM in the wrong place.<br>
> ${RTEMS_SB_BUILD}/soem-${RTEMS_ARCH}-rtems${RTEMS_VER}-1/do-build<br>
> <br>
> echo "*************************"<br>
> echo "************************* Finished do-build but it installed in the wrong place. Redo install..."<br>
> echo "*************************"<br>
> <br>
> # so to finish up and install properly in the prefix<br>
> # I need to do another "make install" in the build-xc directory.<br>
> cd ${RTEMS_SB_BUILD}/soem-${RTEMS_ARCH}-rtems${RTEMS_VER}-1/build-xc/<br>
> make install<br>
> <br>
> # SOEM is "installed". Now I can build the RTEMS SOEM examples.<br>
> <br>
> cd ${RTEMS_GIT}/soem-rtems<br>
> <br>
> export LDFLAGS="-lrtemsdefaultconfig -lm"<br>
> <br>
> echo "*************************"<br>
> echo "************************* XXX Why do I need to set LDFLAGS to ${LDFLAGS} before the ./${SOEM_WAF} configure?"<br>
> echo "*************************"<br>
> <br>
> ./${SOEM_WAF} configure \<br>
> --prefix=${RTEMS_TOOLS} \<br>
> --rtems-bsps=${RTEMS_ARCH}/${RTEMS_BSP} \<br>
> --rtems-version=${RTEMS_VER}<br>
> <br>
> ./${SOEM_WAF}<br>
> <br>
> echo "*************************"<br>
> echo "************************* Done!"<br>
> echo "*************************"<br>
> <br>
> <br>
> Peter<br>
> -----------------<br>
> Peter Dufault<br>
> HD Associates, Inc. Software and System Engineering<br>
> <br>
> This email is delivered through the public internet using protocols subject to interception and tampering.<br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
> <br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div></div>