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

**URL:** <https://root-forum.cern.ch/t/error-no-member-named-signbit-in-the-global-namespace/49130>\
**Category:** Newbie\
**Tags:** build\
**Created:** [March 10, 2022, 10:58pm UTC](https://root-forum.cern.ch/t/error-no-member-named-signbit-in-the-global-namespace/49130 "2022-03-10T22:58:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![preimer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@preimer](https://root-forum.cern.ch/u/preimer)\
**Post date:** [March 10, 2022, 10:58pm UTC](https://root-forum.cern.ch/t/error-no-member-named-signbit-in-the-global-namespace/49130/1 "2022-03-10T22:58:38Z")

</div>

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

```auto
/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

```auto
#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)

* * *

---

<div class="post-metadata">

**Author:** ![preimer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@preimer](https://root-forum.cern.ch/u/preimer)\
**Post date:** [March 11, 2022, 12:25am UTC](https://root-forum.cern.ch/t/error-no-member-named-signbit-in-the-global-namespace/49130/2 "2022-03-11T00:25:03Z")

</div>

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

```auto
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

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [March 11, 2022, 8:52am UTC](https://root-forum.cern.ch/t/error-no-member-named-signbit-in-the-global-namespace/49130/3 "2022-03-11T08:52:40Z")

</div>

So do I understand correctly that your issue is solved?

---

<div class="post-metadata">

**Author:** ![preimer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@preimer](https://root-forum.cern.ch/u/preimer)\
**Post date:** [March 11, 2022, 4:19pm UTC](https://root-forum.cern.ch/t/error-no-member-named-signbit-in-the-global-namespace/49130/4 "2022-03-11T16:19:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![preimer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@preimer](https://root-forum.cern.ch/u/preimer)\
**Post date:** [March 11, 2022, 7:35pm UTC](https://root-forum.cern.ch/t/error-no-member-named-signbit-in-the-global-namespace/49130/5 "2022-03-11T19:35:20Z")

</div>

This problem occurs also with the version of XRootD downloaded from the XRootD site at [Home Page | XRootD](https://xrootd.slac.stanford.edu/index.html). 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

---

<div class="post-metadata">

**Author:** ![hackman](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/96bed5/32.png) [@hackman](https://root-forum.cern.ch/u/hackman)\
**Post date:** [March 19, 2022, 9:59pm UTC](https://root-forum.cern.ch/t/error-no-member-named-signbit-in-the-global-namespace/49130/6 "2022-03-19T21:59:15Z")

</div>

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

```auto
[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)

---

<div class="post-metadata">

**Author:** ![preimer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@preimer](https://root-forum.cern.ch/u/preimer)\
**Post date:** [March 19, 2022, 10:33pm UTC](https://root-forum.cern.ch/t/error-no-member-named-signbit-in-the-global-namespace/49130/7 "2022-03-19T22:33:48Z")

</div>

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:

```auto
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.

```auto
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.

---

<div class="post-metadata">

**Author:** ![preimer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@preimer](https://root-forum.cern.ch/u/preimer)\
**Post date:** [March 29, 2022, 11:04pm UTC](https://root-forum.cern.ch/t/error-no-member-named-signbit-in-the-global-namespace/49130/8 "2022-03-29T23:04:31Z")

</div>

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