Skip to content

Commit 3d101e1

Browse files
authored
Align CMake in build scripts with CUDA-Q devdeps images (#139)
Signed-off-by: Ben Howe <[email protected]>
1 parent ceb54ce commit 3d101e1

File tree

7 files changed

+33
-10
lines changed

7 files changed

+33
-10
lines changed

.github/actions/build-lib/action.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ runs:
2929
run: |
3030
apt update
3131
apt install -y --no-install-recommends ccache
32-
python3 -m pip install "cmake<4" --user
33-
echo "$HOME/.local/bin:$PATH" >> $GITHUB_PATH
3432
shell: bash
3533

3634
- name: Compilation cache key

.github/workflows/docs.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ jobs:
6464
sphinx_copybutton sphinx_inline_tabs sphinx_gallery sphinx_rtd_theme \
6565
sphinx_reredirects sphinx_toolbox cupy-cuda12x cuquantum-python-cu12
6666
67-
python3 -m pip install "cmake<4" --user
68-
echo "$HOME/.local/bin:$PATH" >> $GITHUB_PATH
69-
7067
- name: Build docs
7168
run: |
7269
cmake -S . -B "build" \

Building.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cd cudaqx
3939
mkdir build && cd build
4040

4141
# Configure your build (adjust as necessary)
42-
~/.local/bin/cmake -G Ninja -S .. \
42+
cmake -G Ninja -S .. \
4343
-DCUDAQ_INSTALL_DIR=$CUDAQ_INSTALL_PREFIX \
4444
-DCMAKE_INSTALL_PREFIX=${CUDAQX_INSTALL_PREFIX} \
4545
-DCUDAQ_DIR=${CUDAQ_INSTALL_PREFIX}/lib/cmake/cudaq \

CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ============================================================================ #
2-
# Copyright (c) 2024 NVIDIA Corporation & Affiliates. #
2+
# Copyright (c) 2024 - 2025 NVIDIA Corporation & Affiliates. #
33
# All rights reserved. #
44
# #
55
# This source code and the accompanying materials are made available under #
@@ -11,6 +11,15 @@ set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE)
1111
# We need 3.28 because of the `EXCLUDE_FROM_ALL` in FetchContent_Declare
1212
cmake_minimum_required(VERSION 3.28 FATAL_ERROR)
1313

14+
# Set a default build type if none was specified. Must set this before
15+
# project().
16+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
17+
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel")
18+
19+
# Set a default install prefix if none was specified.
20+
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.cudaqx" CACHE STRING
21+
"Install path prefix, prepended onto install directories")
22+
1423
project(CUDAQX
1524
VERSION 0.0.0
1625
LANGUAGES C CXX)

docker/build_env/cudaqx.dev.Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ LABEL org.opencontainers.image.source="https://github.com/NVIDIA/cudaqx"
1313
LABEL org.opencontainers.image.title="cudaqx-dev"
1414
LABEL org.opencontainers.image.url="https://github.com/NVIDIA/cudaqx"
1515

16+
# FIXME: Remove the cmake install once private repos are updated.
1617
RUN apt-get update && apt-get install -y gfortran libblas-dev jq cuda-nvtx-12-0 \
1718
&& python3 -m pip install "cmake<4" --user \
1819
&& apt-get autoremove -y --purge && apt-get clean && rm -rf /var/lib/apt/lists/*
@@ -32,5 +33,5 @@ RUN mkdir -p /workspaces/cudaq && cd /workspaces/cudaq \
3233
&& rm -rf build
3334

3435
#RUN mkdir -p /workspaces/cudaqx && cd /workspaces/cudaqx \
35-
# && ~/.local/bin/cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCUDAQ_DIR=/usr/local/cudaq/lib/cmake/cudaq .. \
36+
# && cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCUDAQ_DIR=/usr/local/cudaq/lib/cmake/cudaq .. \
3637
# && ninja install

libs/qec/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ============================================================================ #
2-
# Copyright (c) 2024 NVIDIA Corporation & Affiliates. #
2+
# Copyright (c) 2024 - 2025 NVIDIA Corporation & Affiliates. #
33
# All rights reserved. #
44
# #
55
# This source code and the accompanying materials are made available under #
@@ -9,6 +9,15 @@
99
# Requiring the same version as the others.
1010
cmake_minimum_required(VERSION 3.28 FATAL_ERROR)
1111

12+
# Set a default build type if none was specified. Must set this before
13+
# project().
14+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
15+
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel")
16+
17+
# Set a default install prefix if none was specified.
18+
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.cudaqx" CACHE STRING
19+
"Install path prefix, prepended onto install directories")
20+
1221
# Project setup
1322
# ==============================================================================
1423

libs/solvers/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ============================================================================ #
2-
# Copyright (c) 2024 NVIDIA Corporation & Affiliates. #
2+
# Copyright (c) 2024 - 2025 NVIDIA Corporation & Affiliates. #
33
# All rights reserved. #
44
# #
55
# This source code and the accompanying materials are made available under #
@@ -9,6 +9,15 @@
99
# We need 3.28 because of the `EXCLUDE_FROM_ALL` in FetchContent_Declare
1010
cmake_minimum_required(VERSION 3.28 FATAL_ERROR)
1111

12+
# Set a default build type if none was specified. Must set this before
13+
# project().
14+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
15+
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel")
16+
17+
# Set a default install prefix if none was specified.
18+
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.cudaqx" CACHE STRING
19+
"Install path prefix, prepended onto install directories")
20+
1221
# This policy was added in version 3.30 in which calling `FetchContent_Populate()`
1322
# with a single argument (the name of a declared dependency) is deprecated.
1423
# We use the functionality to import the solvers libraries.

0 commit comments

Comments
 (0)