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  <20182019  2020  2021  2022  2023  2024  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  <20182019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: cross-compiling for ppc64 with seq 2.1 and 2.2
From: Jeong Han Lee <[email protected]>
To: "[email protected]" <[email protected]>
Date: Sat, 3 Feb 2018 03:34:19 +0100
Hi,

I create an Application by using makeBaseApp.pl, and the strange behavior exists in there also. So I would like to remove the words seq here.

I don't know why this happens in linux-ppc64e6500 (maybe because of Friday ;) Oh, already Saturday :( ) but somehow, OS_CLASS is only treated as "Shell Variable" in CONFIG_APP_INCLUDE.


Please see the difference between $(OS_CLASS) and $$(OS_CLASS) in only linux-x86_64, not in linux_x86_64


In the file EPICS_BASE/configure/CONFIG_APP_INCLUDE, I see the OS_CLASS variables as


RELEASE_INCLUDES += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/include/os/$(OS_CLASS)))

Using Andrew's rules, it returns correctly OS_CLASS and RELEASE_INCLUDES in linux-x86_64

jhlee@hadron: O.linux-x86_64$ make PRINT.OS_CLASS

make -f ../Makefile TOP=../.. T_A=linux-x86_64  PRINT.OS_CLASS
make[1]: Entering directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-x86_64'

OS_CLASS = 'Linux'

make[1]: Leaving directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-x86_64'


jhlee@hadron: O.linux-x86_64$ make PRINT.RELEASE_INCLUDES

make -f ../Makefile TOP=../.. T_A=linux-x86_64  PRINT.RELEASE_INCLUDES
make[1]: Entering directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-x86_64'

RELEASE_INCLUDES = '-I/home/jhlee/Downloads/epics_test/base-3.15.5/include/compiler/gcc -I/home/jhlee/Downloads/epics_test/base-3.15.5/include/os/Linux -I/home/jhlee/Downloads/epics_test/base-3.15.5/include'

make[1]: Leaving directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-x86_64'


However, it isn't in linux-ppc64e6500.


jhlee@hadron: O.linux-ppc64e6500$ make PRINT.OS_CLASS
make -f ../Makefile TOP=../.. T_A=linux-ppc64e6500  PRINT.OS_CLASS
make[1]: Entering directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-ppc64e6500'

OS_CLASS = 'Linux'

make[1]: Leaving directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-ppc64e6500'


jhlee@hadron: O.linux-ppc64e6500$ make PRINT.RELEASE_INCLUDES

make -f ../Makefile TOP=../.. T_A=linux-ppc64e6500  PRINT.RELEASE_INCLUDES
make[1]: Entering directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-ppc64e6500'

RELEASE_INCLUDES = '-I/home/jhlee/Downloads/epics_test/base-3.15.5/include/compiler/gcc -I/home/jhlee/Downloads/epics_test/base-3.15.5/include/os/ -I/home/jhlee/Downloads/epics_test/base-3.15.5/include'

>> Somehow OS_CLASS is gone!

make[1]: Leaving directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-ppc64e6500'


So, I changed OS_CLASS in configure/CONFIG_APP_INCLUDE as 'shell variable" such as



RELEASE_INCLUDES += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/include/os/$$(OS_CLASS)))

Yes, it returns the same results:

jhlee@hadron: O.linux-x86_64$ make PRINT.OS_CLASS
make -f ../Makefile TOP=../.. T_A=linux-x86_64  PRINT.OS_CLASS
make[1]: Entering directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-x86_64'
OS_CLASS = 'Linux'
make[1]: Leaving directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-x86_64'
jhlee@hadron: O.linux-x86_64$ make PRINT.RELEASE_INCLUDES
make -f ../Makefile TOP=../.. T_A=linux-x86_64  PRINT.RELEASE_INCLUDES
make[1]: Entering directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-x86_64' RELEASE_INCLUDES = '-I/home/jhlee/Downloads/epics_test/base-3.15.5/include/compiler/gcc -I/home/jhlee/Downloads/epics_test/base-3.15.5/include/os/Linux -I/home/jhlee/Downloads/epics_test/base-3.15.5/include' make[1]: Leaving directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-x86_64'


And I see the OS_CLASS in RELEASE_INCLUDES.

jhlee@hadron: O.linux-ppc64e6500$ make PRINT.OS_CLASS
make -f ../Makefile TOP=../.. T_A=linux-ppc64e6500  PRINT.OS_CLASS
make[1]: Entering directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-ppc64e6500'
OS_CLASS = 'Linux'
make[1]: Leaving directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-ppc64e6500'

jhlee@hadron: O.linux-ppc64e6500$ make PRINT.RELEASE_INCLUDES
make -f ../Makefile TOP=../.. T_A=linux-ppc64e6500  PRINT.RELEASE_INCLUDES
make[1]: Entering directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-ppc64e6500'

RELEASE_INCLUDES = '-I/home/jhlee/Downloads/epics_test/base-3.15.5/include/compiler/gcc -I/home/jhlee/Downloads/epics_test/base-3.15.5/include/os/Linux -I/home/jhlee/Downloads/epics_test/base-3.15.5/include'

make[1]: Leaving directory '/home/jhlee/Downloads/epics_test/mk_test/configure/O.linux-ppc64e6500'



I don't think this is the right solution or not, However, OS_CLASS are used in the both variables in many CONFIG files. Please let me know what you think.


Have a great weekend!

Han



On 02/01/2018 09:58 PM, Jeong Han Lee wrote:
Hi,

  I am trying to build the seq 2.1.21 and 2.2.6 for linux-ppc64 target by cross-compiling. And I've got the following error:


