Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake option -Dall=YES breaks the cmake #15139

Closed
1 task done
FonsRademakers opened this issue Apr 4, 2024 · 3 comments
Closed
1 task done

cmake option -Dall=YES breaks the cmake #15139

FonsRademakers opened this issue Apr 4, 2024 · 3 comments
Assignees
Labels

Comments

@FonsRademakers
Copy link
Member

Check duplicate issues.

  • Checked for duplicates

Description

On macOS, running with cmake option -Dall=YES breaks cmake on master, on v6.30.* is works fine:

cmake -G Ninja -Dall=YES -DPYTHON_EXECUTABLE=/opt/homebrew/bin/python3.9 ..

CMake Error in roofit/batchcompute/CMakeLists.txt:
  Exporting the target "RooBatchCompute_CUDA" is not allowed since its linker
  language cannot be determined


CMake Error: CMake can not determine linker language for target: RooBatchCompute_CUDA
CMake Error in roofit/batchcompute/CMakeLists.txt:
  Exporting the target "RooBatchCompute_CUDA" is not allowed since its linker
  language cannot be determined


-- Generating done (0.8s)
CMake Generate step failed.  Build files cannot be regenerated correctly.```

### Reproducer

On `master` branch, on macOS, do:

```cmake -G Ninja -Dall=YES -DPYTHON_EXECUTABLE=/opt/homebrew/bin/python3.9 ..```

### ROOT version

master branch of today.

### Installation method

Build from source

### Operating system

macOS

### Additional context

_No response_
@dpiparo
Copy link
Member

dpiparo commented Apr 4, 2024

@guitargeek is this due to the fact that we do not have this option in 6.30? And if yes, would it be enough to exclude the CUDA option from the set enabled by all on macOS?

@bellenot
Copy link
Member

bellenot commented Apr 4, 2024

FYI I can reproduce the error on Windows

bellenot added a commit to bellenot/root that referenced this issue Apr 5, 2024
guitargeek added a commit to guitargeek/root that referenced this issue Apr 5, 2024
In the ROOT build system, `CheckCompiler` is included before
`RootBuildOptions`. The problem with this is that when building with
`-Dall=ON`, the `cuda` flag is only set in `RootBuildOptions`, which is
too late to find the CUDA compiler in `CheckCompiler`. This results in
issues like root-project#15139:
```
CMake Error in roofit/batchcompute/CMakeLists.txt:
  Exporting the target "RooBatchCompute_CUDA" is not allowed since its linker
  language cannot be determined
```

This commit suggests a solution to this problem: just always enable the
CUDA language in CMake if it is found, and only set the `cuda` flag with
`-Dall=ON` if the CUDA language is enabled.
guitargeek added a commit to guitargeek/root that referenced this issue Apr 5, 2024
In the ROOT build system, `CheckCompiler` is included before
`RootBuildOptions`. The problem with this is that when building with
`-Dall=ON`, the `cuda` flag is only set in `RootBuildOptions`, which is
too late to find the CUDA compiler in `CheckCompiler`. This results in
issues like root-project#15139:
```
CMake Error in roofit/batchcompute/CMakeLists.txt:
  Exporting the target "RooBatchCompute_CUDA" is not allowed since its linker
  language cannot be determined
```

This commit suggests a solution to this problem: just always enable the
CUDA language in CMake if it is found, and only set the `cuda` flag with
`-Dall=ON` if the CUDA language is enabled.
guitargeek added a commit to guitargeek/root that referenced this issue Apr 5, 2024
In the ROOT build system, `CheckCompiler` is included before
`RootBuildOptions`. The problem with this is that when building with
`-Dall=ON`, the `cuda` flag is only set in `RootBuildOptions`, which is
too late to find the CUDA compiler in `CheckCompiler`. This results in
issues like root-project#15139:
```
CMake Error in roofit/batchcompute/CMakeLists.txt:
  Exporting the target "RooBatchCompute_CUDA" is not allowed since its linker
  language cannot be determined
```

This commit suggests a solution to this problem: just always enable the
CUDA language in CMake if it is found, and only set the `cuda` flag with
`-Dall=ON` if the CUDA language is enabled.
guitargeek added a commit that referenced this issue Apr 5, 2024
In the ROOT build system, `CheckCompiler` is included before
`RootBuildOptions`. The problem with this is that when building with
`-Dall=ON`, the `cuda` flag is only set in `RootBuildOptions`, which is
too late to find the CUDA compiler in `CheckCompiler`. This results in
issues like #15139:
```
CMake Error in roofit/batchcompute/CMakeLists.txt:
  Exporting the target "RooBatchCompute_CUDA" is not allowed since its linker
  language cannot be determined
