Package Details: flang 21.1.4-1

Git Clone URL: https://aur.archlinux.org/flang.git (read-only, click to copy)
Package Base: flang
Description: ground-up implementation of a Fortran front end written in modern C++
Upstream URL: http://llvm.org/
Licenses: Apache-2.0 WITH LLVM-exception
Submitter: xantares
Maintainer: xantares
Last Packager: xantares
Votes: 5
Popularity: 0.124803
First Submitted: 2023-08-25 22:06 (UTC)
Last Updated: 2025-11-02 14:41 (UTC)

Latest Comments

1 2 Next › Last »

xantares commented on 2025-11-02 15:14 (UTC)

I added the flang-rt lib

MartinDiehl commented on 2025-10-30 09:29 (UTC) (edited on 2025-10-30 09:29 (UTC) by MartinDiehl)

compilation of 21.1.4-1 works for me but invoking flang fails with /usr/bin/ld: cannot find -lflang_rt.runtime: No such file or directory

HurricanePootis commented on 2025-09-06 20:32 (UTC)

@xantares Your package could do with the following:

  1. Add clang and llvm-libs to depends()
  2. Make the license() SPDX compliant
  3. Make the package more compliant with the CMake packaging guidelines
diff --git a/PKGBUILD b/PKGBUILD
index e8e8964..e52085f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,9 +4,9 @@ pkgrel=1
 pkgdesc="ground-up implementation of a Fortran front end written in modern C++"
 arch=('x86_64')
 url="http://llvm.org/"
-license=('custom:Apache 2.0 with LLVM Exception')
-depends=("mlir>=${pkgver%%.*}")
-makedepends=('cmake' 'python' 'clang' 'llvm')
+license=('Apache-2.0 WITH LLVM-exception')
+depends=("mlir>=${pkgver%%.*}" "clang" "llvm-libs")
+makedepends=('cmake' 'python' 'llvm')
 _source_base=https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver
 source=($_source_base/flang-$pkgver.src.tar.xz{,.sig}
         $_source_base/cmake-$pkgver.src.tar.xz{,.sig}
@@ -27,19 +27,18 @@ prepare() {
 build() {
   cp -r clang{-$pkgver.src,}
   cp -r cmake{-$pkgver.src,}
-  cd flang-$pkgver.src
   export CXXFLAGS="${CXXFLAGS} -Wp,-U_GLIBCXX_ASSERTIONS"
   cmake \
+    -B build -S flang-$pkgver.src \
+    -GNinja \
     -DCMAKE_BUILD_TYPE=Release \
     -DCMAKE_INSTALL_PREFIX=/usr \
     -DCLANG_DIR=/usr/lib/cmake/clang/ \
     -DMLIR_TABLEGEN_EXE=/usr/bin/mlir-tblgen \
-    -DFLANG_INCLUDE_TESTS=OFF \
-    -B build -S .
-  make -C build
+    -DFLANG_INCLUDE_TESTS=OFF
+  cmake --build build
 }

 package() {
-  cd flang-$pkgver.src
-  make DESTDIR="${pkgdir}" install -C build
+  DESTDIR="$pkgdir" cmake --install build
 }

e-kwsm commented on 2025-06-16 14:21 (UTC)

omp_lib.mod and omp_lib_kinds.mod are missed. We have to compile omp_lib.F90 by flang and install the modules.

xantares commented on 2025-01-16 17:56 (UTC)

how about now ?

MartinDiehl commented on 2025-01-16 17:37 (UTC)

I can't build in a clean chroot:

➜  flang git:(master) extra-x86_64-build -- -I ~/mlir-19.1.6-1-x86_64.pkg.tar.zst

leads to

[==> WARNING: Skipping all source file integrity checks.
==> Extracting sources...
  -> Extracting flang-19.1.6.src.tar.xz with bsdtar
  -> Extracting cmake-19.1.6.src.tar.xz with bsdtar
  -> Extracting clang-19.1.6.src.tar.xz with bsdtar
==> Starting prepare()...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  3004    0  3004    0     0   5272      0 --:--:-- --:--:-- --:--:--  5272
patching file CMakeLists.txt
Hunk #1 succeeded at 82 (offset -7 lines).
Hunk #2 succeeded at 100 (offset -7 lines).
Hunk #3 succeeded at 123 (offset -6 lines).
==> Starting build()...
CMake Deprecation Warning at /build/flang/src/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0114 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  CMakeLists.txt:7 (include)


CMake Deprecation Warning at /build/flang/src/cmake/Modules/CMakePolicy.cmake:11 (cmake_policy):
  The OLD behavior for policy CMP0116 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  CMakeLists.txt:7 (include)


Building Flang as a standalone project.
-- The C compiler identification is GNU 14.2.1
-- The CXX compiler identification is GNU 14.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:86 (find_package):
  Could not find a package configuration file provided by "LLVM" with any of
  the following names:

    LLVMConfig.cmake
    llvm-config.cmake

  Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set
  "LLVM_DIR" to a directory containing one of the above files.  If "LLVM"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Build failed, check /var/lib/archbuild/extra-x86_64/m/build

xantares commented on 2023-11-08 17:07 (UTC)

could you update and retry ?

Logrus commented on 2023-11-05 15:23 (UTC) (edited on 2023-11-05 15:33 (UTC) by Logrus)

Here are makepkg.conf https://drive.google.com/file/d/1KIK487enTswoyN4ljk2tKUxMbDGJAjCj/view?usp=sharing Here are log.txt of makepkg command https://drive.google.com/file/d/1t7_dOZ59dnK67PS6YNZVrbEj97OGfCCB/view

Logrus commented on 2023-11-05 15:18 (UTC) (edited on 2023-11-05 15:34 (UTC) by Logrus)

Sorry for Wall of Text

#Console output

makepkg -si > log.txt flang-16.0.6.src.tar.xz ... Passed flang-16.0.6.src.tar.xz.sig ... Skipped cmake-16.0.6.src.tar.xz ... Passed cmake-16.0.6.src.tar.xz.sig ... Skipped clang-16.0.6.src.tar.xz ... Passed clang-16.0.6.src.tar.xz.sig ... Skipped flang-16.0.6.src.tar.xz ... Passed cmake-16.0.6.src.tar.xz ... Passed clang-16.0.6.src.tar.xz ... Passed CMake Deprecation Warning at /home/user/flang/src/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy): The OLD behavior for policy CMP0114 will be removed from a future version of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all policies are deprecated and that a policy should be set to OLD only under specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD. Call Stack (most recent call first): CMakeLists.txt:6 (include)

Building Flang as a standalone project. /home/user/flang/src/flang-16.0.6.src/lib/Lower/ConvertCall.cpp: In member function ‘bool {anonymous}::ElementalUserCallBuilder::canLoadActualArgumentBeforeLoop(unsigned int) const’: /home/user/flang/src/flang-16.0.6.src/lib/Lower/ConvertCall.cpp:902:17: warning: possibly dangling reference to a temporary [-Wdangling-reference] 902 | const auto &arg = caller.getPassedArguments()[argIdx]; | ^~~ /home/user/flang/src/flang-16.0.6.src/lib/Lower/ConvertCall.cpp:902:57: note: the temporary was destroyed at the end of the full expression ‘(&((const {anonymous}::ElementalUserCallBuilder*)this)->{anonymous}::ElementalUserCallBuilder::caller)->Fortran::lower::CallerInterface::<anonymous>.Fortran::lower::CallInterface<Fortran::lower::CallerInterface>::getPassedArguments().llvm::ArrayRef<Fortran::lower::CallInterface\<Fortran::lower::CallerInterface>::PassedEntity>::operator’ 902 | const auto &arg = caller.getPassedArguments()[argIdx]; | ^ /home/user/flang/src/flang-16.0.6.src/lib/Semantics/runtime-type-info.cpp: In function ‘Fortran::semantics::SomeExpr Fortran::semantics::SaveDerivedPointerTarget(Scope&, SourceName, std::vector<Fortran::evaluate::StructureConstructor>&&, Fortran::evaluate::ConstantSubscripts&&)’: /home/user/flang/src/flang-16.0.6.src/lib/Semantics/runtime-type-info.cpp:298:17: warning: possibly dangling reference to a temporary [-Wdangling-reference] 298 | const auto &derivedType{x.front().GetType().GetDerivedTypeSpec()}; | ^~~~~~~~~~~ /home/user/flang/src/flang-16.0.6.src/lib/Semantics/runtime-type-info.cpp:298:67: note: the temporary was destroyed at the end of the full expression ‘(&(& x)->std::vector<Fortran::evaluate::StructureConstructor>::front())->Fortran::evaluate::StructureConstructor::GetType().Fortran::evaluate::DynamicType::GetDerivedTypeSpec()’ 298 | const auto &derivedType{x.front().GetType().GetDerivedTypeSpec()}; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ In file included from /home/user/flang/src/flang-16.0.6.src/include/flang/Tools/CLOptions.inc:16, from /home/user/flang/src/flang-16.0.6.src/lib/Frontend/FrontendActions.cpp:508: /home/user/flang/src/flang-16.0.6.src/include/flang/Optimizer/CodeGen/CodeGen.h:27:10: fatal error: flang/Optimizer/CodeGen/CGPasses.h.inc: No such file or directory 27 | #include "flang/Optimizer/CodeGen/CGPasses.h.inc" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [lib/Frontend/CMakeFiles/obj.flangFrontend.dir/build.make:132: lib/Frontend/CMakeFiles/obj.flangFrontend.dir/FrontendActions.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:2084: lib/Frontend/CMakeFiles/obj.flangFrontend.dir/all] Error 2 make: *** [Makefile:136: all] Error 2 ==> ERROR: A failure occurred in build(). Aborting...

#Console output

xantares commented on 2023-11-05 08:07 (UTC)

seems like an upstream issue:

https://github.com/llvm/llvm-project/issues/61543

maybe a missing dependency

please provide full log and makepkg.conf