xiaoyeli / superlu_dist

Distributed memory, MPI based SuperLU
https://portal.nersc.gov/project/sparse/superlu/
Other
183 stars 64 forks source link

An error occurred when I compile the example #100

Open liuzg-23 opened 2 years ago

liuzg-23 commented 2 years ago

Hello, I installed the superlu_dist_6.3.1 using the Makefile. Please see the following make.inc file that I used:


**#  The machine (platform) identifier to append to the library names
PLAT        = _x86_64
#  The name of the libraries to be created/linked to
#
SuperLUroot     = ${HOME}/code/CSEM_Anisotropic_4.2/contrib/SuperLU_DIST_6.3.1
DSUPERLULIB     = $(SuperLUroot)/lib/libsuperlu_dist.a
INCLUDEDIR      = $(SuperLUroot)/SRC

#
BLASDEF         = -DUSE_VENDOR_BLAS
BLASLIB         = /usr/lib/libblas.so.3
############################################################################
PARMETIS_DIR    = ../../parmetis-4.0.3

METISLIB := -L$(PARMETIS_DIR)/build/Linux-x86_64/libmetis -lmetis
PARMETISLIB := -L$(PARMETIS_DIR)/build/Linux-x86_64/libparmetis -lparmetis
I_PARMETIS := -I${PARMETIS_DIR}/include -I${PARMETIS_DIR}/metis/include
############################################################################

# Define the required Fortran libraries, if you use C compiler to link
FLIBS       = 

# Define all the libraries
LIBS            = $(DSUPERLULIB) $(BLASLIB) $(PARMETISLIB) $(METISLIB) \
          $(LAPACKLIB)
#  The archiver and the flag(s) to use when building archive (library)
#  If your system has no ranlib, set RANLIB = echo.
#
ARCH            = ar
ARCHFLAGS       = cr
RANLIB          = ranlib

############################################################################
# C compiler setup
CC             = mpicc
# CFLAGS should be set to be the C flags that include optimization
CFLAGS         = -pipe -O2 ${I_PARMETIS}
#
# NOOPTS should be set to be the C flags that turn off any optimization
NOOPTS      = 
############################################################################
# FORTRAN compiler setup
FORTRAN        = mpif77
F90FLAGS       = 
############################################################################
LOADER         = mpif77
LOADOPTS    = 
############################################################################
ifeq ($(findstring edison,$(shell uname -n)),edison)
CC = cc
CFLAGS = -fast -m64 -std=c99 -Wall -DDEBUGlevel=0 -DPRNTlevel=0 -DPROFlevel=0 ${I_PARMETIS}
FORTRAN = ftn
F90FLAGS = -fast
LOADER = $(CC)
endif
####################################################################
CDEFS        = -DAdd__** 

However, when I execute the command “make all”, there are some errors as following: 

 /usr/bin/ld: dsp_blas2_dist.c:(.text+0x419): undefined reference to `dtrsv_'
/usr/bin/ld: dsp_blas2_dist.c:(.text+0x5db): undefined reference to `dtrsv_'
/usr/bin/ld: dsp_blas2_dist.c:(.text+0x775): undefined reference to `dtrsv_'
/usr/bin/ld: dsp_blas2_dist.c:(.text+0x7cf): undefined reference to `dgemv_'
TreeInterface.cpp:(.text._ZN16SuperLU_ASYNCOMM11FTreeBcast2I13doublecomplexED0Ev[_ZN16SuperLU_ASYNCOMM11FTreeBcast2I13doublecomplexED5Ev]+0x29): more undefined references to `operator delete(void*, unsigned long)' follow

Can you help me solve this problem? Thanks very much!
Regards,
Zhengguang.
xiaoyeli commented 2 years ago

There are several points.

1) All the undefined routines are in BLAS library. Have you tried: CDEFS = -DAdd_ (add only 1 underscore, not 2 as you did)

2) Version 6.3.1 is really old. In the new version 7.2.0, we do not use TreeInterface.cpp anymore. Can you use the latest version in master branch?

3) Have you tried to install it using CMake ?