6 Replies Latest reply on Jul 31, 2013 9:22 AM by matusi143

    ACML and Visual Studio 2010

    jmalves

      Hi all,

       

      I am trying to add ACML to a C/C++ project.

      I am getting  this compiling error:

       

      1>C:\AMD\acml5.3.0\win64\include\acml.h(102): error C2872: 'complex' : ambiguous symbol

      1>          could be 'C:\AMD\acml5.3.0\win64\include\acml.h(91) : complex complex'

      1>          or       'c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\complex(956) : std::complex'

       

      can anyone help me?

       

      Thanks a lot

        • Re: ACML and Visual Studio 2010
          chipf

          Can you build the ACML examples from a command line?  These include simple cpp examples.

          They should build and run with no errors.

          The error you show for acml.h line 91 looks suspicious, there is only one "complex" on that line in my copy of the file.

          I added #include <complex> to one of the example cpp file and it still built and ran OK using VS 2010.  From a command line that is, and not using any of the C++ complex class features.

           

           

          There is an older post about this:

          http://devgurus.amd.com/message/1008851#1008851

          The solution in that post is to modify the acml.h file to create acmlcomplex and acmldoublecomplex types.  This requires modifying all the function prototypes in acml.h to use the new types, instead of complex or doublecomplex.

          I did not have to do that for the simple examples we have.

          • Re: ACML and Visual Studio 2010
            chipf

            I had a feeling I'd looked at this question before.  I found where I had modified an example to use std::complex instead of ACML's complex type.

            It does require a modified acml.h.

            Here is a script (that runs under a cygwin/dos prompt) that creates a acmlcpp.h from acml.h:

             

            sed -e '/undef complex/d' acml.h > temp

            sed -i -e 's/doublecomplex/acmldoublecomplx/g' temp

            sed -i -e 's/complex/acmlcomplex/g' temp

            sed -i -e 's/acmldoublecomplx/acmldoublecomplex/g' temp

            sed -i -e "/ifndef _ACML_COMPLEX/itypedef complex<float> acmlcomplex;" temp

            sed -i -e "/ifndef _ACML_COMPLEX/itypedef complex<double> acmldoublecomplex;" temp

            sed -i -e '/ifndef _ACML_COMPLEX/i#if 0' temp

            sed -e '/_ACML_COMPLEX)/a#endif' temp > acmlcpp.h

             

            The compiler issued a ton of 4190 warnings about functions that return a complex type, but the example built and ran.

            I have attached the working example and the win64 (not the ifort64) acmlcpp.h file

            1 of 1 people found this helpful
              • Re: ACML and Visual Studio 2010
                jmalves

                Hi,

                 

                Thank you for your help.

                I was able to link correctly, build and ran my C/C++ program.

                 

                I will now test and check for performance.

                 

                Again, thanks for your help.

                 

                Regards,

                Jorge

                • Re: ACML and Visual Studio 2010
                  matusi143

                  Chip,

                   

                  Thank you for this post.  When I found it, I thought I had my problem resolved.  I am using Visual Studio 2012 and writing a program in C++.  Due to a large number of matrix calculations I am trying to implement #include <C:\AMD\acml5.3.1\win64_mp\include\acml.h> and came up with the following compilation errors just by adding the include. Prior to that my code runs fine.  After running the sed script and creating a *cpp file and updating the #include <C:\AMD\acml5.3.1\win64_mp\include\acmlcpp.h> I get the same number of errors.  Any insight on what I need to do to get my code to compile with this include?  It appears my heavy use of complex numbers is causing havoc.  Is there a way to isolate the acml?  All the functions I need the acml for do not use complex numbers so if I could just call it for my inverse function, it would be nice.  Perhaps there is a current version of the acmlcpp.h for 5.3.1, my sed script resulted in a different size file but may have not run correctly.

                   

                  Below is the standard *.h and below that the output of the amclcpp.h file.

                   

                  Thanks,

                  -Matt

                   

                  <C:\AMD\acml5.3.1\win64_mp\include\acml.h>

                  Error    1    error C2144: syntax error : 'char' should be preceded by ')'    c:\amd\acml5.3.1\win64_mp\include\acml.h    1549    1    MPFCA

                  Error    2    error C2144: syntax error : 'char' should be preceded by ';'    c:\amd\acml5.3.1\win64_mp\include\acml.h    1549    1    MPFCA

                  Warning    3    warning C4091: '' : ignored on left of 'char' when no variable is declared    c:\amd\acml5.3.1\win64_mp\include\acml.h    1549    1    MPFCA

                  Error    4    error C2143: syntax error : missing ';' before ','    c:\amd\acml5.3.1\win64_mp\include\acml.h    1549    1    MPFCA

                  Error    5    error C2059: syntax error : ','    c:\amd\acml5.3.1\win64_mp\include\acml.h    1549    1    MPFCA

                  Error    6    error C2059: syntax error : ')'    c:\amd\acml5.3.1\win64_mp\include\acml.h    1549    1    MPFCA

                  Error    7    error C2144: syntax error : 'char' should be preceded by ')'    c:\amd\acml5.3.1\win64_mp\include\acml.h    1714    1    MPFCA

                  Error    8    error C2144: syntax error : 'char' should be preceded by ';'    c:\amd\acml5.3.1\win64_mp\include\acml.h    1714    1    MPFCA

                  Warning    9    warning C4091: '' : ignored on left of 'char' when no variable is declared    c:\amd\acml5.3.1\win64_mp\include\acml.h    1714    1    MPFCA

                  Error    10    error C2143: syntax error : missing ';' before ','    c:\amd\acml5.3.1\win64_mp\include\acml.h    1714    1    MPFCA

                  Error    11    error C2059: syntax error : ','    c:\amd\acml5.3.1\win64_mp\include\acml.h    1714    1    MPFCA

                  Error    12    error C2059: syntax error : ')'    c:\amd\acml5.3.1\win64_mp\include\acml.h    1714    1    MPFCA

                  Error    13    error C2144: syntax error : 'char' should be preceded by ')'    c:\amd\acml5.3.1\win64_mp\include\acml.h    3587    1    MPFCA

                  Error    14    error C2144: syntax error : 'char' should be preceded by ';'    c:\amd\acml5.3.1\win64_mp\include\acml.h    3587    1    MPFCA

                  Warning    15    warning C4091: '' : ignored on left of 'char' when no variable is declared    c:\amd\acml5.3.1\win64_mp\include\acml.h    3587    1    MPFCA

                  Error    16    error C2143: syntax error : missing ';' before ','    c:\amd\acml5.3.1\win64_mp\include\acml.h    3587    1    MPFCA

                  Error    17    error C2059: syntax error : ','    c:\amd\acml5.3.1\win64_mp\include\acml.h    3587    1    MPFCA

                  Error    18    error C2059: syntax error : ')'    c:\amd\acml5.3.1\win64_mp\include\acml.h    3587    1    MPFCA

                  Error    19    error C2144: syntax error : 'char' should be preceded by ')'    c:\amd\acml5.3.1\win64_mp\include\acml.h    3752    1    MPFCA

                  Error    20    error C2144: syntax error : 'char' should be preceded by ';'    c:\amd\acml5.3.1\win64_mp\include\acml.h    3752    1    MPFCA

                  Warning    21    warning C4091: '' : ignored on left of 'char' when no variable is declared    c:\amd\acml5.3.1\win64_mp\include\acml.h    3752    1    MPFCA

                  Error    22    error C2143: syntax error : missing ';' before ','    c:\amd\acml5.3.1\win64_mp\include\acml.h    3752    1    MPFCA

                  Error    23    error C2059: syntax error : ','    c:\amd\acml5.3.1\win64_mp\include\acml.h    3752    1    MPFCA

                  Error    24    error C2059: syntax error : ')'    c:\amd\acml5.3.1\win64_mp\include\acml.h    3752    1    MPFCA

                  Error    25    error C2872: 'complex' : ambiguous symbol    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    89    1    MPFCA

                  Warning    26    warning C4091: 'typedef ' : ignored on left of 'complex' when no variable is declared    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    89    1    MPFCA

                  Error    27    error C2143: syntax error : missing ';' before '<'    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    89    1    MPFCA

                  Error    28    error C2065: 'cmplx_float' : undeclared identifier    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    90    1    MPFCA

                  Error    29    error C2146: syntax error : missing ';' before identifier 'cmplx_a'    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    90    1    MPFCA

                  Error    30    error C3861: 'cmplx_a': identifier not found    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    90    1    MPFCA

                  Error    31    error C2065: 'cmplx_a' : undeclared identifier    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    308    1    MPFCA

                  Error    32    error C3861: 'cmplx_float': identifier not found    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    308    1    MPFCA

                  Error    33    error C2065: 'cmplx_a' : undeclared identifier    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    311    1    MPFCA

                  Error    34    error C2065: 'cmplx_a' : undeclared identifier    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    312    1    MPFCA

                  Error    35    error C2065: 'cmplx_a' : undeclared identifier    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    313    1    MPFCA

                  Error    36    error C2065: 'cmplx_a' : undeclared identifier    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    314    1    MPFCA

                      37    IntelliSense: expected a ')'    c:\AMD\acml5.3.1\win64_mp\include\acml.h    1549    28    MPFCA

                      38    IntelliSense: expected a ')'    c:\AMD\acml5.3.1\win64_mp\include\acml.h    1714    27    MPFCA

                      39    IntelliSense: expected a ')'    c:\AMD\acml5.3.1\win64_mp\include\acml.h    3587    29    MPFCA

                      40    IntelliSense: expected a ')'    c:\AMD\acml5.3.1\win64_mp\include\acml.h    3752    28    MPFCA

                      41    IntelliSense: "complex" is ambiguous    c:\Users\Musto\Desktop\MTech\C++ Source\MPFCA\Source.cpp    89    11    MPFCA

                      42    IntelliSense: expected a ')'    c:\Users\Musto\Desktop\MTech\C++ Source\MPFCA\Source.cpp    90    26    MPFCA

                   

                  <C:\AMD\acml5.3.1\win64_mp\include\acmlcpp.h>

                  Error    1    error C2144: syntax error : 'char' should be preceded by ')'    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    1548    1    MPFCA

                  Error    2    error C2144: syntax error : 'char' should be preceded by ';'    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    1548    1    MPFCA

                  Warning    3    warning C4091: '' : ignored on left of 'char' when no variable is declared    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    1548    1    MPFCA

                  Error    4    error C2143: syntax error : missing ';' before ','    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    1548    1    MPFCA

                  Error    5    error C2059: syntax error : ','    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    1548    1    MPFCA

                  Error    6    error C2059: syntax error : ')'    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    1548    1    MPFCA

                  Error    7    error C2144: syntax error : 'char' should be preceded by ')'    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    1713    1    MPFCA

                  Error    8    error C2144: syntax error : 'char' should be preceded by ';'    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    1713    1    MPFCA

                  Warning    9    warning C4091: '' : ignored on left of 'char' when no variable is declared    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    1713    1    MPFCA

                  Error    10    error C2143: syntax error : missing ';' before ','    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    1713    1    MPFCA

                  Error    11    error C2059: syntax error : ','    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    1713    1    MPFCA

                  Error    12    error C2059: syntax error : ')'    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    1713    1    MPFCA

                  Error    13    error C2144: syntax error : 'char' should be preceded by ')'    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    3586    1    MPFCA

                  Error    14    error C2144: syntax error : 'char' should be preceded by ';'    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    3586    1    MPFCA

                  Warning    15    warning C4091: '' : ignored on left of 'char' when no variable is declared    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    3586    1    MPFCA

                  Error    16    error C2143: syntax error : missing ';' before ','    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    3586    1    MPFCA

                  Error    17    error C2059: syntax error : ','    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    3586    1    MPFCA

                  Error    18    error C2059: syntax error : ')'    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    3586    1    MPFCA

                  Error    19    error C2144: syntax error : 'char' should be preceded by ')'    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    3751    1    MPFCA

                  Error    20    error C2144: syntax error : 'char' should be preceded by ';'    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    3751    1    MPFCA

                  Warning    21    warning C4091: '' : ignored on left of 'char' when no variable is declared    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    3751    1    MPFCA

                  Error    22    error C2143: syntax error : missing ';' before ','    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    3751    1    MPFCA

                  Error    23    error C2059: syntax error : ','    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    3751    1    MPFCA

                  Error    24    error C2059: syntax error : ')'    c:\amd\acml5.3.1\win64_mp\include\acmlcpp.h    3751    1    MPFCA

                  Error    25    error C2872: 'complex' : ambiguous symbol    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    89    1    MPFCA

                  Warning    26    warning C4091: 'typedef ' : ignored on left of 'complex' when no variable is declared    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    89    1    MPFCA

                  Error    27    error C2143: syntax error : missing ';' before '<'    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    89    1    MPFCA

                  Error    28    error C2065: 'cmplx_float' : undeclared identifier    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    90    1    MPFCA

                  Error    29    error C2146: syntax error : missing ';' before identifier 'cmplx_a'    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    90    1    MPFCA

                  Error    30    error C3861: 'cmplx_a': identifier not found    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    90    1    MPFCA

                  Error    31    error C2065: 'cmplx_a' : undeclared identifier    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    308    1    MPFCA

                  Error    32    error C3861: 'cmplx_float': identifier not found    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    308    1    MPFCA

                  Error    33    error C2065: 'cmplx_a' : undeclared identifier    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    311    1    MPFCA

                  Error    34    error C2065: 'cmplx_a' : undeclared identifier    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    312    1    MPFCA

                  Error    35    error C2065: 'cmplx_a' : undeclared identifier    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    313    1    MPFCA

                  Error    36    error C2065: 'cmplx_a' : undeclared identifier    c:\users\musto\desktop\mtech\c++ source\mpfca\source.cpp    314    1    MPFCA

                      37    IntelliSense: expected a ')'    c:\AMD\acml5.3.1\win64_mp\include\acmlcpp.h    1548    28    MPFCA

                      38    IntelliSense: expected a ')'    c:\AMD\acml5.3.1\win64_mp\include\acmlcpp.h    1713    27    MPFCA

                      39    IntelliSense: expected a ')'    c:\AMD\acml5.3.1\win64_mp\include\acmlcpp.h    3586    29    MPFCA

                      40    IntelliSense: expected a ')'    c:\AMD\acml5.3.1\win64_mp\include\acmlcpp.h    3751    28    MPFCA

                      41    IntelliSense: "complex" is ambiguous    c:\Users\Musto\Desktop\MTech\C++ Source\MPFCA\Source.cpp    89    11    MPFCA

                      42    IntelliSense: expected a ')'    c:\Users\Musto\Desktop\MTech\C++ Source\MPFCA\Source.cpp    90    26    MPFCA