Compiling MAGMA for Visual Studios w/o Fortran

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)
Post Reply
joshua
Posts: 7
Joined: Tue Jul 24, 2018 3:22 pm

Compiling MAGMA for Visual Studios w/o Fortran

Post by joshua » Tue Jul 24, 2018 3:27 pm

Hi all,

I am attempting to compile MAGMA into Microsoft Visual Studios and I am unable to build the solution file for MAGMA. I used CMake to create the build files and chose to build without Fortran. On attempting to build the solution, I receive the following error.

magma_s_no_fortran.cpp(132): error C2733: 'slatms_': second C linkage of overloaded function not allowed

I was wondering if there is a setting that I am forgetting to set or maybe I created the build incorrectly.

Any help would be greatly appreciated, thank you!

Josh

mgates3
Posts: 897
Joined: Fri Jan 06, 2012 2:13 pm

Re: Compiling MAGMA for Visual Studios w/o Fortran

Post by mgates3 » Tue Jul 24, 2018 4:12 pm

Please see
viewtopic.php?f=2&t=1774

This only affects compiling the testers — the library itself was probably already successfully compiled.

If it turns that wasn’t the problem, let us know.

Mark
Last edited by mgates3 on Tue Jul 24, 2018 4:14 pm, edited 1 time in total.
Reason: Fix url

joshua
Posts: 7
Joined: Tue Jul 24, 2018 3:22 pm

Re: Compiling MAGMA for Visual Studios w/o Fortran

Post by joshua » Mon Jul 30, 2018 3:35 pm

Thank you! That solved that error.

Now I have another error upon attempting to build a project with a call to magma_cgglse(). All of the headers have been linked and the syntax for the function is recognized by Visual Studios but when I attempt to build it gives the following error:

#error directive: "One of ADD_, NOCHANGE, or UPCASE must be defined to set how Fortran functions are name mangled. For example, in MAGMA, add -DADD_ to CFLAGS, FFLAGS, etc. in make.inc. If using CMake, it defines MAGMA_GLOBAL instead."

I'm not quite sure how to diagnose this one.

Josh

mgates3
Posts: 897
Joined: Fri Jan 06, 2012 2:13 pm

Re: Compiling MAGMA for Visual Studios w/o Fortran

Post by mgates3 » Tue Jul 31, 2018 12:59 am

Do you #include magma_lapack.h? If so, you need to #define either ADD_, NOCHANGE, or UPCASE, depending on the Fortran name mangling in your BLAS & LAPACK library. See if the BLAS library has the dgemm_, dgemm, or DGEMM symbol, respectively. If you can’t tell, just try defining each of those (ADD_, ...) in turn. CMake should handle figuring out the Fortran name mangling, but maybe couldn’t without a Fortran compiler.

However, that header is only needed if you call Fortran BLAS or LAPACK functions, e.g., blasf77_dgemm or lapackf77_dgetrf. So perhaps the easiest solution is to not include that header.

Mark

joshua
Posts: 7
Joined: Tue Jul 24, 2018 3:22 pm

Re: Compiling MAGMA for Visual Studios w/o Fortran

Post by joshua » Tue Jul 31, 2018 12:03 pm

Yes, I removed the header and then inserted the definitions and it solved my problem! Thank you very much for all of your help! :D

Thank you again!
Josh

Post Reply