我正在尝试安装一个名为stn的luarocks包。安装它的官方方法是运行:
luarocks install https://raw.githubusercontent.com/qassemoquab/stnbhwd/master/stnbhwd-scm-1.rockspec
但这给了我一个不幸的,恶化的错误:
nvcc fatal : Value 'sm_20' is not defined for option 'gpu-architecture'
据我所知,修复此问题的唯一方法是手动从以下位置更改CMakeLists.txt文件:
IF (CUDA_FOUND)
LIST(APPEND CUDA_NVCC_FLAGS "-arch=sm_20")
至:
IF (CUDA_FOUND)
LIST(APPEND CUDA_NVCC_FLAGS "-arch=sm_30")
因此,这意味着我必须将回购文件克隆到本地文件中,更改CMakeLists文件,然后使用luarock进行复制。(作为免责声明,为了做到这一点,我不得不chown
我的整个用户,因为目录写入权限luarocks似乎没有任何原因。)我有多惨?)。
因此,我能够通过cding到主目录来安装.rockspec文件,并且:
luarocks make stnbhwd-scm-1.rockspec
这给了我这个输出:
$ luarocks make stnbhwd-scm-1.rockspec
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/home/tex/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1" && make
-- Found Torch7 in /home/tex/torch/install
-- Compiling with OpenMP support
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tex/Downloads/stnbhwd-master/build
[ 50%] Built target stn
[ 75%] Building NVCC (Device) object CMakeFiles/custn.dir/custn_generated_init.cu.o
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THStorage.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THStorageCopy.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCStorage.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCStorageCopy.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THTensor.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THTensorCopy.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THTensorRandom.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THTensorMath.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THTensorConv.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THTensorLapack.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensor.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorCopy.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorRandom.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMath.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathBlas.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathMagma.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathPairwise.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathPointwise.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathReduce.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathCompare.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathCompareT.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMathScan.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMasked.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorScatterGather.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorIndex.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorSort.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorMode.h
CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensorTopK.h
[100%] Linking CXX shared module libcustn.so
[100%] Built target custn
cd build && make install
[ 50%] Built target stn
[100%] Built target custn
Install the project...
-- Install configuration: "Release"
-- Installing: /home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lib/libstn.so
-- Set runtime path of "/home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lib/libstn.so" to "$ORIGIN/../lib:/home/tex/torch/install/lib"
-- Installing: /home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lua/stn/test.lua
-- Installing: /home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lua/stn/AffineGridGeneratorBHWD.lua
-- Installing: /home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lua/stn/AffineTransformMatrixGenerator.lua
-- Installing: /home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lua/stn/init.lua
-- Installing: /home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lua/stn/BilinearSamplerBHWD.lua
-- Installing: /home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lib/libcustn.so
-- Set runtime path of "/home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lib/libcustn.so" to "$ORIGIN/../lib:/home/tex/torch/install/lib"
Warning: /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/init.lua is not tracked by this installation of LuaRocks. Moving it to /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/init.lua~~~~~~
Warning: /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/AffineTransformMatrixGenerator.lua is not tracked by this installation of LuaRocks. Moving it to /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/AffineTransformMatrixGenerator.lua~~~~~~
Warning: /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/BilinearSamplerBHWD.lua is not tracked by this installation of LuaRocks. Moving it to /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/BilinearSamplerBHWD.lua~~~~~~
Warning: /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/test.lua is not tracked by this installation of LuaRocks. Moving it to /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/test.lua~~~~~~
Warning: /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/AffineGridGeneratorBHWD.lua is not tracked by this installation of LuaRocks. Moving it to /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/AffineGridGeneratorBHWD.lua~~~~~~
Warning: /home/tex/torch/install/lib/lua/5.1/stnbhwd_scm_1-libstn.so is not tracked by this installation of LuaRocks. Moving it to /home/tex/torch/install/lib/lua/5.1/stnbhwd_scm_1-libstn.so~~~~~~
Warning: /home/tex/torch/install/lib/lua/5.1/stnbhwd_scm_1-libcustn.so is not tracked by this installation of LuaRocks. Moving it to /home/tex/torch/install/lib/lua/5.1/stnbhwd_scm_1-libcustn.so~~~~~
stnbhwd scm-1 is now installed in /home/tex/torch/install/ (license: MIT)
注意“警告”标志。我不知道为什么会这样,但我认为它对安装有一些明显的影响,因为当我加载stn时:
Failed loading module stn in LuaRocks rock stnbhwd scm-1
no field package.preload['stn']
no file '/home/tex/.luarocks/share/lua/5.1/stn.lua'
no file '/home/tex/.luarocks/share/lua/5.1/stn/init.lua'
no file '/home/tex/torch/install/share/lua/5.1/stn.lua'
no file '/home/tex/torch/install/share/lua/5.1/stn/init.lua'
no file './stn.lua'
no file '/home/tex/torch/install/share/luajit-2.1.0-beta1/stn.lua'
no file '/usr/local/share/lua/5.1/stn.lua'
no file '/usr/local/share/lua/5.1/stn/init.lua'
no file '/home/tex/.luarocks/lib/lua/5.1/stn.so'
no file '/home/tex/torch/install/lib/lua/5.1/stn.so'
no file '/home/tex/torch/install/lib/stn.so'
no file './stn.so'
no file '/usr/local/lib/lua/5.1/stn.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'error'
/home/tex/torch/install/share/lua/5.1/trepl/init.lua:389: in function 'require'
run_model.lua:6: in main chunk
[C]: in function 'dofile'
.../tex/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50
叹了口气,,有人知道解决办法吗?有解决办法吗?LuaRocks仍然适用于安装软件包,但也许我在安装本地软件包时做错了什么。是否有一种方法可以在安装cmake文件之前安装stn软件包(而不是下载软件包并以这种方式手动更改它)?我很怀疑但是..。:(
编辑:任何人阅读这篇文章,请参考此页。我必要地说,去它的,并上传了编辑的回购到我自己的github页面。现在,我面临着一个不同的错误。
发布于 2017-12-06 10:45:19
我能看到路径上有错配。安装stnbhwd时使用前缀:
-DCMAKE_INSTALL_PREFIX="/home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1"
但看看你得到的警告:
Warning: /home/tex/torch/install/share/lua/5.1/stnbhwd_scm_1-stn/init.lua is not tracked by this installation of LuaRocks
显示您的LUA_PATH,LUA_CPATH设置为
/home/tex/torch/install/share/lua/5.1
首先,尝试在前缀中使用的路径以添加到LUA_PATH,LUA_CPATH中。
如果这无助于在Lua脚本中指定路径:
-- add a new directory to the path
package.path = package.path .. ";/home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1/lua/stn/?.lua"
Alos,检查这 1
https://stackoverflow.com/questions/47665820
复制相似问题