Skip to content

Add missing headers - #5518

Open
rupprecht wants to merge 1 commit into
facebookresearch:mainfrom
rupprecht:cmath-header
Open

Add missing headers#5518
rupprecht wants to merge 1 commit into
facebookresearch:mainfrom
rupprecht:cmath-header

Conversation

@rupprecht

Copy link
Copy Markdown

When using libc++ after llvm/llvm-project@ada3786, #include <random> does not imply #include <cmath>, so we need to directly import it to avoid breakages, e.g.

faiss/utils/random.cpp:140:40: error: use of undeclared identifier 'log'; did you mean 'long'?
  140 |                 x[i] = a * sqrt(-2.0 * log(s) / s);

While #include <cmath> is the only one necessary to fix a breakage from that LLVM commit, there are a few other C++ headers not being directly included, so I included those to prevent future breakages from refactorings.

@meta-cla

meta-cla Bot commented Aug 13, 2026

Copy link
Copy Markdown

Hi @rupprecht!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant