[GSoC 2020]: Weekly thread: Preparing RSB recipies for EPICS

Mritunjay Sharma mritunjaysharma394 at gmail.com
Thu Jul 23 23:57:13 UTC 2020


Sorry for the inconvenience, Gedare,
I will create another thread in relation with my doubts.

I will also check about sed from here:
https://docs.rtems.org/branches/master/user/testing/configuration.html
and revert back to you!


Thanks
Mritunjay

On Fri, Jul 24, 2020 at 4:35 AM Gedare Bloom <gedare at rtems.org> wrote:

> On Thu, Jul 23, 2020 at 3:26 PM Mritunjay Sharma
> <mritunjaysharma394 at gmail.com> wrote:
> >
> > I have sent the Patches related to the RSB recipe of EPICS build
> > and I will request Chris and other mentors to kindly review and suggest
> improvements.
> >
> > Also Chris, please can you help me how to ake it work across different
> BSPs / architectures?
> > How to add some code to parameterize the EPICS configuration?
> >
> At this point you might want to write a separate email thread to
> clearly describe the problem, your current solution, and request for
> help. Sometimes these conversations in threads get a little bit
> confusing.
>
> I'm starting to wonder if the EPICS configuration can be handled by
> script to manipulate the files (something like sed)
>
> > Thanks
> > Mritunjay
> >
> > On Wed, Jul 22, 2020 at 2:55 AM Gedare Bloom <gedare at rtems.org> wrote:
> >>
> >> On Tue, Jul 21, 2020 at 2:16 PM Mritunjay Sharma
> >> <mritunjaysharma394 at gmail.com> wrote:
> >> >
> >> > I cancelled the earlier message because the log file size was very big
> >> > and could not be posted in the devel list.
> >> >
> >> > [UPDATE]: Applying PATCH for RTEMS-pc386 support to EPICS and
> >> > making other changes in code worked and EPICS7 was successfully built
> >> > and installed using the RSB recipe.
> >> >
> >> > Tha changes that made it work:
> >> >
> >> > -------------------------------------------------
> >> > diff --git a/rtems/config/epics/epics-7-1.cfg
> b/rtems/config/epics/epics-7-1.cfg
> >> > new file mode 100644
> >> > index 00000000..ed1f768b
> >> > --- /dev/null
> >> > +++ b/rtems/config/epics/epics-7-1.cfg
> >> > @@ -0,0 +1,28 @@
> >> > +#
> >> > +# EPICS 3afec267ab08568ea454789e562450b00feea5c0
> >> > +#
> >> > +
> >> > +%if %{release} == %{nil}
> >> > + %define release 1
> >> > +%endif
> >> > +
> >> > +#%include %{_configdir}/rtems-bsp.cfg
> >> > +
> >> > +#
> >> > +# EPICS Version
> >> > +#
> >> > +%define epics_version 3afec267ab08568ea454789e562450b00feea5c0
> >> > +
> >> > +#%hash sha512 epics-%{ntp_version}.tar.gz
> 8d76fc7e92b2ea6dd5031e6030a7aba4ff6fb3e19d3bc0153852509861be5d0960e70604814163caedb81f8315a451d78371f99634a50b55cfe1cbd2c69e3046
> >> > +
> >> > +#
> >> > +# Patch for RTEMS support.
> >> > +#
> >> > +%patch add epics -p1
> file:///home/mritunjay/development/rtems/src/rsb_GSoC/rtems/patches/0001-Added-Support-for-RTEMS-pc386.patch
> >> > +
> >> > +#%hash  sha512 rtems-ntp-4.2.6p5.diff
> 257223d207d0b77cde2b9d7add22e3b9d657b58998411d2e20d0b1adf36910be21f1277386c54c34f5d9616fccd29f721d007295708047ea7ae0270a00be25a0
> >> > +
> >> > +#
> >> > +# EPICS Build configuration
> >> > +#
> >> > +%include %{_configdir}/epics-7-1.cfg
> >> > diff --git a/rtems/config/epics/epics-base.bset
> b/rtems/config/epics/epics-base.bset
> >> > new file mode 100644
> >> > index 00000000..550daad0
> >> > --- /dev/null
> >> > +++ b/rtems/config/epics/epics-base.bset
> >> > @@ -0,0 +1,26 @@
> >> > +#
> >> > +# Build set for EPICS
> >> > +#
> >> > +
> >> > +%define release 1
> >> > +
> >> > +#
> >> > +# RTEMS Version
> >> > +#
> >> > +%define rtems_version 5
> >> > +
> >> > +#
> >> > +# The RTEMS URL paths.
> >> > +#
> >> > +%include rtems-urls.bset
> >> > +
> >> > +#
> >> > +# The RTEMS Package defines
> >> > +#
> >> > +%include rtems-package.bset
> >> > +
> >> > +
> >> > +#
> >> > +# Build EPICS.
> >> > +#
> >> > +epics/epics-7-1.cfg
> >> > \ No newline at end of file
> >> > diff --git a/source-builder/config/epics-7-1.cfg
> b/source-builder/config/epics-7-1.cfg
> >> > index ea25f284..b18f62bd 100644
> >> > --- a/source-builder/config/epics-7-1.cfg
> >> > +++ b/source-builder/config/epics-7-1.cfg
> >> > @@ -31,6 +31,7 @@ URL:  https://epics.mpg.de/
> >> >    source_dir_epics="epicsBaseOwnPlayground-%{epics_version}"
> >> >
> >> >    %source setup epics -q -n epicsBaseOwnPlayground-%{epics_version}
> >> > +  %patch setup epics -p1
> >> >
> >> >    cd ${build_top}
> >> >
> >> > @@ -43,10 +44,7 @@ URL:  https://epics.mpg.de/
> >> >
> >> >    %{__make} PREFIX=%{_prefix}
> >> >
> >> > -  ./configure \
> >> > -    --prefix=%{_prefix}
> >> > -
> >> > -  %{__make} %{?_smp_mflags}
> >> > +  #%{__make} %{?_smp_mflags}
> >> >
> >> >    cd ${build_top}
> >> > ----------------------------------------------------------------------
> >> >
> >> > The changes can also be looked here:
> https://github.com/RTEMS/rtems-source-builder/compare/master...mritunjaysharma394:epics-support?expand=1
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > On Tue, Jul 21, 2020 at 10:23 PM Gedare Bloom <gedare at rtems.org>
> wrote:
> >> >>
> >> >> On Tue, Jul 21, 2020 at 10:42 AM Mritunjay Sharma
> >> >> <mritunjaysharma394 at gmail.com> wrote:
> >> >> >
> >> >> > [UPDATE]: The error was actually a mismatch of names which was
> fixed with the following
> >> >> > changes:
> >> >> > -----------------------------------------------
> >> >> >
> >> >> > diff --git a/source-builder/config/epics-7-1.cfg
> b/source-builder/config/epics-7-1.cfg
> >> >> > index fe1fb458..ea25f284 100644
> >> >> > --- a/source-builder/config/epics-7-1.cfg
> >> >> > +++ b/source-builder/config/epics-7-1.cfg
> >> >> > @@ -10,7 +10,7 @@
> >> >> >
> >> >> >  %define epics_version 3afec267ab08568ea454789e562450b00feea5c0
> >> >> >
> >> >> > -Name:      epics-%{epics_version}-%{_host}-%{release}
> >> >> > +Name:
> epicsBaseOwnPlayground-%{epics_version}-%{_host}-%{release}
> >> >> >  Summary:   EPICS v%{epics_version} for target %{_target} on host
> %{_host}
> >> >> >  Version:   %{epics_version}
> >> >> >  Release:   %{release}
> >> >> > @@ -19,7 +19,8 @@ URL:  https://epics.mpg.de/
> >> >> >  #
> >> >> >  # Source
> >> >> >  #
> >> >> > -%source set epics --rsb-file=epics-%{epics_version}.zip
> https://github.com/hjunkes/epicsBaseOwnPlayground/archive/%{epics_version}.zip
> >> >> > +%source set epics
> --rsb-file=epicsBaseOwnPlayground-%{epics_version}.tar.gz
> https://github.com/hjunkes/epicsBaseOwnPlayground/archive/%{epics_version}.tar.gz
> >> >> > +
> >> >> >
> >> >> >  #
> >> >> >  # Prepare the source code.
> >> >> > @@ -27,25 +28,20 @@ URL:  https://epics.mpg.de/
> >> >> >  %prep
> >> >> >    build_top=$(pwd)
> >> >> >
> >> >> > -  source_dir_epics="epics-%{epics_version}"
> >> >> > +  source_dir_epics="epicsBaseOwnPlayground-%{epics_version}"
> >> >> >
> >> >> > -  %source setup epics -q -n epics-%{epics_version}
> >> >> > +  %source setup epics -q -n
> epicsBaseOwnPlayground-%{epics_version}
> >> >> >
> >> >>
> >> >> We will eventually want this to work from the upstream EPICS.
> >> >
> >> >
> >> > Yes, I think we need to discuss it with Heinz when he is available.
> >> >
> >> >>
> >> >>
> >> >>
> >> >> >    cd ${build_top}
> >> >> >
> >> >> >  %build
> >> >> >    build_top=$(pwd)
> >> >> >
> >> >> > -
> >> >> > -
> >> >> > -  %{build_directory}
> >> >> > -
> >> >> > -  mkdir -p ${build_dir}
> >> >> > -  cd ${build_dir}
> >> >> > +  cd ${source_dir_epics}
> >> >> >
> >> >> > -  %{host_build_flags}
> >> >> > +  %{build_build_flags}
> >> >> >
> >> >> > -  #cd ${source_dir_epics}
> >> >> > +  %{__make} PREFIX=%{_prefix}
> >> >> >
> >> >> >    ./configure \
> >> >> >      --prefix=%{_prefix}
> >> >> >
> >> >> >
> >> >> > ------------------------------
> >> >> >
> >> >> > After this, I ran the command
> >> >> >
> >> >> > `../source-builder/sb-builder
> --prefix=/home/mritunjay/development  --log=log_epics epics-7-1 --trace`
> >> >> >
> >> >> > again. The error that has come now was expected because the
> changes I made in epicsBaseOwnPlayground/configure file
> >> >> >
> >> >> > were done manually and here it has to be done through a script.
> The changes that I did manually were;
> >> >> >>
> >> >> >> in epics-base/configure/CONFIG_SITE
> >> >> >> set
> >> >> >> CROSS_COMPILER_TARGET_ARCHS=
> >> >> >
> >> >> >    What I entered:
> >> >> >    CROSS_COMPILER_TARGET_ARCHS=  RTEMS-pc386-qemu
> >> >> >>
> >> >> >> e.g. RTEMS-pc386
> >> >> >> or RTEMS-xilinx_zynq_a9_qemu
> >> >> >>
> >> >> >> in epics-base/configure/os there must be a file for the target
> used,
> >> >> >> e.g.
> >> >> >> CONFIG.Common.RTEMS-xilinx_zynq_a9_qemu
> >> >> >> or
> >> >> >> CONFIG.Common.RTEMS-pc386
> >> >> >
> >> >> > Checked.  CONFIG.Common.RTEMS-pc386 was there
> >> >> >>
> >> >> >>
> >> >> >> Then you have to set in configure/os/CONFIG_SITE.Common.RTEMS
> >> >> >> where to find RTEMS:
> >> >> >>
> >> >> >> # Where to find RTEMS
> >> >> >> #
> >> >> >> # APS:
> >> >> >> #RTEMS_VERSION = 4.10.2
> >> >> >> #RTEMS_BASE = /usr/local/vw/rtems/rtems-$(RTEMS_VERSION)
> >> >> >
> >> >> >
> >> >> > In my system, I entered this:
> >> >> > #FHI
> >> >> > RTEMS_VERSION = 5
> >> >> > RTEMS_BASE = /home/mritunjay/development/rtems/$(RTEMS_VERSION)
> >> >> >
> >> >> > I have a doubt on how to implement the above changes in the
> `source-builder/config/epics-7-1.cfg` to make it work.
> >> >> >
> >> >> > Do we have to write a patch? And what will be the best way to do
> it?
> >> >> >
> >> >>
> >> >> This is a good question. These configuration changes need to be
> >> >> populated somehow based on the target being built. If this is only
> >> >> doable by writing files directly, then we'll probably need a way to
> >> >> apply patches for each different target. This seems unwieldy, so
> >> >> further thought should be considered on how to configure EPICS based
> >> >> on the RTEMS BSP build.
> >> >>
> >> >> You can start with a manually-created patch file, but eventually we
> >> >> need something that can be used across different BSPs /
> architectures.
> >> >
> >> >
> >> > The manually-created patch file has worked.
> >> > Now, what can be done to make it work across different BSPs /
> architectures?
> >> > Will writing similar patches for each architecture should be our way?
> >> > And I guess in the #FHI section as well we have to do something so
> that user
> >> > can add the path interactively where the user's BSP are installed?
> >> > Would you like to give any other feedback/suggestions?
> >> >
> >>
> >> I'd like to see if Chris has an idea. Adding patches for each
> >> architecture/bsp is not preferred. It might be that we can pick up the
> >> target (architecture, bsp) in the build script, and add some code to
> >> parameterize the EPICS configuration. This file-based configuration is
> >> a little bit clunky in EPICS.
> >>
> >> > Thanks
> >> > Mritunjay
> >> >>
> >> >>
> >> >> > The latest error looks somewhat like this which is because I have
> to change the configurations in epics directory.
> >> >> >
> >> >> > The question is how to accomplish it through the script.
> >> >> >
> >> >> > ../../configure/os/CONFIG.Common.RTEMS:36:
> /Users/junkes/MVME6100/RTEMS/rtems-5/powerpc-rtems5/beatnik/Makefile.inc:
> No such file or directory
> >> >> >
> >> >> >
> >> >> >
> >> >> > Thanks
> >> >> >
> >> >> > Mritunjay
> >> >> >
> >> >> >
> >> >> >
> >> >> > On Tue, Jul 21, 2020 at 4:09 AM Mritunjay Sharma <
> mritunjaysharma394 at gmail.com> wrote:
> >> >> >>
> >> >> >> Hello all,
> >> >> >>
> >> >> >> I went through the
> https://docs.rtems.org/branches/master/user/rsb/index.html
> >> >> >> and started writing a recipe for building EPICS 7.
> >> >> >>
> >> >> >> The code is based on a very raw idea just now and
> >> >> >> so was expected to give errors.
> >> >> >>
> >> >> >> The code can be found here:
> https://github.com/mritunjaysharma394/rtems-source-builder/blob/epics-support/source-builder/config/epics-7-1.cfg
> >> >> >>
> >> >> >> After this, just to check, what errors it might gave,
> >> >> >> I ran the following command:
> >> >> >>
> >> >> >> ../source-builder/sb-builder
> --prefix=/home/mritunjay/development      --log=log_epics epics-7-1 --trace
> >> >> >>
> >> >> >> This gave me the following error:
> >> >> >>
> >> >> >> `+ cd epics-3afec267ab08568ea454789e562450b00feea5c0
> >> >> >>
> /home/mritunjay/development/rtems/src/rsb_GSoC/rtems/build/epics-3afec267ab08568ea454789e562450b00feea5c0-x86_64-linux-gnu-1/do-build:
> 90: cd: can't cd to epics-3afec267ab08568ea454789e562450b00feea5c0
> >> >> >> shell cmd failed: /bin/sh -ex
> /home/mritunjay/development/rtems/src/rsb_GSoC/rtems/build/epics-3afec267ab08568ea454789e562450b00feea5c0-x86_64-linux-gnu-1/do-build
> >> >> >> error: building
> epics-3afec267ab08568ea454789e562450b00feea5c0-x86_64-linux-gnu-1`
> >> >> >>
> >> >> >> I think there seems to be some problem with naming the directory.
> >> >> >> I request you all to kindly help with the error as well as please
> check the code
> >> >> >> to see if I am on the right path.
> >> >> >> I am attaching the log and trace file as well.
> >> >> >>
> >> >> >> Thanks,
> >> >> >> Mritunjay
> >> >> >>
> >> >> >>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200724/33ac0266/attachment-0001.html>


More information about the devel mailing list