From b6197826ddb39b9a128d27577b236253d7e066a9 Mon Sep 17 00:00:00 2001 From: Mark Gates Date: Sat, 6 Feb 2016 22:43:06 +0000 Subject: [PATCH] cleanup for Windows git-svn-id: https://icl.cs.utk.edu/svn/magma/trunk@8571 02bb5f2a-90ca-11de-bb24-8aedcc835bc8 --- CMakeLists.txt | 44 +++++++++++++++++++--------------- README-Windows | 10 +++----- testing/testing_zunmql_gpu.cpp | 2 +- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64a347ca..de015f77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,7 +179,7 @@ endif() # ---------------------------------------- -# where to put libmagma +# save magma.lib, magma_sparse.lib, etc. in lib/ set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY lib ) set( CMAKE_LIBRARY_OUTPUT_DIRECTORY lib ) @@ -325,24 +325,6 @@ else() endif() -# ---------------------------------------- -# compile each tester -# skip Fortran testers, which require an extra file from CUDA -set( CMAKE_RUNTIME_OUTPUT_DIRECTORY testing ) -foreach( f ${testing_allsrc} ) - if ( ${f} MATCHES "\\.(c|cu|cpp)$" ) - list( APPEND testing_allsrc_cpp ${f} ) - endif() -endforeach() -foreach( TEST ${testing_allsrc_cpp} ) - string( REGEX REPLACE "\\.(cpp|f90|F90)" "" EXE ${TEST} ) - string( REGEX REPLACE "testing/" "" EXE ${EXE} ) - #message( "${TEST} --> ${EXE}" ) - add_executable( ${EXE} ${TEST} ) - target_link_libraries( ${EXE} ${LIBS} ) -endforeach() - - # ---------------------------------------- # compile MAGMA sparse library @@ -361,6 +343,30 @@ target_link_libraries( magma_sparse set( LIBS_SPARSE ${LIBS} magma_sparse ) +# ---------------------------------------- +# compile each tester + +# save testers to testing/ +# save tester lib files to testing_lib/ to avoid cluttering lib/ +set( CMAKE_RUNTIME_OUTPUT_DIRECTORY testing ) +set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY testing_lib ) +set( CMAKE_LIBRARY_OUTPUT_DIRECTORY testing_lib ) + +# skip Fortran testers, which require an extra file from CUDA +foreach( f ${testing_allsrc} ) + if ( ${f} MATCHES "\\.(c|cu|cpp)$" ) + list( APPEND testing_allsrc_cpp ${f} ) + endif() +endforeach() +foreach( TEST ${testing_allsrc_cpp} ) + string( REGEX REPLACE "\\.(cpp|f90|F90)" "" EXE ${TEST} ) + string( REGEX REPLACE "testing/" "" EXE ${EXE} ) + #message( "${TEST} --> ${EXE}" ) + add_executable( ${EXE} ${TEST} ) + target_link_libraries( ${EXE} ${LIBS} ) +endforeach() + + # ---------------------------------------- # compile each sparse tester set( CMAKE_RUNTIME_OUTPUT_DIRECTORY sparse-iter/testing ) diff --git a/README-Windows b/README-Windows index a0ce194b..bce1672f 100644 --- a/README-Windows +++ b/README-Windows @@ -27,7 +27,7 @@ Click the Configure button. It will ask to create the build directory; enter Yes. -It will ask what generator to use. We used "Visual Studio 10 Win64", +It will ask what generator to use. We used "Visual Studio 12 2013 Win64", with the default native compilers. Click Finish. It should spend a few minutes analyzing your system, then return to the @@ -53,7 +53,7 @@ the setup some. For OpenBLAS, we used (again, no spaces before or after): - c:\openblas-0.2.14\lib\libopenblas.a + c:\openblas-0.2.14\lib\libopenblas.dll.a * If using Intel MKL, also set MKLROOT. In our case, we used: C:\Program Files (x86)\Intel\Composer XE\mkl @@ -80,13 +80,9 @@ In the Toolbar, select the desired Solution Configuration: From the Build menu, run Build Solution. VS does not support parallel builds with nvcc, so it will take a long time -to build -- perhaps an hour. +to build -- perhaps several hours. Once built, the MAGMA library and testers should be in build\lib\Debug\ build\testing\Debug\ where "Debug" depends on what solution configuration you chose. - -CMake would not compile Fortran and C++ files in the same library, so Fortran -files are compiled into a separate magmaf library. Currently, it is only -required for the non-symmetric eigenvalue problem, though. diff --git a/testing/testing_zunmql_gpu.cpp b/testing/testing_zunmql_gpu.cpp index 49201d71..764c6b5d 100644 --- a/testing/testing_zunmql_gpu.cpp +++ b/testing/testing_zunmql_gpu.cpp @@ -174,7 +174,7 @@ int main( int argc, char** argv ) size = ldc*n; blasf77_zaxpy( &size, &c_neg_one, C, &ione, R, &ione ); Cnorm = lapackf77_zlange( "Fro", &m, &n, C, &ldc, work ); - error = lapackf77_zlange( "Fro", &m, &n, R, &ldc, work ) / (sqrt(m*n) * Cnorm); + error = lapackf77_zlange( "Fro", &m, &n, R, &ldc, work ) / (magma_dsqrt(m*n) * Cnorm); printf( "%5d %5d %5d %4c %5c %7.2f (%7.2f) %7.2f (%7.2f) %8.2e %s\n", (int) m, (int) n, (int) k,