-
Notifications
You must be signed in to change notification settings - Fork 573
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
Address "Error 127" when trying to build libs with ETI and COMPLEX enabled #2141
Comments
FYI: I also discovered another undocumented option These three options should completely eliminate every "compile-line too long" error that even have seen in huge projects like CASL VERA that use CMake. This means that using these options that the TriBITS approach should work with the largest projects we can imagine. |
I did a more detailed Google search on "compiler response file" and it seems that nearly every major compiler (GCC, Intel, Clang, MS Visual C++) supports them as well as Ninja itself. But it looks like the IBM XL C++ compiler does not support *.rsp files that I can find. Therefore, this may not be a 100% portable solution. Just another reason not to use the IBM XL compiler. |
I am not sure we should pull the trigger on adding an automated setting of I think we need to research resolve all of the issues |
@bartlettroscoe : Is there a way to specify wildcards (*.o) instead of this response files ? I assume that will work in portable way. |
@srajama1 not that I know of with CMake. I will see if I can reproduce this failure and see what is going on. |
It looks like it is premature to be thinking about an automated way to set |
@bartlettroscoe Will IBM XL compiler's option @file (-qoptfile) do what you are looking for? |
Good to know that the XL compiler supports that ability. Unfortunately, it does not look like CMake knows about that option from grepping the CMake sources:
We have a contract with Kitware and I will ask them to add support for that for the IBM XL compiler when |
I created: |
FYI: CMake 3.11.0 will support response files for the IBM XL compiler (see https://gitlab.kitware.com/cmake/cmake/merge_requests/1691). Also, newer versions of CMake should automatically set |
Given that #2115 is resolved, can we close this or should we try to automatically set |
But I guess we should at least document |
@bartlettroscoe I would say, let's open a new issue that says "either set that CMake option automatically, or document that it's needed and fail the configure if it's not set." |
We could. But it might be just as fast to just add a section to the document: Then we can leave this issue here in the backlog to perhaps automated this if justified. But I suspect that very few people are doing a CUDA+ETI+COMPLEX builds and we can just point them to the documentation. If I write up some updated documentation on a branch could you review that real fast? |
@bartlettroscoe wrote:
Yes, gladly :-) . If you need a faster response just call my office phone. |
@bartlettroscoe wrote:
We want Sierra to use ETI, and Sierra always enables complex. |
Is Sierra doing CUDA builds? In any case, Sierra is just one customer so if we tell them about this option then they will add it. Who else would use CUDA+ETI+COMPLEX? |
@bartlettroscoe Any of various ATDM projects. External users about which I don't know. |
So much for "real fast" but can you please review the new documentation for these CMake vars at: If you find any typos or other problems, please let me know and I will fix them. Otherwise, this will automatically update the Trilinos build reference guild: the next time I update the snapshot of TriBITS. |
@bartlettroscoe Thanks! I just have one question about the documentation: Should users always set all three of those options the same, or might it make sense only to enable some of them? |
@mhoemmen, please take a look at the new "NOTE" in the updated section: Does that answer your question? |
@bartlettroscoe Yes it does -- thanks Ross! This helps a lot :D |
@trilinos/tpetra See the following GitHub issue: trilinos#2141 and the following detailed instructions: https://tribits.org/doc/TribitsBuildReference.html#enabling-the-usage-of-resource-files-to-reduce-length-of-build-lines Thanks to @bartlettroscoe for the instructions!
Addresses: TriBITSPub/TriBITS#216, #2324, #2141 Build/Test Cases Summary Enabled Packages: Disabled Packages: PyTrilinos,Claps,TriKota Enabled all Packages 0) MPI_RELEASE_DEBUG_SHARED_PT => passed: passed=2564,notpassed=0 (107.48 min) Other local commits for this build/test group: e45ac5f, e1df790
Add work-around for "Error 127" kokkos-kernels CUDA build link error to Tpetra's FAQ. See Trilinos/packages/tpetra/doc/FAQ.txt. This commit ONLY affects Tpetra's documentation. It does not touch source code files. @trilinos/tpetra See the following GitHub issue: #2141 and the following detailed instructions: https://tribits.org/doc/TribitsBuildReference.html#enabling-the-usage-of-resource-files-to-reduce-length-of-build-lines Thanks to @bartlettroscoe for the instructions!
Add work-around for "Error 127" kokkos-kernels CUDA build link error to Tpetra's FAQ. See Trilinos/packages/tpetra/doc/FAQ.txt. This commit ONLY affects Tpetra's documentation. It does not touch source code files. @trilinos/tpetra See the following GitHub issue: trilinos#2141 and the following detailed instructions: https://tribits.org/doc/TribitsBuildReference.html#enabling-the-usage-of-resource-files-to-reduce-length-of-build-lines Thanks to @bartlettroscoe for the instructions!
Given the recent CASL experience with trying use With that, should we just reduce the scope of the Issue to what has been completed (i.e. the documentation added to TriBITS) and then close this issue? |
@bartlettroscoe I think it makes sense to close this issue. I will do so. I also opened a kokkos-kernels issue kokkos/kokkos-kernels#176 to add some CMake logic in that package, for the specific issue that the package itself creates. Thanks! |
CC: @trilinos/framework, @trilinos/kokkos, @trilinos/kokkos-kernels
Next Action Status
Waiting to resolve all of the issues with
CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS=ON
(e.g. #2115) before trying to automate turning this on ...Description
This issue is to address the problem with the library creation command failing with "Error 127" with KokkosKernels with CUDA, ETI, and COMPLEX enabled described in kokkos/kokkos-kernels#141. The issue is that Kokkos and KokkosKernels create a bunch of *.cpp files, one for each function, instantiation set, and scalar type. This quickly explodes to hundreds of *.cpp files per library and therefore hundreds of *.o files when creating a library. It seems that some compilers choke on that many object files and just return "Error 127". Christian found the CMake option
CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS
that when set toTRUE
will put the list of all of the object files into a*.rsp
file that is then passed to the command to create the library. This was reported to solve the problem described in kokkos/kokkos-kernels#141.It turns out that the option
CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS
is not documented in the official CMake documentation. There are just a few references to it when you Google. Apparently, this option is only meant to be set in a compiler toolchain file for a given system. However, Google searches mention this options working with Linux GCC compilers, Windows Visual Studio compilers, and MAC OS-X. Therefore, we might hope that it is somewhat portable.The proposed solution that we will attempt to implement in this Issue is to put in automatic logic to set
CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS
when ETI is enabled, COMPLEX is enabled, and KokkosKernels is enabled. I think this case works right now and only fails when CUDA is also enabled which doubles the number of *.o files (one for the host CPU, and one for the GPU). But talking with @crtrott, it seems likely that as KokkosKernels is continued to be developed that we will hit this "Error 127" soon even without CUDA enabled. Therefore, it seems like a good idea to go ahead and turn this on by default when just ETI, COMPLEX and KokkosKernels are enabled.I will add a
NOTE:
to the CMake output remarking that this var is being set and then just cross our fingers that the target system will support this feature. Since there are fairly few clients that will enable ETI, COMPLEX and KokkosKernels, hopefully this will not cause a lot of trouble.I guess to be safe, we could add a configure-time test to make sure that
CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS=ON
works for the selected compilers and other options but that would be a good bit of work (since we would have to create a separate dummy CMake project to try this out and verify that a *.rsp file is getting used). In fact, if we do that, we should just always setCMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS=ON
if we determine that response files are supported for the selected compilers and system. Since this will take a bit more work we can avoid doing this for now. But If we discover that this people are getting broken builds due to this logic, we can go ahead and implement the more sophisticated configure-time check and be done with this once and for all.Related Issues
The text was updated successfully, but these errors were encountered: