-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add missing fstream include to fix std::ofstream compilation error #162421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is the error message we got: ``` torch/csrc/distributed/c10d/FlightRecorder.cpp:8:17: error: implicit instantiation of undefined template 'std::basic_ofstream<char>' 8 | std::ofstream file(filename_, std::ios::binary); | ^ libcxx/include/__fwd/fstream.h:26:7: note: template is declared here 26 | class basic_ofstream; | ^ 1 error generated. ```
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/162421
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit ecdc35f with merge base fecd968 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This is the error message we got: ``` torch/csrc/distributed/c10d/FlightRecorder.cpp:8:17: error: implicit instantiation of undefined template 'std::basic_ofstream<char>' 8 | std::ofstream file(filename_, std::ios::binary); | ^ libcxx/include/__fwd/fstream.h:26:7: note: template is declared here 26 | class basic_ofstream; | ^ 1 error generated. ```
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: Auto Request Review Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…ytorch#162421) ## Summary This PR adds a missing `#include <fstream>` to fix a compilation error that occurred with the clang compiler on the standard *Google internal compile setup* (built with bazel). ## Details The `std::ofstream` type was implicitly instantiated, which can cause compilation to fail with certain compilers. In this case, the clang compiler within the Google internal compile setup failed with an implicit instantiation error of `std::basic_ofstream<char>`. By explicitly including the `<fstream>` header, this PR resolves the error and ensures proper compilation in a wider range of setups and compilers. ## Error message: ``` torch/csrc/distributed/c10d/FlightRecorder.cpp:8:17: error: implicit instantiation of undefined template 'std::basic_ofstream<char>' 8 | std::ofstream file(filename_, std::ios::binary); | ^ libcxx/include/__fwd/fstream.h:26:7: note: template is declared here 26 | class basic_ofstream; | ^ 1 error generated. ``` Pull Request resolved: pytorch#162421 Approved by: https://github.com/ezyang
…ytorch#162421) ## Summary This PR adds a missing `#include <fstream>` to fix a compilation error that occurred with the clang compiler on the standard *Google internal compile setup* (built with bazel). ## Details The `std::ofstream` type was implicitly instantiated, which can cause compilation to fail with certain compilers. In this case, the clang compiler within the Google internal compile setup failed with an implicit instantiation error of `std::basic_ofstream<char>`. By explicitly including the `<fstream>` header, this PR resolves the error and ensures proper compilation in a wider range of setups and compilers. ## Error message: ``` torch/csrc/distributed/c10d/FlightRecorder.cpp:8:17: error: implicit instantiation of undefined template 'std::basic_ofstream<char>' 8 | std::ofstream file(filename_, std::ios::binary); | ^ libcxx/include/__fwd/fstream.h:26:7: note: template is declared here 26 | class basic_ofstream; | ^ 1 error generated. ``` Pull Request resolved: pytorch#162421 Approved by: https://github.com/ezyang
…ytorch#162421) ## Summary This PR adds a missing `#include <fstream>` to fix a compilation error that occurred with the clang compiler on the standard *Google internal compile setup* (built with bazel). ## Details The `std::ofstream` type was implicitly instantiated, which can cause compilation to fail with certain compilers. In this case, the clang compiler within the Google internal compile setup failed with an implicit instantiation error of `std::basic_ofstream<char>`. By explicitly including the `<fstream>` header, this PR resolves the error and ensures proper compilation in a wider range of setups and compilers. ## Error message: ``` torch/csrc/distributed/c10d/FlightRecorder.cpp:8:17: error: implicit instantiation of undefined template 'std::basic_ofstream<char>' 8 | std::ofstream file(filename_, std::ios::binary); | ^ libcxx/include/__fwd/fstream.h:26:7: note: template is declared here 26 | class basic_ofstream; | ^ 1 error generated. ``` Pull Request resolved: pytorch#162421 Approved by: https://github.com/ezyang
…ytorch#162421) ## Summary This PR adds a missing `#include <fstream>` to fix a compilation error that occurred with the clang compiler on the standard *Google internal compile setup* (built with bazel). ## Details The `std::ofstream` type was implicitly instantiated, which can cause compilation to fail with certain compilers. In this case, the clang compiler within the Google internal compile setup failed with an implicit instantiation error of `std::basic_ofstream<char>`. By explicitly including the `<fstream>` header, this PR resolves the error and ensures proper compilation in a wider range of setups and compilers. ## Error message: ``` torch/csrc/distributed/c10d/FlightRecorder.cpp:8:17: error: implicit instantiation of undefined template 'std::basic_ofstream<char>' 8 | std::ofstream file(filename_, std::ios::binary); | ^ libcxx/include/__fwd/fstream.h:26:7: note: template is declared here 26 | class basic_ofstream; | ^ 1 error generated. ``` Pull Request resolved: pytorch#162421 Approved by: https://github.com/ezyang
Summary
This PR adds a missing
#include <fstream>
to fix a compilation error that occurred with the clang compiler on the standard Google internal compile setup (built with bazel).Details
The
std::ofstream
type was implicitly instantiated, which can cause compilation to fail with certain compilers. In this case, the clang compiler within the Google internal compile setup failed with an implicit instantiation error ofstd::basic_ofstream<char>
. By explicitly including the<fstream>
header, this PR resolves the error and ensures proper compilation in a wider range of setups and compilers.Error message:
cc @H-Huang @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @pragupta @ezyang @msaroufim @haifeng-jin