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

Mark Adams mfadams at lbl.gov
Thu Feb 23 20:42:36 CST 2023


Keep this on the list.

We don't support SuperLU_MT.
There is no interface to it in PETSc.

Here is a table with our available solvers:
https://petsc.org/main/overview/linear_solve_table

I thought SuperLU supported using threads in the solver, but I could be
wrong.
You could ask them. They would know what is supported in PETSc and how to
use it.

Good luck,
Mark




On Thu, Feb 23, 2023 at 8:44 PM Salman Ahmad <salmanuom206 at gmail.com> wrote:

> Dear Mark,
>
> Thank you so much for your reply!
>
> I am a Mathematics Student and a beginner in Makefile. Please help me how
> I add the  (libsuperlu_mt_PTHREAD.a) having address /usr/lib in the
> attached make file?
>
> Best Regards,
> Salman Ahmad
>
> On Fri, Feb 24, 2023 at 2:39 AM Mark Adams <mfadams at lbl.gov> wrote:
>
>> 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/470a7903/attachment.html>


More information about the petsc-users mailing list