Page 1 of 1

Lapack with v6

Posted: Tue Mar 09, 2021 11:14 am
by daniele
Hello,

I would like to perform matrix operations inside a fortran user subroutine, with code_saturne v6. I need Lapack.
I read a post in this forum discussing how to install code_saturne v2 with Lapack.
What is the procedure you reccomend with v6?

Thank you very much for your help.
Best regards,
Daniele

Re: Lapack with v6

Posted: Tue Mar 09, 2021 11:25 am
by Yvan Fournier
Hello,

Iy you use Lapack only in user subroutines, you can simply add the required compile and link flags in a cs_user_scripts.py file (under DATA), in the domain.compile_cflags, domain.compile_cxxflags, and domain.compile_libs entries.

Best regards,

Yvan

Re: Lapack with v6

Posted: Tue Apr 20, 2021 3:01 pm
by daniele
Hello Yvan,

Thank you very much for your help.
I am not very good in compiling stuff, could you please help me further: what do I have to specify exactly for domain.compile_...? The location of the Lapack libraries etc?

Thanks a lot for your time.
Best regards,
Daniele

Re: Lapack with v6

Posted: Tue Apr 20, 2021 4:14 pm
by Yvan Fournier
Hello,

On a system where Lapack is installed under /usr, simply use

Code: Select all

    domain.compile_cflags = None
    domain.compile_cxxflags = None
    domain.compile_fcflags = None
    domain.compile_libs = -llapack
On a system where it is installed on, for example /opt/lapack, adapt this:

Code: Select all

    domain.compile_cflags = -I/opt/lapack
    domain.compile_cxxflags = None
    domain.compile_fcflags = None
    domain.compile_libs = "-L/opt/lapack -llapack"
You might then have other errors due to dependencies, and need to add other libriaries (i.E. BLAS) depending on your system.

Best regards,

Yvan

Re: Lapack with v6

Posted: Fri May 21, 2021 4:28 pm
by daniele
Thank you very much Yvan.
I managed to properly link Lapack!
Best regards,
Daniele