-
Notifications
You must be signed in to change notification settings - Fork 579
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
using the custom ninja build rebuilds fortran files every time #261
Comments
@bathmatt and I found that
This is a dependency on a directory instead of a file and causes a rebuild whenever the directory modification time is updated. In the Fortran preprocessor output file
we see the line:
This line tells CMake's dependency extraction that the preprocessor used the directory as input. This may be a bug in the compiler, but I've taught CMake to tolerate it in commit Kitware/CMake@f831d75 by filtering out dependencies that are not on actual files. |
|
This is unlikely because all the change does is remove (incorrect) dependencies. The behavior Matthew observed is likely due to other environment changes (e.g. the location of cmake). We'll have to wait for Matthew to have time to do a fresh build, bring it up to date, and then try to reproduce the original problem. I cannot reproduce it because it requires a compiler whose preprocessor generates these line directives referencing directories. |
Depending on how long Matt is gone, I may be able to try this out before Matt gets back as part of getting the CUDA builds to work as part of #172. |
The patch that you suggested causes over 2000 files to be rebuilt every time, I reverted it, Sorry this has taken so long to reply, but I was out of the country. |
That should not be possible. All the patch does is filter out some dependencies. I suspect some rebuilds may be caused by inconsistencies left due to the switch between versions. Please leave the patch applied, create a whole new build tree from scratch, allow a full build to complete, and then run |
There was a compilation error with about 60 files to build, did the explain after that, went back to 2555 files to build., attached |
The
Running
That is what explains why things are rebuilding. |
I've done a rm -rf on the build dir, there is an error in my build with This is with the patch, It looks like something with ninja and nvcc_wrapper On Thu, Apr 28, 2016 at 6:33 AM, Brad King [email protected] wrote:
|
Also, this is only an issue when I use ninja, not when I build with make. |
This is the part for which we need |
I attached that previously, and you mentioned it was for an incomplete On Thu, Apr 28, 2016 at 10:52 AM, Brad King [email protected]
|
I'm attaching a fresh copy of the explain output, |
I'm saying that the file does not have the output that it should. Please run this:
and send it to me via private email. |
Do you want me to wait for it to compile the files that it can? That is about 1-1.5 hours to go through the list or can I hit ^C once it starts compiling? |
Thanks for sending the file. I see output like this in it:
These appear to be temporary files used by the compiler wrapper to do preprocessing. This causes the preprocessor output to have |
The reason CMake tries to extract dependencies from the $ >foo.f
$ gfortran -cpp -MD -MT foo.f-pp.f -MF foo.f-pp.f.d -E foo.f >/dev/null
$ cat foo.f-pp.f.d
foo.o foo.f-pp.f: foo.f The Please try running the above example with your Fortran compiler substituted for gfortran (it may need an option different than |
I'm using gfortran as well. foo.o foo.f-pp.f: foo.f On Thu, Apr 28, 2016 at 11:51 AM, Brad King [email protected]
|
Please send me your build.ninja and rules.ninja files via private email. |
Looking again at the build log you sent I'll quote another line of context this time:
This seems to indicate that the bogus dependency is actually attached to a regular C++ source and has nothing to do with the Fortran support or the Please run
and send me the |
From the
This indicates that Ninja has recorded a dependency on that temporary file. This is on a C++ build rule and has nothing to do with Fortran support. Here are the relevant pieces of the
Somehow the compiler is reporting a dependency on a temporary file to Ninja. I cannot reproduce this. I tried building Trilinos with Open MPI 1.10.2 wrapping around GNU 4.9.3 and got: $ ninja -t deps commonTools/gtest/CMakeFiles/gtest.dir/gtest/gtest-all.cc.o
commonTools/gtest/CMakeFiles/gtest.dir/gtest/gtest-all.cc.o: #deps 2, deps mtime 1461874185 (VALID)
/.../commonTools/gtest/gtest/gtest-all.cc
/.../commonTools/gtest/gtest/gtest.h |
I think the next step for you is to try building with plain upstream CMake and plain upstream Ninja but not turning on Fortran support. Enable only the Gtest package:
|
I can't turn off fortran with this because of some dependence issues. I get mapvarlib or something like that issue. |
@bradking, are there no machines at Kitware that have a GPU with CUDA installed? |
Make sure no other packages besides Gtest are ON, e.g.:
|
What does this have to do with CUDA? Matthew is using the MPI compilers. |
I believe that Matt's setup is using OpenMPI which is using nvcc_wrapper (a wrapper for nvcc) as the native C++ compiler. Is that right @bathmatt? |
correct.
I believe that Matt's setup is using OpenMPI which is using nvcc_wrapper (a wrapper for nvcc) as the native C++ compiler. Is that right @bathmatt? |
What are your values for |
nvcc_wrapper |
Matt, I hope you mean that OMPI_CXX=nvcc_wrapper. OMPI_CC and OMPI_FC should be empty. |
@crtrott correct, |
Okay, now that I understand what compilers are actually being run, I've reproduced this: $ export PATH=/path/to/Trilinos/packages/kokkos/config:$PATH
$ export OMPI_CC=gcc-4.9
$ export OMPI_CXX=nvcc_wrapper
$ export OMPI_FC=gfortran-4.9
$ export NVCC_WRAPPER_DEFAULT_COMPILER=g++-4.9
$ export CC=mpicc CXX=mpicxx FC=mpifort
$ cmake ../Trilinos -GNinja -DTrilinos_ENABLE_Fortran=OFF -DTrilinos_ENABLE_Gtest:STRING=ON -DTPL_ENABLE_Matio=OFF
$ ninja commonTools/gtest/CMakeFiles/gtest.dir/gtest/gtest-all.cc.o
[1/1] Building CXX object commonTools/gtest/CMakeFiles/gtest.dir/gtest/gtest-all.cc.o
$ ninja -t deps commonTools/gtest/CMakeFiles/gtest.dir/gtest/gtest-all.cc.o
commonTools/gtest/CMakeFiles/gtest.dir/gtest/gtest-all.cc.o: #deps 1, deps mtime 1461877049 (VALID)
/tmp/tmpxft_000037f8_00000000-14_gtest-all.ii
$ ninja -d explain commonTools/gtest/CMakeFiles/gtest.dir/gtest/gtest-all.cc.o
ninja explain: output /tmp/tmpxft_000037f8_00000000-14_gtest-all.ii of phony edge with no inputs doesn't exist
ninja explain: /tmp/tmpxft_000037f8_00000000-14_gtest-all.ii is dirty
[1/1] Building CXX object commonTools/gtest/CMakeFiles/gtest.dir/gtest/gtest-all.cc.o This is with a CMake and Ninja that are not modified with my Fortran work. Further investigation will be needed to see how that dependency ends up there. |
Since the discussion here got side-tracked by figuring out how to reproduce the issue, and ended up concluding it is not related to the custom CMake or Ninja versions, I've opened a new issue #321 to record the actual problem. I propose closing this issue in favor of that one, and moving discussion over there. |
FYI: As is being tracked in: the updated After that, the new automated ATDM build of CUDA submitting to the Trilinos CDash site will switch back over to use ninja and will help maintain this capability. |
This issue has had no activity for 365 days and is marked for closure. It will be closed after an additional 30 days of inactivity. |
@bartlettroscoe
Everytime configure runs all the fortran files are rebuilt using the custom ninja. I edit the cmakefiles.txt in panzer and it recompiles all the fortran files, 1300 or so of them.
The text was updated successfully, but these errors were encountered: