From d1d951689077675684bb470b47f5e0bac7662188 Mon Sep 17 00:00:00 2001 From: Lijun Zhu Date: Tue, 19 Nov 2019 16:51:06 -0800 Subject: [PATCH] cuda: remove arch specific flag; add /lib64 to LIBPATH for libcuda.so for most Linux systems --- components/zerodop/GPUampcor/cuda/SConscript | 10 +++++----- components/zerodop/GPUtopozero/cuda/compilation | 2 +- scons_tools/cuda.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/zerodop/GPUampcor/cuda/SConscript b/components/zerodop/GPUampcor/cuda/SConscript index 7d76208..c0ec346 100644 --- a/components/zerodop/GPUampcor/cuda/SConscript +++ b/components/zerodop/GPUampcor/cuda/SConscript @@ -2,19 +2,19 @@ #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Copyright 2010 California Institute of Technology. ALL RIGHTS RESERVED. -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# +# # United States Government Sponsorship acknowledged. This software is subject to # U.S. export control laws and regulations and has been classified as 'EAR99 NLR' # (No [Export] License Required except when exporting to an embargoed country, @@ -49,7 +49,7 @@ if envGPUampcor['GPU_ACC_ENABLED']: build_base += "-ccbin " + envGPUampcor['NVCC_CCBIN'] + " " else: print('Assuming default system compiler for nvcc.') - build_base += "-arch=sm_35 -shared -Xcompiler -fPIC -O3 " + build_base += "-shared -Xcompiler -fPIC -O3 " build_cmd = build_base + "-dc -m64 -o $TARGET -c $SOURCE" built_path = os.path.join(build, 'gpu-ampcor.o') linked_path = os.path.join(build, 'gpu-ampcor-linked.o') diff --git a/components/zerodop/GPUtopozero/cuda/compilation b/components/zerodop/GPUtopozero/cuda/compilation index ff97c2a..246d366 100644 --- a/components/zerodop/GPUtopozero/cuda/compilation +++ b/components/zerodop/GPUtopozero/cuda/compilation @@ -1,2 +1,2 @@ -nvcc -arch=sm_35 -Xcompiler -fPIC -o gpu-topo.o -c Topo.cu +nvcc -Xcompiler -fPIC -o gpu-topo.o -c Topo.cu cp -f gpu-topo.o .. diff --git a/scons_tools/cuda.py b/scons_tools/cuda.py index fe2f6d0..9dce35b 100644 --- a/scons_tools/cuda.py +++ b/scons_tools/cuda.py @@ -52,7 +52,7 @@ def generate(env): # default flags for the NVCC compiler env['STATICNVCCFLAGS'] = '' env['SHAREDNVCCFLAGS'] = '' - env['ENABLESHAREDNVCCFLAG'] = '-arch=sm_35 -shared -Xcompiler -fPIC' + env['ENABLESHAREDNVCCFLAG'] = '-shared -Xcompiler -fPIC' # default NVCC commands env['STATICNVCCCMD'] = '$NVCC -o $TARGET -c $NVCCFLAGS $STATICNVCCFLAGS $SOURCES' @@ -153,7 +153,7 @@ def generate(env): #env.Append(LIBPATH=[cudaSDKPath + '/lib', cudaSDKPath + '/common/lib' + cudaSDKSubLibDir, cudaToolkitPath + '/lib']) env.Append(CUDACPPPATH=[cudaToolkitPath + '/include']) - env.Append(CUDALIBPATH=[cudaToolkitPath + '/lib', cudaToolkitPath + '/lib64']) + env.Append(CUDALIBPATH=[cudaToolkitPath + '/lib', cudaToolkitPath + '/lib64', '/lib64']) env.Append(CUDALIBS=['cudart']) def exists(env):