gpt4 book ai didi

linux - 无法在 Ubuntu 10.04、CUDA 5.0 上编译 MAGMA 1.3

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:05:15 25 4
gpt4 key购买 nike

我正在尝试编译 MAGMA Ubuntu 10.04 上的库,我被卡住了。

来自 README 文件:

To INSTALL MAGMA, modify the make.inc file to indicate where CUDA, CPU BLAS, and LAPACK are installed on your system. Examples
are given in make.inc.mkl, make.inc.acml, make.inc.goto, and
make.inc.atlas, showing how to link correspondingly to MKL, ACML,
GOTO BLAS or ATLAS BLAS. After proper modification of the make.inc
file, typing 'make', will create 1) the libmagma.a and libmagmablas.a libraries in directory 'lib' 2) testing drivers in directory 'testing'.

因此,我安装了所需的软件包:

apt-get install libatlas-base-dev liblapack-dev libf2c2-dev gfortran

复制make.inc.atlasmake.inc修改CUDA路径,nvcc路径和liblapack.a 路径,我删除了两个不必要的链接目录。

为了完整引用,这里是原始的make.inc.atlas:

#//////////////////////////////////////////////////////////////////////////////
# -- MAGMA (version 1.3.0) --
# Univ. of Tennessee, Knoxville
# Univ. of California, Berkeley
# Univ. of Colorado, Denver
# November 2012
#//////////////////////////////////////////////////////////////////////////////

#
# GPU_TARGET specifies for which GPU you want to compile MAGMA:
# "Tesla" (NVIDIA compute capability 1.x cards)
# "Fermi" (NVIDIA compute capability 2.x cards)
# See http://developer.nvidia.com/cuda-gpus

GPU_TARGET = Fermi

CC = gcc
NVCC = nvcc
FORT = gfortran

ARCH = ar
ARCHFLAGS = cr
RANLIB = ranlib

OPTS = -O3 -DADD_
F77OPTS = -O3 -DADD_
FOPTS = -O3 -DADD_ -x f95-cpp-input
NVOPTS = -O3 -DADD_ --compiler-options -fno-strict-aliasing -DUNIX
LDOPTS = -fPIC -Xlinker -zmuldefs

LIB = /home/tomov/LIB/lapack-lite-3.1.1/lapack_LINUX64.a \
-lf77blas -latlas -lcblas -lf2c -lcublas -lm

CUDADIR = /usr/local/cuda-3.0

LIBDIR = -L/home/tomov/LIB/ATLAS/lib/Linux_UNKNOWNSSE2 \
-L/home/tomov/LIB/CLAPACK-3.1.1/F2CLIBS/ \
-L$(CUDADIR)/lib64
INC = -I$(CUDADIR)/include

在这里,我修改后的文件保存到 make.inc 中:

#//////////////////////////////////////////////////////////////////////////////
# -- MAGMA (version 1.3.0) --
# Univ. of Tennessee, Knoxville
# Univ. of California, Berkeley
# Univ. of Colorado, Denver
# November 2012
#//////////////////////////////////////////////////////////////////////////////

#
# GPU_TARGET specifies for which GPU you want to compile MAGMA:
# "Tesla" (NVIDIA compute capability 1.x cards)
# "Fermi" (NVIDIA compute capability 2.x cards)
# See http://developer.nvidia.com/cuda-gpus

GPU_TARGET = Fermi

CC = gcc
NVCC = /usr/local/cuda-5.0/bin/nvcc
FORT = gfortran

ARCH = ar
ARCHFLAGS = cr
RANLIB = ranlib

OPTS = -O3 -DADD_
F77OPTS = -O3 -DADD_
FOPTS = -O3 -DADD_ -x f95-cpp-input
NVOPTS = -O3 -DADD_ --compiler-options -fno-strict-aliasing -DUNIX
LDOPTS = -fPIC -Xlinker -zmuldefs

LIB = /usr/lib/liblapack.a \
-lf77blas -latlas -lcblas -lf2c -lcublas -lm

CUDADIR = /usr/local/cuda-5.0

LIBDIR = -L$(CUDADIR)/lib64
INC = -I$(CUDADIR)/include

因此,我运行 make 并得到 this error .我应用那里提出的解决方案,并且编译继续进行,直到这一点:

make[1]: Entering directory `/usr/src/magma-1.3.0/testing'
gcc -O3 -DADD_ -DHAVE_CUBLAS -DGPUSHMEM=200 -I/usr/local/cuda-5.0/include -I../include -I../control -c /usr/local/cuda-5.0/src/fortran.c -o fortran.o
In file included from /usr/local/cuda-5.0/src/fortran.c:67:
/usr/local/cuda-5.0/src/fortran_common.h:405:2: error: #error unsupported Fortran compiler
make[1]: *** [fortran.o] Error 1
make[1]: Leaving directory `/usr/src/magma-1.3.0/testing'
make: *** [test] Error 2

我能做什么?

最佳答案

简单的解决方案:设置 FORT 如下:

FORT      = gfortran -DCUBLAS_GFORTRAN

关于linux - 无法在 Ubuntu 10.04、CUDA 5.0 上编译 MAGMA 1.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14378868/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com