[PATCH] D97527: [test-suite] SPEC2017 CPU CAM4 floating point tests.

Nichols A. Romero via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 1 21:29:55 PST 2021


naromero77 added inline comments.


================
Comment at: External/SPEC/CFP2017rate/527.cam4_r/CMakeLists.txt:47-51
+# two binaries (exe,validator) are in the same directory with
+# overlapping source and ninja gives a hard error during the depency
+# analysis because it leads to duplicate rules for common modules
+# modules. Create a OBJECT library from netcdf sources and re-use the
+# this target
----------------
Meinersbur wrote:
> naromero77 wrote:
> > Meinersbur wrote:
> > > The same source used for multiple artifacts is supposed to work for C/C++ (e.g. often used to build a shared and static library). Is this a bug in CMake's Fortran support?
> > > 
> > > Another thing you could try to build the validator in another CMakeLists.txt added by `add_subdirectory`. Different add_subdirectories have independent dependency analyses. An (object) library might still be preferable to not compile these files twice.
> > Ninja came to a hard stop because of multiple rules generating the same module file error. I spent a while searching online for a work around. In some CMake issues, it looks like it was a known "behavior" with CMake + Ninja specific to Fortran. In previous version of ninja, it was only a warning, but now its a hard error. It looked like it was still possible to override this behavior with a optional flag to ninja. However since they are they same source files it was just as easy to make it an (object) library and to avoid the duplicate compile.
> > 
> > I did not try to build the validator in a separate CMakeLists.txt and perhaps indeed this would have solved my issue as well.
> Could you point me the online sites you found?
> 
> However, I don't think it's worth looking for better workarounds.
Here is the most recent one which is still open:
https://gitlab.kitware.com/cmake/cmake/-/issues/20181

Here is another one, where the original issue was allegedly fixed:
https://gitlab.kitware.com/cmake/cmake/-/issues/17601

Here is an older one though that suggests its a build specific problem:
https://github.com/ninja-build/ninja/issues/543



Repository:
  rT test-suite

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97527/new/

https://reviews.llvm.org/D97527



More information about the llvm-commits mailing list