Hello,
I successfully built magma.lib on windows with CMake, VS2013 and Intel Fortran, but unfortunately it doesn't contains the magmaf_xxxxx interfaces that I need (I used such interface on Linux for compatibility with legacy code).
I'm aware that a different magmaf.lib library should be built, but I don't know how to achieve that. Does anyone have succeeded in that?
Thanks,
Paolo
Unable to build magmaf.lib
Re: Unable to build magmaf.lib
The comment about magmaf.lib is out-of-date. There were a couple Fortran files for the non-symmetric eigenvalue problem, but those have been replaced with C files.
Looking at the Makefile that CMake generates, it appears it should compile the Fortran wrappers, namely control/*f77.cpp. It does not however, compile the F90 interfaces, control/*fortran.F90. These are really just the F90 interfaces; the wrappers themselves (e.g., magmaf_dgetrf) should exist. The reason being a comment in the CMakeLists.txt file:
You could probably just copy the interfaces you need out of the control/*fortran.F90 files. The only preprocessing they may need is to define magma_devptr_t as integer(kind=8), assuming 64-bit pointers.
-mark
Looking at the Makefile that CMake generates, it appears it should compile the Fortran wrappers, namely control/*f77.cpp. It does not however, compile the F90 interfaces, control/*fortran.F90. These are really just the F90 interfaces; the wrappers themselves (e.g., magmaf_dgetrf) should exist. The reason being a comment in the CMakeLists.txt file:
Code: Select all
if ( WIN32 )
# Windows seems to have a problem mixing C, CUDA, and Fortran files
# Currently ignores .f90 and .F90 files, because it doesn't seem to
# understand that .F90 files should be pre-processed.
-mark
-
paoloviviani
- Posts: 14
- Joined: Mon Nov 09, 2015 12:17 pm
Re: Unable to build magmaf.lib
Thanks mark for the quick reply, unfortunately my description of the problem was not exact, in fact I'm interested in the Fortran wrappers contained in control/*f77.cpp, since my code is C++, but uses the Lapack convention (i.e. char* instead of enums).
However it seem that it does not compile the wrappers too, since it gives unresolved symbols when linking to magmaf_xxxxx.
Apart from that I succeeded in implementing a translation layer (like what control/*f77.cpp does) within my code, so I don't need to call the magmaf_xxxxx anymore, but I can call directly the magma_xxxxx functions. Unfortunately this works fine on Linux, but on Windows I get an error from magma_dgesdd (illegal value for parameter number 12, lwork). I can't see where the code is wrong, as it works flawlessly on Linux, so it might be some king of bug. Any idea?
Thanks again,
Paolo
However it seem that it does not compile the wrappers too, since it gives unresolved symbols when linking to magmaf_xxxxx.
Apart from that I succeeded in implementing a translation layer (like what control/*f77.cpp does) within my code, so I don't need to call the magmaf_xxxxx anymore, but I can call directly the magma_xxxxx functions. Unfortunately this works fine on Linux, but on Windows I get an error from magma_dgesdd (illegal value for parameter number 12, lwork). I can't see where the code is wrong, as it works flawlessly on Linux, so it might be some king of bug. Any idea?
Thanks again,
Paolo
Re: Unable to build magmaf.lib
The lwork depends on jobz, m, n, and nb. What values do you have for those 5 variables? Have you tried querying it, by passing in lwork = -1? There's an example of this in testing_dgesdd.cpp.
As for constants, you can of course use the conversion functions, e.g.,
const char * uplo = "Lower";
magma_dpotrf( magma_uplo_const( *uplo ), N, A, lda, &info );
These are documented in the "Constants" section.
http://icl.cs.utk.edu/projectsfiles/mag ... tants.html
-mark
Code: Select all
lwork = -1;
magma_dgesdd( jobz, M, N,
NULL, lda, NULL, NULL, ldu, NULL, ldv, dummy, lwork,
NULL, &info );
lwork = (int) MAGMA_D_REAL( dummy[0] );
const char * uplo = "Lower";
magma_dpotrf( magma_uplo_const( *uplo ), N, A, lda, &info );
These are documented in the "Constants" section.
http://icl.cs.utk.edu/projectsfiles/mag ... tants.html
-mark
-
paoloviviani
- Posts: 14
- Joined: Mon Nov 09, 2015 12:17 pm
Re: Unable to build magmaf.lib
Querying magma_dgesdd worked nicely, thanks!