8 Replies Latest reply on Feb 10, 2012 6:14 PM by pillum

    ACML/LIBM for GCC on Win?

    pillum

      Hello,

       

      since I am using GCC as my main compiler on all my platforms, I'm asking if there will maybe a GCC compiled lib of ACML/LIBM for Windows?

       

      When I link it with my software, I get a lot of errors (I don't remember them anymore).

      Or is there a workaround to still be able to use it?

       

      Thanks

        • Re: ACML/LIBM for GCC on Win?
          chipf

          We do not have plans to provide a GCC/GFORTRAN compiled version of the libarary for Windows.  We tried recently to build GCC/GFORTRAN under both the cygwin and mingw environments, howver we were not successful,  Having that compiler working would be a prerequisite.  I see that cygwin is still at version 4.5.3, and we would want to build with 4.6.0 to support our newer instruction sets.

           

          By the way, are you using cygwin or mingw?

          • Re: ACML/LIBM for GCC on Win?
            sturlamolden

            MinGW can use import libraries for Microsoft Visual C++. Since the Porland build works with MSVC it should work with MinGW as well (gcc and gfortran). Make sure to use the DLL version, not the static library.

             

            This should be all you need to do:

             

            gfortran -o foobar.exe foobar.f77 -libacml_dll.lib

             

            (And as it happens, Portland and gfortran use the same name mangling, whereas ifort uses another.)

            1 of 1 people found this helpful
            • Re: ACML/LIBM for GCC on Win?
              pillum

              Well, I finally got it

              after manually loading the function through GetProcAddress.

              But I am disappointed by the speed of the AMD LibM.

               

              Without any optimization enabled:

              Using amd_sin ...

              -0.092349 is the result after 0.00708409 milliseconds

               

              Using sin ...

              -0.092349 is the result after 0.0196423 milliseconds

              -Ofast/O3/O2/O1 (all have the same speed for me)

              Using amd_sin ...

              -0.092349 is the result after 0.00708409 milliseconds

               

              Using sin ...

              -0.092349 is the result after 0.000644008 milliseconds

                • Re: ACML/LIBM for GCC on Win?
                  sturlamolden

                  A few comments:

                   

                  -Ofast/O3/O2/O1 are optimization flags for GCC, they do not affect AMD's library.

                   

                  You are calling the library with a function pointer, expect some extra overhead.

                   

                  Your timings are less than the granularity of the Windows' NT-kernel. You will need to do timings on tasks that takes much longer to complete for any timing to be reliable.

                    • Re: ACML/LIBM for GCC on Win?
                      pillum

                      1. Of course I know, that  it doesn't affect AMD's LibM but I used it for comparison against GCC's LibM.

                       

                      2.The function pointer overhead shouldn't be that much, that it does any significant difference.

                       

                      3. To get the time spent in the function I call QueryPerformanceCounter which has a nano/micro second resolution

                       

                      edit: 4. I know RDTSC isn't good for Benchmarking, but as written here you can use RDTSCP to benchmark your code with a error rate between 1-100 cycles. And even there standard sin uses only 1/100th of the time amd_sin needs.

                       

                      5. I don't know why, but now i can link directly with the dll.