Error: no member named 'signbit' in the global namespace

Hello,

I am trying to compile root from source. I have a new installation of OSX12.2.1, and just. installed Xcode 13.2.1 from the App Store (important since many solutions found with Google blame Xcode) and downloaded the tar file for root_v6.26.00.source.tar

The make process fails, early on in the compilation of VDT. The VDT-build-err.log contains many errors similar to

/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global namespace
using ::signbit;
      ~~^

Now, this is probably not a root problem, but a Mac problem, since I can to compile the code

#include <cmath>
int main() {
  return abs(1);
}

and will obtain the same litany of errors. Nevertheless, the web-based help that I was able to find in more general forums about using or not using /Library/Developer/CommandLineTools vs the /Applications/Xcode.app/… versions of the includes, etc do not help. So I wanted to reach out here incase someone here had dealt with this.

Thanks,

Paul

_ROOT Version: 6.26.00
_Platform: OSX 12.2.1
_Compiler: Apple clang version 13.0.0 (clang-1300.0.29.30)


1 Like

Some problems have simple solutions. Following several posts on other web sites, I traced from where the include files were being read with

gcc -Wp,-v -E -

It turns out that math.h could be found in 3 different places, two of which had a corresponding cmath file. Unfortunately, the search list was ordered so that the unmatched math.h was found first. It was different from the other two math.h files, hence causing the incompatibility.

Paul

So do I understand correctly that your issue is solved?

Yes, that is correct. I have moved on to the next issue that deals with the compilation of XROOTD where there is an error with

error: no matching function for call to ‘RSA_public_decrypt’

if ((lout = RSA_public_decrypt(lcmax, (unsigned char *)&in[kk],

I will look for a solution to that before bothering the forum

Paul

This problem occurs also with the version of XRootD downloaded from the XRootD site at Home Page | XRootD. The problem is a compatibility between XRootD and openssl-3.0.1 If anyone else encounters this problem, XRootD will compile with openssl-1.1.1m, but not with openssl-3.0.1.

Paul

1 Like

Hi, I’m having a very similar but not quite the same problem with branch 6-24-patches:

[ 46%] Generating G__Core.cxx, ../lib/Core.pcm
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:31:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex.h:28:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ccomplex:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:245:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:317:9: error: missing '#include "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/math.h"'; declaration of
      'signbit' must be imported from module 'std.depr.math_h' before it is required
using ::signbit;
        ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/math.h:331:1: note: previous declaration is here
signbit(_A1 __lcpp_x) _NOEXCEPT
^
input_line_1:1:10: fatal error: could not build module 'std'
#include <new>

Is this basically the same error and if so could you elaborate on the solution?

I don’t even remember the last time I tried compiling root from source and I’ve never tried it on a Mac so I apologize for being a real newbie but I’d appreciate it if you could step me through the solution.

OSX 10.15.7
Root branch 6-24-patches cloned 2022-03-19
Apple clang version 12.0.0 (clang-1200.0.32.29)
cmake version 3.16.4

Thanks

(btw yes I tried installing the .pkg but Catalina won’t let me)

Yes, that it the problem which I saw. My problem was that the various include paths that the compiler searched had several cmath and math.h files that were not alike and so it used cmath from one path and math.h from another and they were not compatible with each other.

The short answer is that I had the environmental variable CPATH defined to point to a directory that only had the math.h file and not a cmath file. I don’t know how this happened, but removing that directory from the definition of the CPATH environment variable solved the problem.

The longer answer is

From elsewhere on the web, I learned that the command
gcc -Wp,-v -E -
will give you a list of the include search paths. (Note that the command will just sit there waiting afterwards, so you need to terminate it with ctrl-c. My output is included below:

gcc -Wp,-v -E -
clang -cc1 version 13.1.6 (clang-1316.0.21.2) default target x86_64-apple-darwin21.4.0
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/Users/reimer/Documents/local/include/root
/Users/reimer/Documents/local/include
.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.1.6/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)

End of search list.

^C

I then looked in each of those directories for math.h and cmath files e.g.

ls /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.1.6/include/math.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.1.6/include/cmath

My understanding is that the compiler will take the first math.h or cmath file it finds in the search path. My problem was that there existed a math.h file in one first search paths without a corresponding cmath file, so it took the next cmath file it could find. The two were incompatible.

I should have mentioned in my above post that I am running OSX 12.3 Monterey