EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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  <20232024  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  <20232024 
<== Date ==> <== Thread ==>

Subject: Re: EPICS 3.15.9 build system weird behaviour upon missing g++
From: "Dmitry Yu. Bolkhovityanov via Tech-talk" <tech-talk at aps.anl.gov>
To: tech-talk at aps.anl.gov
Date: Sun, 30 Apr 2023 12:51:55 +0700 (+07)
On Fri, 28 Apr 2023, Dmitry Yu. Bolkhovityanov via Tech-talk wrote:

 It's possible that removing the asLib$(DEP) rule might clean this up, but
 I don't know if the result will actually build. Please let me know if you
 find a solution that removes some of this complexity.

I'll try to, but I doubt I'm able to completely grok the operation of EPICS build system.

(Shame on me, even the principle of "HOST_OPT=NO" functioning is still a mystery: there are no references to $(HOST_OPT) besides 6 items in *win32-x86.win32-x86 files, yet the "HOST_OPT=NO" does affect Linux builds. Must be something with computed variable names...)

UPD: I figured out how $(HOST_OPT) works:


1. The configure/CONFIG_COMMON file specifies "BUILD_CLASS = HOST"

2. Below there are lines

# Warnings flags
WARN_CPPFLAGS = $(WARN_CPPFLAGS_$($(BUILD_CLASS)_WARN))
WARN_CFLAGS = $(WARN_CFLAGS_$($(BUILD_CLASS)_WARN))
WARN_CXXFLAGS = $(WARN_CXXFLAGS_$($(BUILD_CLASS)_WARN))

# Optimization flags
OPT_CPPFLAGS = $(OPT_CPPFLAGS_$($(BUILD_CLASS)_OPT))
OPT_CFLAGS = $(OPT_CFLAGS_$($(BUILD_CLASS)_OPT))
OPT_CXXFLAGS = $(OPT_CXXFLAGS_$($(BUILD_CLASS)_OPT))

3. Specific CONFIG.* files define OPT_nnn_YES и OPT_nnn_NO, e.g. configure/CONFIG.gnuCommon sets

OPT_CFLAGS_YES = -O3
OPT_CFLAGS_NO = -g

4. Thus, setting HOST_OPT=YES or HOST_OPT=NO selects which of OPT_CFLAGS_* to use.


Well, that's an elegant albeit a rather non-obvoius implementation.

It's a pity this isn't described somewhere in documentation. Computed variable names, while giving much flexibility, are extremely tricky and turn Makefiles into difficult to study, plus "double-indirect" references entangle things even more (you can't find anything until you know exactly what to find).


With best regards,
Dmitry

Replies:
Re: EPICS 3.15.9 build system weird behaviour upon missing g++ Andrew Johnson via Tech-talk
References:
EPICS 3.15.9 build system weird behaviour upon missing g++ Dmitry Yu. Bolkhovityanov via Tech-talk
Re: EPICS 3.15.9 build system weird behaviour upon missing g++ Johnson, Andrew N. via Tech-talk
Re: EPICS 3.15.9 build system weird behaviour upon missing g++ Dmitry Yu. Bolkhovityanov via Tech-talk
Re: EPICS 3.15.9 build system weird behaviour upon missing g++ Andrew Johnson via Tech-talk
Re: EPICS 3.15.9 build system weird behaviour upon missing g++ Dmitry Yu. Bolkhovityanov via Tech-talk

Navigate by Date:
Prev: Re: EPICS 3.15.9 build system weird behaviour upon missing g++ Dmitry Yu. Bolkhovityanov via Tech-talk
Next: Re: EPICS 3.15.9 build system weird behaviour upon missing g++ Andrew Johnson via Tech-talk
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  <20232024 
Navigate by Thread:
Prev: Re: EPICS 3.15.9 build system weird behaviour upon missing g++ Dmitry Yu. Bolkhovityanov via Tech-talk
Next: Re: EPICS 3.15.9 build system weird behaviour upon missing g++ Andrew Johnson via Tech-talk
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  <20232024 
ANJ, 01 May 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·