I am building a code with meson using GCC 7.5.0 and CUDA 11.4 and getting the error:
/usr/bin/ld: unrecognized option '-pthread'
in the building step. ld version is 2.34. Here is the output:
[5/6] Linking target SU2_CFD/src/SU2_CFD
FAILED: SU2_CFD/src/SU2_CFD
nvcc -o SU2_CFD/src/SU2_CFD SU2_CFD/src/SU2_CFD.p/SU2_CFD.cpp.o -Xlinker=-O1 SU2_CFD/src/libSU2core.a externals/metis/libmetis.a externals/parmetis/libparmetis.a Common/src/libSU2Common.a -Xlinker=-pthread -Xlinker=-rpath -Xlinker=/usr/apps/openmpi/lib -Xlinker=--enable-new-dtags -L/usr/apps/openmpi/lib -lmpi -Xlinker=-pthread -Xlinker=-rpath -Xlinker=/usr/apps/openmpi/lib -Xlinker=--enable-new-dtags -L/usr/apps/openmpi/lib -lmpi -Xlinker=/usr/local/cuda-11.4/targets/x86_64-linux/lib/libcusparse.so -Xlinker=-pthread -Xlinker=-rpath -Xlinker=/usr/apps/openmpi/lib -Xlinker=--enable-new-dtags -L/usr/apps/openmpi/lib -lmpi -Xlinker=-pthread -Xlinker=-rpath -Xlinker=/usr/apps/openmpi/lib -Xlinker=--enable-new-dtags -L/usr/apps/openmpi/lib -lmpi -Xlinker=-pthread -Xlinker=-rpath -Xlinker=/usr/apps/openmpi/lib -Xlinker=--enable-new-dtags -L/usr/apps/openmpi/lib -lmpi -Xlinker=-pthread -Xlinker=-rpath -Xlinker=/usr/apps/openmpi/lib -Xlinker=--enable-new-dtags -L/usr/apps/openmpi/lib -lmpi -Xlinker=-pthread -Xlinker=-rpath -Xlinker=/usr/apps/openmpi/lib -Xlinker=--enable-new-dtags -L/usr/apps/openmpi/lib -lmpi -Xlinker=-pthread -Xlinker=-rpath -Xlinker=/usr/apps/openmpi/lib -Xlinker=--enable-new-dtags -L/usr/apps/openmpi/lib -lmpi '-Xlinker=-rpath,$ORIGIN/:$ORIGIN/../../externals/metis:$ORIGIN/../../externals/parmetis:$ORIGIN/../../Common/src' -Xlinker=-rpath-link,/home/nahmad16/SU2/build/SU2_CFD/src -Xlinker=-rpath-link,/home/nahmad16/SU2/build/externals/metis -Xlinker=-rpath-link,/home/nahmad16/SU2/build/externals/parmetis -Xlinker=-rpath-link,/home/nahmad16/SU2/build/Common/src -lstdc++
/usr/bin/ld: unrecognized option '-pthread'
/usr/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Thanks for your help