```

This commit suggests a solution to this problem: just always enable the
CUDA language in CMake if it is found, and only set the `cuda` flag with
`-Dall=ON` if the CUDA language is enabled.
@guitargeek
Copy link
Contributor

Closed by #15155.

@guitargeek guitargeek added this to Issues in Fixed in 6.32.00 via automation Apr 5, 2024
guitargeek added a commit to guitargeek/root that referenced this issue Apr 5, 2024
In the ROOT build system, `CheckCompiler` is included before
`RootBuildOptions`. The problem with this is that when building with
`-Dall=ON`, the `cuda` flag is only set in `RootBuildOptions`, which is
too late to find the CUDA compiler in `CheckCompiler`. This results in
issues like root-project#15139:
```
CMake Error in roofit/batchcompute/CMakeLists.txt:
  Exporting the target "RooBatchCompute_CUDA" is not allowed since its linker
  language cannot be determined
```

This commit suggests a solution to this problem: just always enable the
CUDA language in CMake if it is found, and only set the `cuda` flag with
`-Dall=ON` if the CUDA language is enabled.
guitargeek added a commit that referenced this issue Apr 5, 2024
In the ROOT build system, `CheckCompiler` is included before
`RootBuildOptions`. The problem with this is that when building with
`-Dall=ON`, the `cuda` flag is only set in `RootBuildOptions`, which is
too late to find the CUDA compiler in `CheckCompiler`. This results in
issues like #15139:
```
CMake Error in roofit/batchcompute/CMakeLists.txt:
  Exporting the target "RooBatchCompute_CUDA" is not allowed since its linker
  language cannot be determined
```

This commit suggests a solution to this problem: just always enable the
CUDA language in CMake if it is found, and only set the `cuda` flag with
`-Dall=ON` if the CUDA language is enabled.
aandvalenzuela pushed a commit to cms-sw/root that referenced this issue Apr 8, 2024
In the ROOT build system, `CheckCompiler` is included before
`RootBuildOptions`. The problem with this is that when building with
`-Dall=ON`, the `cuda` flag is only set in `RootBuildOptions`, which is
too late to find the CUDA compiler in `CheckCompiler`. This results in
issues like root-project#15139:
```
CMake Error in roofit/batchcompute/CMakeLists.txt:
  Exporting the target "RooBatchCompute_CUDA" is not allowed since its linker
  language cannot be determined
```

This commit suggests a solution to this problem: just always enable the
CUDA language in CMake if it is found, and only set the `cuda` flag with
`-Dall=ON` if the CUDA language is enabled.
kristupaspranc pushed a commit to kristupaspranc/root that referenced this issue Apr 10, 2024
In the ROOT build system, `CheckCompiler` is included before
`RootBuildOptions`. The problem with this is that when building with
`-Dall=ON`, the `cuda` flag is only set in `RootBuildOptions`, which is
too late to find the CUDA compiler in `CheckCompiler`. This results in
issues like root-project#15139:
```
CMake Error in roofit/batchcompute/CMakeLists.txt:
  Exporting the target "RooBatchCompute_CUDA" is not allowed since its linker
  language cannot be determined
```

This commit suggests a solution to this problem: just always enable the
CUDA language in CMake if it is found, and only set the `cuda` flag with
`-Dall=ON` if the CUDA language is enabled.
lobis pushed a commit to lobis/root that referenced this issue Apr 10, 2024
In the ROOT build system, `CheckCompiler` is included before
`RootBuildOptions`. The problem with this is that when building with
`-Dall=ON`, the `cuda` flag is only set in `RootBuildOptions`, which is
too late to find the CUDA compiler in `CheckCompiler`. This results in
issues like root-project#15139:
```
CMake Error in roofit/batchcompute/CMakeLists.txt:
  Exporting the target "RooBatchCompute_CUDA" is not allowed since its linker
  language cannot be determined
```

This commit suggests a solution to this problem: just always enable the
CUDA language in CMake if it is found, and only set the `cuda` flag with
`-Dall=ON` if the CUDA language is enabled.
kristupaspranc pushed a commit to kristupaspranc/root that referenced this issue May 21, 2024
In the ROOT build system, `CheckCompiler` is included before
`RootBuildOptions`. The problem with this is that when building with
`-Dall=ON`, the `cuda` flag is only set in `RootBuildOptions`, which is
too late to find the CUDA compiler in `CheckCompiler`. This results in
issues like root-project#15139:
```
CMake Error in roofit/batchcompute/CMakeLists.txt:
  Exporting the target "RooBatchCompute_CUDA" is not allowed since its linker
  language cannot be determined
```

This commit suggests a solution to this problem: just always enable the
CUDA language in CMake if it is found, and only set the `cuda` flag with
`-Dall=ON` if the CUDA language is enabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

No branches or pull requests

4 participants