Compilation error on XRootD 5.5.1 - make_unique is not a member of std

Hi,

Newbie question on XRootD here:
I’m trying to compile latest XRootD (5.5.1) on CentOS 7 and I’m getting a compilation error.
I’m wondering if someone has seen or encountered this before, and if there are good tips to go around it.

Cheers,
Dejan

------
Scanning dependencies of target XrdOssSIgpfsT-5
[ 59%] Building CXX object src/CMakeFiles/XrdOssSIgpfsT-5.dir/XrdOss/XrdOssSIgpfsT.cc.o
[ 59%] Linking CXX shared module libXrdOssSIgpfsT-5.so
[ 59%] Built target XrdOssSIgpfsT-5
Scanning dependencies of target XrdAccSciTokens-5
[ 59%] Building CXX object src/CMakeFiles/XrdAccSciTokens-5.dir/XrdSciTokens/XrdSciTokensAccess.cc.o
/home/centos/xrd/xrootd-5.5.1/src/XrdSciTokens/XrdSciTokensAccess.cc: In function 'std::string {anonymous}::AccessRuleStr(const AccessRulesRaw&)':
/home/centos/xrd/xrootd-5.5.1/src/XrdSciTokens/XrdSciTokensAccess.cc:153:71: error: 'make_unique' is not a member of 'std'
             auto result = rule_map.insert(std::make_pair(rule.second, std::make_unique<std::stringstream>()));
                                                                       ^
/home/centos/xrd/xrootd-5.5.1/src/XrdSciTokens/XrdSciTokensAccess.cc:153:105: error: expected primary-expression before '>' token
             auto result = rule_map.insert(std::make_pair(rule.second, std::make_unique<std::stringstream>()));
                                                                                                         ^
/home/centos/xrd/xrootd-5.5.1/src/XrdSciTokens/XrdSciTokensAccess.cc:153:107: error: expected primary-expression before ')' token
             auto result = rule_map.insert(std::make_pair(rule.second, std::make_unique<std::stringstream>()));
                                                                                                           ^
make[2]: *** [src/CMakeFiles/XrdAccSciTokens-5.dir/XrdSciTokens/XrdSciTokensAccess.cc.o] Error 1
make[1]: *** [src/CMakeFiles/XrdAccSciTokens-5.dir/all] Error 2
make: *** [all] Error 2
[centos@xrootd build-5.5.1]$ 
.........

may be @ganis can help ?

Hi @vitlacil,

What compiler are you using? Also, why are you compiling xrootd when you have the official package available?

Cheers,
Vincenzo

Thanks for the link @vpadulan

I’m playing around and testing. I’m trying different installation processes.
My final goal is to test XRootD with INDIGO IAM.

Cheers,
Dejan

[centos@xrootd ~]$ g++ --version
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[centos@xrootd ~]$ 

I see, I think that xrootd has been tested on INDIGO IAM in other instances, there should be literature about it but right now I don’t have a citation.

For your C++ issue, always double check the compiler you use, its version, the supported C++ standards (for the compiler and for the project).

For instance in your case:

std::make_unique is a C++14 feature. You could have seen this if you looked at some website with standard C++ references, such as std::make_unique, std::make_unique_for_overwrite - cppreference.com

GCC 4.8.5 does not support C++14, you could have found this out if you looked at the official C++ standard support for GCC, at their website C++ Standards Support in GCC - GNU Project

The default compiler on CentOS7 is indeed GCC 4.8.5, so you are out of luck here. There are many, many ways to update the compiler, you can find references online for many of these.

My suggestion: avoid CentOS7 for new developments.

Cheers,
Vincenzo

Thanks for your help and advices @vpadulan.