[petsc-users] How to link SuperLU_MT library in GCC_default.mk file?

Mark Adams mfadams at lbl.gov
Thu Feb 23 12:39:38 CST 2023


You want to configure PETSc with threads and not add them yourself:

    '--with-openmp=1',
    '--with-log=0',
    '--with-threadsafety',

And you want a threadsafe lapack probably.

Mark

On Thu, Feb 23, 2023 at 2:54 AM Salman Ahmad <salmanuom206 at gmail.com> wrote:

> Dear All,
>
> I compiled the library "SuperLU_MT" and got the "libsuperlu_mt_PTHREAD.a"
> and  "libsuperlu_mt_PTHREAD.a"  to  /usr/lib to /usr/lib. I am using the
> following file to link but not working:
>
> CC = gcc
> CXX     = g++
> F77 = gfortran
> LINKER  = ${CXX}
>
> WARNINGS = -Wall -pedantic -Wextra -Weffc++ -Woverloaded-virtual
> -Wfloat-equal -Wshadow \
>            -Wredundant-decls -Winline -fmax-errors=1
>
> CXXFLAGS += -ffast-math -O3 -march=native -std=c++17 ${WARNINGS}
>
> LINKFLAGS   += -O2
>
> #architecture
> #CPU = -march=znver2
> CXXFLAGS  += ${CPU}
> LINKFLAGS += ${CPU}
>
>
> ifeq ($(UBUNTU),1)
> LINKFLAGS += -llapack -lblas
> CXXFLAGS  += -DUBUNTU
> else
> # on  archlinux
> LINKFLAGS += -llapack -lopenblas -lcblas
> endif
>
> SANITARY =  -fsanitize=address  -fsanitize=undefined -fsanitize=null
> -fsanitize=return \
>  -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero
> -fsanitize=float-cast-overflow \
>  -fsanitize=bool -fsanitize=enum -fsanitize=vptr
>
> # SuperLU_MT
> CXXFLAGS += -L/usr/lib/lsuperlu_mt_PTHREAD
> LINKFLAGS += -L/usr/lib/lsuperlu_mt_PTHREAD
> #
> SUPERLU_INC= -I/usr/include/superlu -I/usr/include/superlu-dist
> CXXFLAGS  += ${SUPERLU_INC}
> LINKFLAGS +=-lsuperlu
> # OpenMP
> CXXFLAGS += -fopenmp
> LINKFLAGS += -fopenmp
>
> Any suggestions?
> Best Regards,
> Salman Ahmad
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230223/7a0bf177/attachment.html>


More information about the petsc-users mailing list