From 07f55772c7934e43552aaa874f467bc2709440b9 Mon Sep 17 00:00:00 2001 From: Natalia Gimelshein Date: Mon, 9 Oct 2017 12:41:52 -0700 Subject: [PATCH 1/2] files for cuda90 magma builds --- conda/magma-cuda90-2.2.0/build.sh | 16 ++ conda/magma-cuda90-2.2.0/cmakelists.patch | 193 ++++++++++++++++++++ conda/magma-cuda90-2.2.0/meta.yaml | 21 +++ conda/magma-cuda90-2.2.0/run_test.sh | 136 ++++++++++++++ conda/magma-cuda90-2.2.0/thread_queue.patch | 20 ++ 5 files changed, 386 insertions(+) create mode 100644 conda/magma-cuda90-2.2.0/build.sh create mode 100644 conda/magma-cuda90-2.2.0/cmakelists.patch create mode 100644 conda/magma-cuda90-2.2.0/meta.yaml create mode 100644 conda/magma-cuda90-2.2.0/run_test.sh create mode 100644 conda/magma-cuda90-2.2.0/thread_queue.patch diff --git a/conda/magma-cuda90-2.2.0/build.sh b/conda/magma-cuda90-2.2.0/build.sh new file mode 100644 index 000000000..b23fe4e66 --- /dev/null +++ b/conda/magma-cuda90-2.2.0/build.sh @@ -0,0 +1,16 @@ +export CMAKE_LIBRARY_PATH=$PREFIX/lib:$PREFIX/include:$CMAKE_LIBRARY_PATH +export CMAKE_PREFIX_PATH=$PREFIX +export PATH=$PREFIX/bin:$PATH + +CUDA__VERSION=$(nvcc --version|tail -n1|cut -f5 -d" "|cut -f1 -d",") +if [ "$CUDA__VERSION" != "9.0" ]; then + echo "CUDA Version is not 9.0. CUDA Version found: $CUDA__VERSION" + exit 1 +fi + +mkdir build +cd build +cmake .. -DUSE_FORTRAN=OFF -DGPU_TARGET="All" -DCMAKE_INSTALL_PREFIX=$PREFIX +make -j$(getconf _NPROCESSORS_CONF) +make install +cd .. diff --git a/conda/magma-cuda90-2.2.0/cmakelists.patch b/conda/magma-cuda90-2.2.0/cmakelists.patch new file mode 100644 index 000000000..5b86fa76b --- /dev/null +++ b/conda/magma-cuda90-2.2.0/cmakelists.patch @@ -0,0 +1,193 @@ +--- magma-2.2.0/CMakeLists.txt 2016-11-20 20:20:02.000000000 -0500 ++++ magma-2.2.0/CMakeLists.txt 2017-07-17 01:10:32.161739159 -0400 +@@ -60,6 +60,7 @@ + message( WARNING "The compiler ${CMAKE_C_COMPILER} doesn't support the -std=c99 flag. Some code may not compile.") + endif() + ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -fno-exceptions") + + # ---------------------------------------- + # check Fortran name mangling +@@ -79,14 +80,14 @@ + + # ---------------------------------------- + # locate OpenMP +-find_package( OpenMP ) +-if ( OPENMP_FOUND ) +- message( STATUS "Found OpenMP" ) +- message( STATUS " OpenMP_C_FLAGS ${OpenMP_C_FLAGS}" ) +- message( STATUS " OpenMP_CXX_FLAGS ${OpenMP_CXX_FLAGS}" ) +- set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" ) +- set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" ) +-endif() ++# find_package( OpenMP ) ++# if ( OPENMP_FOUND ) ++# message( STATUS "Found OpenMP" ) ++# message( STATUS " OpenMP_C_FLAGS ${OpenMP_C_FLAGS}" ) ++# message( STATUS " OpenMP_CXX_FLAGS ${OpenMP_CXX_FLAGS}" ) ++# set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" ) ++# set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" ) ++# endif() + + + # ---------------------------------------- +@@ -164,13 +165,20 @@ + set( NV_SM "${NV_SM} -gencode arch=compute_50,code=sm_50" ) + set( NV_COMP "-gencode arch=compute_50,code=compute_50" ) + message( STATUS " compile for CUDA arch 5.0 (Maxwell)" ) +- endif() ++ endif() ++ ++ if ( ${GPU_TARGET} MATCHES "All") ++ set( MIN_ARCH 200) ++ SET( NV_SM "-gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_32,code=sm_32 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 ") ++ SET( NV_COMP "") ++ endif() + + if ( NOT MIN_ARCH ) + message( FATAL_ERROR "GPU_TARGET must contain one or more of Fermi, Kepler, Maxwell, or sm{20,30,35,50}." ) + endif() + +- set( CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -DHAVE_CUBLAS ${NV_SM} ${NV_COMP} ${FORTRAN_CONVENTION}" ) ++ set( CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -DHAVE_CUBLAS -Xcompiler -fPIC ${NV_SM} ${NV_COMP} ${FORTRAN_CONVENTION}" ) ++ MESSAGE(STATUS "CUDA_NVCC_FLAGS: ${CUDA_NVCC_FLAGS}") + add_definitions( "-DHAVE_CUBLAS -DMIN_CUDA_ARCH=${MIN_ARCH}" ) + message( STATUS "Define -DHAVE_CUBLAS -DMIN_CUDA_ARCH=${MIN_ARCH}" ) + endif() +@@ -181,7 +189,7 @@ + set( LAPACK_LIBRARIES "" CACHE STRING "Libraries for LAPACK and BLAS, to manually override search" ) + if ( "${LAPACK_LIBRARIES}" STREQUAL "" ) + message( STATUS "Searching for BLAS and LAPACK. To override, set LAPACK_LIBRARIES using ccmake." ) +- find_package( LAPACK ) ++ # find_package( LAPACK ) + else() + message( STATUS "User set LAPACK_LIBRARIES. To change, edit LAPACK_LIBRARIES using ccmake (set to empty to enable search)." ) + # Check existence -- but this may be okay, if the user entered, e.g., -llapack instead of /path/to/lapack.a +@@ -228,7 +236,8 @@ + # ---------------------------------------- + # common flags + +-set( LIBS tester lapacktest magma ) ++# set( LIBS tester lapacktest magma ) ++set( LIBS magma) + + if ( WIN32 ) + # On Windows: +@@ -336,32 +345,33 @@ + ) + endif() + ++set_target_properties(magma PROPERTIES POSITION_INDEPENDENT_CODE ON) + + # ---------------------------------------- + # compile tester library +-add_library( tester ${libtest_all} ) ++# add_library( tester ${libtest_all} ) + + + # ---------------------------------------- + # compile lapacktest library + # If use fortran, compile only Fortran files, not magma_[sdcz]_no_fortran.cpp + # else, compile only C++ files, not Fortran files +-if ( USE_FORTRAN ) +- foreach( f ${liblapacktest_all} ) +- if ( ${f} MATCHES "\\.(f|f90)$" ) +- list( APPEND liblapacktest_all_f ${f} ) +- endif() +- endforeach() +- add_library( lapacktest ${liblapacktest_all_f} ) +-else() +- # alternatively, use only C/C++/CUDA files, including magma_[sdcz]_no_fortran.cpp +- foreach( f ${liblapacktest_all} ) +- if ( ${f} MATCHES "\\.(c|cu|cpp)$" ) +- list( APPEND liblapacktest_all_cpp ${f} ) +- endif() +- endforeach() +- add_library( lapacktest ${liblapacktest_all_cpp} ) +-endif() ++# if ( USE_FORTRAN ) ++# foreach( f ${liblapacktest_all} ) ++# if ( ${f} MATCHES "\\.(f|f90)$" ) ++# list( APPEND liblapacktest_all_f ${f} ) ++# endif() ++# endforeach() ++# add_library( lapacktest ${liblapacktest_all_f} ) ++# else() ++# # alternatively, use only C/C++/CUDA files, including magma_[sdcz]_no_fortran.cpp ++# foreach( f ${liblapacktest_all} ) ++# if ( ${f} MATCHES "\\.(c|cu|cpp)$" ) ++# list( APPEND liblapacktest_all_cpp ${f} ) ++# endif() ++# endforeach() ++# add_library( lapacktest ${liblapacktest_all_cpp} ) ++# endif() + + + # ---------------------------------------- +@@ -380,42 +390,42 @@ + ${CUDA_cusparse_LIBRARY} + ) + set( LIBS_SPARSE ${LIBS} magma_sparse ) +- ++set_target_properties(magma_sparse PROPERTIES POSITION_INDEPENDENT_CODE ON) + + # ---------------------------------------- + # 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 ) ++# 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_all} ) +- if ( ${f} MATCHES "\\.(c|cu|cpp)$" ) +- list( APPEND testing_all_cpp ${f} ) +- endif() +-endforeach() +-foreach( TEST ${testing_all_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() ++# foreach( f ${testing_all} ) ++# if ( ${f} MATCHES "\\.(c|cu|cpp)$" ) ++# list( APPEND testing_all_cpp ${f} ) ++# endif() ++# endforeach() ++# foreach( TEST ${testing_all_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/testing ) +-foreach( TEST ${sparse_testing_all} ) +- string( REGEX REPLACE "\\.(cpp|f90|F90)" "" EXE ${TEST} ) +- string( REGEX REPLACE "sparse/testing/" "" EXE ${EXE} ) +- #message( "${TEST} --> ${EXE}" ) +- add_executable( ${EXE} ${TEST} ) +- target_link_libraries( ${EXE} ${LIBS_SPARSE} ) +-endforeach() ++# set( CMAKE_RUNTIME_OUTPUT_DIRECTORY sparse/testing ) ++# foreach( TEST ${sparse_testing_all} ) ++# string( REGEX REPLACE "\\.(cpp|f90|F90)" "" EXE ${TEST} ) ++# string( REGEX REPLACE "sparse/testing/" "" EXE ${EXE} ) ++# #message( "${TEST} --> ${EXE}" ) ++# add_executable( ${EXE} ${TEST} ) ++# target_link_libraries( ${EXE} ${LIBS_SPARSE} ) ++# endforeach() + + + # ---------------------------------------- diff --git a/conda/magma-cuda90-2.2.0/meta.yaml b/conda/magma-cuda90-2.2.0/meta.yaml new file mode 100644 index 000000000..68e6d8443 --- /dev/null +++ b/conda/magma-cuda90-2.2.0/meta.yaml @@ -0,0 +1,21 @@ +package: + name: magma-cuda90 + version: 2.2.0 + +source: + url: http://icl.cs.utk.edu/projectsfiles/magma/downloads/magma-2.2.0.tar.gz + patches: + - cmakelists.patch + - thread_queue.patch + +requirements: + build: + - gcc + +build: + number: 1 + +about: + home: http://icl.cs.utk.edu/magma/software/index.html + license: BSD + license_file: COPYRIGHT diff --git a/conda/magma-cuda90-2.2.0/run_test.sh b/conda/magma-cuda90-2.2.0/run_test.sh new file mode 100644 index 000000000..a1870840c --- /dev/null +++ b/conda/magma-cuda90-2.2.0/run_test.sh @@ -0,0 +1,136 @@ +#build/testing/testing_cgegqr_gpu +#build/testing/testing_cgelqf_gpu +#build/testing/testing_cgels3_gpu +#build/testing/testing_cgels_gpu +#build/testing/testing_cgeqp3_gpu +#build/testing/testing_cgeqr2_gpu +#build/testing/testing_cgeqr2x_gpu +#build/testing/testing_cgeqrf_gpu +#build/testing/testing_cgeqrf_mgpu +#build/testing/testing_cgesv_gpu +#build/testing/testing_cgetf2_gpu +#build/testing/testing_cgetrf_gpu +#build/testing/testing_cgetrf_mgpu +#build/testing/testing_cgetri_gpu +#build/testing/testing_cheevd_gpu +#build/testing/testing_chegst_gpu +#build/testing/testing_chemm_mgpu +#build/testing/testing_chemv_mgpu +#build/testing/testing_cher2k_mgpu +#build/testing/testing_chesv_nopiv_gpu +#build/testing/testing_chetrd_gpu +#build/testing/testing_chetrd_mgpu +#build/testing/testing_clarfb_gpu +#build/testing/testing_cposv_gpu +#build/testing/testing_cpotf2_gpu +#build/testing/testing_cpotrf_gpu +#build/testing/testing_cpotrf_mgpu +#build/testing/testing_cpotri_gpu +#build/testing/testing_csysv_nopiv_gpu +#build/testing/testing_ctrtri_gpu +#build/testing/testing_cungqr_gpu +#build/testing/testing_cunmql_gpu +#build/testing/testing_cunmqr_gpu +#build/testing/testing_dgegqr_gpu +#build/testing/testing_dgelqf_gpu +#build/testing/testing_dgels3_gpu +#build/testing/testing_dgels_gpu +#build/testing/testing_dgeqp3_gpu +#build/testing/testing_dgeqr2_gpu +#build/testing/testing_dgeqr2x_gpu +#build/testing/testing_dgeqrf_gpu +#build/testing/testing_dgeqrf_mgpu +#build/testing/testing_dgesv_gpu +#build/testing/testing_dgetf2_gpu +#build/testing/testing_dgetrf_gpu +#build/testing/testing_dgetrf_mgpu +#build/testing/testing_dgetri_gpu +#build/testing/testing_dlarfb_gpu +#build/testing/testing_dorgqr_gpu +#build/testing/testing_dormql_gpu +#build/testing/testing_dormqr_gpu +#build/testing/testing_dposv_gpu +#build/testing/testing_dpotf2_gpu +#build/testing/testing_dpotrf_gpu +#build/testing/testing_dpotrf_mgpu +#build/testing/testing_dpotri_gpu +#build/testing/testing_dsgeqrsv_gpu +#build/testing/testing_dsgesv_gpu +#build/testing/testing_dsposv_gpu +#build/testing/testing_dsyevd_gpu +#build/testing/testing_dsygst_gpu +#build/testing/testing_dsymm_mgpu +#build/testing/testing_dsymv_mgpu +#build/testing/testing_dsyr2k_mgpu +#build/testing/testing_dsysv_nopiv_gpu +#build/testing/testing_dsytrd_gpu +#build/testing/testing_dsytrd_mgpu +#build/testing/testing_dtrtri_gpu +#build/testing/testing_sgegqr_gpu +#build/testing/testing_sgelqf_gpu +#build/testing/testing_sgels3_gpu +#build/testing/testing_sgels_gpu +#build/testing/testing_sgeqp3_gpu +#build/testing/testing_sgeqr2_gpu +#build/testing/testing_sgeqr2x_gpu +#build/testing/testing_sgeqrf_gpu +#build/testing/testing_sgeqrf_mgpu +#build/testing/testing_sgesv_gpu +#build/testing/testing_sgetf2_gpu +#build/testing/testing_sgetrf_gpu +#build/testing/testing_sgetrf_mgpu +#build/testing/testing_sgetri_gpu +#build/testing/testing_slarfb_gpu +#build/testing/testing_sorgqr_gpu +#build/testing/testing_sormql_gpu +#build/testing/testing_sormqr_gpu +#build/testing/testing_sposv_gpu +#build/testing/testing_spotf2_gpu +#build/testing/testing_spotrf_gpu +#build/testing/testing_spotrf_mgpu +#build/testing/testing_spotri_gpu +#build/testing/testing_ssyevd_gpu +#build/testing/testing_ssygst_gpu +#build/testing/testing_ssymm_mgpu +#build/testing/testing_ssymv_mgpu +#build/testing/testing_ssyr2k_mgpu +#build/testing/testing_ssysv_nopiv_gpu +#build/testing/testing_ssytrd_gpu +#build/testing/testing_ssytrd_mgpu +#build/testing/testing_strtri_gpu +#build/testing/testing_zcgeqrsv_gpu +#build/testing/testing_zcgesv_gpu +#build/testing/testing_zcposv_gpu +#build/testing/testing_zgegqr_gpu +#build/testing/testing_zgelqf_gpu +#build/testing/testing_zgels3_gpu +#build/testing/testing_zgels_gpu +#build/testing/testing_zgeqp3_gpu +#build/testing/testing_zgeqr2_gpu +#build/testing/testing_zgeqr2x_gpu +#build/testing/testing_zgeqrf_gpu +#build/testing/testing_zgeqrf_mgpu +#build/testing/testing_zgesv_gpu +#build/testing/testing_zgetf2_gpu +#build/testing/testing_zgetrf_gpu +#build/testing/testing_zgetrf_mgpu +#build/testing/testing_zgetri_gpu +#build/testing/testing_zheevd_gpu +#build/testing/testing_zhegst_gpu +#build/testing/testing_zhemm_mgpu +#build/testing/testing_zhemv_mgpu +#build/testing/testing_zher2k_mgpu +#build/testing/testing_zhesv_nopiv_gpu +#build/testing/testing_zhetrd_gpu +#build/testing/testing_zhetrd_mgpu +#build/testing/testing_zlarfb_gpu +#build/testing/testing_zposv_gpu +#build/testing/testing_zpotf2_gpu +#build/testing/testing_zpotrf_gpu +#build/testing/testing_zpotrf_mgpu +#build/testing/testing_zpotri_gpu +#build/testing/testing_zsysv_nopiv_gpu +#build/testing/testing_ztrtri_gpu +#build/testing/testing_zungqr_gpu +#build/testing/testing_zunmql_gpu +#build/testing/testing_zunmqr_gpu diff --git a/conda/magma-cuda90-2.2.0/thread_queue.patch b/conda/magma-cuda90-2.2.0/thread_queue.patch new file mode 100644 index 000000000..cabbafa71 --- /dev/null +++ b/conda/magma-cuda90-2.2.0/thread_queue.patch @@ -0,0 +1,20 @@ +--- magma-2.2.0/control/thread_queue.cpp 2016-08-30 06:37:49.000000000 -0700 ++++ magma-2.2.0/control/thread_queue.cpp 2016-10-10 19:47:28.911580965 -0700 +@@ -15,7 +15,7 @@ + { + if ( err != 0 ) { + fprintf( stderr, "Error: %s (%d)\n", strerror(err), err ); +- throw std::exception(); ++ // throw std::exception(); + } + } + +@@ -172,7 +172,7 @@ + check( pthread_mutex_lock( &mutex )); + if ( quit_flag ) { + fprintf( stderr, "Error: push_task() called after quit()\n" ); +- throw std::exception(); ++ // throw std::exception(); + } + q.push( task ); + ntask += 1; From c8e8432f73c4c3279ab5b616e427b60b438cfc6d Mon Sep 17 00:00:00 2001 From: Natalia Gimelshein Date: Mon, 9 Oct 2017 14:01:47 -0700 Subject: [PATCH 2/2] remove gcc builde req from meta, otherwise old gcc gets pulled in --- conda/magma-cuda90-2.2.0/meta.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/conda/magma-cuda90-2.2.0/meta.yaml b/conda/magma-cuda90-2.2.0/meta.yaml index 68e6d8443..3eebb6fe4 100644 --- a/conda/magma-cuda90-2.2.0/meta.yaml +++ b/conda/magma-cuda90-2.2.0/meta.yaml @@ -8,9 +8,6 @@ source: - cmakelists.patch - thread_queue.patch -requirements: - build: - - gcc build: number: 1