mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2025-08-23 23:35:31 +08:00
Update CHANGELOG.md and README.md for QNX cross build
This commit is contained in:
parent
ce28796d6c
commit
a47b422205
@ -77,6 +77,7 @@
|
||||
* `simpleCUFFT_2d_MGPU`
|
||||
* `simpleCUFFT_MGPU`
|
||||
* `simpleCUFFT_callback`
|
||||
* Updated toolchain for cross-compilation for Tegra QNX platforms.
|
||||
|
||||
### CUDA 12.9
|
||||
* Updated toolchain for cross-compilation for Tegra Linux platforms.
|
||||
|
11
README.md
11
README.md
@ -135,9 +135,14 @@ $ cmake -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DCMAKE_LIBRARY_PATH=/usr
|
||||
|
||||
### QNX
|
||||
|
||||
Note that in the current branch sample cross-compilation for QNX is not fully validated. This placeholder will be updated in the
|
||||
near future with QNX cross-compilation instructions. In the meantime, if you want to cross-compile for QNX please check out one
|
||||
of the previous tags prior to the CMake build system transition in 12.8.
|
||||
The sample cross-compilation for QNX is supported since v13.0 CUDA Samples. An example build for Tegra Thor QNX platform might like this:
|
||||
|
||||
```
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
|
||||
QNX_HOST=/path/to/qnx/host QNX_TARGET=/path/to/qnx/target cmake .. -DBUILD_TEGRA=True -DCMAKE_CUDA_COMPILER=/usr/local/cuda-safe-13.0/bin/nvcc -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/toolchain-aarch64-qnx.cmake -DCMAKE_LIBRARY_PATH=/usr/local/cuda-safe-13.0/thor/targets/aarch64-qnx/lib/stubs/ -DCMAKE_INCLUDE_PATH=/usr/local/cuda-safe-13.0/thor/targets/aarch64-qnx/include/
|
||||
```
|
||||
|
||||
## Running All Samples as Tests
|
||||
|
||||
|
@ -1,18 +1,28 @@
|
||||
set(CMAKE_SYSTEM_NAME QNX)
|
||||
set(CMAKE_SYSTEM_PROCESSOR aarch64)
|
||||
|
||||
# Need to set the QNX_HOST and QNX_TARGET environment variables
|
||||
set(QNX_HOST $ENV{QNX_HOST})
|
||||
set(QNX_TARGET $ENV{QNX_TARGET})
|
||||
|
||||
message(STATUS "QNX_HOST = ${QNX_HOST}")
|
||||
message(STATUS "QNX_TARGET = ${QNX_TARGET}")
|
||||
|
||||
set(CMAKE_C_COMPILER ${QNX_HOST}/usr/bin/qcc)
|
||||
set(CMAKE_CXX_COMPILER ${QNX_HOST}/usr/bin/q++)
|
||||
find_program(QNX_QCC NAMES qcc PATHS "${QNX_HOST}/usr/bin")
|
||||
find_program(QNX_QPLUS NAMES q++ PATHS "${QNX_HOST}/usr/bin")
|
||||
|
||||
if(NOT QNX_QCC OR NOT QNX_QPLUS)
|
||||
message(FATAL_ERROR "Could not find qcc or q++ in QNX_HOST=${QNX_HOST}/usr/bin")
|
||||
endif()
|
||||
|
||||
# Specify the cross-compilers
|
||||
set(CMAKE_C_COMPILER ${QNX_QCC})
|
||||
set(CMAKE_CXX_COMPILER ${QNX_QPLUS})
|
||||
|
||||
set(CMAKE_C_COMPILER_TARGET aarch64)
|
||||
set(CMAKE_CXX_COMPILER_TARGET aarch64)
|
||||
|
||||
# Set compiler flags
|
||||
set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING "" FORCE)
|
||||
set(CMAKE_CUDA_COMPILER_ID_TEST_FLAGS_FIRST "-nodlink -L${CUDA_ROOT}/lib64 -L${CUDA_ROOT}/lib -I${CUDA_ROOT}/include")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user