Repository navigation
Conversation
…he example on linux64 with flang Mirrors the docker support in qef/etc/docker, trimmed to hello's needs: a conda-forge env with the clang/flang toolchain plus pyre/python/pybind11, and an mm.yaml that leans on the new support (mode: conda, pkgdb: conda) so it needs no prefix/bldroot/pycPrefix or external package database. config.mm is empty since conda resolves every external dependency. The image mounts the whole mm repo so both the build tool and this example come along; building it exercises mat.f03 through flang to validate make/compilers/clang/flang.mm on linux64.
…rt.runtime for mixed builds
flang has no {-pipe} option, so clear {flang.compile.base}. The LLVM Flang-RT runtime
library was renamed from {FortranRuntime} to {flang_rt.runtime} (libflang_rt.runtime.so);
point {flang.mixed.libraries} at it so a c/c++-driven link of a target with Fortran objects
resolves symbols like {_FortranAAssign}.
The {flang} conda package is compiler-only; add {libflang-rt} so the runtime
({libflang_rt.runtime.so}) is present. Declare {fortran} on {hello.lib.extern} so mm injects
{flang.mixed.libraries} into the c++-driven link of the library that carries {mat.f03}.
The mount source referenced $(hello.home) with := , which expands while the config file is included — before docker-images.init sets the project home, so -warn-undefined flagged it. Use = so hello.home is read when the mount is assembled instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make the LLVM flang Fortran compiler usable under mm and prove it end-to-end by building
the
helloexample (mixed C/C++/Fortran) on a real linux64 box.flang compiler support (
make/compilers/clang/flang.mm)-pipefromflang.compile.base— flang does not accept it.flang.mixed.librariesatflang_rt.runtime(libflang_rt.runtime.so), theLLVM Flang-RT runtime, replacing the stale
FortranRuntimename. This is what suppliessymbols like
_FortranAAssignwhen a non-Fortran compiler drives the link of a targetthat contains Fortran objects.
Installing flang from conda-forge
To get a functioning flang toolchain, install:
flang— the compiler. Provides the plainflangdriver onPATH(bin/flang),the compiler libraries, headers, and
libFortranDecimal. This package iscompiler-only — it does not include the runtime.
libflang-rt— the LLVM Flang-RT runtime (libflang_rt.runtime.so), which defines the_FortranA*symbol namespace (e.g._FortranAAssign). Required to link any program withFortran objects; without it the link fails with unresolved
_FortranA*symbols.Notes:
flang_linux-64for mm. That is the autotools/cmake activationmetapackage (gcc_linux-64 analogue): it sets
FC/sysroot env, ships an emptybin/, anddrags in
clangdev+compiler-rt_linux-64. mm invokes the plainflangdriver directly(
flang.driver := flang) and ignores conda's activation, soflang+libflang-rtis thecorrect, minimal set.
linux64 test harness (
examples/hello/etc/docker/questing-clang/)A docker image, modeled on
qef/etc/dockerand trimmed to hello, for building and testingthe example on linux64 at will:
ubuntu:questing+ micromamba env with the clang/flang toolchain (per above) and hello's deps.mm.yamlleans on the new support:mode: conda(noprefix/bldroot/pycPrefix) andpkgdb: conda(no external package database);config.mmis therefore empty.hello.docker-images := hello.questing-clang+includeinhello.mm.Because hello lives inside the mm repo, the image mounts the whole repo (build tool +
example);
mounts.sourceuses deferred (=) expansion so it survives-warn-undefined.hello example wiring
hello.lib.extern := pyre fortran— thefortranextern is mm's mixed-language seam; itinjects
flang.mixed.librariesinto the clang++-driven link of the library carryingmat.f03, resolving the Fortran runtime symbols.Validation
Builds and tests clean on a real linux64 machine.
Note: this branch also carries a few unrelated
examples/hellorepairs (package meta, aregistration typo, the plexus banner, a cli/package-name collision) that are incidental to
flang support.