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 compilation for gcc and clang |
From: | "Johnson, Andrew N. via Tech-talk" <tech-talk at aps.anl.gov> |
To: | Philipp Kampmann <p.kampmann at fz-juelich.de> |
Cc: | EPICS tech-talk <tech-talk at aps.anl.gov> |
Date: | Tue, 20 Jul 2021 16:55:04 +0000 |
Hi Philipp,
Welcome to the EPICS community!
On Jul 20, 2021, at 10:34 AM, Philipp Kampmann via Tech-talk <tech-talk at aps.anl.gov> wrote:
Assuming your EPICS_HOST_ARCH is linux-x86_64 you can switch the compiler that EPICS uses from gcc to clang by editing the file
base-3.15/configure/os/CONFIG_SITE.Common.linux-x86_64 and following the instructions in the comments there. However as Lewis just pointed out there might be problems with mixing the two different compilers, because the CA
library is coded in C++ even though its API is pure C. Apparently on x64 both compilers adhere to an Itanium
standard ABI for name mangling, but that doesn’t guarantee that they’ll be compatible.
I can suggest two solutions to avoid that problem, one simpler than the other. The easy one is to have a second installation of EPICS Base that was built using clang (follow the directions above to switch the compiler for the second one). Alternatively
it is possible to build the libraries for both into the same installation of Base, but you would have to create and use a different EPICS_HOST_ARCH which should be named linux-x86_64-clang for the second one
which requires adding 2 or 3 new files to your configure/os directory – if you want to go this route I can help you to do that.
HTH,
- Andrew
--
Complexity comes for free, simplicity you have to work for.
|