Please read tips for efficient and successful posting and posting code
ROOT Version: 6.24
I know that cygwin is not supported, but let me post this all the same…
My cmake build ran (apparently) no problem, with this command:
/cern/build> make -DCMAKE_INSTALL_PREFIX=/cern/install -Dgminimal=ON /cern/root-6.24.00
but the following cmake gave:
/cern/build> cmake --build . -- install
[ 17%] Building CXX object interpreter/llvm/src/lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTFWrapper.cpp.o
[ 17%] Building CXX object interpreter/llvm/src/lib/Support/CMakeFiles/LLVMSupport.dir/CrashRecoveryContext.cpp.o
/cern/root-6.24.00/interpreter/llvm/src/lib/Support/CrashRecoveryContext.cpp:292:25: error: elements of array ‘sigaction PrevActions ’ have incomplete type
292 | static struct sigaction PrevActions[NumSignals];
/cern/root-6.24.00/interpreter/llvm/src/lib/Support/CrashRecoveryContext.cpp:292:25: error: storage size of ‘PrevActions’ isn’t known
plus many more errors in the same file.
I found the offending command in compileCommands.json, line:
/usr/bin/c++.exe -DGTEST_HAS_RTTI=0 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/cern/build/interpreter/llvm/src/lib/Support -I/cern/root-6.24.00/interpreter/llvm/src/lib/Support -I/cern/build/interpreter/llvm/src/include -I/cern/root-6.24.00/interpreter/llvm/src/include -std=c++14 -Wno-implicit-fallthrough -Wno-noexcept-type -pthread -Werror=date-time -std=gnu++1y -w -O3 -DNDEBUG -DNDEBUG -fvisibility=hidden -std=c++14 -fno-exceptions -fno-rtti -o CMakeFiles/LLVMSupport.dir/CrashRecoveryContext.cpp.o -c /cern/root-6.24.00/interpreter/llvm/src/lib/Support/CrashRecoveryContext.cpp
Trying to run this by hand, I found that compilation works if I remove the second option -std=c++14, thus uncovering the preceding -std=gnu++1y option
So now the question is: how can I force the ROOT build sistem to use gnu++1y, or even gnu++14?
Because it appears that I can only add -DCMAKE_XX_STANDARD=11,14,20 etc., but I cannot choose the gnu++ family. And for ROOT_on_cygwin the c++ family seems to be a no-no-go.
You’re right, cygwin is not supported. That said, according to gcc.gnu.org,
std=gnu++14 is used to enable GNU extensions. Do you really need to enable them? And gcc 10 should support c++14:
C++14 Support in GCC
GCC has full support for the of the 2014 C++ standard.
This mode is the default in GCC 6.1 up until GCC 10 (including); it can be explicitly selected with the
-std=c++14 command-line flag, or
-std=gnu++14 to enable GNU extensions as well.
And you can still try to modify the
CMAKE_CXX_FLAGS and add
-std=gnu++14 or whatever you want to try (if you open
cmake-gui, you can easily see all the options)
BTW, may I ask you why you want to use Cygwin?
Hi, thank you for the answer.
Actually, it’s not me who requires the GNU extensions, it’s ROOT itself! since structure “sigaction”, on which ROOT build system hiccups is not seen at all with the c++ line of standards.
The details are unclear to me, but seem to have to do with an #if __POSIX_ISVISIBLE in /usr/include/sys/signal.h, that cygwin bluntly redirects to /usr/include/cygwin/signal.h.
struct sigaction is not defined unless __POSIX_VISIBLE is -ehm…- visible! and that does not happen unless the family of gnu standards is defined.
Thank you for suggesting that other flag, I will try and use it and see what happens.
Finally, there is still (?) a small community of people who do not like a lot cygwin, but happen to have a Windows machine, bought by their employer, although they strongly dislike the Windows Way of the Wasteful. And cygwin has also good points that others have been discussing since many years.
Hi, just for the record: after some netsurfings I found the good flag that I needed. These 2 lines:
cmake -DCMAKE_INSTALL_PREFIX=/cern/install -Dgminimal=ON -DCMAKE_CXX_FLAGS="-D_GNU_SOURCE" /cern/root-6.24.02
cmake --build . --target install
brought me halfway through, but I got this real showstopper:
/cern/root-6.24.02/interpreter/cling/lib/Utils/UTF8.cpp:163:35: error: static assertion failed: Sizes don't match
163 | static_assert(sizeof(wchar_t) == sizeof(char32_t), "Sizes don't match");
size of wchar_t in cygwin64 is 2, not 4.
I can not think of a way out of something so basic, so for now I must renounce my efforts with cygwin.
In case it helps, note that ROOT runs fine in Windows Subsystem for Linux.
…and so it does, and very well too.
I may trash both cygwin and my big xubuntu VirtualBox.
Thank you Enrico! and all people that worked in all parts of this.
In case anybody else is interested, I found my way here: