Bug 270954 - devel/cmake-core: lots of armv7 build failures with "No SOURCES given to target"
Summary: devel/cmake-core: lots of armv7 build failures with "No SOURCES given to target"
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Some People
Assignee: Robert Clausecker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-20 16:27 UTC by Robert Clausecker
Modified: 2023-04-30 18:46 UTC (History)
4 users (show)

See Also:
adridg: maintainer-feedback+
fuz: merge-quarterly?
antoine: exp-run+


Attachments
devel/cmake-core: remove outdated FindOpenMP.cmake patch (5.96 KB, patch)
2023-04-20 20:36 UTC, Robert Clausecker
fuz: maintainer-approval? (kde)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Clausecker freebsd_committer freebsd_triage 2023-04-20 16:27:45 UTC
Many ports fail on armv7 with the same class of error message:

-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /wrkdirs/usr/ports/graphics/pfstools/work/.build/CMakeFiles/CMakeTmp/CMakeLists.txt:14 (add_executable):
  No SOURCES given to target: cmTC_7730d


CMake Error at /usr/local/share/cmake/Modules/FindOpenMP.cmake:261 (try_compile):
  Failed to generate test project build system.
Call Stack (most recent call first):
  /usr/local/share/cmake/Modules/FindOpenMP.cmake:537 (_OPENMP_GET_FLAGS)
  CMakeLists.txt:39 (find_package)


-- Configuring incomplete, errors occurred!
See also "/wrkdirs/usr/ports/graphics/pfstools/work/.build/CMakeFiles/CMakeOutput.log".
*** Error code 1

This affects at least the following ports (tested on 2023Q2):

graphics/oyranos
audio/fluidsynth
cad/gmsh
science/gromacs
math/cimod
lang/halide 
games/regoth
misc/openmvg
cad/FreeCAD
graphics/cloudcompare
math/blaze
science/gnudatalanguage
graphics/pfstool

Without having investigated this at all, the cause may be connected with LLVM not supporting OpenMP on armv6/armv7.  The offending file FindOpenMP.cmake is installed by devel/cmake-core.  Unfortunately I am not very familiar with cmake and don't really have any idea on what the cause could be.
Comment 1 Adriaan de Groot freebsd_committer freebsd_triage 2023-04-20 19:05:43 UTC
This looks like us shooting ourselves in the foot with a patch. Can you remove devel/cmake-core/files/patch-Modules_FindOpenMP.cmake and rebuild devel/cmake-core, then try your OpenMP-using ports again? I don't have any ARMv7 (well, there's a BeagleBone Black if I could find a suitable power supply and an infinite supply of patience).

What's happening is that the code surrounding that patch has changed enough for the patch to still apply, but be invalid. None of the Tier-1 platforms seem to hit that code-path, which suggests that the patch isn't needed anymore.
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2023-04-20 20:36:48 UTC
Created attachment 241623 [details]
devel/cmake-core: remove outdated FindOpenMP.cmake patch

The attached patch removes the offending patch file.  This did indeed fix the build for me on armv7.  Currently testing on arm64.  Is an exp run a good idea here?
Comment 3 Robert Clausecker freebsd_committer freebsd_triage 2023-04-21 09:06:52 UTC
Cmake works ok with this patch on arm64.
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2023-04-23 15:10:45 UTC
Request exp-run of all ports depending on devel/cmake-core, as discussed with diizzy.
Comment 5 Adriaan de Groot freebsd_committer freebsd_triage 2023-04-25 12:34:13 UTC
I'll wait for the exp-run results.
Comment 6 Antoine Brodin freebsd_committer freebsd_triage 2023-04-28 12:47:34 UTC
Exp-run looks fine
Comment 7 Robert Clausecker freebsd_committer freebsd_triage 2023-04-28 16:13:09 UTC
Do I have permission to commit this patch?
Comment 8 Adriaan de Groot freebsd_committer freebsd_triage 2023-04-28 20:25:31 UTC
Yes, please go ahead. (I should have said that while the exp-run was going on).
Comment 9 Adriaan de Groot freebsd_committer freebsd_triage 2023-04-28 20:26:47 UTC
I don't know about MFH, though: the branches do not usually get CMake updates because they can be quite disruptive (generally: see the "fix <thing> ahead of CMake update" kind of commits, I think we had five ports with that this time, which is low)
Comment 10 Robert Clausecker freebsd_committer freebsd_triage 2023-04-28 22:24:53 UTC
(In reply to Adriaan de Groot from comment #9)

About two dozen ports plus dependent ports are affected by this issue (basically any cmake port using OpenMP):

graphics/oyranos
audio/fluidsynth # cmake issues
cad/gmsh
science/gromacs # cmake issues
math/cimod
lang/halide
games/regoth
misc/openmvg
cad/FreeCAD
graphics/cloudcompare
math/blaze
science/gnudatalanguage
graphics/pfstool
misc/lightgbm
misc/darknet
science/openmodelica
science/agrum
biology/hyphy
graphics/gmt
graphics/luminance-qt5
graphics/digikam
math/hmat-oss
math/xlife++
math/fann
graphics/openmvs
math/ambit

I would really love if MFH was granted for this one.
Comment 11 Dima Panov freebsd_committer freebsd_triage 2023-04-28 23:40:15 UTC
(In reply to Robert Clausecker from comment #10)
Yep, MFH it please 

Dima, on behalf of ports-secteam
Comment 12 Robert Clausecker freebsd_committer freebsd_triage 2023-04-29 12:46:25 UTC
Will commit and MFH with my next batch.
Comment 13 commit-hook freebsd_committer freebsd_triage 2023-04-30 18:44:25 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b13bdddc804511e345e66f152d0e62b689b63cbb

commit b13bdddc804511e345e66f152d0e62b689b63cbb
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-04-20 20:33:54 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-04-30 18:41:40 +0000

    devel/cmake-core: remove outdated FindOpenMP.cmake patch

    This patch broke the build of any armv6/armv7 package that tried to
    use OpenMP.  It was once appropriate, but is now no longer correct
    or needed.

    PR:             270954
    MFH:            2023Q2
    Approved by:    ports-secteam (fluffy), adridg
    Tested by:      portmgr (antoine, exp-run)

 devel/cmake-core/Makefile                          |   1 +
 .../files/patch-Modules_FindOpenMP.cmake (gone)    | 105 ---------------------
 2 files changed, 1 insertion(+), 105 deletions(-)
Comment 14 commit-hook freebsd_committer freebsd_triage 2023-04-30 18:45:27 UTC
A commit in branch 2023Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5e5a4225dc993c5a939a8b3636362a6e0b4a3896

commit 5e5a4225dc993c5a939a8b3636362a6e0b4a3896
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-04-20 20:33:54 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-04-30 18:44:30 +0000

    devel/cmake-core: remove outdated FindOpenMP.cmake patch

    This patch broke the build of any armv6/armv7 package that tried to
    use OpenMP.  It was once appropriate, but is now no longer correct
    or needed.

    PR:             270954
    MFH:            2023Q2
    Approved by:    ports-secteam (fluffy), adridg
    Tested by:      portmgr (antoine, exp-run)

    (cherry picked from commit b13bdddc804511e345e66f152d0e62b689b63cbb)

 devel/cmake-core/Makefile                          |   1 +
 .../files/patch-Modules_FindOpenMP.cmake (gone)    | 105 ---------------------
 2 files changed, 1 insertion(+), 105 deletions(-)