diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e19a5024b..1db8b19893 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -262,7 +262,7 @@ if(AER_THRUST_SUPPORTED) set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${AER_CUDA_ARCH_FLAGS_EXPAND} -DAER_THRUST_CUDA -I${AER_SIMULATOR_CPP_SRC_DIR} -isystem ${AER_SIMULATOR_CPP_SRC_DIR}/third-party/headers -use_fast_math --expt-extended-lambda") set(AER_COMPILER_DEFINITIONS ${AER_COMPILER_DEFINITIONS} THRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA) - set(THRUST_DEPENDENT_LIBS "") + set(THRUST_DEPENDANT_LIBS "-L${CUDA_TOOLKIT_ROOT_DIR}/lib64") if(NOT DEFINED CUQUANTUM_ROOT) if(DEFINED ENV{CUQUANTUM_ROOT}) set(CUQUANTUM_ROOT $ENV{CUQUANTUM_ROOT}) @@ -283,14 +283,14 @@ if(AER_THRUST_SUPPORTED) set(AER_COMPILER_DEFINITIONS ${AER_COMPILER_DEFINITIONS} AER_CUSTATEVEC AER_CUTENSORNET) if(DEFINED CUQUANTUM_ROOT) set(AER_COMPILER_FLAGS "${AER_COMPILER_FLAGS} -I${CUQUANTUM_ROOT}/include") - set(THRUST_DEPENDANT_LIBS "-L${CUQUANTUM_ROOT}/lib/${CUDA_VERSION_MAJOR}") + set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -L${CUQUANTUM_ROOT}/lib/${CUDA_VERSION_MAJOR}") endif() if(DEFINED CUTENSOR_ROOT) set(AER_COMPILER_FLAGS "${AER_COMPILER_FLAGS} -I${CUTENSOR_ROOT}/include") set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -L${CUTENSOR_ROOT}/lib/${CUDA_VERSION_MAJOR}") endif() if(CUQUANTUM_STATIC) - set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -lcustatevec_static -lcutensornet_static -lcutensor -lcublas") + set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -lcustatevec_static -lcutensornet_static -lcutensor_static -lmetis_static -lcusolver_static -lcusparse_static -lcusolver_lapack_static -lcublas_static -lcublasLt_static -lculibos") else() set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -lcustatevec -lcutensornet -lcutensor") endif() @@ -299,9 +299,9 @@ if(AER_THRUST_SUPPORTED) set(AER_COMPILER_DEFINITIONS ${AER_COMPILER_DEFINITIONS} AER_CUSTATEVEC) set(AER_COMPILER_FLAGS "${AER_COMPILER_FLAGS} -I${CUSTATEVEC_ROOT}/include") if(CUSTATEVEC_STATIC) - set(THRUST_DEPENDANT_LIBS "-L${CUSTATEVEC_ROOT}/lib -L${CUSTATEVEC_ROOT}/lib64 -lcustatevec_static -L${CUDA_TOOLKIT_ROOT_DIR}/lib64 -lcublas") + set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -L${CUSTATEVEC_ROOT}/lib -L${CUSTATEVEC_ROOT}/lib/${CUDA_VERSION_MAJOR} -lcustatevec_static -lcusolver_static -lcusparse_static -lcusolver_lapack_static -lcublas_static -lcublasLt_static -lculibos") else() - set(THRUST_DEPENDANT_LIBS "-L${CUSTATEVEC_ROOT}/lib -L${CUSTATEVEC_ROOT}/lib64 -lcustatevec") + set(THRUST_DEPENDANT_LIBS "${THRUST_DEPENDANT_LIBS} -L${CUSTATEVEC_ROOT}/lib -L${CUSTATEVEC_ROOT}/lib/${CUDA_VERSION_MAJOR} -lcustatevec") endif() endif() elseif(AER_THRUST_BACKEND STREQUAL "TBB") diff --git a/releasenotes/notes/fix_cuQuantum_static-ad132d742a64a3d5.yaml b/releasenotes/notes/fix_cuQuantum_static-ad132d742a64a3d5.yaml new file mode 100644 index 0000000000..86ba4a6d65 --- /dev/null +++ b/releasenotes/notes/fix_cuQuantum_static-ad132d742a64a3d5.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + This is fix for static link libraries of cuQuantum when building with + CUQUANTUM_STATIC=true.