我正在尝试安装 Pastix 库,但我仍然遇到缺少库的问题,我现在真的很无助。
我从复制LINUX-GNU.in
as开始config.in
,因为我正在使用 Lubuntu 15.04。我已经改用 Scotch 和 Blas 的路径。
但是现在,当我尝试时make examples_s
,它看起来没问题,但文件bin
夹中没有出现编译文件。
当我尝试制作任何其他示例时,例如make examples_z
,最终我得到了错误:
/usr/bin/ld: cannot find -lblas
我知道找不到 Blas 库,但我没有看到我犯的错误。Blas 库位于我的/usr/lib
文件夹中,如下所示:
├── libblas
| ├── libblas.so.3 -> libblas.so.3.0
| └── libblas.so.3.0
├── libblas.so.3 -> /etc/alternatives/libblas.so.3
├── libblas.so.3gf -> /etc/alternatives/libblas.so.3gf
├── libgslcblas.so.0 -> libgslcblas.so.0.0.0
└── libgslcblas.so.0.0.0
在config.in
我设置BLAS_HOME
了这样的变量:
BLAS_HOME=/usr/lib/libblas
所以,你知道我做错了什么吗?我没有使用 Pastix 的经验,所以我现在很困惑。
解决方案
我终于发现,Pastix 需要专门的libblas.a
库。
所以,解决方案是:
- 找到包含
libblas.a
-apt-file search libblas.a
- 选择其中一个包 - 例如
libblas-dev
- 安装选择的包 -
sudo apt-get install libblas-dev
配置文件
HOSTARCH = i686_pc_linux
VERSIONBIT = _32bit
EXEEXT =
OBJEXT = .o
LIBEXT = .a
CCPROG = gcc -Wall
CFPROG = gfortran
CF90PROG = gfortran -ffree-form
MCFPROG = mpif90
CF90CCPOPT = -ffree-form -x f95-cpp-input
# Compilation options for optimization (make expor)
CCFOPT = -O3
# Compilation options for debug (make | make debug)
CCFDEB = -g3
CXXOPT = -O3
NVCCOPT = -O3
LKFOPT =
MKPROG = make
MPCCPROG = mpicc -Wall
MPCXXPROG = mpic++ -Wall
CPP = cpp
ARFLAGS = ruv
ARPROG = ar
EXTRALIB = -lgfortran -lm -lrt
CTAGSPROG = ctags
VERSIONMPI = _mpi
VERSIONSMP = _smp
VERSIONSCH = _static
VERSIONINT = _int
VERSIONPRC = _simple
VERSIONFLT = _real
VERSIONORD = _scotch
###################################################################
# SETTING INSTALL DIRECTORIES #
###################################################################
# ROOT = /home/osboxes/pastix
# INCLUDEDIR = ${ROOT}/include
# LIBDIR = ${ROOT}/lib
# BINDIR = ${ROOT}/bin
# PYTHON_PREFIX = ${ROOT}
###################################################################
# SHARED LIBRARY GENERATION #
###################################################################
#SHARED=1
#SOEXT=.so
#SHARED_FLAGS = -shared -Wl,-soname,__SO_NAME__
#CCFDEB := ${CCFDEB} -fPIC
#CCFOPT := ${CCFOPT} -fPIC
#CFPROG := ${CFPROG} -fPIC
###################################################################
# INTEGER TYPE #
###################################################################
# Uncomment the following lines for integer type support (Only 1)
#VERSIONINT = _long
#CCTYPES = -DFORCE_LONG -DINTSIZELONG
#---------------------------
#VERSIONINT = _int32
#CCTYPES = -DINTSIZE32
#---------------------------
#VERSIONINT = _int64
#CCTYPES = -DINTSSIZE64
###################################################################
# FLOAT TYPE #
###################################################################
CCTYPESFLT =
# Uncomment the following lines for double precision support
VERSIONPRC = _double
CCTYPESFLT := $(CCTYPESFLT) -DPREC_DOUBLE
# Uncomment the following lines for float=complex support
#VERSIONFLT = _complex
#CCTYPESFLT := $(CCTYPESFLT) -DTYPE_COMPLEX
###################################################################
# MPI/THREADS #
###################################################################
# Uncomment the following lines for sequential (NOMPI) version
#VERSIONMPI = _nompi
#CCTYPES := $(CCTYPES) -DFORCE_NOMPI
#MPCCPROG = $(CCPROG)
#MCFPROG = $(CFPROG)
# Uncomment the following lines for non-threaded (NOSMP) version
#VERSIONSMP = _nosmp
#CCTYPES := $(CCTYPES) -DFORCE_NOSMP
# Uncomment the following line to enable a progression thread,
# then use IPARM_THREAD_COMM_MODE
#CCPASTIX := $(CCPASTIX) -DPASTIX_THREAD_COMM
# Uncomment the following line if your MPI doesn't support MPI_THREAD_MULTIPLE level,
# then use IPARM_THREAD_COMM_MODE
#CCPASTIX := $(CCPASTIX) -DPASTIX_FUNNELED
# Uncomment the following line if your MPI doesn't support MPI_Datatype correctly
#CCPASTIX := $(CCPASTIX) -DNO_MPI_TYPE
# Uncomment the following line if you want to use semaphore barrier
# instead of MPI barrier (with IPARM_AUTOSPLIT_COMM)
#CCPASTIX := $(CCPASTIX) -DWITH_SEM_BARRIER
# Uncomment the following lines to enable StarPU.
#CCPASTIX := $(CCPASTIX) `pkg-config libstarpu --cflags` -DWITH_STARPU
#EXTRALIB := $(EXTRALIB) `pkg-config libstarpu --libs`
# Uncomment the correct 2 lines
#CCPASTIX := $(CCPASTIX) -DCUDA_SM_VERSION=11
#NVCCOPT := $(NVCCOPT) -maxrregcount 32 -arch sm_11
#CCPASTIX := $(CCPASTIX) -DCUDA_SM_VERSION=13
#NVCCOPT := $(NVCCOPT) -maxrregcount 32 -arch sm_13
CCPASTIX := $(CCPASTIX) -DCUDA_SM_VERSION=20
NVCCOPT := $(NVCCOPT) -arch sm_20
# Uncomment the following line to enable StarPU profiling
# ( IPARM_VERBOSE > API_VERBOSE_NO ).
#CCPASTIX := $(CCPASTIX) -DSTARPU_PROFILING
# Uncomment the following line to disable CUDA (StarPU)
#CCPASTIX := $(CCPASTIX) -DFORCE_NO_CUDA
###################################################################
# Options #
###################################################################
# Show memory usage statistics
#CCPASTIX := $(CCPASTIX) -DMEMORY_USAGE
# Show memory usage statistics in solver
#CCPASTIX := $(CCPASTIX) -DSTATS_SOPALIN
# Uncomment following line for dynamic thread scheduling support
#CCPASTIX := $(CCPASTIX) -DPASTIX_DYNSCHED
# Uncomment the following lines for Out-of-core
#CCPASTIX := $(CCPASTIX) -DOOC -DOOC_NOCOEFINIT -DOOC_DETECT_DEADLOCKS
###################################################################
# GRAPH PARTITIONING #
###################################################################
# Uncomment the following lines for using metis ordering
#VERSIONORD = _metis
#METIS_HOME = ${HOME}/metis-4.0
#CCPASTIX := $(CCPASTIX) -DMETIS -I$(METIS_HOME)/Lib
#EXTRALIB := $(EXTRALIB) -L$(METIS_HOME) -lmetis
# Scotch always needed to compile
#SCOTCH_HOME ?= ${HOME}/scotch_5.1/
SCOTCH_INC ?= /usr/include/scotch-int64 #$(SCOTCH_HOME)/include
SCOTCH_LIB ?= /usr/lib #$(SCOTCH_HOME)/lib
# Uncomment on of this blocks
#scotch
#CCPASTIX := $(CCPASTIX) -I$(SCOTCH_INC) -DWITH_SCOTCH
#EXTRALIB := $(EXTRALIB) -L$(SCOTCH_LIB) -lscotch -lscotcherrexit
#ptscotch
CCPASTIX := $(CCPASTIX) -I$(SCOTCH_INC) -DDISTRIBUTED -DWITH_SCOTCH
#if scotch >= 6.0
EXTRALIB := $(EXTRALIB) -L$(SCOTCH_LIB) -lptscotch -lscotch -lptscotcherrexit
#else
#EXTRALIB := $(EXTRALIB) -L$(SCOTCH_LIB) -lptscotch -lptscotcherrexit
###################################################################
# Portable Hardware Locality #
###################################################################
# By default PaStiX uses hwloc to bind threads,
# comment this lines if you don't want it (not recommended)
HWLOC_HOME ?= /opt/hwloc/
HWLOC_INC ?= $(HWLOC_HOME)/include
HWLOC_LIB ?= $(HWLOC_HOME)/lib
CCPASTIX := $(CCPASTIX) -I$(HWLOC_INC) -DWITH_HWLOC
EXTRALIB := $(EXTRALIB) -L$(HWLOC_LIB) -lhwloc
###################################################################
# MARCEL #
###################################################################
# Uncomment following lines for marcel thread support
#VERSIONSMP := $(VERSIONSMP)_marcel
#CCPASTIX := $(CCPASTIX) `pm2-config --cflags` -I${PM2_ROOT}/marcel/include/pthread
#EXTRALIB := $(EXTRALIB) `pm2-config --libs`
# ---- Thread Posix ------
EXTRALIB := $(EXTRALIB) -lpthread
# Uncomment following line for bubblesched framework support (need marcel support)
#VERSIONSCH = _dyn
#CCPASTIX := $(CCPASTIX) -DPASTIX_BUBBLESCHED
###################################################################
# BLAS #
###################################################################
# Choose Blas library (Only 1)
# Do not forget to set BLAS_HOME if it is not in your environnement
BLAS_HOME=/usr/lib/libblas
#---- Blas ----
BLASLIB = -lblas
#---- Gotoblas ----
#BLASLIB = -L${BLAS_HOME} -lgoto
#---- MKL ----
#Uncomment the correct line
#BLASLIB = -L$(BLAS_HOME) -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
#BLASLIB = -L$(BLAS_HOME) -lmkl_intel -lmkl_sequential -lmkl_core
#---- Acml ----
#BLASLIB = -L$(BLAS_HOME) -lacml
###################################################################
# MURGE #
###################################################################
# Uncomment if you need MURGE interface to be thread safe
# CCPASTIX := $(CCPASTIX) -DMURGE_THREADSAFE
# Uncomment this to have more timings inside MURGE
# CCPASTIX := $(CCPASTIX) -DMURGE_TIME
###################################################################
# DO NOT TOUCH #
###################################################################
FOPT := $(CCFOPT)
FDEB := $(CCFDEB)
CCHEAD := $(CCPROG) $(CCTYPES) $(CCFOPT)
CCFOPT := $(CCFOPT) $(CCTYPES) $(CCPASTIX)
CCFDEB := $(CCFDEB) $(CCTYPES) $(CCPASTIX)
NVCCOPT := $(NVCCOPT) $(CCTYPES) $(CCPASTIX)
###################################################################
# MURGE COMPATIBILITY #
###################################################################
MAKE = $(MKPROG)
CC = $(MPCCPROG)
CFLAGS = $(CCFOPT) $(CCTYPESFLT)
FC = $(MCFPROG)
FFLAGS = $(CCFOPT)
LDFLAGS = $(EXTRALIB) $(BLASLIB)
CTAGS = $(CTAGSPROG)