Compiling geoviewer using LCG toolchain

Hello,

To make the installation of flair easier for my needs, I created a conda package. conda-build takes care of the compilation on the target environment and the package can then be installed. No issue so far.

However, trying to update to the latest version, I get compilation errors:

In file included from usrbinlayer.cc:13:0:
…/data/usrbin.h: At global scope:
…/data/usrbin.h:31:58: error: invalid conversion from ‘const char*’ to ‘char’ [-fpermissive]
static constexpr char USRBINErrHeader = { “STATISTICS” };
^
…/data/usrbin.h:31:58: error: field initializer is not constant
make[1]: *** [usrbinlayer.o] Error 1
make[1]: Leaving directory `$SRC_DIR/flair-geoviewer-3.2-4.5/viewer’
make: *** [viewer/libviewer.a] Error 2

I use GCC 9 on CC7 using the LCG release on CVMFS ( /cvmfs/sft.cern.ch/lcg/releases/gcc/9.2.0-afc57/x86_64-centos7/bin/g++ ). The documentation does not mention a specific version of GCC so I assume this should work.

I’m a bit puzzled as this seems like a genuine C++ error.

Any pointer would be appreciated.

Hi @chernals,

the code is perfectly fine, yet this line uses a newer language feature (in class initialization of static variables) that was slowly adopted by the various compilers.

While previous versions of geoviewer were 100% compatible with old compilers (e.g. GCC 4), this is undergoing some change as by now those compilers should be long retired. I tried with the LCG release on CC7 (LXPLUS7) and cannot reproduce the error.

However, on CC7 the default compiler is GCC 4.8 which will not support this feature as it is too old. Are you sure that your build process is not, mistakenly, falling back to the system’s default compiler? It would most probably have been transparent with former versions of geoviewer.

Cheers
Chris

1 Like

Hi @ctheis

My apologies for the delayed reply (to say the least…).

I realised that indeed my LCG environment loading was, due to a bug, not active when building the Conda package. Indeed the default CC7 compiler is too old anyway.

All this should be a non-issue now that CC7 is retiring and as you said, these compilers should be gone.

Thanks for taking the time to look into this anyway.

Cheers,