Giter VIP home page Giter VIP logo

Comments (7)

jmontleon avatar jmontleon commented on September 22, 2024 2

Did I file this in the wrong place? cpuinfo is included in the third_party deps of pytorch and this repo is within the pytorch org. I had assumed you all talk occasionally?

The only option I see available in pytorch is -DUSE_SYSTEM_PYTORCH to use a version provided by the system rather than bundled in the third party repo.

And the cmake warning when building on unsupported architectures:

CMake Warning at third_party/cpuinfo/CMakeLists.txt:81 (MESSAGE):
  Target processor architecture "s390x" is not supported in cpuinfo.  cpuinfo
  will compile, but cpuinfo_initialize() will always fail.

from cpuinfo.

jmontleon avatar jmontleon commented on September 22, 2024 1

To you question, "Why is syscall undeclared on Red Hat?", I don't think this is distribution specific. As mentioned I don't have this problem on amd64 or aarch64 using the same version of clang. Rather it seems a difference in architectures.

One of the explanations I see is:
"#define _GNU_SOURCE before including unistd.h or any other header as syscall(2) is not POSIX."
https://stackoverflow.com/questions/42469583/problems-calling-syscall-function-in-c

It's also present in the example within the man page
https://man7.org/linux/man-pages/man2/syscall.2.html#EXAMPLES

Putting this define at the top of the file does seem to resolve the build failure. I don't have a strong enough understanding at present to say why it's necessary for some architectures and not others.

from cpuinfo.

Maratyszcza avatar Maratyszcza commented on September 22, 2024

Why is syscall undeclared on Red Hat?

from cpuinfo.

Maratyszcza avatar Maratyszcza commented on September 22, 2024

Also, cpuinfo doesn't support ppc64 and s390x

from cpuinfo.

jmontleon avatar jmontleon commented on September 22, 2024

Is there a way to build pytorch without it?

from cpuinfo.

Maratyszcza avatar Maratyszcza commented on September 22, 2024

I don't know, you should ask PyTorch devs

from cpuinfo.

bhbruce avatar bhbruce commented on September 22, 2024

@Maratyszcza syscall is not a standard function in posix.

It is implemented in glibc. It looks like the Clang has strict constraints (compared to GCC) ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration].

The man page https://linux.die.net/man/2/syscall also show that we should add #define _GNU_SOURCE before including headers.

from cpuinfo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.