[Flang-dev] Fortran compatible ninja; flang circular dependencies

Stephen Scalpone sscalpone at nvidia.com
Fri Oct 12 11:55:16 EDT 2018

There’s an issue raised on github about the ieee_arithmetic.F95 build problem.  The the flang libraries are built twice, once as a shared library and once as a static library.  Both builds write their mod files to the same directory (‘include’), which is the problem.  Seems like we need to fix the build to use the -module option for compilations & then atomically copy the resulting .mod files into the include directory.  It’s probably a good idea to verify that the mod files are the same except for the time stamp.

From: flang-dev <flang-dev-bounces at lists.flang-compiler.org> on behalf of blubee blubeeme <gurenchan at gmail.com>
Date: Friday, October 12, 2018 at 1:03 AM
To: "flang-dev at lists.flang-compiler.org" <flang-dev at lists.flang-compiler.org>
Subject: Re: [Flang-dev] Fortran compatible ninja; flang circular dependencies

On Fri, Oct 12, 2018 at 2:39 PM blubee blubeeme <gurenchan at gmail.com<mailto:gurenchan at gmail.com>> wrote:
There's a fork of ninja that supports fortran files: https://github.com/ninja-build/ninja

When attempting to build you'll get an error:

You can change that from error to warning with
-w dupbuild=warn

but then the build still fails with circular dependencies:
-- Build files have been written to: /wrkdirs/usr/ports/devel/pflang/work/.build
ninja: warning: multiple rules generate include/iso_c_binding.mod. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: error: dependency cycle: runtime/flang/CMakeFiles/flang_shared.dir/Fortran.dd -> runtime/flang/CMakeFiles/flang_shared.dir/ieee_arithmetic.F95-pp.f95.ddi -> include/iso_c_binding.mod -> runtime/flang/CMakeFiles/flang_shared.dir/iso_c_bind.F95.o -> runtime/flang/CMakeFiles/flang_shared.dir/Fortran.dd

It doesn't fail with Makefiles but ninja allows building a lot faster.

Is this something that the flang developers are interested in taking a look at?

I forgot to mention but building libpgmath with kitware ninja works just fine.


This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.flang-compiler.org/pipermail/flang-dev_lists.flang-compiler.org/attachments/20181012/917ed7c8/attachment.html>

More information about the flang-dev mailing list