Experimental Physics and Industrial Control System
Do you mean "changing language standard version"?
On 7/7/23 12:12, Pierrick M Hanlet via Tech-talk wrote:
Greetings all,
I'd like to build our EPICS software (starting on an Alma Linux 9 platform) for
C++17 or even C++20.
What is motivating this? imo. language version might best be
decided on a per-module basis. eg. for PVXS I set -std=c++11
I haven't tried, but I would not be surprised if some of our
more... mature c++ code might not compile with c++20.
On the chance that you are thinking the -std= effects ABI,
you will want to read:
https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html
I'm presently building with C++11 by adding
-std=c++11 to the USR_CXXFLAGS in configure/CONFIG_COMMON.
USR_* is probably not the best place to put this if you want to
effect downstream builds as well. Some module builds will
overwrite these variables instead of appending.
Looking at some places where this is already done in base might
provide a starting point.
$ git grep '\-std='
...
configure/os/CONFIG.Common.RTEMS-uC5282:ARCH_DEP_CXXFLAGS_5 = -std=c++98
configure/os/CONFIG.Common.solaris-sparc-gnu:POSIX_CFLAGS = -std=gnu99 -D_POSIX_C_SOURCE=200112L
configure/os/CONFIG.Common.solaris-x86-gnu:POSIX_CFLAGS = -std=gnu99 -D_POSIX_C_SOURCE=200112L
However,
when I tried c++20/c++17/c++14 and it failed in every case with:
* g++: error: unrecognized command line option ‘-std=c++20’
Could you share the exact command invocation which gives this error?
(also, which GCC version?)
somewhere in the middle of building libcom - after the compilation call to
resourceLib.
A colleague of mine played with the configure/CONFIG.gnuCommon and
had a different level of success and failure.
Any help, even pointing me to the correct documentation would be
greatly appreciated.
Cheers,
Pierrick
--
Pierrick Hanlet
Fermi National Accelerator
Accelerator Front End Controls
+1-630-840-5555 -- lab
+1-312-687-4980 -- mobile
"Whether you think you can or think you can't, you're right" -- Henry Ford
- References:
- changing compiler versions Pierrick M Hanlet via Tech-talk
- Navigate by Date:
- Prev:
changing compiler versions Pierrick M Hanlet via Tech-talk
- Next:
Re: External: changing compiler versions Niko Kivel 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
<2023>
2024
- Navigate by Thread:
- Prev:
changing compiler versions Pierrick M Hanlet via Tech-talk
- Next:
Re: External: changing compiler versions Niko Kivel 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
<2023>
2024