Page MenuHomePhabricator

[flang] Fix -intrinsic-module-directory in flang script
ClosedPublic

Authored by tskeith on Dec 17 2020, 3:53 PM.

Details

Summary

The flang wrapper script that was created as bin/flang in an in-tree
build did not have a correct -intrinsic-module-directory option.
It was correct for out-of-tree builds and for both kinds of installs.

The fix is to pick the correct directory based on what exists.

The script is no longer configured by cmake (just copied) so that
mechanism can be deleted from the cmake file.

Diff Detail

Event Timeline

tskeith created this revision.Dec 17 2020, 3:53 PM
tskeith requested review of this revision.Dec 17 2020, 3:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 17 2020, 3:53 PM

I was able to invoke the "runtest" on both in-tree and out-of-tree builds. What command were you using to invoke "runtest" that caused the problem?

I invoked it by "cd"ing to the install directory for an in-tree build. I then invoked a script that starts as follows:

#!/bin/bash
PGI="-pgi ."
xargs -L 1 -P 40 -I CMD bash -c CMD <<EOF
# PLATFORM f18 fcvs | qsub -l nodes=1:linux:gcc72p
/proj/ta/bin/runtest -compiler llvm -env F18_FC=nvfortran NO_STOP_MESSAGE=1 -suite fcvs
# PLATFORM f18 nag f95 | qsub -l nodes=1:linux:gcc72p
/proj/ta/bin/runtest -compiler llvm -env F18_FC=nvfortran NO_STOP_MESSAGE=1 -suite nag_f95_arrays
/proj/ta/bin/runtest -compiler llvm -env F18_FC=nvfortran NO_STOP_MESSAGE=1 -suite nag_f95_handbook

You need a test that depends on intrinsic modules:

$ cat t.f90
use iso_c_binding
end

$ build/Release-clang-9.0.0/bin/flang -c t.f90
t.f90:1:5: error: Error reading module file for module 'iso_c_binding'
  use iso_c_binding
      ^^^^^^^^^^^^^
sscalpone accepted this revision.Dec 17 2020, 6:03 PM

Nice simplification!

This revision is now accepted and ready to land.Dec 17 2020, 6:03 PM
PeteSteinfeld accepted this revision.Dec 17 2020, 6:17 PM

All looks good. I tested the resulting compiler on both in-tree and out-of-tree builds and as able to run "runtest" for all configurations without a problem.

This revision was landed with ongoing or failed builds.Dec 17 2020, 7:08 PM
This revision was automatically updated to reflect the committed changes.