Pytorch Build Error

Hi, I setup new Conda env and followed git to build from source, I got this error, It also instead all the requirements.txt without error.

/usr/include/x86_64-linux-gnu/bits/mathcalls.h:366:129: error:
‘_Float64x’ was not declared in this scope; did you mean
‘_Float16’?

366 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
    |                                                                                                                                 ^
    |                                                                                                                                 _Float16

/usr/include/x86_64-linux-gnu/bits/mathcalls.h:366:144: error: expected
primary-expression before ‘int’

366 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
    |                                                                                                                                                ^

/usr/include/x86_64-linux-gnu/bits/mathcalls.h:366:157: error: expected
primary-expression before ‘unsigned’

366 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
    |                                                                                                                                                             ^

/usr/include/x86_64-linux-gnu/bits/mathcalls.h:366:173: error: expression
list treated as compound expression in initializer [-fpermissive]

366 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
    |                                                                                                                                                                             ^

/usr/include/x86_64-linux-gnu/bits/mathcalls.h:370:29: error:
‘_Float64x’ was not declared in this scope; did you mean
‘_Float16’?

370 | __MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x));
    |                             ^~~~~~~~~
    |                             _Float16

/usr/include/x86_64-linux-gnu/bits/mathcalls.h:370:41: error: ‘__cx’
was not declared in this scope

370 | __MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x));
    |                                         ^~~~

/usr/include/x86_64-linux-gnu/bits/mathcalls.h:370:47: error: expected
primary-expression before ‘const’

370 | __MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x));
    |                                               ^~~~~

/usr/include/x86_64-linux-gnu/bits/mathcalls.h:370:68: error: expression
list treated as compound expression in initializer [-fpermissive]

370 | __MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x));
    |                                                                    ^

/usr/include/x86_64-linux-gnu/bits/mathcalls.h:377:8: error:
‘_Float64x’ does not name a type; did you mean ‘_Float16’?

377 | __MATHCALLX (fmaxmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
    |        ^~~~~~~~~
    |        _Float16

/usr/include/x86_64-linux-gnu/bits/mathcalls.h:377:104: error:
‘_Float64x’ does not name a type; did you mean ‘_Float16’?

377 | __MATHCALLX (fmaxmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));

Were you able to solve this? I’m facing the same error.

Can you check your gcc version and check its compatibility with Conda.
Upgrade your gcc as well

sudo apt-get install build-essential gcc g++

Then set the appropriate compiler flags before rebuilding

I encounter the same issue (unrecognized _Float64x) while trying uv pip install --no-build-isolation -v -e .

Use conda forge compilers and point build to that, it should avoid your “new glibc + old complier” trap try this bash: conda activate
conda install -c conda-forge compilers sysroot_linux-64
export CC=x86_64-conda-linux-gnu-gcc
export CXX=x86_64-conda-linux-gnu-g++
export CONDA_BUILD_SYSROOT=$CONDA_PREFIX/x86_64-conda-linux-gnu/sysroot

uv pip install --no-build-isolation -v -e . is basically the perfect recipe for surfacing this exact _Float64x failure, because it forces your build to use whatever compiler / headers / sysroot happen to be in your current environment, with no clean, isolated build environment to paper over mismatches.

With build isolation enabled (the default for many PEP 517 builds), pip creates a temporary build env and often pulls in compatible build requirements (or at least a consistent set of tools). You’re basically saying: “Use my existing environment exactly as-is.” So if your environment has: Newer glibc headers (system /usr/include/…),but an older compiler (or wrong C++ mode support), or a Conda environment that isn’t using Conda’s sysroot/toolchain then the build explodes at mathcalls.h with _Float64x not declared.