1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 <2021> 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 <2021> 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: EPICS in Docker image Build Error base-3.15.6 (alpine linux) |
From: | Tynan Ford via Tech-talk <tech-talk at aps.anl.gov> |
To: | "Johnson, Andrew N." <anj at anl.gov> |
Cc: | Josh Fiddler <[email protected]>, EPICS tech-talk <tech-talk at aps.anl.gov> |
Date: | Tue, 20 Apr 2021 16:58:07 -0700 |
Hi Josh,I tried to build epics base in an alpine container awhile back for CI, and forget a lot of the details, but do have a working example I can share. I can't exactly remember what things were needed to fix what errors though.FROM alpine:latest
RUN apk add --update make gcc git python3 py3-pip curl perl-dev readline-dev ncurses-dev build-base p7zip g++
RUN apk add --update libstdc++ linux-headers libexecinfo-dev libtirpc rpcgen
RUN git clone https://github.com/epics-base/epics-base.git
WORKDIR /epics-base
RUN echo "USR_CXXFLAGS+=-DIPPORT_USERRESERVED=5000 -fPIC -D__UCLIBC_MAJOR__=0" > configure/CONFIG_SITE.local
RUN makeI do remember this tech talk gave some guidance: https://epics.anl.gov/core-talk/2020/msg01246.php and adding this to configure/CONFIG_SITE.local seemed to be needed: USR_CXXFLAGS+=-DIPPORT_USERRESERVED=5000 -fPIC -D__UCLIBC_MAJOR__=0. Also seem to remember running into more issues while building modules.Best,TynanOn Tue, Apr 20, 2021 at 4:33 PM Johnson, Andrew N. via Tech-talk <tech-talk at aps.anl.gov> wrote:Hi Josh,
Welcome to the EPICS community!
On Apr 20, 2021, at 6:07 PM, Josh Fiddler via Tech-talk <tech-talk at aps.anl.gov> wrote:
>
> I have what seems to be a unique problem.
Apparently, but it should be easily solvable...
> To build the MDSplus EPICS interface requirements I appear to need the MDSplus libraries. MDSplus provides a docker image based on Alpine linux. I've added the required build tools with `apk`.
I don’t know of anyone using Alpine Linux with EPICS yet, but we're a pretty big community now.
...
> Everything goes swimmingly, so far as I can tell, until it comes to `src/libCom/osi` and then the compiler complains and quits. Here's the error
>
> ############# Begin Error snippet #############
> usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_X86_64_ -DUNIX -Dlinux -O3 -g -Wall -mtune=generic -m64 -fPIC -I. -I../O.Common -I. -I../../../src/libCom/osi/compiler/gcc -I../../../src/libCom/osi/compiler/default -I. -I../../../src/libCom/osi/os/Linux -I../../../src/libCom/osi/os/posix -I../../../src/libCom/osi/os/default -I.. -I../../../src/libCom/as -I../../../src/libCom/bucketLib -I../../../src/libCom/calc -I../../../src/libCom/cvtFast -I../../../src/libCom/cppStd -I../../../src/libCom/cxxTemplates -I../../../src/libCom/dbmf -I../../../src/libCom/ellLib -I../../../src/libCom/env -I../../../src/libCom/error -I../../../src/libCom/fdmgr -I../../../src/libCom/flex -I../../../src/libCom/freeList -I../../../src/libCom/gpHash -I../../../src/libCom/iocsh -I../../../src/libCom/log -I../../../src/libCom/macLib -I../../../src/libCom/misc -I../../../src/libCom/osi -I../../../src/libCom/pool -I../../../src/libCom/ring -I../../../src/libCom/taskwd -I../../../src/libCom/timer -I../../../src/libCom/yacc -I../../../src/libCom/yacc -I../../../src/libCom/yajl -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -c ../../../src/libCom/env/envSubr.c
> ../../../src/libCom/env/envSubr.c: In function 'envGetInetPortConfigParam':
> ../../../src/libCom/env/envSubr.c:411:21: error: 'IPPORT_USERRESERVED' undeclared (first use in this function)
> if (epicsParam<=IPPORT_USERRESERVED || epicsParam>USHRT_MAX) {
> ^~~~~~~~~~~~~~~~~~~
> ../../../src/libCom/env/envSubr.c:411:21: note: each undeclared identifier is reported only once for each function it appears in
> make[3]: *** [../../../configure/RULES_BUILD:232: envSubr.o] Error 1
> make[3]: Leaving directory '/epics/base-3.15.6/src/libCom/O.linux-x86_64'
> make[2]: *** [../../configure/RULES_ARCHS:58: install.linux-x86_64] Error 2
> make[2]: Leaving directory '/epics/base-3.15.6/src/libCom'
> make[1]: *** [../configure/RULES_DIRS:84: libCom.install] Error 2
> make[1]: Leaving directory '/epics/base-3.15.6/src'
> ############# END ERROR SNIPPET #############
>
> The Asks:
> 1) Is there anyone who has some insights into this error or has built in Alpine?
The macro IPPORT_USERRESERVED is defined in /usr/include/netinet/in.h in my Linux (RHEL-7) system so my guess is that you need some networking -devel or similar package to be installed that provides that header or an equivalent. It’s definitely a standard networking constant so you just have to work out how to get hold of the right headers.
Our build documentation is somewhat out of date. If you want to test your build after it’s done, run ‘make runtests’ and it will execute the built-in test programs and report the results – always a good thing to do after building on a new OS-type.
Good luck!
- Andrew
--
Complexity comes for free, simplicity you have to work for.