```
/opt/fsl-qoriq/current/sysroots/x86_64-fslsdk-linux/usr/bin/powerpc64-fsl-linux/powerpc64-fsl-linux-gcc  -D_GNU_SOURCE -D_DEFAULT_SOURCE         -DUSE_TYPED_RSET   -D_ppc_64_ -DUNIX  -Dlinux     -O3   -Wall       -m64 --sysroot=/opt/fsl-qoriq/current/sysroots/ppc64e6500-fsl-linux -mhard-float -mcpu=e6500 -pipe -feliminate-unused-debug-types     -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/home/jhlee/epics_env/epics-base/include/compiler/gcc -I/home/jhlee/epics_env/epics-base/include/os/ -I/home/jhlee/epics_env/epics-base/include        -MM -MF pv.d  ../pv.c


In file included from /home/jhlee/epics_env/epics-base/include/cadef.h:40:0,
                  from ../pv.c:5:
/home/jhlee/epics_env/epics-base/include/epicsThread.h:214:23: fatal error: osdThread.h: No such file or directory
  #include "osdThread.h"
```

Got the hint from EPICS_BASE/CONFIG, I changed seq/configure/CONFIG as follows:

$ git diff configure/CONFIG
diff --git a/configure/CONFIG b/configure/CONFIG
index 3861c7e..cd9f838 100644
--- a/configure/CONFIG
+++ b/configure/CONFIG
@@ -22,7 +22,9 @@ include $(TOP)/configure/CONFIG_SITE
  ifdef T_A
    -include $(TOP)/configure/CONFIG_SITE.Common.$(T_A)
    -include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
-  -include $(TOP)/configure/O.$(T_A)/CONFIG_APP_INCLUDE
+  ifneq ($(CONFIG),$(TOP)/configure)
+    -include $(CONFIG)/CONFIG_APP_INCLUDE
+  endif
  endif

The cross compilation works again.


```
/opt/fsl-qoriq/current/sysroots/x86_64-fslsdk-linux/usr/bin/powerpc64-fsl-linux/powerpc64-fsl-linux-gcc  -D_GNU_SOURCE -D_DEFAULT_SOURCE         -DUSE_TYPED_RSET   -D_ppc_64_ -DUNIX  -Dlinux     -O3   -Wall       -m64 --sysroot=/opt/fsl-qoriq/current/sysroots/ppc64e6500-fsl-linux -mhard-float -mcpu=e6500 -pipe -feliminate-unused-debug-types     -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/home/jhlee/epics_env/epics-base/include/compiler/gcc -I/home/jhlee/epics_env/epics-base/include/os/ -I/home/jhlee/epics_env/epics-base/include -I/home/jhlee/epics_env/epics-base/include/compiler/gcc -I/home/jhlee/epics_env/epics-base/include/os/Linux -I/home/jhlee/epics_env/epics-base/include        -MM -MF pv.d  ../pv.c
```

It looks like somehow OS_CLASS is missing. Can I get some more insights about them?


The weird CONFIG_SITE.Common.linux-ppc64e6500 is as follows:

```
include $(CONFIG)/os/CONFIG.Common.linux-ppc64

TOOLCHAIN_VER=current
TOOLCHAIN=fsl
TOOLCHAIN_SUFFIX=-qoriq

GNU_TARGET=powerpc64-$(TOOLCHAIN)-linux
SYSROOTS=/opt/$(TOOLCHAIN)$(TOOLCHAIN_SUFFIX)/$(TOOLCHAIN_VER)/sysroots
SDKTARGETSYSROOT=$(SYSROOTS)/ppc64e6500-$(TOOLCHAIN)-linux

CROSS_INCLUDES =

FSL_CFLAG = --sysroot=$(SDKTARGETSYSROOT) -mhard-float -mcpu=e6500

#ARCH_DEP_CPPFLAGS += $(FSL_CFLAG)

ARCH_DEP_CFLAGS   += $(FSL_CFLAG)
ARCH_DEP_CXXFLAGS += $(FSL_CFLAG)
ARCH_DEP_LDFLAGS  += --sysroot=$(SDKTARGETSYSROOT)


ARCH_DEP_CFLAGS   += -pipe -feliminate-unused-debug-types
ARCH_DEP_CXXFLAGS += -pipe -feliminate-unused-debug-types
ARCH_DEP_LDFLAGS  += -Wl,-O1
ARCH_DEP_LDFLAGS  += -Wl,--hash-style=gnu
ARCH_DEP_LDFLAGS  += -Wl,--as-needed

OECORE_NATIVE=x86_64-$(TOOLCHAIN)sdk-linux
GNU_DIR=$(SYSROOTS)/$(OECORE_NATIVE)/usr
GNU_BIN=$(GNU_DIR)/bin/$(GNU_TARGET)
GNU_TARGET_LIB_DIR=$(GNU_DIR)/lib
```

Best,
Han




Replies:
Re: cross-compiling for ppc64 with seq 2.1 and 2.2 Jeong Han Lee
References:
cross-compiling for ppc64 with seq 2.1 and 2.2 Jeong Han Lee

Navigate by Date:
Prev: Re: Seq-2.2.5 compilation on windows Benjamin Franksen
Next: AreaDetector repository inconsistent Jörn Dreyer
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  <20182019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: cross-compiling for ppc64 with seq 2.1 and 2.2 Jeong Han Lee
Next: Re: cross-compiling for ppc64 with seq 2.1 and 2.2 Jeong Han Lee
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  <20182019  2020  2021  2022  2023  2024 
ANJ, 08 Feb 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·