Skip to content

Commit c838fb4

Browse files
authored
Merge pull request #60 from LLNL/cmake-build-type
Make it easier to build with debug or int64 flags
2 parents cd648a8 + d868a2b commit c838fb4

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.ci-scripts/radiuss-spack-configs

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ project(
66
LANGUAGES CXX C
77
)
88

9+
# Set default build type to Release if not specified
10+
if(NOT CMAKE_BUILD_TYPE)
11+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose build type" FORCE)
12+
endif()
13+
914
set(BLT_CXX_STD "c++14" CACHE STRING "Version of C++ standard")
1015
set(CMAKE_CXX_STANDARD 14)
11-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
16+
1217
set(ENABLE_MPI ON CACHE BOOL "")
1318

1419
################################

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ pip install -e .
5555
#### Optional Spack environment variations
5656
The Spack environment used to build Quandary is defined in `.spack_env/spack.yaml`.
5757
You can add or remove packages from the `specs` list as needed or use different variants of these.
58-
For instance, if you want to use the debug variant (which builds Petsc in debug mode) you can use `quandary@develop+test+debug`.
58+
For instance, if you want to use the debug variant (which builds Quandary and Petsc in debug mode) you can use `quandary@develop+test build_type=Debug`.
59+
To build with `PetscInt`s set to 64-bit integers, use `quandary+int64`.
5960
To use a specific version of Petsc instead of the latest release, you can do e.g. `quandary@develop^petsc@3.22.1`.
6061
The `+test` variant (by default on in `.spack_env/spack.yaml`) adds python and pip to the Spack environment.
6162
This allows `pip install` to install python packages to your Spack virtual environment rather than a global one.
@@ -89,6 +90,7 @@ cmake ..
8990
make
9091
```
9192
93+
To build in debug mode use `cmake -DCMAKE_BUILD_TYPE=Debug ..`.
9294
Add the path to Quandary to your `PATH` variable with `export PATH=/path/to/quandary/:$PATH`, so your binary can be found.
9395
Alternatively, you can install the Quandary executable in a specific path (such as the default `/usr/local/bin` to have it in your `PATH` automatically):
9496
```

0 commit comments

Comments
 (0)