Hi,
What is the correct way to call a BLAS routine from a Fortran Cactus thorn? I am trying to compile the LlamaWaveToy, and it does this:
subroutine LWT_min_spacing (CCTK_ARGUMENTS) use lapack ... call syev ('N', 'U', 3, gg, 3, ev, work, lwork, info)
and at link time, I get
/home/ianhin/Cactus/EinsteinToolkitGit/configs/etllama/lib/libthorn_LlamaWaveToy.a(min_spacing.F90.o): In function `lwt_min_spacing': /home/ianhin/Cactus/EinsteinToolkitGit/arrangements/Llama/LlamaWaveToy/src/min_spacing.F90:38: undefined reference to `syev_'
Do I need to do something special to make the symbol found, or to convert Fortran to C names, etc?
Hi Ian,
I haven't tried to use Lapack routines from Cactus, but I have other Fortran codes where I do.
I have a code, where I just link the library (or add -mkl to the link line if I use the intel compilers) without even including 'use lapack' in the source file.
How does you cactus link line look like?
Do you maybe need something like "REQUIRES Lapack" in your configuration.ccl?
Cheers,
Peter
On Monday 2016-11-14 11:21, Ian Hinder wrote:
Date: Mon, 14 Nov 2016 11:21:30 From: Ian Hinder ian.hinder@aei.mpg.de To: Einstein Toolkit Users users@einsteintoolkit.org Subject: [Users] Calling BLAS from Fortran
Hi,
What is the correct way to call a BLAS routine from a Fortran Cactus thorn? I am trying to compile the LlamaWaveToy, and it does this:
subroutine LWT_min_spacing (CCTK_ARGUMENTS) use lapack ... call syev ('N', 'U', 3, gg, 3, ev, work, lwork, info)
and at link time, I get
/home/ianhin/Cactus/EinsteinToolkitGit/configs/etllama/lib/libthorn_LlamaWaveToy.a(min_spacing.F90.o): In function `lwt_min_spacing': /home/ianhin/Cactus/EinsteinToolkitGit/arrangements/Llama/LlamaWaveToy/src/min_spacing.F90:38: undefined reference to `syev_'
Do I need to do something special to make the symbol found, or to convert Fortran to C names, etc?
-- Ian Hinder http://members.aei.mpg.de/ianhin
Users mailing list Users@einsteintoolkit.org http://lists.einsteintoolkit.org/mailman/listinfo/users
Ian
It's likely that Cactus does not contain a generic type-safe wrapper for syev. In this case, you need to call the original Lapack routine directly, e.g. dsyev if you are using double precision. (You need to add one character depending on the type, either s, d, c, or z.)
-erik
On Mon, Nov 14, 2016 at 10:21 AM, Ian Hinder ian.hinder@aei.mpg.de wrote:
Hi,
What is the correct way to call a BLAS routine from a Fortran Cactus thorn? I am trying to compile the LlamaWaveToy, and it does this:
subroutine LWT_min_spacing (CCTK_ARGUMENTS) use lapack ... call syev ('N', 'U', 3, gg, 3, ev, work, lwork, info)
and at link time, I get
/home/ianhin/Cactus/EinsteinToolkitGit/configs/etllama/lib/libthorn_ LlamaWaveToy.a(min_spacing.F90.o): In function `lwt_min_spacing': /home/ianhin/Cactus/EinsteinToolkitGit/arrangements/Llama/ LlamaWaveToy/src/min_spacing.F90:38: undefined reference to `syev_'
Do I need to do something special to make the symbol found, or to convert Fortran to C names, etc?
-- Ian Hinder http://members.aei.mpg.de/ianhin
Users mailing list Users@einsteintoolkit.org http://lists.einsteintoolkit.org/mailman/listinfo/users
users@lists.einsteintoolkit.org