Commit Graph

41 Commits

Author SHA1 Message Date
Mark de Wever
cbaa3597aa Reland "[CMake] Bumps minimum version to 3.20.0.
This reverts commit d763c6e5e2.

Adds the patch by @hans from
https://github.com/llvm/llvm-project/issues/62719
This patch fixes the Windows build.

d763c6e5e2 reverted the reviews

D144509 [CMake] Bumps minimum version to 3.20.0.

This partly undoes D137724.

This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193

Note this does not remove work-arounds for older CMake versions, that
will be done in followup patches.

D150532 [OpenMP] Compile assembly files as ASM, not C

Since CMake 3.20, CMake explicitly passes "-x c" (or equivalent)
when compiling a file which has been set as having the language
C. This behaviour change only takes place if "cmake_minimum_required"
is set to 3.20 or newer, or if the policy CMP0119 is set to new.

Attempting to compile assembly files with "-x c" fails, however
this is workarounded in many cases, as OpenMP overrides this with
"-x assembler-with-cpp", however this is only added for non-Windows
targets.

Thus, after increasing cmake_minimum_required to 3.20, this breaks
compiling the GNU assembly for Windows targets; the GNU assembly is
used for ARM and AArch64 Windows targets when building with Clang.
This patch unbreaks that.

D150688 [cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump

The build uses other mechanism to select the runtime.

Fixes #62719

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D151344
2023-05-27 12:51:21 +02:00
Nico Weber
d763c6e5e2 Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""
This reverts commit 65429b9af6.

Broke several projects, see https://reviews.llvm.org/D144509#4347562 onwards.

Also reverts follow-up commit "[OpenMP] Compile assembly files as ASM, not C"

This reverts commit 4072c8aee4.

Also reverts fix attempt  "[cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump"

This reverts commit 7d47dac5f8.
2023-05-17 10:53:33 -04:00
Mark de Wever
65429b9af6 Reland "[CMake] Bumps minimum version to 3.20.0."
The owner of the last two failing buildbots updated CMake.

This reverts commit e8e8707b4a.
2023-05-13 11:42:25 +02:00
Mark de Wever
e8e8707b4a Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""
Unfortunatly not all buildbots are updated.

This reverts commit ffb807ab53.
2023-05-06 17:03:56 +02:00
Mark de Wever
ffb807ab53 Reland "[CMake] Bumps minimum version to 3.20.0."
All build bots should be updated now.

This reverts commit 44d38022ab.
2023-05-06 11:43:02 +02:00
Mark de Wever
44d38022ab Revert "Revert "Revert "[CMake] Bumps minimum version to 3.20.0."""
This reverts commit 1ef4c3c859.

Two buildbots still haven't been updated.
2023-04-15 20:12:24 +02:00
Mark de Wever
1ef4c3c859 Revert "Revert "[CMake] Bumps minimum version to 3.20.0.""
This reverts commit 92523a35a8.

Reland to see whether CIs are updated.
2023-04-15 13:12:04 +02:00
Mark de Wever
d0398d3593 Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""
This reverts commit a72165e5df.

Some buildbots have not been updated yet.
2023-03-18 20:32:43 +01:00
Mark de Wever
a72165e5df Reland "[CMake] Bumps minimum version to 3.20.0."
This reverts commit 92523a35a8.

Test whether all CI runners are updated.
2023-03-18 13:33:42 +01:00
Mark de Wever
92523a35a8 Revert "[CMake] Bumps minimum version to 3.20.0."
Some build bots have not been updated to the new minimal CMake version.
Reverting for now and ping the buildbot owners.

This reverts commit 44c6b905f8.
2023-03-04 18:28:13 +01:00
Mark de Wever
44c6b905f8 [CMake] Bumps minimum version to 3.20.0.
This partly undoes D137724.

This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193

Note this does not remove work-arounds for older CMake versions, that
will be done in followup patches.

Reviewed By: mehdi_amini, MaskRay, ChuanqiXu, to268, thieta, tschuett, phosek, #libunwind, #libc_vendors, #libc, #libc_abi, sivachandra, philnik, zibi

Differential Revision: https://reviews.llvm.org/D144509
2023-03-04 12:40:57 +01:00
John Ericson
e941b031d3 Revert "[cmake] Use CMAKE_INSTALL_LIBDIR too"
This reverts commit f7a33090a9.

Unfortunately this causes a number of failures that didn't show up in my
local build.
2022-08-18 22:46:32 -04:00
John Ericson
f7a33090a9 [cmake] Use CMAKE_INSTALL_LIBDIR too
We held off on this before as `LLVM_LIBDIR_SUFFIX` conflicted with it.
Now we return this.

`LLVM_LIBDIR_SUFFIX` is kept as a deprecated way to set
`CMAKE_INSTALL_LIBDIR`. The other `*_LIBDIR_SUFFIX` are just removed
entirely.

I imagine this is too potentially-breaking to make LLVM 15. That's fine.
I have a more minimal version of this in the disto (NixOS) patches for
LLVM 15 (like previous versions). This more expansive version I will
test harder after the release is cut.

Reviewed By: sebastian-ne, ldionne, #libc, #libc_abi

Differential Revision: https://reviews.llvm.org/D130586
2022-08-18 15:33:35 -04:00
John Ericson
df31ff1b29 [cmake] Make include(GNUInstallDirs) always below project(..)
Its defaulting logic must go after `project(..)` to work correctly,  but `project(..)` is often in a standalone condition making this
awkward, since the rest of the condition code may also need GNUInstallDirs.

The good thing is there are the various standalone booleans, which I had missed before. This makes splitting the conditional blocks less awkward.

Reviewed By: arichardson, phosek, beanz, ldionne, #libunwind, #libc, #libc_abi

Differential Revision: https://reviews.llvm.org/D117639
2022-01-20 18:59:17 +00:00
John Ericson
c90d136be4 [pstl][cmake] Use GNUInstallDirs to support custom installation dirs
I am breaking apart D99484 so the cause of build failures is easier to
understand.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D117418
2022-01-17 20:04:46 +00:00
John Ericson
da77db58d7 Revert "[cmake] Use GNUInstallDirs to support custom installation dirs."
https://lab.llvm.org/buildbot/#/builders/46/builds/21146 Still have
this odd error, not sure how to reproduce, so I will just try breaking
up my patch.

This reverts commit 4a678f8072.
2022-01-16 05:48:30 +00:00
John Ericson
4a678f8072 [cmake] Use GNUInstallDirs to support custom installation dirs.
This is the original patch in my GNUInstallDirs series, now last to merge as the final piece!

It arose as a new draft of D28234. I initially did the unorthodox thing of pushing to that when I wasn't the original author, but since I ended up

 - Using `GNUInstallDirs`, rather than mimicking it, as the original author was hesitant to do but others requested.

 - Converting all the packages, not just LLVM, effecting many more projects than LLVM itself.

I figured it was time to make a new revision.

I have used this patch series (and many back-ports) as the basis of https://github.com/NixOS/nixpkgs/pull/111487 for my distro (NixOS), which was merged last spring (2021). It looked like people were generally on board in D28234, but I make note of this here in case extra motivation is useful.

---

As pointed out in the original issue, a central tension is that LLVM already has some partial support for these sorts of things. Variables like `COMPILER_RT_INSTALL_PATH` have already been dealt with. Variables like `LLVM_LIBDIR_SUFFIX` however, will require further work, so that we may use `CMAKE_INSTALL_LIBDIR`.

These remaining items will be addressed in further patches. What is here is now rote and so we should get it out of the way before dealing more intricately with the remainder.

Reviewed By: #libunwind, #libc, #libc_abi, compnerd

Differential Revision: https://reviews.llvm.org/D99484
2022-01-16 05:33:07 +00:00
John Ericson
6e52bfe09d Revert "[cmake] Use GNUInstallDirs to support custom installation dirs."
Sorry for the disruption, I will try again later.

This reverts commit efeb501970.
2022-01-15 07:35:02 +00:00
John Ericson
efeb501970 [cmake] Use GNUInstallDirs to support custom installation dirs.
This is the original patch in my GNUInstallDirs series, now last to merge as the final piece!

It arose as a new draft of D28234. I initially did the unorthodox thing of pushing to that when I wasn't the original author, but since I ended up

 - Using `GNUInstallDirs`, rather than mimicking it, as the original author was hesitant to do but others requested.

 - Converting all the packages, not just LLVM, effecting many more projects than LLVM itself.

I figured it was time to make a new revision.

I have used this patch series (and many back-ports) as the basis of https://github.com/NixOS/nixpkgs/pull/111487 for my distro (NixOS), which was merged last spring (2021). It looked like people were generally on board in D28234, but I make note of this here in case extra motivation is useful.

---

As pointed out in the original issue, a central tension is that LLVM already has some partial support for these sorts of things. Variables like `COMPILER_RT_INSTALL_PATH` have already been dealt with. Variables like `LLVM_LIBDIR_SUFFIX` however, will require further work, so that we may use `CMAKE_INSTALL_LIBDIR`.

These remaining items will be addressed in further patches. What is here is now rote and so we should get it out of the way before dealing more intricately with the remainder.

Reviewed By: #libunwind, #libc, #libc_abi, compnerd

Differential Revision: https://reviews.llvm.org/D99484
2022-01-15 01:08:35 +00:00
Mikhail Dvorskiy
6069a6a504 [pstl] Initial implementation of OpenMP backend, on behalf of Christopher Nelson nadiasvertex@gmail.com
Phabricator Review:
https://reviews.llvm.org/D99836

A couple of parallel patterns still remains serial - "Parallel partial sort", and "Parallel transform scan" - there are //TODOs in the code.
2021-10-15 15:36:07 +03:00
Louis Dionne
afa1afd410 [CMake] Bump CMake minimum version to 3.13.4
This upgrade should be friction-less because we've already been ensuring
that CMake >= 3.13.4 is used.

This is part of the effort discussed on llvm-dev here:

  http://lists.llvm.org/pipermail/llvm-dev/2020-April/140578.html

Differential Revision: https://reviews.llvm.org/D78648
2020-07-22 14:25:07 -04:00
Louis Dionne
ef14e52be4 [pstl] Do not install the __config_site.in file
The generated version of the file is already installed -- we shouldn't
install the pre-generation version of the file.
2020-07-08 14:52:03 -04:00
Louis Dionne
1b6d6e595b [pstl] Allow customizing whether per-TU insulation is provided
Like we do in libc++, PSTL needs the ability to constrain
ABI-unstable symbols to each translation unit. This is OFF by
default (like for libc++), because most people don't care about
this and there is a cost associated to enabling the option (code
bloat because templates are not deduped across TUs).

I'm using '#pragma clang attribute push' to avoid marking each
declaration with an attribute, which quickly becomes difficult
to maintain.

llvm-svn: 368684
2019-08-13 12:49:00 +00:00
Louis Dionne
5065e78173 [pstl] Rename PARALLELSTL_BACKEND to PSTL_PARALLEL_BACKEND
It makes more sense to name configuration options as PSTL_XXX.
Also, I'm naming it PSTL_PARALLEL_BACKEND because we might introduce
the ability to customize the vectorization backend, in which case
PSTL_BACKEND would become ambiguous.

llvm-svn: 368672
2019-08-13 11:50:26 +00:00
Louis Dionne
bf4808439f [pstl] Add a __pstl_config_site header to record the CMake configuration
This commit adds a __pstl_config_site header that contains the value of
macros specified at CMake configuration time. It works similarly to
libc++'s __config_site header, except we always include it as a separate
file instead of concatenating it to the main configuration header.

It is necessary to thread the includes for that header into libc++'s
lit configuration, otherwise we'd be requiring an installation step
prior to running the test suite.

llvm-svn: 368284
2019-08-08 12:43:04 +00:00
Louis Dionne
762e662582 [pstl] Make sure we install all of PSTL's include/ directory
We want to install files directly in include/, not only in include/pstl.

llvm-svn: 368203
2019-08-07 20:29:04 +00:00
Louis Dionne
65a422c81c [pstl] Make the default backend be the serial backend and always provide parallel policies
Summary:
Before this change, the default backend was TBB but one could disable
anything related to TBB by removing the parallel policies. This change
uses the serial backend by default and removes the ability to disable
parallel policies, which is not useful anymore.

Reviewers: rodgert, MikeDvorskiy

Subscribers: mgorny, jkorous, dexonsmith, jdoerfert, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59792

llvm-svn: 359134
2019-04-24 20:12:36 +00:00
Louis Dionne
dcf4b9aee0 [pstl] Add a serial backend for the PSTL
Summary:
The serial backend performs all tasks serially and does not require
threads. It does not have any dependencies beyond normal C++, but
it is not very efficient either.

Reviewers: rodgert, MikeDvorskiy

Subscribers: mgorny, jkorous, dexonsmith, jdoerfert, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59791

llvm-svn: 358700
2019-04-18 18:20:19 +00:00
Louis Dionne
e7f2cbe45a [pstl] Remove our custom FindTBB CMake file
Summary:
The TBBConfig file installed by TBB 2019 Update 5 works properly, so we
don't need this workaround anymore.

Reviewers: rodgert, MikeDvorskiy

Subscribers: mgorny, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D60467

llvm-svn: 358196
2019-04-11 17:23:18 +00:00
Louis Dionne
ab38599bb1 [pstl] Setup the _PSTL_VERSION macro like _LIBCPP_VERSION, and add release notes
Reviewers: rodgert, MikeDvorskiy

Subscribers: mgorny, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D60464

llvm-svn: 358193
2019-04-11 17:08:55 +00:00
Louis Dionne
f7433f9623 [pstl][CMake] Install CMake export files
This allows other projects to depend on PSTL using the classic CMake
find_package protocol.

llvm-svn: 358028
2019-04-09 18:35:56 +00:00
Louis Dionne
2fb3225375 [pstl][NFC] Move the ParallelSTLConfig template to the cmake/ subdirectory
llvm-svn: 358018
2019-04-09 16:48:43 +00:00
Louis Dionne
540e18ded7 [pstl] Require C++17 when linking against pstl
llvm-svn: 357609
2019-04-03 17:17:40 +00:00
Louis Dionne
3b62047b8b Restructure test suite to follow libc++ standard layout
Summary: Subsumes changes requested in https://reviews.llvm.org/D59110

Reviewers: EricWF, ldionne

Subscribers: mgorny, krytarowski, jfb, jdoerfert, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59856

llvm-svn: 357124
2019-03-27 21:28:24 +00:00
Louis Dionne
e808befa0e [pstl][CMake] Move include() closer to its point of use
llvm-svn: 356900
2019-03-25 14:45:21 +00:00
Louis Dionne
72b8e77a49 [pstl] By default, disable the parallel policies
Since we don't have any non-trivial PSTL backend that doesn't require
TBB yet, enabling the parallel policies by default breaks people that
try to build all of LLVM without having an installation of TBB. Since
this is unacceptable, parallel policies are disabled by default.

We can re-enable it once we have a backend that does not require anything
beyond what C++ already requires. For example, we could have a simple
backend that uses std::thread by default or something along those lines,
with the understanding that vendors would use their own (more efficient)
backend.

llvm-svn: 356194
2019-03-14 19:33:58 +00:00
Louis Dionne
0f4ce2b0d7 [pstl] Properly extract the version number from pstl_config.h
Previously, we'd be performing math on `#define PSTL_VERSION NNN` instead
of just `NNN`. It seems like older CMakes didn't complain, but newer
CMakes do complain because it doesn't make sense.

llvm-svn: 355918
2019-03-12 13:48:25 +00:00
Chandler Carruth
57b08b0944 Update more file headers across all of the LLVM projects in the monorepo
to reflect the new license. These used slightly different spellings that
defeated my regular expressions.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351648
2019-01-19 10:56:40 +00:00
Louis Dionne
70f1b79687 [pstl] Fix CMake configuration when parallel policies are disabled
llvm-svn: 350812
2019-01-10 11:17:26 +00:00
Louis Dionne
5e334b516b [pstl] Initial integration with LLVM's CMake
Summary:
This commit adds a check-pstl CMake target that will run the tests
we currently have for pstl. Those tests are not using LLVM lit yet,
but switching them over should be a transparent change. With this
change, we can start relying on the `check-pstl` target for workflows
and CI.

Note that this commit purposefully does not support the pre-monorepo
layout (with subprojects in projects/), since LLVM is moving towards
the monorepo layout anyway.

Reviewers: jfb

Subscribers: mgorny, jkorous, dexonsmith, libcxx-commits, mclow.lists, rodgert

Differential Revision: https://reviews.llvm.org/D55963

llvm-svn: 349919
2018-12-21 15:59:04 +00:00
JF Bastien
e637637ae4 Initial PSTL commit
The initial commit of the Parallel STL upstream (under LLVM umbrella) based on
Parallel STL 20181204 open source release, which is available by
https://github.com/intel/parallelstl

Author: Mikhail Dvorskiy <mikhail.dvorskiy@intel.com>

Differential Revision: https://reviews.llvm.org/D55889

llvm-svn: 349653
2018-12-19 17:45:32 +00:00