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

Chris Johns chrisj at rtems.org
Sun Jul 26 23:59:05 UTC 2020


On 22/7/20 6:16 am, Mritunjay Sharma wrote:
> I cancelled the earlier message because the log file size was very big
> and could not be posted in the devel list.

OK. If we need a large log it is normally compressed and loaded onto a server
somewhere and a link provided.

> 
> [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.

Yes the PC patch  ... more on this below ...

> 
> 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

I cannot see this file if it is local to your machine.

> +
> +#%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
> <mailto:gedare at rtems.org>> wrote:
> 
>     On Tue, Jul 21, 2020 at 10:42 AM Mritunjay Sharma
>     <mritunjaysharma394 at gmail.com <mailto: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
>     <https://github.com/hjunkes/epicsBaseOwnPlayground/archive/%%7Bepics_version%7D.zip>
>     > +%source set epics
>     --rsb-file=epicsBaseOwnPlayground-%{epics_version}.tar.gz
>     https://github.com/hjunkes/epicsBaseOwnPlayground/archive/%{epics_version}.tar.gz
>     <https://github.com/hjunkes/epicsBaseOwnPlayground/archive/%%7Bepics_version%7D.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.

Sure but I cannot find it online. Have you published it somewhere? You blog
makes no reference to it or the PC build of EPICS you did by hand.

> Now, what can be done to make it work across different BSPs / architectures?

I would need to see what is needed.

> Will writing similar patches for each architecture should be our way?

Good question, I do not know.

> 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 need more information.

Thanks
Chris


More information about the devel mailing list