pax_global_header00006660000000000000000000000064147072040050014511gustar00rootroot0000000000000052 comment=07cd703c4613cd1f51661148debfc4eccc5d84a2 lapackpp-2024.10.26/000077500000000000000000000000001470720400500137025ustar00rootroot00000000000000lapackpp-2024.10.26/.github/000077500000000000000000000000001470720400500152425ustar00rootroot00000000000000lapackpp-2024.10.26/.github/workflows/000077500000000000000000000000001470720400500172775ustar00rootroot00000000000000lapackpp-2024.10.26/.github/workflows/build.sh000077500000000000000000000015011470720400500207320ustar00rootroot00000000000000#!/bin/bash -x maker=$1 device=$2 mydir=$(dirname $0) source ${mydir}/setup_env.sh print "======================================== Build" make -j8 || exit 10 print "======================================== Install" make -j8 install || exit 11 ls -R ${top}/install print "======================================== Verify build" ldd_result=$(ldd test/tester) || exit 12 echo "${ldd_result}" # Verify that tester linked with cublas or rocblas as intended. if [ "${device}" = "gpu_nvidia" ]; then echo "${ldd_result}" | grep cublas || exit 13 elif [ "${device}" = "gpu_amd" ]; then echo "${ldd_result}" | grep rocblas || exit 14 else # CPU-only not linked with cublas or rocblas. echo "${ldd_result}" | grep -P "cublas|rocblas" && exit 15 fi print "======================================== Finished build" exit 0 lapackpp-2024.10.26/.github/workflows/configure.sh000077500000000000000000000030531470720400500216200ustar00rootroot00000000000000#!/bin/bash -x maker=$1 device=$2 if [ "${maker}" = "cmake" ]; then rm -rf build mkdir -p build fi mydir=$(dirname $0) source ${mydir}/setup_env.sh print "======================================== Environment" # Show environment variables, excluding functions. (set -o posix; set) print "======================================== Modules" quiet module list -l print "======================================== Query GPUs" if [ "${device}" = "gpu_nvidia" ]; then nvidia-smi elif [ "${device}" = "gpu_amd" ]; then rocm-smi elif [ "${device}" = "gpu_intel" ]; then clinfo sycl-ls fi print "======================================== Setup build" # Note: set all env variables in setup_env.sh, # else build.sh and test.sh won't see them. rm -rf ${top}/install if [ "${maker}" = "make" ]; then make distclean make config prefix=${top}/install \ || exit 10 elif [ "${maker}" = "cmake" ]; then ( # Build blaspp first git clone https://github.com/icl-utk-edu/blaspp mkdir blaspp/build && cd blaspp/build cmake -Dcolor=no -Dbuild_tests=no \ -DCMAKE_INSTALL_PREFIX=${top}/install \ -Dblas_int=${blas_int} \ -Dgpu_backend=${gpu_backend} .. \ || exit 11 make -j8 install ) cmake -Dcolor=no \ -DCMAKE_INSTALL_PREFIX=${top}/install \ -Dblas_int=${blas_int} \ -Dgpu_backend=${gpu_backend} .. \ || exit 12 fi cat include/lapack/defines.h print "======================================== Finished configure" exit 0 lapackpp-2024.10.26/.github/workflows/main.yml000066400000000000000000000017661470720400500207600ustar00rootroot00000000000000# This is a basic workflow to help you get started with Actions name: CI # Controls when the workflow will run on: # Triggers the workflow on push or pull request events but only for the master branch push: branches: [ master ] pull_request: branches: [ master ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: icl_lapackpp: timeout-minutes: 120 strategy: matrix: maker: [make, cmake] device: [cpu, gpu_nvidia, gpu_amd, gpu_intel] fail-fast: false runs-on: ${{ matrix.device }} steps: - uses: actions/checkout@v3 - name: Configure run: .github/workflows/configure.sh ${{matrix.maker}} ${{matrix.device}} - name: Build run: .github/workflows/build.sh ${{matrix.maker}} ${{matrix.device}} - name: Test run: .github/workflows/test.sh ${{matrix.maker}} ${{matrix.device}} lapackpp-2024.10.26/.github/workflows/setup_env.sh000077500000000000000000000057531470720400500216600ustar00rootroot00000000000000#!/bin/bash #------------------------------------------------------------------------------- # Functions # Suppress echo (-x) output of commands executed with `quiet`. # Useful for sourcing files, loading modules, spack, etc. # set +x, set -x are not echo'd. quiet() { { set +x; } 2> /dev/null; $@; set -x } # `print` is like `echo`, but suppresses output of the command itself. # https://superuser.com/a/1141026 echo_and_restore() { builtin echo "$*" date case "${save_flags}" in (*x*) set -x esac } alias print='{ save_flags="$-"; set +x; } 2> /dev/null; echo_and_restore' #------------------------------------------------------------------------------- quiet source /etc/profile hostname && pwd export top=$(pwd) shopt -s expand_aliases quiet module load intel-oneapi-mkl print "MKLROOT=${MKLROOT}" quiet module load python quiet which python quiet which python3 python --version python3 --version quiet module load pkgconf quiet which pkg-config # CMake finds CUDA in /usr/local/cuda, so need to explicitly set gpu_backend. export gpu_backend=none export color=no export CXXFLAGS="-Werror -Wno-unused-command-line-argument" # Test int64 build with make/cuda and cmake/amd. # Test int32 build with cmake/cuda and make/amd and all others. if [ "${maker}" = "make" -a "${device}" = "gpu_nvidia" ]; then export blas_int=int64 elif [ "${maker}" = "cmake" -a "${device}" = "gpu_amd" ]; then export blas_int=int64 else export blas_int=int32 fi #----------------------------------------------------------------- Compiler if [ "${device}" = "gpu_intel" ]; then print "======================================== Load Intel oneAPI compiler" quiet module load intel-oneapi-compilers else print "======================================== Load GNU compiler" quiet module load gcc@11.3 fi print "---------------------------------------- Verify compiler" print "CXX = $CXX" print "CC = $CC" print "FC = $FC" ${CXX} --version ${CC} --version ${FC} --version #----------------------------------------------------------------- GPU if [ "${device}" = "gpu_nvidia" ]; then print "======================================== Load CUDA" quiet module load cuda print "CUDA_HOME=${CUDA_HOME}" export PATH=${PATH}:${CUDA_HOME}/bin export gpu_backend=cuda quiet which nvcc nvcc --version elif [ "${device}" = "gpu_amd" ]; then print "======================================== Load ROCm" export ROCM_PATH=/opt/rocm # Some hip utilities require /usr/sbin/lsmod export PATH=${PATH}:${ROCM_PATH}/bin:/usr/sbin export gpu_backend=hip quiet which hipcc hipcc --version elif [ "${device}" = "gpu_intel" ]; then # Intel oneAPI SYCL compiler loaded above export gpu_backend=sycl fi #----------------------------------------------------------------- CMake if [ "${maker}" = "cmake" ]; then print "======================================== Load cmake" quiet module load cmake quiet which cmake cmake --version cd build fi lapackpp-2024.10.26/.github/workflows/test.sh000077500000000000000000000024741470720400500206240ustar00rootroot00000000000000#!/bin/bash -x maker=$1 device=$2 mydir=$(dirname $0) source ${mydir}/setup_env.sh # Instead of exiting on the first failed test (bash -e), # run all the tests and accumulate failures into $err. err=0 export OMP_NUM_THREADS=8 print "======================================== Tests" cd test args="--quick" if [ "${device}" = "gpu_intel" ]; then # Our Intel GPU supports only single precision. args+=" --type s,c" fi ./run_tests.py ${args} --host (( err += $? )) # CUDA, HIP, or SYCL. These fail gracefully when GPUs are absent. ./run_tests.py ${args} --device (( err += $? )) print "======================================== Smoke tests" cd ${top}/examples # Makefile or CMakeLists.txt picks up ${test_args}. if [ "${device}" = "gpu_intel" ]; then # Our Intel GPU supports only single precision. export test_args="s c" else export test_args="s d c z" fi if [ "${maker}" = "make" ]; then export PKG_CONFIG_PATH+=:${top}/install/lib/pkgconfig make clean || exit 20 elif [ "${maker}" = "cmake" ]; then rm -rf build && mkdir build && cd build cmake "-DCMAKE_PREFIX_PATH=${top}/install" .. || exit 30 fi # ARGS=-V causes CTest to print output. Makefile doesn't use it. make -j8 || exit 40 make test ARGS=-V (( err += $? )) print "======================================== Finished test" exit ${err} lapackpp-2024.10.26/.gitignore000066400000000000000000000012721470720400500156740ustar00rootroot00000000000000*.bak *.d *.mod *.o *.orig *.pyc *.svg .DS_Store .id __pycache__ lapackpp-* build* config/acml_version config/blas config/cblas config/compiler_cxx config/cublas config/essl_version config/hello config/lapack_matgen config/lapack_potrf config/lapack_pstrf config/lapack_version config/lapack_xblas config/lapacke_potrf config/lapacke_pstrf config/log.txt config/mkl_version config/onemkl config/openblas_version config/openmp config/return_complex config/return_complex_argument config/return_float config/return_float_f2c config/rocblas docs/doxygen/errors.txt docs/html/ files.txt include/lapack/defines.h install* issues/ lib/*.a lib/*.so lib/pkgconfig/*.pc make.inc test/tester tools/gen wiki/ lapackpp-2024.10.26/CHANGELOG.md000066400000000000000000000035531470720400500155210ustar00rootroot000000000000002024.10.26 - Added eigenvalue utilities (lae2, laev2, lasr). - Refactor eigenvalue testers. - Use std::hypot instead of lapy2, lapy3. - Use to_lapack_int to convert int32 to int64. 2024.05.31 - Added shared library version (ABI version 1.0.0) - Updated enum parameters to have `to_string`, `from_string`; deprecate `2str`, `str2` - Removed some deprecated functions 2023.11.05 - Add heevd GPU wrapper for CUDA, ROCm, oneMKL - Update Fortran strlen handling - Fix CMake library ordering 2023.08.25 - Use yyyy.mm.dd version scheme, instead of yyyy.mm.release - Added oneAPI support to CMake - Fixed int64 support - More robust Makefile configure doesn't require CUDA or ROCm to be in compiler search paths (CPATH, LIBRARY_PATH, etc.) - Added `gemqrt` to multiply by Q from QR 2023.06.00 - Updates for BLAS++ changes to Queue class 2023.01.00 - Added oneAPI port (currently Makefile only) - Added `{or,un}hr_col` Householder reconstruction - Added `tgexc, tgsen` to reorder generalized Schur form - Added `lartg` to generate plane rotation - Moved main repo to https://github.com/icl-utk-edu/lapackpp/ - Use python3 2022.07.00 - Added device queue and Cholesky (potrf), LU (getrf), and QR (geqrf) on GPU for CUDA (cuSolver) and ROCm (rocSolver) - Added geqr tester 2022.05.00 - Added laed4, sturm - Use custom allocator to avoid workspace initialization overhead - Backward error checks for more routines 2021.04.00 - Added include/lapack/defines.h based on configuration - Added larfgp - More robust backward error checks - Makefile and CMake fixes 2020.10.01 - Fixes: ILP64, CMake output padding 2020.10.00 - Fixes: CMake version - Added `make check` 2020.09.00 - Initial release - Supports LAPACK >= 3.2.1 - Includes routines through LAPACK 3.7.0 - Makefile and CMake build options lapackpp-2024.10.26/CMakeLists.txt000066400000000000000000000547261470720400500164600ustar00rootroot00000000000000# Copyright (c) 2017-2023, University of Tennessee. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # This program is free software: you can redistribute it and/or modify it under # the terms of the BSD 3-Clause license. See the accompanying LICENSE file. # # CMake script for LAPACK++ library. cmake_minimum_required( VERSION 3.17 ) # 3.1 target_compile_features # 3.8 target_compile_features( cxx_std_17 ) # 3.14 install( LIBRARY DESTINATION lib ) default # 3.15 $<$COMPILE_LANG_AND_ID # optional # 3.15 message DEBUG, string REPEAT # 3.17 find_package( CUDAToolkit ) project( lapackpp VERSION 2024.10.26 LANGUAGES CXX ) # See notes in GNUmakefile about using abi-compliance-checker. # soversion is major ABI version. set( abi_version 1.0.0 ) string( REPLACE "." ";" abi_list "${abi_version}" ) list( GET abi_list 0 soversion ) include( CheckCXXCompilerFlag ) # When built as a sub-project, add a namespace to make targets unique, # e.g., `make tester` becomes `make lapackpp_tester`. if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) set( lapackpp_is_project true ) set( lapackpp_ "" ) else() set( lapackpp_is_project false ) set( lapackpp_ "lapackpp_" ) endif() #------------------------------------------------------------------------------- # Options if (lapackpp_is_project) set( log "" CACHE STRING "Shorthand for CMAKE_MESSAGE_LOG_LEVEL" ) set_property( CACHE log PROPERTY STRINGS FATAL_ERROR SEND_ERROR WARNING AUTHOR_WARNING DEPRECATION NOTICE STATUS VERBOSE DEBUG TRACE ) if (log) set( CMAKE_MESSAGE_LOG_LEVEL "${log}" ) endif() endif() option( BUILD_SHARED_LIBS "Build shared libraries" true ) option( build_tests "Build test suite" "${lapackpp_is_project}" ) option( color "Use ANSI color output" true ) option( use_cmake_find_lapack "Use CMake's find_package( LAPACK ) rather than the search in LAPACK++" false ) set( gpu_backend "auto" CACHE STRING "GPU backend to use" ) set_property( CACHE gpu_backend PROPERTY STRINGS auto cuda hip sycl none ) # After color. include( "cmake/util.cmake" ) # Recognize CTest's BUILD_TESTING flag. (Quotes required.) if (NOT "${BUILD_TESTING}" STREQUAL "") set( build_tests "${BUILD_TESTING}" ) endif() # Default prefix=/opt/slate if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND lapackpp_is_project) set( prefix "/opt/slate" CACHE PATH "Shorthand for CMAKE_INSTALL_PREFIX" ) set( CMAKE_INSTALL_PREFIX "${prefix}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE ) message( STATUS "Setting CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}" ) # Append the new CMAKE_INSTALL_PREFIX, since CMake appended the old value. # This helps find TestSweeper. list( APPEND CMAKE_SYSTEM_PREFIX_PATH ${CMAKE_INSTALL_PREFIX} ) else() message( STATUS "Using CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}" ) endif() # Provide menu of options. (Why doesn't CMake do this?) set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS None Debug Release RelWithDebInfo MinSizeRel ) # Provide menu of options. set( BLA_VENDOR "" CACHE STRING "LAPACK Vendor for use in CMake's FindLAPACK. If empty, use LAPACK++ search. Some obsolete options are omitted here." ) set_property( CACHE BLA_VENDOR PROPERTY STRINGS "" All Goto OpenBLAS FLAME ATLAS IBMESSL Intel10_32 Intel10_64lp Intel10_64lp_seq Intel10_64ilp Intel10_64ilp_seq Intel10_64_dyn Apple NAS Arm Arm_mp Arm_ilp64 Arm_ilp64_mp Generic ) #----------------------------------- # LAPACK options # todo: FLAME, others? set( lapack "auto" CACHE STRING "LAPACK library to search for. Often, LAPACK is included in the BLAS library (e.g., -lopenblas contains both)." ) set_property( CACHE lapack PROPERTY STRINGS "auto" "generic" ) message( DEBUG "Settings: CMAKE_VERSION = ${CMAKE_VERSION} CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX} CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE} BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS} BLA_VENDOR = ${BLA_VENDOR} lapack = ${lapack} build_tests = ${build_tests} color = ${color} use_cmake_find_lapack = ${use_cmake_find_lapack} gpu_backend = ${gpu_backend} lapackpp_is_project = ${lapackpp_is_project} lapackpp_ = ${lapackpp_} abi_version = ${abi_version} soversion = ${soversion} " ) #------------------------------------------------------------------------------- # Enforce out-of-source build string( TOLOWER "${CMAKE_CURRENT_SOURCE_DIR}" source_dir ) string( TOLOWER "${CMAKE_CURRENT_BINARY_DIR}" binary_dir ) if ("${source_dir}" STREQUAL "${binary_dir}") message( FATAL_ERROR "Compiling LAPACK++ with CMake requires an out-of-source build. To proceed: rm -rf CMakeCache.txt CMakeFiles/ # delete files in ${CMAKE_CURRENT_SOURCE_DIR} mkdir build cd build cmake .. make" ) endif() #------------------------------------------------------------------------------- # Build library. add_library( lapackpp src/bbcsd.cc src/bdsdc.cc src/bdsqr.cc src/bdsvdx.cc src/disna.cc src/gbbrd.cc src/gbcon.cc src/gbequ.cc src/gbequb.cc src/gbrfs.cc src/gbrfsx.cc src/gbsv.cc src/gbsvx.cc src/gbtrf.cc src/gbtrs.cc src/gebak.cc src/gebal.cc src/gebrd.cc src/gecon.cc src/geequ.cc src/geequb.cc src/gees.cc src/geesx.cc src/geev.cc src/gehrd.cc src/gelq.cc src/gelq2.cc src/gelqf.cc src/gels.cc src/gelsd.cc src/gelss.cc src/gelsy.cc src/gemlq.cc src/gemqr.cc src/gemqrt.cc src/geql2.cc src/geqlf.cc src/geqp3.cc src/geqr.cc src/geqr2.cc src/geqrf.cc src/geqrfp.cc src/geqrt.cc src/geqrt2.cc src/geqrt3.cc src/gerfs.cc src/gerfsx.cc src/gerq2.cc src/gerqf.cc src/gesdd.cc src/gesv.cc src/gesvd.cc src/gesvdx.cc src/gesvx.cc src/getf2.cc src/getrf.cc src/getrf2.cc src/getri.cc src/getrs.cc src/getsls.cc src/ggbak.cc src/ggbal.cc src/gges.cc src/gges3.cc src/ggesx.cc src/ggev.cc src/ggev3.cc src/ggglm.cc src/gghrd.cc src/gglse.cc src/ggqrf.cc src/ggrqf.cc src/ggsvd3.cc src/ggsvp3.cc src/gtcon.cc src/gtrfs.cc src/gtsv.cc src/gtsvx.cc src/gttrf.cc src/gttrs.cc src/hbev_2stage.cc src/hbev.cc src/hbevd_2stage.cc src/hbevd.cc src/hbevx_2stage.cc src/hbevx.cc src/hbgst.cc src/hbgv.cc src/hbgvd.cc src/hbgvx.cc src/hbtrd.cc src/hecon_rk.cc src/hecon.cc src/heequb.cc src/heev_2stage.cc src/heev.cc src/heevd_2stage.cc src/heevd.cc src/heevr_2stage.cc src/heevr.cc src/heevx_2stage.cc src/heevx.cc src/hegst.cc src/hegv_2stage.cc src/hegv.cc src/hegvd.cc src/hegvx.cc src/herfs.cc src/herfsx.cc src/hesv_aa.cc src/hesv_rk.cc src/hesv_rook.cc src/hesv.cc src/hesvx.cc src/heswapr.cc src/hetrd_2stage.cc src/hetrd.cc src/hetrf_aa.cc src/hetrf_rk.cc src/hetrf_rook.cc src/hetrf.cc src/hetri_rk.cc src/hetri.cc src/hetri2.cc src/hetrs_aa.cc src/hetrs_rk.cc src/hetrs_rook.cc src/hetrs.cc src/hetrs2.cc src/hfrk.cc src/hgeqz.cc src/hpcon.cc src/hpev.cc src/hpevd.cc src/hpevx.cc src/hpgst.cc src/hpgv.cc src/hpgvd.cc src/hpgvx.cc src/hprfs.cc src/hpsv.cc src/hpsvx.cc src/hptrd.cc src/hptrf.cc src/hptri.cc src/hptrs.cc src/hseqr.cc src/lacgv.cc src/lacp2.cc src/lacpy.cc src/lae2.cc src/laed4.cc src/laev2.cc src/lag2c.cc src/lag2d.cc src/lag2s.cc src/lag2z.cc src/lagge.cc src/laghe.cc src/lagsy.cc src/langb.cc src/lange.cc src/langt.cc src/lanhb.cc src/lanhe.cc src/lanhp.cc src/lanhs.cc src/lanht.cc src/lansb.cc src/lansp.cc src/lanst.cc src/lansy.cc src/lantb.cc src/lantp.cc src/lantr.cc src/lapmr.cc src/lapmt.cc src/lapy2.cc src/lapy3.cc src/larf.cc src/larfb.cc src/larfg.cc src/larfgp.cc src/larft.cc src/larfx.cc src/larfy.cc src/larfy.cc src/larnv.cc src/lartg.cc src/lartgp.cc src/lartgs.cc src/lascl.cc src/laset.cc src/lasr.cc src/lassq.cc src/laswp.cc src/lauum.cc src/opgtr.cc src/opmtr.cc src/orcsd2by1.cc src/orgbr.cc src/orghr.cc src/orglq.cc src/orgql.cc src/orgqr.cc src/orgrq.cc src/orgtr.cc src/orhr_col.cc src/ormbr.cc src/ormhr.cc src/ormlq.cc src/ormql.cc src/ormqr.cc src/ormrq.cc src/ormrz.cc src/ormtr.cc src/pbcon.cc src/pbequ.cc src/pbrfs.cc src/pbstf.cc src/pbsv.cc src/pbsvx.cc src/pbtrf.cc src/pbtrs.cc src/pftrf.cc src/pftri.cc src/pftrs.cc src/pocon.cc src/poequ.cc src/poequb.cc src/porfs.cc src/porfsx.cc src/posv.cc src/posvx.cc src/potf2.cc src/potrf.cc src/potrf2.cc src/potri.cc src/potrs.cc src/ppcon.cc src/ppequ.cc src/pprfs.cc src/ppsv.cc src/ppsvx.cc src/pptrf.cc src/pptri.cc src/pptrs.cc src/pstrf.cc src/ptcon.cc src/pteqr.cc src/ptrfs.cc src/ptsv.cc src/ptsvx.cc src/pttrf.cc src/pttrs.cc src/sbev_2stage.cc src/sbev.cc src/sbevd_2stage.cc src/sbevd.cc src/sbevx_2stage.cc src/sbevx.cc src/sbgst.cc src/sbgv.cc src/sbgvd.cc src/sbgvx.cc src/sbtrd.cc src/sfrk.cc src/spcon.cc src/spev.cc src/spevd.cc src/spevx.cc src/spgst.cc src/spgv.cc src/spgvd.cc src/spgvx.cc src/sprfs.cc src/spsv.cc src/spsvx.cc src/sptrd.cc src/sptrf.cc src/sptri.cc src/sptrs.cc src/stedc.cc src/stegr.cc src/stein.cc src/stemr.cc src/steqr.cc src/sterf.cc src/stev.cc src/stevd.cc src/stevr.cc src/stevx.cc src/sturm.cc src/sycon_rk.cc src/sycon.cc src/syequb.cc src/syev_2stage.cc src/syev.cc src/syevd_2stage.cc src/syevd.cc src/syevr_2stage.cc src/syevr.cc src/syevx_2stage.cc src/syevx.cc src/sygst.cc src/sygv_2stage.cc src/sygv.cc src/sygvd.cc src/sygvx.cc src/symv.cc src/syr.cc src/syrfs.cc src/syrfsx.cc src/sysv_aa.cc src/sysv_rk.cc src/sysv_rook.cc src/sysv.cc src/sysvx.cc src/syswapr.cc src/sytrd_2stage.cc src/sytrd.cc src/sytrf_aa.cc src/sytrf_rk.cc src/sytrf_rook.cc src/sytrf.cc src/sytri_rk.cc src/sytri.cc src/sytri2.cc src/sytrs_aa.cc src/sytrs_rk.cc src/sytrs_rook.cc src/sytrs.cc src/sytrs2.cc src/tbcon.cc src/tbrfs.cc src/tbtrs.cc src/tfsm.cc src/tftri.cc src/tfttp.cc src/tfttr.cc src/tgexc.cc src/tgsen.cc src/tgsja.cc src/tgsyl.cc src/tpcon.cc src/tplqt.cc src/tplqt2.cc src/tpmlqt.cc src/tpmqrt.cc src/tpqrt.cc src/tpqrt2.cc src/tprfb.cc src/tprfs.cc src/tptri.cc src/tptrs.cc src/tpttf.cc src/tpttr.cc src/trcon.cc src/trevc.cc src/trevc3.cc src/trexc.cc src/trrfs.cc src/trsen.cc src/trtri.cc src/trtrs.cc src/trttf.cc src/trttp.cc src/tzrzf.cc src/ungbr.cc src/unghr.cc src/unglq.cc src/ungql.cc src/ungqr.cc src/ungrq.cc src/ungtr.cc src/unhr_col.cc src/unmbr.cc src/unmhr.cc src/unmlq.cc src/unmql.cc src/unmqr.cc src/unmrq.cc src/unmrz.cc src/unmtr.cc src/upgtr.cc src/upmtr.cc src/util.cc src/version.cc src/cuda/cuda_common.cc src/cuda/cuda_geqrf.cc src/cuda/cuda_getrf.cc src/cuda/cuda_potrf.cc src/cuda/cuda_heevd.cc src/rocm/rocm_geqrf.cc src/rocm/rocm_getrf.cc src/rocm/rocm_potrf.cc src/rocm/rocm_heevd.cc src/onemkl/onemkl_geqrf.cc src/onemkl/onemkl_getrf.cc src/onemkl/onemkl_potrf.cc src/onemkl/onemkl_heevd.cc src/stub/stub_geqrf.cc src/stub/stub_getrf.cc src/stub/stub_potrf.cc src/stub/stub_heevd.cc ) #------------------------------------------------------------------------------- # CUDA support. message( "" ) set( lapackpp_use_cuda false ) # output in lapackppConfig.cmake.in if (gpu_backend MATCHES "^(auto|cuda)$") message( STATUS "${bold}Looking for CUDA${not_bold} (gpu_backend = ${gpu_backend})" ) if (gpu_backend STREQUAL "cuda") find_package( CUDAToolkit REQUIRED ) else() find_package( CUDAToolkit QUIET ) endif() if (CUDAToolkit_FOUND) set( gpu_backend "cuda" ) set( lapackpp_defs_cuda_ "-DLAPACK_HAVE_CUBLAS" ) set( lapackpp_use_cuda true ) # Some platforms need these to be public libraries. target_link_libraries( lapackpp PUBLIC CUDA::cudart CUDA::cusolver ) message( STATUS "${blue}Building CUDA support${plain}" ) else() message( STATUS "${red}No CUDA support: CUDA not found${plain}" ) endif() else() message( STATUS "${red}No CUDA support: gpu_backend = ${gpu_backend}${plain}" ) endif() #------------------------------------------------------------------------------- # HIP/ROCm support. message( "" ) set( lapackpp_use_hip false ) # output in lapackppConfig.cmake.in if (NOT CUDAToolkit_FOUND AND gpu_backend MATCHES "^(auto|hip)$") message( STATUS "${bold}Looking for HIP/ROCm${not_bold} (gpu_backend = ${gpu_backend})" ) if (gpu_backend STREQUAL "hip") find_package( rocblas REQUIRED ) find_package( rocsolver REQUIRED ) else() find_package( rocblas QUIET ) find_package( rocsolver QUIET ) endif() if (rocblas_FOUND AND rocsolver_FOUND) set( gpu_backend "hip" ) set( lapackpp_defs_hip_ "-DLAPACK_HAVE_ROCBLAS" ) set( lapackpp_use_hip true ) # Some platforms need these to be public libraries. target_link_libraries( lapackpp PUBLIC roc::rocblas roc::rocsolver ) message( STATUS "${blue}Building HIP/ROCm support${plain}" ) else() message( STATUS "${red}No HIP/ROCm support: ROCm not found${plain}" ) endif() else() message( STATUS "${red}No HIP/ROCm support: gpu_backend = ${gpu_backend}${plain}" ) endif() #------------------------------------------------------------------------------- # SYCL support. message( "" ) set( lapackpp_use_sycl false ) # output in lapackppConfig.cmake.in if (gpu_backend MATCHES "^(sycl|auto)$") message( STATUS "${bold}Looking for oneMKL-SYCL${not_bold} (gpu_backend = ${gpu_backend})" ) if (TARGET MKL::MKL_DPCPP) # Search for MKL only if not already been found set( MKL_FOUND true ) endif() if (NOT MKL_FOUND) # Search for MKL only if not already been found if (gpu_backend STREQUAL "sycl") find_package( MKL CONFIG REQUIRED QUIET HINTS "$ENV{MKL_ROOT}") else() find_package( MKL CONFIG QUIET HINTS "$ENV{MKL_ROOT}") endif() endif() # message(STATUS "Available targets: ${MKL_IMPORTED_TARGETS}") # Check if compiler supports the SYCL flag check_cxx_compiler_flag( "-fsycl" FSYCL_SUPPORT ) # If oneMKL is found and the compiler supports SYCL then # enable oneMKL-SYCL-device support if (MKL_FOUND AND FSYCL_SUPPORT) set( gpu_backend "sycl" ) set( lapackpp_defs_sycl_ "-DLAPACK_HAVE_SYCL" ) set( lapackpp_use_sycl true ) # Uncomment to use CMake FindBLAS using BLA_VENDOR # if (NOT BLA_VENDOR) # set( BLA_VENDOR Intel10_64lp ) # endif() target_compile_options( lapackpp PUBLIC -fsycl ) target_link_options( lapackpp PUBLIC -fsycl ) target_link_libraries( lapackpp PUBLIC -lmkl_sycl -lsycl -lOpenCL ) message( STATUS "${blue}Building oneMKL-SYCL device support${plain}" ) elseif (gpu_backend STREQUAL "sycl") message( FATAL_ERROR "${red}SYCL compiler not found${plain}" ) else() message( STATUS "${red}No oneMKL-SYCL device support: oneMKL or SYCL compiler not found${plain}" ) endif() else() message( STATUS "${red}No oneMKL-SYCL device support: gpu_backend = ${gpu_backend}${plain}" ) endif() #------------------------------------------------------------------------------- # Clean stale defines.h from Makefile-based build. message( "" ) file( REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/include/lapack/defines.h" ) # Include directory. # During build it's {source}/include; after install it's {prefix}/include. target_include_directories( lapackpp PUBLIC "$" # defines.h "$" "$" ) # Get git commit id. if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") execute_process( COMMAND git rev-parse --short HEAD WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE lapackpp_id ) string( STRIP "${lapackpp_id}" lapackpp_id ) message( STATUS "lapackpp_id = ${lapackpp_id}" ) # Don't put in lapackpp_defs_ as the quotes cause parsing issues. target_compile_definitions( lapackpp PRIVATE LAPACKPP_ID="${lapackpp_id}" ) endif() # Use and export -std=c++17. # CMake inexplicably allows gnu++17 or "decay" to c++11 or 14; prohibit those. target_compile_features( lapackpp PUBLIC cxx_std_17 ) set_target_properties( lapackpp PROPERTIES CXX_STANDARD_REQUIRED true # prohibit < c++17 CXX_EXTENSIONS false # prohibit gnu++17 WINDOWS_EXPORT_ALL_SYMBOLS ON VERSION "${abi_version}" SOVERSION "${soversion}" ) if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.15) # Conditionally add -Wall. See CMake tutorial. set( gcc_like_cxx "$" ) target_compile_options( lapackpp PRIVATE "$<${gcc_like_cxx}:$>" ) endif() #------------------------------------------------------------------------------- # Search for BLAS library, if not already included (e.g., in SLATE). message( STATUS "Check for BLAS++" ) if (NOT TARGET blaspp) find_package( blaspp ) if (blaspp_FOUND) message( " Found BLAS++: ${blaspp_DIR}" ) else() message( FATAL_ERROR "BLAS++ not found. LAPACK++ requires BLAS++ to be installed first." ) endif() else() message( " BLAS++ already included" ) endif() # Search for LAPACK library. message( "" ) if (BLA_VENDOR OR use_cmake_find_lapack) message( DEBUG "Using CMake's FindLAPACK" ) find_package( LAPACK ) else() message( DEBUG "Using LAPACKFinder" ) include( "cmake/LAPACKFinder.cmake" ) endif() if (NOT LAPACK_FOUND) message( FATAL_ERROR "LAPACK++ requires a LAPACK library and none was found." " Ensure that it is accessible in environment variables" " $CPATH, $LIBRARY_PATH, and $LD_LIBRARY_PATH." ) endif() include( "cmake/LAPACKConfig.cmake" ) # (LAPACK++ treats defs_ the same as BLAS++ for consistency.) # Cache lapackpp_defs_ that was built in LAPACKFinder, LAPACKConfig. set( lapackpp_defs_ "${lapackpp_defs_}" CACHE INTERNAL "Constants defined for LAPACK" ) # Concat defines. set( lapackpp_defines ${lapackpp_defs_} ${lapackpp_defs_cuda_} ${lapackpp_defs_hip_} ${lapackpp_defs_sycl_} CACHE INTERNAL "") if (true) # Extract definitions as #define VAR or #define VAR VALUE. set( lapackpp_header_defines "" ) foreach (def IN LISTS lapackpp_defines) string( REGEX REPLACE "^-D" "" def "${def}" ) string( REGEX REPLACE "=" " " def "${def}" ) string( APPEND lapackpp_header_defines "#define ${def}\n" ) endforeach() # ctime format: Mon Nov 16 15:19:47 2020 string( TIMESTAMP datetime "%a %b %d %H:%M:%S %Y" ) # Pass defines via header. configure_file( include/lapack/defines.h.in # in source dir include/lapack/defines.h # in binary dir ) else() # Pass defines via compiler flags. target_compile_definitions( lapackpp PRIVATE ${blaspp_defines} ${lapackpp_defines} ) endif() # Export via lapackppConfig.cmake list( APPEND LAPACK_LIBRARIES "blaspp" ) set( lapackpp_libraries "${LAPACK_LIBRARIES}" CACHE INTERNAL "" ) message( DEBUG "lapackpp_libraries = '${lapackpp_libraries}'" ) # lapackpp_libraries could be private, but then if an application directly # calls blas, cblas, lapack, lapacke, mkl, essl, etc., it would need to # devine the exact same LAPACK_LIBRARIES. For example, the tester calls # lapacke. Instead, make it public. target_link_libraries( lapackpp PUBLIC ${lapackpp_libraries} ) # Add 'make lib' target. if (lapackpp_is_project) add_custom_target( lib DEPENDS lapackpp ) endif() #------------------------------------------------------------------------------- if (build_tests) add_subdirectory( test ) endif() #------------------------------------------------------------------------------- # Install rules. # GNU Filesystem Conventions include( GNUInstallDirs ) if (WIN32) set( install_configdir "lapackpp" ) else() set( install_configdir "${CMAKE_INSTALL_LIBDIR}/cmake/lapackpp" ) endif() # Install library and add to Targets.cmake install( TARGETS lapackpp EXPORT lapackppTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ) # Install header files install( # / copies contents, not directory itself DIRECTORY "${PROJECT_SOURCE_DIR}/include/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" FILES_MATCHING REGEX "\\.(h|hh)$" ) install( FILES "${PROJECT_BINARY_DIR}/include/lapack/defines.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/lapack" ) # Install Targets.cmake install( EXPORT lapackppTargets DESTINATION "${install_configdir}" ) # Also export Targets.cmake in build directory export( EXPORT lapackppTargets FILE "lapackppTargets.cmake" ) # Install Config.cmake and ConfigVersion.cmake, # to enable find_package( ). include( CMakePackageConfigHelpers ) configure_package_config_file( "lapackppConfig.cmake.in" "lapackppConfig.cmake" INSTALL_DESTINATION "${install_configdir}" ) write_basic_package_version_file( "lapackppConfigVersion.cmake" VERSION "${lapackpp_VERSION}" COMPATIBILITY AnyNewerVersion ) install( FILES "${CMAKE_CURRENT_BINARY_DIR}/lapackppConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/lapackppConfigVersion.cmake" DESTINATION "${install_configdir}" ) lapackpp-2024.10.26/GNUmakefile000066400000000000000000000334431470720400500157630ustar00rootroot00000000000000# Copyright (c) 2017-2023, University of Tennessee. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # This program is free software: you can redistribute it and/or modify it under # the terms of the BSD 3-Clause license. See the accompanying LICENSE file. # # See INSTALL.md for usage. #------------------------------------------------------------------------------- # Configuration # Variables defined in make.inc, or use make's defaults: # CXX, CXXFLAGS -- C compiler and flags # LD, LDFLAGS, LIBS -- Linker, options, library paths, and libraries # AR, RANLIB -- Archiver, ranlib updates library TOC # prefix -- where to install LAPACK++ ifeq (${MAKECMDGOALS},config) # For `make config`, don't include make.inc with previous config; # force re-creating make.inc. .PHONY: config config: make.inc make.inc: force else ifneq (clean,${findstring clean,${MAKECMDGOALS}}) # For `make clean` or `make distclean`, don't include make.inc, # which could generate it. Otherwise, include make.inc. include make.inc endif python ?= python3 force: ; make.inc: ${python} configure.py # Defaults if not given in make.inc. GNU make doesn't have defaults for these. RANLIB ?= ranlib prefix ?= /opt/slate abs_prefix := ${abspath ${prefix}} # Default LD=ld won't work; use CXX. Can override in make.inc or environment. ifeq (${origin LD},default) LD = ${CXX} endif # Use abi-compliance-checker to compare the ABI (application binary # interface) of 2 releases. Changing the ABI does not necessarily change # the API (application programming interface). Rearranging a struct or # changing a by-value argument from int64 to int doesn't change the # API--no source code changes are required, just a recompile. # # if structs or routines are changed or removed: # bump major version and reset minor, revision = 0; # else if structs or routines are added: # bump minor version and reset revision = 0; # else (e.g., bug fixes): # bump revision # # soversion is major ABI version. abi_version = 1.0.0 soversion = ${word 1, ${subst ., ,${abi_version}}} #------------------------------------------------------------------------------- ldflags_shared = -shared # auto-detect OS # $OSTYPE may not be exported from the shell, so echo it ostype := ${shell echo $${OSTYPE}} ifneq (,${findstring darwin, ${ostype}}) # MacOS is darwin macos = 1 # MacOS needs shared library's path set, and shared library version. ldflags_shared += -install_name @rpath/${notdir $@} \ -current_version ${abi_version} \ -compatibility_version ${soversion} so = dylib so2 = .dylib # on macOS, .dylib comes after version: libfoo.4.dylib else # Linux needs shared library's soname. ldflags_shared += -Wl,-soname,${notdir ${lib_soname}} so = so so1 = .so # on Linux, .so comes before version: libfoo.so.4 endif #------------------------------------------------------------------------------- # if shared ifneq (${static},1) CXXFLAGS += -fPIC LDFLAGS += -fPIC lib_ext = ${so} else lib_ext = a endif #------------------------------------------------------------------------------- # Files lib_src = ${wildcard src/*.cc src/cuda/*.cc src/rocm/*.cc src/onemkl/*.cc src/stub/*.cc} lib_obj = ${addsuffix .o, ${basename ${lib_src}}} dep += ${addsuffix .d, ${basename ${lib_src}}} tester_src = ${wildcard test/*.cc} tester_obj = ${addsuffix .o, ${basename ${tester_src}}} dep += ${addsuffix .d, ${basename ${tester_src}}} tester = test/tester pkg = lib/pkgconfig/lapackpp.pc #------------------------------------------------------------------------------- # BLAS++ # todo: should configure.py save blaspp_dir & testsweeper_dir in make.inc? # Order here (./blaspp, ../blaspp) is reverse of order in configure.py. blaspp_dir = ${wildcard ./blaspp} ifeq (${blaspp_dir},) blaspp_dir = ${wildcard ../blaspp} endif blaspp_src = ${wildcard ${blaspp_dir}/src/*.cc ${blaspp_dir}/include/*.hh} blaspp = ${blaspp_dir}/lib/libblaspp.${lib_ext} blaspp: ${blaspp} ifneq (${blaspp_dir},) ${blaspp}: ${blaspp_src} cd ${blaspp_dir} && ${MAKE} lib CXX=${CXX} else ${blaspp}: ${error LAPACK++ requires BLAS++, which was not found. Run 'make config' \ or download manually from https://github.com/icl-utk-edu/blaspp} endif # Compile BLAS++ before LAPACK++. ${lib_obj} ${tester_obj}: | ${blaspp} #------------------------------------------------------------------------------- # TestSweeper testsweeper_dir = ${wildcard ../testsweeper} ifeq (${testsweeper_dir},) testsweeper_dir = ${wildcard ${blaspp_dir}/testsweeper} endif ifeq (${testsweeper_dir},) testsweeper_dir = ${wildcard ./testsweeper} endif testsweeper_src = ${wildcard ${testsweeper_dir}/testsweeper.cc ${testsweeper_dir}/testsweeper.hh} testsweeper = ${testsweeper_dir}/libtestsweeper.${lib_ext} testsweeper: ${testsweeper} ifneq (${testsweeper_dir},) ${testsweeper}: ${testsweeper_src} cd ${testsweeper_dir} && ${MAKE} lib CXX=${CXX} else ${testsweeper}: ${error Tester requires TestSweeper, which was not found. Run 'make config' \ or download manually from https://github.com/icl-utk-edu/testsweeper} endif # Compile TestSweeper before LAPACK++. ${lib_obj} ${tester_obj}: | ${testsweeper} #------------------------------------------------------------------------------- # Get Mercurial id, and make version.o depend on it via .id file. ifneq (${wildcard .git},) id := ${shell git rev-parse --short HEAD} src/version.o: CXXFLAGS += -DLAPACKPP_ID='"${id}"' endif last_id := ${shell [ -e .id ] && cat .id || echo 'NA'} ifneq (${id},${last_id}) .id: force endif .id: echo ${id} > .id src/version.o: .id #------------------------------------------------------------------------------- # LAPACK++ specific flags and libraries CXXFLAGS += -I./include CXXFLAGS += -I${blaspp_dir}/include # additional flags and libraries for testers ${tester_obj}: CXXFLAGS += -I${testsweeper_dir} TEST_LDFLAGS += -L./lib -Wl,-rpath,${abspath ./lib} TEST_LDFLAGS += -L${blaspp_dir}/lib -Wl,-rpath,${abspath ${blaspp_dir}/lib} TEST_LDFLAGS += -L${testsweeper_dir} -Wl,-rpath,${abspath ${testsweeper_dir}} TEST_LIBS += -llapackpp -lblaspp -ltestsweeper #------------------------------------------------------------------------------- # Rules .DELETE_ON_ERROR: .SUFFIXES: .PHONY: all docs hooks lib src test tester headers include clean distclean .DEFAULT_GOAL = all all: lib tester hooks install: lib ${pkg} mkdir -p ${DESTDIR}${abs_prefix}/include/lapack mkdir -p ${DESTDIR}${abs_prefix}/lib${LIB_SUFFIX}/pkgconfig cp include/*.hh ${DESTDIR}${abs_prefix}/include/ cp include/lapack/*.h ${DESTDIR}${abs_prefix}/include/lapack/ cp include/lapack/*.hh ${DESTDIR}${abs_prefix}/include/lapack/ cp -av ${lib_name}* ${DESTDIR}${abs_prefix}/lib${LIB_SUFFIX}/ cp ${pkg} ${DESTDIR}${abs_prefix}/lib${LIB_SUFFIX}/pkgconfig/ cd ${blaspp_dir} && make install prefix=${prefix} uninstall: ${RM} ${DESTDIR}${abs_prefix}/include/lapack.hh ${RM} -r ${DESTDIR}${abs_prefix}/include/lapack ${RM} ${DESTDIR}${abs_prefix}/lib${LIB_SUFFIX}/${notdir ${lib_name}*} ${RM} ${DESTDIR}${abs_prefix}/lib${LIB_SUFFIX}/pkgconfig/lapackpp.pc #------------------------------------------------------------------------------- # if re-configured, recompile everything ${lib_obj} ${tester_obj}: make.inc #------------------------------------------------------------------------------- # Generic rule for shared libraries. # For libfoo.so version 4.5.6, this creates libfoo.so.4.5.6 and symlinks # libfoo.so.4 -> libfoo.so.4.5.6 # libfoo.so -> libfoo.so.4 # # Needs [private] variables set (shown with example values): # LDFLAGS = -L/path/to/lib # LIBS = -lmylib # lib_obj = src/foo.o src/bar.o # lib_so_abi = libfoo.so.4.5.6 # lib_soname = libfoo.so.4 # abi_version = 4.5.6 # soversion = 4 %.${lib_ext}: mkdir -p lib ${LD} ${LDFLAGS} ${ldflags_shared} ${LIBS} ${lib_obj} -o ${lib_so_abi} ln -fs ${notdir ${lib_so_abi}} ${lib_soname} ln -fs ${notdir ${lib_soname}} $@ # Generic rule for static libraries, creates libfoo.a. # The library should depend only on its objects. %.a: mkdir -p lib ${RM} $@ ${AR} cr $@ $^ ${RANLIB} $@ #------------------------------------------------------------------------------- # LAPACK++ library # so is like libfoo.so or libfoo.dylib # so_abi is like libfoo.so.4.5.6 or libfoo.4.5.6.dylib # soname is like libfoo.so.4 or libfoo.4.dylib lib_name = lib/liblapackpp lib_a = ${lib_name}.a lib_so = ${lib_name}.${so} lib = ${lib_name}.${lib_ext} lib_so_abi = ${lib_name}${so1}.${abi_version}${so2} lib_soname = ${lib_name}${so1}.${soversion}${so2} ${lib_so}: ${lib_obj} ${lib_a}: ${lib_obj} # sub-directory rules lib src: ${lib} lib/clean src/clean: ${RM} ${lib_a} ${lib_so} ${lib_so_abi} ${lib_soname} ${lib_obj} #------------------------------------------------------------------------------- # tester ${tester}: ${tester_obj} ${lib} ${testsweeper} ${blaspp} ${LD} ${TEST_LDFLAGS} ${LDFLAGS} ${tester_obj} \ ${TEST_LIBS} ${LIBS} -o $@ # sub-directory rules # Note 'test' is sub-directory rule; 'tester' is CMake-compatible rule. test: ${tester} tester: ${tester} test/clean: ${RM} ${tester} test/*.o test/check: check # 'make check' tests subset of routines, to avoid spurious failures check: tester cd test; ${python} run_tests.py --quick \ gesv getrf posv potrf geqrf ungqr gels \ geev heev heevd heevr gesvd #------------------------------------------------------------------------------- # headers # precompile headers to verify self-sufficiency headers = ${wildcard include/lapack.hh include/lapack/*.h include/lapack/*.hh test/*.hh} headers_gch = ${addsuffix .gch, ${basename ${headers}}} headers: ${headers_gch} headers/clean: ${RM} ${headers_gch} # sub-directory rules include: headers include/clean: headers/clean #------------------------------------------------------------------------------- # pkgconfig # Keep -std=c++11 in CXXFLAGS. Keep -fopenmp in LDFLAGS. CXXFLAGS_clean = ${filter-out -O% -W% -pedantic -D% -I./include -I${blaspp_dir}% -MMD -fPIC -fopenmp, ${CXXFLAGS}} CPPFLAGS_clean = ${filter-out -O% -W% -pedantic -D% -I./include -I${blaspp_dir}% -MMD -fPIC -fopenmp, ${CPPFLAGS}} LDFLAGS_clean = ${filter-out -fPIC, ${LDFLAGS}} .PHONY: ${pkg} ${pkg}: perl -pe "s'#VERSION'2024.10.26'; \ s'#PREFIX'${abs_prefix}'; \ s'#CXX\b'${CXX}'; \ s'#CXXFLAGS'${CXXFLAGS_clean}'; \ s'#CPPFLAGS'${CPPFLAGS_clean}'; \ s'#LDFLAGS'${LDFLAGS_clean}'; \ s'#LIBS'${LIBS}';" \ $@.in > $@ #------------------------------------------------------------------------------- # documentation docs: docs/html/index.html doc_files = \ docs/doxygen/DoxygenLayout.xml \ docs/doxygen/doxyfile.conf \ docs/doxygen/groups.dox \ README.md \ INSTALL.md \ docs/html/index.html: ${headers} ${lib_src} ${tester_src} ${doc_files} doxygen docs/doxygen/doxyfile.conf @echo ======================================== cat docs/doxygen/errors.txt @echo ======================================== @echo "Documentation available in docs/html/index.html" @echo ======================================== # sub-directory redirects src/docs: docs test/docs: docs #------------------------------------------------------------------------------- # general rules clean: lib/clean test/clean headers/clean ${RM} ${dep} distclean: clean ${RM} make.inc include/lapack/defines.h # Install git hooks hooks = .git/hooks/pre-commit hooks: ${hooks} .git/hooks/%: tools/hooks/% @if [ -e .git/hooks ]; then \ echo cp $< $@ ; \ cp $< $@ ; \ fi %.o: %.cc ${CXX} ${CXXFLAGS} -c $< -o $@ # preprocess source %.i: %.cc ${CXX} ${CXXFLAGS} -I${blaspp_dir}/test -I${testsweeper_dir} -E $< -o $@ # preprocess source %.i: %.h ${CXX} ${CXXFLAGS} -I${blaspp_dir}/test -I${testsweeper_dir} -E $< -o $@ # preprocess source %.i: %.hh ${CXX} ${CXXFLAGS} -I${blaspp_dir}/test -I${testsweeper_dir} -E $< -o $@ # precompile header to check for errors %.gch: %.h ${CXX} ${CXXFLAGS} -I${blaspp_dir}/test -I${testsweeper_dir} -c $< -o $@ %.gch: %.hh ${CXX} ${CXXFLAGS} -I${blaspp_dir}/test -I${testsweeper_dir} -c $< -o $@ -include ${dep} #------------------------------------------------------------------------------- # debugging echo: @echo "---------- Options" @echo "static = '${static}'" @echo "prefix = '${prefix}'" @echo "abs_prefix = '${abs_prefix}'" @echo @echo "---------- Internal variables" @echo "ostype = '${ostype}'" @echo "macos = '${macos}'" @echo "id = '${id}'" @echo "last_id = '${last_id}'" @echo "abi_version = '${abi_version}'" @echo "soversion = '${soversion}'" @echo @echo "---------- Libraries" @echo "lib_name = ${lib_name}" @echo "lib_a = ${lib_a}" @echo "lib_so = ${lib_so}" @echo "lib = ${lib}" @echo "lib_so_abi = ${lib_so_abi}" @echo "lib_soname = ${lib_soname}" @echo @echo "pkg = ${pkg}" @echo @echo "lib_src = ${lib_src}" @echo @echo "lib_obj = ${lib_obj}" @echo @echo "tester_src = ${tester_src}" @echo @echo "tester_obj = ${tester_obj}" @echo @echo "tester = ${tester}" @echo @echo "dep = ${dep}" @echo @echo "testsweeper_dir = ${testsweeper_dir}" @echo "testsweeper_src = ${testsweeper_src}" @echo "testsweeper = ${testsweeper}" @echo @echo "blaspp_dir = ${blaspp_dir}" @echo "blaspp_src = ${blaspp_src}" @echo "blaspp = ${blaspp}" @echo @echo "---------- C++ compiler" @echo "CXX = ${CXX}" @echo "CXXFLAGS = ${CXXFLAGS}" @echo @echo "---------- Link flags" @echo "LD = ${LD}" @echo "LDFLAGS = ${LDFLAGS}" @echo "LIBS = ${LIBS}" @echo "ldflags_shared = ${ldflags_shared}" @echo @echo "TEST_LDFLAGS = ${TEST_LDFLAGS}" @echo "TEST_LIBS = ${TEST_LIBS}" lapackpp-2024.10.26/GNUmakefile.subdir000066400000000000000000000022531470720400500172450ustar00rootroot00000000000000# Subdirectories include this makefile to forward rules to the top level makefile. # Define ${top} for where the top level is. # Example: src/GNUmakefile: # top = .. # include ${top}/GNUmakefile.subdir .SUFFIXES: pwd = ${shell pwd} abs_top = ${abspath ${top}}/ abs_pwd = ${abspath ${pwd}} cdir = ${subst ${abs_top},,${abs_pwd}} # ------------------------------------------------------------------------------ ifneq (${MAKECMDGOALS},) # If arguments are given, presumably files like test.o, forward them to top # with cdir prefix. # All files are forwarded as one rule, based on first; rest are quietly ignored. goals := ${filter-out echo ${DONT_FORWARD}, ${MAKECMDGOALS}} forward := ${addprefix ${cdir}/, ${goals}} first := ${firstword ${goals}} rest := ${wordlist 2, ${words ${goals}}, ${goals}} ${first}: force cd ${top} && ${MAKE} ${forward} ${rest}: force @echo > /dev/null # ------------------------------------------------------------------------------ else # Otherwise, forward subdirectory name as target. .PHONY: ${cdir} ${cdir}: cd ${top} && ${MAKE} $@ endif # ------------------------------------------------------------------------------ force: ; lapackpp-2024.10.26/INSTALL.md000066400000000000000000000250101470720400500153300ustar00rootroot00000000000000LAPACK++ Installation Notes ================================================================================ [TOC] Synopsis -------------------------------------------------------------------------------- Configure and compile the LAPACK++ library and its tester, then install the headers and library. Option 1: Makefile make && make install Option 2: CMake # LAPACK++ requires BLAS++, from # https://github.com/icl-utk-edu/blaspp cd /path/to/blaspp mkdir build && cd build cmake .. make && make install # After installing BLAS++ above cd /path/to/lapackpp mkdir build && cd build cmake .. make && make install Environment variables (Makefile and CMake) -------------------------------------------------------------------------------- Standard environment variables affect both Makefile (configure.py) and CMake. These include: LD Linker; defaults to CXX CXX C++ compiler CXXFLAGS C++ compiler flags LDFLAGS linker flags CPATH compiler include search path LIBRARY_PATH compile-time library search path LD_LIBRARY_PATH runtime library search path DYLD_LIBRARY_PATH runtime library search path on macOS CUDA_PATH path to CUDA, e.g., /usr/local/cuda CUDA_HOME also recognized for path to CUDA ROCM_PATH path to ROCm, e.g., /opt/rocm Options (Makefile and CMake) -------------------------------------------------------------------------------- See the BLAS++ INSTALL.md for BLAS++ specific options. Since the LAPACK library is often bundled with the BLAS library, such as -lopenblas, it should be specified in BLAS++. LAPACK++ specific options include (all values are case insensitive): lapack LAPACK libraries to search for. LAPACK is often included in the BLAS library (e.g., -lopenblas contains both), so there is usually no need to specify this. One or more of: auto search for all libraries (default) generic generic -llapack LAPACK_LIBRARIES Specify the exact LAPACK libraries, overriding the built-in search. Again, there is usually no need to specify this. E.g., cmake -DLAPACK_LIBRARIES='-lopenblas' .. gpu_backend BLAS++ must be built with the same GPU backend. auto (default) auto-detect CUDA, HIP/ROCm, or SYCL cuda build with CUDA support hip build with HIP/ROCm support sycl build with SYCL and oneMKL support none do not build with GPU backend color Whether to use ANSI colors in output. One of: auto uses color if output is a TTY (default with Makefile; not support with CMake) yes (default with CMake) no With Makefile, options are specified as environment variables or on the command line using `option=value` syntax, such as: python3 configure.py lapack=generic With CMake, options are specified on the command line using `-Doption=value` syntax (not as environment variables), such as: cmake -Dblas=mkl .. Makefile Installation -------------------------------------------------------------------------------- Available targets: make - configures (if make.inc is missing), then compiles the library and tester make config - configures LAPACK++, creating a make.inc file make lib - compiles the library (lib/liblapackpp.so) make tester - compiles test/tester make check - run basic checks using tester make docs - generates documentation in docs/html/index.html make install - installs the library and headers to ${prefix} make uninstall - remove installed library and headers from ${prefix} make clean - deletes object (*.o) and library (*.a, *.so) files make distclean - also deletes make.inc and dependency files (*.d) ### Options make config [options] or python3 configure.py [options] Runs the `configure.py` script to detect your compiler and library properties, then creates a make.inc configuration file. You can also manually edit the make.inc file. Options are name=value pairs to set variables. Besides the Environment variables and Options listed above, additional options include: static Whether to build as a static or shared library. 0 shared library (default) 1 static library prefix Where to install, default /opt/slate. Headers go in ${prefix}/include, library goes in ${prefix}/lib${LIB_SUFFIX} These can be set in your environment or on the command line, e.g., python3 configure.py CXX=g++ prefix=/usr/local Configure assumes environment variables are set so your compiler can find BLAS and LAPACK libraries. For example: export LD_LIBRARY_PATH="/opt/my-blas/lib64" # or DYLD_LIBRARY_PATH on macOS export LIBRARY_PATH="/opt/my-blas/lib64" export CPATH="/opt/my-blas/include" or export LDFLAGS="-L/opt/my-blas/lib64 -Wl,-rpath,/opt/my-blas/lib64" export CXXFLAGS="-I/opt/my-blas/include" On some systems, loading the appropriate module will set these flags: module load my-blas ### Vendor notes Intel MKL provides scripts to set these flags, e.g.: source /opt/intel/bin/compilervars.sh intel64 or source /opt/intel/mkl/bin/mklvars.sh intel64 IBM ESSL provides only a subset of LAPACK functions, so Netlib LAPACK is also required. ### Manual configuration If you have a specific configuration that you want, set CXX, CXXFLAGS, LDFLAGS, and LIBS, e.g.: export CXX="g++" export CXXFLAGS="-I${MKLROOT}/include -fopenmp" export LDFLAGS="-L${MKLROOT}/lib/intel64 -Wl,-rpath,${MKLROOT}/lib/intel64 -fopenmp" export LIBS="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lm" These can also be set when running configure: make config CXX=g++ \ CXXFLAGS="-I${MKLROOT}/include -fopenmp" \ LDFLAGS="-L${MKLROOT}/lib/intel64 -Wl,-rpath,${MKLROOT}/lib/intel64 -fopenmp" \ LIBS="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lm" Note that all test programs are compiled with those options, so errors may cause configure to fail. If you experience unexpected problems, please see config/log.txt to diagnose the issue. The log shows the option being tested, the exact command run, the command's standard output (stdout), error output (stderr), and exit status. All test files are in the config directory. CMake Installation -------------------------------------------------------------------------------- LAPACK++ requires BLAS++ and inherits its dependencies from BLAS++, so BLAS++ must be installed first via CMake, before running CMake for LAPACK++. Information and installation instructions can be found at https://github.com/icl-utk-edu/blaspp. Briefly: # LAPACK++ requires BLAS++, from # https://github.com/icl-utk-edu/blaspp cd /path/to/blaspp cmake [-DCMAKE_INSTALL_PREFIX=/path/to/install] [options] .. make make install The CMake script enforces an out-of-source build. Create a build directory under the LAPACK++ root directory: # After installing BLAS++ above cd /path/to/lapackpp mkdir build && cd build cmake [-DCMAKE_INSTALL_PREFIX=/path/to/install] [options] .. make make install LAPACK++ should find BLAS++ if it is installed in a system default location (e.g., /usr/local), or their install prefix is the same. If LAPACK++ can't find BLAS++, you can point to its directory: cmake -DCMAKE_PREFIX_PATH=/path/to/install [options] .. or cmake -Dblaspp_DIR=/path/to/install/lib/blaspp [options] .. LAPACK++ uses the TestSweeper library (https://github.com/icl-utk-edu/testsweeper) to run its tests. If CMake doesn't find TestSweeper, it will be downloaded and compiled. To use a different TestSweeper build that was not installed, you can point to its directory. cmake -Dtestsweeper_DIR=/path/to/testsweeper/build [options] .. ### Options Besides the Environment variables and Options listed above, additional options include: build_tests Whether to build test suite (test/tester). Requires TestSweeper, CBLAS, and LAPACKE. One of: yes (default) no use_cmake_find_lapack Whether to use CMake's FindLAPACK, instead of LAPACK++ search. Again, as LAPACK is often included in the BLAS library, there is usually no need to specify this. One of: yes no (default) If BLA_VENDOR is set, it automatically uses CMake's FindLAPACK. BLA_VENDOR Use CMake's FindLAPACK, instead of LAPACK++ search. For values, see: https://cmake.org/cmake/help/latest/module/FindLAPACK.html Standard CMake options include: BUILD_SHARED_LIBS Whether to build as a static or shared library. One of: yes shared library (default) no static library CMAKE_INSTALL_PREFIX (alias prefix) Where to install, default /opt/slate. Headers go in ${prefix}/include, library goes in ${prefix}/lib CMAKE_PREFIX_PATH Where to look for CMake packages such as BLAS++ and TestSweeper. CMAKE_BUILD_TYPE Type of build. One of: [empty] default compiler optimization (no flags) Debug no optimization, with asserts (-O0 -g) Release optimized, no asserts, no debug info (-O3 -DNDEBUG) RelWithDebInfo optimized, no asserts, with debug info (-O2 -DNDEBUG -g) MinSizeRel Release, but optimized for size (-Os -DNDEBUG) CMAKE_MESSAGE_LOG_LEVEL (alias log) Level of messages to report. In ascending order: FATAL_ERROR, SEND_ERROR, WARNING, AUTHOR_WARNING, DEPRECATION, NOTICE, STATUS, VERBOSE, DEBUG, TRACE. Particularly, DEBUG or TRACE gives useful information. With CMake, options are specified on the command line using `-Doption=value` syntax (not as environment variables), such as: # in build directory cmake -Dbuild_tests=no -DCMAKE_INSTALL_PREFIX=/usr/local .. Alternatively, use the `ccmake` text-based interface or the CMake app GUI. # in build directory ccmake .. # Type 'c' to configure, then 'g' to generate Makefile To re-configure CMake, you may need to delete CMake's cache: # in build directory rm CMakeCache.txt # or rm -rf * cmake [options] .. To debug the build, set `VERBOSE`: # in build directory, after running cmake make VERBOSE=1 lapackpp-2024.10.26/LICENSE000066400000000000000000000030101470720400500147010ustar00rootroot00000000000000Copyright (c) 2017-2023, University of Tennessee. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the University of Tennessee nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. lapackpp-2024.10.26/README.md000066400000000000000000000132471470720400500151700ustar00rootroot00000000000000 | \ _ \ \ __| | / | | | _ \ __/ _ \ ( < __ __|__ __| ____|_/ _\_| _/ _\___|_|\_\ _| _| **C++ API for the Linear Algebra PACKage** **Innovative Computing Laboratory** **University of Tennessee** * * * [TOC] * * * About -------------------------------------------------------------------------------- The Linear Algebra PACKage (LAPACK) is a standard software library for numerical linear algebra. It provides routines for solving systems of linear equations and linear least squares problems, eigenvalue problems, and singular value decomposition. It also includes routines to implement the associated matrix factorizations such as LU, QR, Cholesky, etc. LAPACK was originally written in FORTRAN 77, and moved to Fortran 90 in version 3.2 (2008). LAPACK provides routines for handling both real and complex matrices in both single and double precision. The objective of LAPACK++ is to provide a convenient, performance oriented API for development in the C++ language, that, for the most part, preserves established conventions, while, at the same time, takes advantages of modern C++ features, such as: namespaces, templates, exceptions, etc. LAPACK++ is part of the SLATE project ([Software for Linear Algebra Targeting Exascale](http://icl.utk.edu/slate/)), which is funded by the [Department of Energy](https://energy.gov) as part of its [Exascale Computing Initiative](https://exascaleproject.org) (ECP). Closely related to LAPACK++ is the [BLAS++](https://github.com/icl-utk-edu/blaspp) project, which provides a C++ API for BLAS and Batch BLAS. ![LAPACKPP](http://icl.bitbucket.io/slate/artwork/Bitbucket/lapackpp_stack.png) * * * Documentation -------------------------------------------------------------------------------- * [INSTALL.md](INSTALL.md) for installation notes. * [LAPACK++ Doxygen](https://icl.bitbucket.io/lapackpp/) * [SLATE Working Note 2: C++ API for BLAS and LAPACK](http://www.icl.utk.edu/publications/swan-002) * * * Getting Help -------------------------------------------------------------------------------- For assistance, visit the *SLATE User Forum* at . Join by signing in with your Google credentials, then clicking *Join group to post*. Bug reports can be filed directly on Github's issue tracker: . * * * Resources -------------------------------------------------------------------------------- * Visit the [BLAS++ repository](https://github.com/icl-utk-edu/blaspp) for more information about the C++ API for the standard BLAS. * Visit the [SLATE website](http://icl.utk.edu/slate/) for more information about the SLATE project. * Visit the [SLATE Working Notes](http://www.icl.utk.edu/publications/series/swans) to find out more about ongoing SLATE developments. * Visit the [ECP website](https://exascaleproject.org) to find out more about the DOE Exascale Computing Initiative. * * * Contributing -------------------------------------------------------------------------------- The SLATE project welcomes contributions from new developers. Contributions can be offered through the standard Github pull request model. We strongly encourage you to coordinate large contributions with the SLATE development team early in the process. * * * Acknowledgments -------------------------------------------------------------------------------- This research was supported by the Exascale Computing Project (17-SC-20-SC), a joint project of the U.S. Department of Energy's Office of Science and National Nuclear Security Administration, responsible for delivering a capable exascale ecosystem, including software, applications, and hardware technology, to support the nation’s exascale computing imperative. This research uses resources of the Oak Ridge Leadership Computing Facility, which is a DOE Office of Science User Facility supported under Contract DE-AC05-00OR22725. This research also uses resources of the Argonne Leadership Computing Facility, which is a DOE Office of Science User Facility supported under Contract DE-AC02-06CH11357. * * * License -------------------------------------------------------------------------------- Copyright (c) 2017-2023, University of Tennessee. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the University of Tennessee nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. **This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright holders or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.** lapackpp-2024.10.26/cmake/000077500000000000000000000000001470720400500147625ustar00rootroot00000000000000lapackpp-2024.10.26/cmake/LAPACKConfig.cmake000066400000000000000000000103761470720400500200540ustar00rootroot00000000000000# Copyright (c) 2017-2023, University of Tennessee. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # This program is free software: you can redistribute it and/or modify it under # the terms of the BSD 3-Clause license. See the accompanying LICENSE file. # Check if this file has already been run with these settings. if (DEFINED lapack_config_cache AND "${lapack_config_cache}" STREQUAL "${LAPACK_LIBRARIES}") message( DEBUG "LAPACK config already done for '${LAPACK_LIBRARIES}'" ) return() endif() set( lapack_config_cache "${LAPACK_LIBRARIES}" CACHE INTERNAL "" ) include( "cmake/util.cmake" ) #------------------------------------------------------------------------------- message( STATUS "Checking LAPACK version" ) try_run( run_result compile_result ${CMAKE_CURRENT_BINARY_DIR} SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/config/lapack_version.cc" LINK_LIBRARIES ${LAPACK_LIBRARIES} ${blaspp_libraries} COMPILE_DEFINITIONS ${blaspp_defines} COMPILE_OUTPUT_VARIABLE compile_output RUN_OUTPUT_VARIABLE run_output ) debug_try_run( "lapack_version.cc" "${compile_result}" "${compile_output}" "${run_result}" "${run_output}" ) if (compile_result AND "${run_output}" MATCHES "LAPACK_VERSION=(([0-9]+)\\.([0-9]+)\\.([0-9]+))") # Form version without periods (30201 for 3.2.1) for easy # comparisons in C preprocessor. set( lapack_version "${CMAKE_MATCH_2}${CMAKE_MATCH_3}${CMAKE_MATCH_4}" ) message( "${blue} LAPACK version ${CMAKE_MATCH_1} (${lapack_version})${plain}" ) list( APPEND lapackpp_defs_ "-DLAPACK_VERSION=${lapack_version}" ) else() message( "${red} Unknown LAPACK version${plain}" ) endif() #------------------------------------------------------------------------------- message( STATUS "Checking for XBLAS" ) try_run( run_result compile_result ${CMAKE_CURRENT_BINARY_DIR} SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/config/lapack_xblas.cc" LINK_LIBRARIES ${LAPACK_LIBRARIES} ${blaspp_libraries} COMPILE_DEFINITIONS ${blaspp_defines} COMPILE_OUTPUT_VARIABLE compile_output RUN_OUTPUT_VARIABLE run_output ) debug_try_run( "lapack_xblas.cc" "${compile_result}" "${compile_output}" "${run_result}" "${run_output}" ) if (compile_result AND "${run_output}" MATCHES "ok") message( "${blue} Found XBLAS${plain}" ) list( APPEND lapackpp_defs_ "-DLAPACK_HAVE_XBLAS" ) else() message( "${red} XBLAS not found.${plain}" ) endif() #------------------------------------------------------------------------------- # Find LAPACKE, either in the BLAS/LAPACK library or in -llapacke. # Check for pstrf (Cholesky with pivoting). set( lib_list ";-llapacke" ) message( DEBUG "lib_list ${lib_list}" ) foreach (lib IN LISTS lib_list) message( STATUS "Checking for LAPACKE library ${lib}" ) try_run( run_result compile_result ${CMAKE_CURRENT_BINARY_DIR} SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/config/lapacke_pstrf.cc" LINK_LIBRARIES ${lib} ${LAPACK_LIBRARIES} ${blaspp_libraries} COMPILE_DEFINITIONS ${blaspp_defines} COMPILE_OUTPUT_VARIABLE compile_output RUN_OUTPUT_VARIABLE run_output ) debug_try_run( "lapacke_pstrf.cc" "${compile_result}" "${compile_output}" "${run_result}" "${run_output}" ) if (compile_result AND "${run_output}" MATCHES "ok") list( APPEND lapackpp_defs_ "-DLAPACK_HAVE_LAPACKE" ) set( lapacke_libraries "${lib}" CACHE INTERNAL "" ) set( lapacke_found true CACHE INTERNAL "" ) break() endif() endforeach() if (lapacke_found) if (NOT lapacke_libraries) message( "${blue} Found LAPACKE library in BLAS library${plain}" ) else() message( "${blue} Found LAPACKE library: ${lapacke_libraries}${plain}" ) endif() else() message( "${red} LAPACKE library not found. Tester cannot be built.${plain}" ) endif() #------------------------------------------------------------------------------- message( DEBUG " lapackpp_defs_ = '${lapackpp_defs_}' lapacke_found = '${lapacke_found}' lapacke_libraries = '${lapacke_libraries}' ") lapackpp-2024.10.26/cmake/LAPACKFinder.cmake000066400000000000000000000144521470720400500200550ustar00rootroot00000000000000# Copyright (c) 2017-2023, University of Tennessee. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # This program is free software: you can redistribute it and/or modify it under # the terms of the BSD 3-Clause license. See the accompanying LICENSE file. # Convert to list, as lapack_libs is later, to match cached value. string( REGEX REPLACE "([^ ])( +|\\\;)" "\\1;" LAPACK_LIBRARIES "${LAPACK_LIBRARIES}" ) string( REGEX REPLACE "-framework;" "-framework " LAPACK_LIBRARIES "${LAPACK_LIBRARIES}" ) message( DEBUG "LAPACK_LIBRARIES '${LAPACK_LIBRARIES}'" ) message( DEBUG " cached '${lapack_libraries_cached}'" ) message( DEBUG "lapack '${lapack}'" ) message( DEBUG " cached '${lapack_cached}'" ) message( DEBUG "" ) #----------------------------------- # Check if this file has already been run with these settings. if (LAPACK_LIBRARIES AND NOT "${lapack_libraries_cached}" STREQUAL "${LAPACK_LIBRARIES}") # Ignore lapack if LAPACK_LIBRARIES changes. # Set to empty, rather than unset, so when cmake is invoked again # they don't force a search. message( DEBUG "clear lapack" ) set( lapack "" CACHE INTERNAL "" ) elseif (NOT ("${lapack_cached}" STREQUAL "${lapack}")) # Ignore LAPACK_LIBRARIES if lapack* changed. message( DEBUG "unset LAPACK_LIBRARIES" ) set( LAPACK_LIBRARIES "" CACHE INTERNAL "" ) else() message( DEBUG "LAPACK search already done for lapack = ${lapack} LAPACK_LIBRARIES = ${LAPACK_LIBRARIES}" ) return() endif() set( lapack_libraries_cached ${LAPACK_LIBRARIES} CACHE INTERNAL "" ) # updated later set( lapack_cached ${lapack} CACHE INTERNAL "" ) include( "cmake/util.cmake" ) message( STATUS "Looking for LAPACK libraries and options" ) #------------------------------------------------------------------------------- # Parse options: LAPACK_LIBRARIES, lapack. #---------------------------------------- LAPACK_LIBRARIES if (LAPACK_LIBRARIES) set( test_lapack_libraries true ) endif() #---------------------------------------- lapack string( TOLOWER "${lapack}" lapack_ ) if ("${lapack_}" MATCHES "auto") set( test_all true ) endif() if ("${lapack_}" MATCHES "default") set( test_default true ) endif() if ("${lapack_}" MATCHES "generic") set( test_generic true ) endif() message( DEBUG " LAPACK_LIBRARIES = '${LAPACK_LIBRARIES}' lapack = '${lapack}' lapack_ = '${lapack_}' test_lapack_libraries = '${test_lapack_libraries}' test_default = '${test_default}' test_generic = '${test_generic}' test_all = '${test_all}'") #------------------------------------------------------------------------------- # Build list of libraries to check. # todo: add flame? # todo: LAPACK_?(ROOT|DIR) set( lapack_libs_list "" ) #---------------------------------------- LAPACK_LIBRARIES if (test_lapack_libraries) # Escape ; semi-colons so we can append it as one item to a list. string( REPLACE ";" "\\;" LAPACK_LIBRARIES_ESC "${LAPACK_LIBRARIES}" ) message( DEBUG "LAPACK_LIBRARIES ${LAPACK_LIBRARIES}" ) message( DEBUG " => ${LAPACK_LIBRARIES_ESC}" ) list( APPEND lapack_libs_list "${LAPACK_LIBRARIES_ESC}" ) endif() #---------------------------------------- default (in BLAS library) if (test_all OR test_default) list( APPEND lapack_libs_list " " ) endif() #---------------------------------------- generic -llapack if (test_all OR test_generic) list( APPEND lapack_libs_list "-llapack" ) endif() message( DEBUG "lapack_libs_list ${lapack_libs_list}" ) #------------------------------------------------------------------------------- # Check each LAPACK library. # BLAS++ needs only a limited subset of LAPACK, so check for potrf (Cholesky). # LAPACK++ checks for pstrf (Cholesky with pivoting) to make sure it is # a complete LAPACK library, since some BLAS libraries (ESSL, ATLAS) # contain only an optimized subset of LAPACK routines. unset( LAPACK_FOUND CACHE ) unset( lapackpp_defs_ CACHE ) foreach (lapack_libs IN LISTS lapack_libs_list) if ("${lapack_libs}" MATCHES "^ *$") set( label " In BLAS library" ) else() set( label " ${lapack_libs}" ) endif() pad_string( "${label}" 50 label ) # Try to link and run LAPACK routine with the library. try_run( run_result compile_result ${CMAKE_CURRENT_BINARY_DIR} SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/config/lapack_pstrf.cc" LINK_LIBRARIES # Use blaspp_libraries instead of blaspp, when SLATE includes # blaspp and lapackpp, so the blaspp library doesn't exist yet. # Not "quoted"; screws up OpenMP. ${lapack_libs} ${blaspp_libraries} COMPILE_DEFINITIONS ${blaspp_defines} COMPILE_OUTPUT_VARIABLE compile_output RUN_OUTPUT_VARIABLE run_output ) debug_try_run( "lapack_pstrf.cc" "${compile_result}" "${compile_output}" "${run_result}" "${run_output}" ) if (NOT compile_result) message( "${label} ${red} no (didn't link: routine not found)${plain}" ) elseif ("${run_result}" EQUAL 0 AND "${run_output}" MATCHES "ok") # If it runs (exits 0), we're done, so break loop. message( "${label} ${blue} yes${plain}" ) set( LAPACK_FOUND true CACHE INTERNAL "" ) string( STRIP "${lapack_libs}" lapack_libs ) set( LAPACK_LIBRARIES "${lapack_libs}" CACHE STRING "" FORCE ) list( APPEND lapackpp_defs_ "-DLAPACK_HAVE_LAPACK" ) break() else() message( "${label} ${red} no (didn't run: int mismatch, etc.)${plain}" ) endif() endforeach() # Update to found LAPACK library. set( lapack_libraries_cached ${LAPACK_LIBRARIES} CACHE INTERNAL "" ) #------------------------------------------------------------------------------- if (LAPACK_FOUND) if (NOT LAPACK_LIBRARIES) message( "${blue} Found LAPACK library in BLAS library${plain}" ) else() message( "${blue} Found LAPACK library: ${LAPACK_LIBRARIES}${plain}" ) endif() else() message( "${red} LAPACK library not found.${plain}" ) endif() message( DEBUG " LAPACK_FOUND = '${LAPACK_FOUND}' LAPACK_LIBRARIES = '${LAPACK_LIBRARIES}' lapackpp_defs_ = '${lapackpp_defs_}' ") lapackpp-2024.10.26/cmake/util.cmake000066400000000000000000000052571470720400500167520ustar00rootroot00000000000000# Copyright (c) 2017-2023, University of Tennessee. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # This program is free software: you can redistribute it and/or modify it under # the terms of the BSD 3-Clause license. See the accompanying LICENSE file. if (color) string( ASCII 27 Esc ) set( ansi_reset "${Esc}[0m" ) set( bold "${Esc}[1m" ) set( not_bold "${Esc}[22m" ) # "normal" set( italic "${Esc}[3m" ) set( not_italic "${Esc}[23m" ) set( black "${Esc}[30m" ) set( red "${Esc}[31m" ) set( green "${Esc}[32m" ) set( yellow "${Esc}[33m" ) set( blue "${Esc}[34m" ) set( magenta "${Esc}[35m" ) set( cyan "${Esc}[36m" ) set( gray "${Esc}[37m" ) set( default_color "${Esc}[39m" ) set( plain "${Esc}[39m" ) endif() #------------------------------------------------------------------------------- # pad_string( input length output_variable ) # Adds spaces to input up to length and saves to output_variable. # function( pad_string input length output_variable ) string( LENGTH "${input}" len ) math( EXPR pad_len "${length} - ${len}" ) if (pad_len LESS 0) set( pad_len 0 ) endif() string( REPEAT " " ${pad_len} pad ) set( ${output_variable} "${input}${pad}" PARENT_SCOPE ) endfunction() #------------------------------------------------------------------------------- # debug_try_compile( msg compile_result compile_output ) # Prints compile_result at log level DEBUG (5); # compile_output at log level TRACE (6). # function( debug_try_compile msg compile_result compile_output ) message( DEBUG "${msg}: compile_result '${compile_result}'" ) message( TRACE "compile_output: <<<\n${compile_output}>>>" ) endfunction() #------------------------------------------------------------------------------- # debug_try_run( msg compile_result run_result compile_output run_output ) # Prints {compile,run}_result at debug DEBUG (5); # {compile,run}_output at debug TRACE (6). # function( debug_try_run msg compile_result compile_output run_result run_output ) message( DEBUG "${msg}: compile_result '${compile_result}', run_result '${run_result}'" ) message( TRACE "compile_output: '''\n${compile_output}'''" ) message( TRACE "run_output: '''\n${run_output}'''" ) endfunction() #------------------------------------------------------------------------------- # assert( condition ) # Aborts if condition is not true. function( assert var ) if (NOT ${var}) message( FATAL_ERROR "\n${red}Assertion failed: ${var} (value is '${${var}}')${default_color}\n" ) endif() endfunction() lapackpp-2024.10.26/config/000077500000000000000000000000001470720400500151475ustar00rootroot00000000000000lapackpp-2024.10.26/config/__init__.py000066400000000000000000000000261470720400500172560ustar00rootroot00000000000000from .config import * lapackpp-2024.10.26/config/acml_version.cc000066400000000000000000000007771470720400500201520ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include int main() { int major, minor, patch, build; acmlversion( &major, &minor, &patch, &build ); printf( "ACML_VERSION=%d.%d.%d.%d\n", major, minor, patch, build ); return 0; } lapackpp-2024.10.26/config/ansicodes.py000066400000000000000000000345671470720400500175100ustar00rootroot00000000000000# Copyright (c) 2017-2023, University of Tennessee. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # This program is free software: you can redistribute it and/or modify it under # the terms of the BSD 3-Clause license. See the accompanying LICENSE file. ''' ANSI font and color codes. ''' import sys ansi_esc_ = chr(0x1B) + '[' #------------------------------------------------------------------------------- class Font( object ): ''' ANSI font and color codes. The Font class implements all settings, and is accessible by a global object `font`. Member functions that take a string `msg`, e.g., `font.bold( msg )`, return a string of an ANSI code + msg + an ANSI code to restore the state. Member functions that don't take a string just return an ANSI code, usually to restore the state, e.g., `font.not_italic()`. Example use: from ansicodes import font font.set_enabled( True ) # enabled by default print( font.bold( font.red( 'red' ) + ' bold' ) + ' normal.' ) Styles and one color can be nested: print( 'normal' + font.bold( 'bold ' + font.italic( 'bold-italic ' + fg.red( 'red-bold-italic' ) + ' bold-italic' ) + ' bold' ) + ' normal' ) Multiple colors cannot be nested: print( fg.red( 'red ' + fg.blue( 'blue' ) + ' *black' ) + ' black' ) where one might expect the ' *black' text to be red, but that color is lost. ''' #-------------------- def __init__( self ): self.enabled_ = True #-------------------- def set_enabled( self, val ): ''' Enable or disable ANSI codes. Enable if val == True, 'y', 'yes', or 'always', or if val = 'auto' and output is to a console (TTY). ''' self.enabled_ = (val in (True, 'y', 'yes', 'always') or (val == 'auto' and sys.stdout.isatty())) # end #-------------------- def code( self, val ): ''' If ANSI codes are enabled, returns "ESC[" + val + "m"; otherwise returns empty string. ''' if (self.enabled_): return ansi_esc_ + val + 'm' else: return '' # end #-------------------- font styles def reset( self, msg ): return self.code('0') def bold( self, msg ): return self.code('1') + msg + self.normal() def faint( self, msg ): return self.code('2') + msg + self.normal() def italic( self, msg ): return self.code('3') + msg + self.not_italic() def underline( self, msg ): return self.code('4') + msg + self.not_underline() def blink( self, msg ): return self.code('5') + msg + self.steady() def blink_fast( self, msg ): return self.code('6') + msg + self.steady() def negative( self, msg ): return self.code('7') + msg + self.positive() def conceal( self, msg ): return self.code('8') + msg + self.reveal() def strike( self, msg ): return self.code('9') + msg + self.not_strike() def fraktur( self, msg ): return self.code('20') + msg + self.not_italic() # 21 is either not-bold or double underline, an unfortunate ambiguity. def not_bold( self ): return self.code('21') def normal( self ): return self.code('22') # not bold, not faint def not_italic( self ): return self.code('23') def not_fraktur( self ): return self.code('23') def not_underline( self ): return self.code('24') def steady( self ): return self.code('25') def positive( self ): return self.code('27') def reveal( self ): return self.code('28') def not_strike( self ): return self.code('29') #-------------------- fonts (rarely supported) def default_font( self ): return self.code('10') def font1( self, msg ): return self.code('11') + msg + self.default_font() def font2( self, msg ): return self.code('12') + msg + self.default_font() def font3( self, msg ): return self.code('13') + msg + self.default_font() def font4( self, msg ): return self.code('14') + msg + self.default_font() def font5( self, msg ): return self.code('15') + msg + self.default_font() def font6( self, msg ): return self.code('16') + msg + self.default_font() def font7( self, msg ): return self.code('17') + msg + self.default_font() def font8( self, msg ): return self.code('18') + msg + self.default_font() def font9( self, msg ): return self.code('19') + msg + self.default_font() #-------------------- frames (rarely supported) def framed( self, msg ): return self.code('51') + msg + self.not_framed() def encircled( self, msg ): return self.code('52') + msg + self.not_encircled() def overlined( self, msg ): return self.code('53') + msg + self.not_overlined() def not_framed( self ): return self.code('54') def not_encircled( self ): return self.code('54') def not_overlined( self ): return self.code('55') #-------------------- foreground colors def black( self, msg ): return self.code('30') + msg + self.default_color() def red( self, msg ): return self.code('31') + msg + self.default_color() def green( self, msg ): return self.code('32') + msg + self.default_color() def yellow( self, msg ): return self.code('33') + msg + self.default_color() def blue( self, msg ): return self.code('34') + msg + self.default_color() def magenta( self, msg ): return self.code('35') + msg + self.default_color() def cyan( self, msg ): return self.code('36') + msg + self.default_color() def gray( self, msg ): return self.code('37') + msg + self.default_color() def default_color( self ): return self.code('39') def color( self, r, g, b, msg ): ''' Returns string to display msg using a 24-bit RGB foreground color. Supported on Xterm, Konsole, Gnome, libvte, etc. May produce weird results on others like macOS Terminal. ''' return self.code('38;2;%d;%d;%d' % (r, g, b)) + msg + self.default_color() #-------------------- background colors def black_bg( self, msg ): return self.code('40') + msg + self.default_bgcolor() def red_bg( self, msg ): return self.code('41') + msg + self.default_bgcolor() def green_bg( self, msg ): return self.code('42') + msg + self.default_bgcolor() def yellow_bg( self, msg ): return self.code('43') + msg + self.default_bgcolor() def blue_bg( self, msg ): return self.code('44') + msg + self.default_bgcolor() def magenta_bg( self, msg ): return self.code('45') + msg + self.default_bgcolor() def cyan_bg( self, msg ): return self.code('46') + msg + self.default_bgcolor() def gray_bg( self, msg ): return self.code('47') + msg + self.default_bgcolor() def default_bgcolor( self ): return self.code('49') def bgcolor( self, r, g, b, msg ): ''' Returns string to display msg using a 24-bit RGB background color. ''' return self.code('48;2;%d;%d;%d' % (r, g, b)) + msg + self.default_bgcolor() # end #------------------------------------------------------------------------------- # Global object to access the Font class. font = Font() #------------------------------------------------------------------------------- def test(): print( font.bold( 'Styles' ) ) print( 'bold: ', font.bold ( ' text ' ), 'post' ) print( 'faint: ', font.faint ( ' text ' ), 'post' ) print( 'italic: ', font.italic ( ' text ' ), 'post' ) print( 'underline: ', font.underline ( ' text ' ), 'post' ) print( 'blink: ', font.blink ( ' text ' ), 'post' ) print( 'blink_fast:', font.blink_fast( ' text ' ), 'post *' ) print( 'negative: ', font.negative ( ' text ' ), 'post' ) print( 'conceal: ', font.conceal ( ' text ' ), 'post' ) print( 'strike: ', font.strike ( ' text ' ), 'post' ) print( 'fraktur: ', font.fraktur ( ' text ' ), 'post *' ) print( 'framed: ', font.framed ( ' text ' ), 'post *' ) print( 'encircled: ', font.encircled ( ' text ' ), 'post *' ) print( 'overlined: ', font.overlined ( ' text ' ), 'post *' ) print( font.bold( '\nFonts (* rarely supported)' ) ) print( 'font1:', font.font1( ' text ' ), 'post *' ) print( 'font2:', font.font2( ' text ' ), 'post *' ) print( 'font3:', font.font3( ' text ' ), 'post *' ) print( 'font4:', font.font4( ' text ' ), 'post *' ) print( 'font5:', font.font5( ' text ' ), 'post *' ) print( 'font6:', font.font6( ' text ' ), 'post *' ) print( 'font7:', font.font7( ' text ' ), 'post *' ) print( 'font8:', font.font8( ' text ' ), 'post *' ) print( 'font9:', font.font9( ' text ' ), 'post *' ) print( font.bold( '\nForeground colors' ) ) print( 'default:', font.default_color() + ' text ', 'post' ) print( 'black: ', font.black ( ' text ' ), 'post' ) print( 'red: ', font.red ( ' text ' ), 'post' ) print( 'green: ', font.green ( ' text ' ), 'post' ) print( 'yellow: ', font.yellow ( ' text ' ), 'post' ) print( 'blue: ', font.blue ( ' text ' ), 'post' ) print( 'magenta:', font.magenta( ' text ' ), 'post' ) print( 'cyan: ', font.cyan ( ' text ' ), 'post' ) print( 'gray: ', font.gray ( ' text ' ), 'post' ) # aka, "white" print( font.bold( 'RGB colors' ) ) print( 'red: ', font.color( 255, 0, 0, ' text ' ), 'post' ) print( 'purple: ', font.color( 148, 33, 147, ' text ' ), 'post' ) print( 'orange: ', font.color( 255, 147, 0, ' text ' ), 'post' ) print( font.bold( '\nForeground colors + bold ("bright")' ) ) print( 'default:', font.bold( font.default_color() + ' text ' ), 'post' ) print( 'black: ', font.bold( font.black ( ' text ' ) ), 'post' ) print( 'red: ', font.bold( font.red ( ' text ' ) ), 'post' ) print( 'green: ', font.bold( font.green ( ' text ' ) ), 'post' ) print( 'yellow: ', font.bold( font.yellow ( ' text ' ) ), 'post' ) print( 'blue: ', font.bold( font.blue ( ' text ' ) ), 'post' ) print( 'magenta:', font.bold( font.magenta( ' text ' ) ), 'post' ) print( 'cyan: ', font.bold( font.cyan ( ' text ' ) ), 'post' ) print( 'gray: ', font.bold( font.gray ( ' text ' ) ), 'post' ) print( font.bold( 'RGB colors' ) ) print( 'red: ', font.bold( font.color( 255, 0, 0, ' text ' ) ), 'post' ) print( 'purple: ', font.bold( font.color( 148, 33, 147, ' text ' ) ), 'post' ) print( 'orange: ', font.bold( font.color( 255, 147, 0, ' text ' ) ), 'post' ) print( font.bold( '\nBackground colors' ) ) print( 'bg default:', font.default_bgcolor() + ' text ', 'post' ) print( 'bg black: ', font.black_bg ( ' text ' ), 'post' ) print( 'bg red: ', font.red_bg ( ' text ' ), 'post' ) print( 'bg green: ', font.green_bg ( ' text ' ), 'post' ) print( 'bg yellow: ', font.yellow_bg ( ' text ' ), 'post' ) print( 'bg blue: ', font.blue_bg ( ' text ' ), 'post' ) print( 'bg magenta:', font.magenta_bg( ' text ' ), 'post' ) print( 'bg cyan: ', font.cyan_bg ( ' text ' ), 'post' ) print( 'bg gray: ', font.gray_bg ( ' text ' ), 'post' ) print( font.bold( 'bg RGB colors' ) ) print( 'bg red: ', font.bgcolor( 255, 0, 0, ' text ' ), 'post' ) print( 'bg purple: ', font.bgcolor( 148, 33, 147, ' text ' ), 'post' ) print( 'bg orange: ', font.bgcolor( 255, 147, 0, ' text ' ), 'post' ) print( font.bold( '\nBackground colors + bold ("bright")' ) ) print( 'bg black: ', font.bold( font.black_bg ( ' text ' ) ), 'post' ) print( 'bg red: ', font.bold( font.red_bg ( ' text ' ) ), 'post' ) print( 'bg green: ', font.bold( font.green_bg ( ' text ' ) ), 'post' ) print( 'bg yellow: ', font.bold( font.yellow_bg ( ' text ' ) ), 'post' ) print( 'bg blue: ', font.bold( font.blue_bg ( ' text ' ) ), 'post' ) print( 'bg magenta:', font.bold( font.magenta_bg( ' text ' ) ), 'post' ) print( 'bg cyan: ', font.bold( font.cyan_bg ( ' text ' ) ), 'post' ) print( 'bg gray: ', font.bold( font.gray_bg ( ' text ' ) ), 'post' ) print( font.bold( 'bg RGB colors' ) ) print( 'bg red: ', font.bold( font.bgcolor( 255, 0, 0, ' text ' ) ), 'post' ) print( 'bg purple: ', font.bold( font.bgcolor( 148, 33, 147, ' text ' ) ), 'post' ) print( 'bg orange: ', font.bold( font.bgcolor( 255, 147, 0, ' text ' ) ), 'post' ) print( font.bold( '\nCombinations' ) ) # bold + italic, bold + underline print( 'pre ' + font.bold( 'bold ' + font.italic( 'bold-italic' ) + ' bold' ) + ' normal' ) print( 'pre ' + font.bold( 'bold ' + font.underline( 'bold-underline' ) + ' bold' ) + ' normal' ) # italic + bold, italic + underline print( 'pre ' + font.italic( 'italic ' + font.bold( 'italic-bold' ) + ' italic' ) + ' normal' ) print( 'pre ' + font.italic( 'italic ' + font.underline( 'italic-underline' ) + ' italic' ) + ' normal' ) # underline + bold, underline + italic print( 'pre ' + font.underline( 'underline ' + font.bold( 'underline-bold' ) + ' underline' ) + ' normal' ) print( 'pre ' + font.underline( 'underline ' + font.italic( 'underline-italic' ) + ' underline' ) + ' normal' ) # bold + italic + underline print( 'pre ' + font.bold( 'bold ' + font.underline( 'bold-underline ' + font.italic( 'bold-italic-underline' ) + ' bold-underline' ) + ' bold' ) + ' normal' ) # bold + fg color, bold + bg color print( 'pre ' + font.bold( 'bold ' + font.red( 'bold-red' ) + ' bold' ) + ' normal' ) print( 'pre ' + font.bold( 'bold ' + font.red_bg( 'bold/red' ) + ' bold' ) + ' normal' ) # colors: fg + bg, bg + fg, negative bg + fg print( 'pre ' + font.red( 'red ' + font.yellow_bg( 'red/yellow' ) + ' red' ) + ' normal' ) print( 'pre ' + font.red_bg( 'black/red ' + font.yellow( 'yellow/red' ) + ' black/red' ) + ' normal' ) print( 'pre ' + font.negative( 'negative ' + font.red_bg( 'black/red ' + font.yellow( 'yellow/red' ) + ' black/red' ) + ' negative' ) + ' normal' ) # end lapackpp-2024.10.26/config/blas.cc000066400000000000000000000020661470720400500164030ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include #include "config.h" #define BLAS_ddot FORTRAN_NAME( ddot, DDOT ) // result return directly #ifdef __cplusplus extern "C" #endif double BLAS_ddot( const blas_int* n, const double* x, const blas_int* incx, const double* y, const blas_int* incy ); int main() { // If blas_int is 32-bit, but BLAS actually interprets it as 64-bit, // BLAS will see n = 0x500000005 and segfault. // If blas_int is 64-bit, BLAS can interpret it as 32-bit or 64-bit // to see n = 5 and pass. blas_int n[] = { 5, 5 }, ione = 1; double x[] = { 1, 2, 3, 4, 5 }; double y[] = { 5, 4, 3, 2, 1 }; double result = BLAS_ddot( n, x, &ione, y, &ione ); bool okay = (result == 35); printf( "%s\n", okay ? "ok" : "failed" ); return ! okay; } lapackpp-2024.10.26/config/cblas.cc000066400000000000000000000031261470720400500165440ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #if defined(BLAS_HAVE_MKL) || defined(LAPACK_HAVE_MKL) #if (defined(BLAS_ILP64) || defined(LAPACK_ILP64)) && ! defined(MKL_ILP64) #define MKL_ILP64 #endif #include #elif defined(BLAS_HAVE_ESSL) || defined(LAPACK_HAVE_ESSL) #if (defined(BLAS_ILP64) || defined(LAPACK_ILP64)) && ! defined(_ESV6464) #define _ESV6464 #endif #include #elif defined(BLAS_HAVE_ACCELERATE) || defined(LAPACK_HAVE_ACCELERATE) // On macOS, the official way to include cblas is via Accelerate.h. // Unfortunately with Xcode 10.3 and GNU g++ 9.3, that doesn't compile. // If we can find cblas.h, use it, otherwise use Accelerate.h. #if defined(BLAS_HAVE_ACCELERATE_CBLAS_H) || defined(LAPACK_HAVE_ACCELERATE_CBLAS_H) #include #else #include #endif #else #ifdef __cplusplus // Some ancient cblas.h don't include extern C. It's okay to nest. extern "C" { #include } #else #include #endif #endif int main() { int n = 5; double x[] = { 1, 2, 3, 4, 5 }; double y[] = { 5, 4, 3, 2, 1 }; double result = cblas_ddot( n, x, 1, y, 1 ); bool okay = (result == 35); printf( "%s\n", okay ? "ok" : "failed" ); return ! okay; } lapackpp-2024.10.26/config/compiler_cxx.cc000066400000000000000000000032561470720400500201600ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #ifdef __cplusplus #include #else #include #endif int main() { // xlc must come before clang // clang and icc must come before gcc // icpx and icx must come before clang const char* compiler = #ifdef __cplusplus // IBM's documentation says __IBMCPP__, // but xlc -qshowmacros shows __ibmxl_version__. #if defined(__IBMCPP__) || defined(__ibmxl_version__) "xlc++"; #elif defined(_CRAYC) "cray"; #elif defined(__ICC) "icpc"; #elif defined(__INTEL_LLVM_COMPILER) "icpx"; #elif defined(_MSC_VER) "MSC"; #elif defined(__clang__) "clang++"; #elif defined(__GNUG__) "g++"; #else "unknown C++"; #endif #else #if defined(__IBMC__) || defined(__ibmxl_version__) "xlc"; #elif defined(_CRAYC) "cray"; #elif defined(__ICC) "icc"; #elif defined(__INTEL_LLVM_COMPILER) "icx"; #elif defined(_MSC_VER) "MSC"; #elif defined(__clang__) "clang"; #elif defined(__GNUC__) "gcc"; #else "unknown C"; #endif #endif #ifdef __cplusplus std::cout << compiler << "\n"; #else printf( "%s\n", compiler ); #endif return 0; } lapackpp-2024.10.26/config/config.h000066400000000000000000000026241470720400500165710ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #ifndef CONFIG_H #define CONFIG_H #include //------------------------------------------------------------------------------ #if defined(FORTRAN_UPPER) || defined(BLAS_FORTRAN_UPPER) || defined(LAPACK_FORTRAN_UPPER) #define FORTRAN_NAME( lower, UPPER ) UPPER #elif defined(FORTRAN_LOWER) || defined(BLAS_FORTRAN_LOWER) || defined(LAPACK_FORTRAN_LOWER) #define FORTRAN_NAME( lower, UPPER ) lower #elif defined(FORTRAN_ADD_) || defined(BLAS_FORTRAN_ADD_) || defined(LAPACK_FORTRAN_ADD_) #define FORTRAN_NAME( lower, UPPER ) lower ## _ #else #error "must define one of FORTRAN_ADD_, FORTRAN_LOWER, FORTRAN_UPPER" #endif //------------------------------------------------------------------------------ #if defined(BLAS_ILP64) || defined(LAPACK_ILP64) typedef int64_t blas_int; typedef int64_t lapack_int; #else typedef int blas_int; typedef int lapack_int; #endif //------------------------------------------------------------------------------ #ifndef BLAS_FORTRAN_STRLEN_END #define BLAS_FORTRAN_STRLEN_END #endif #ifndef LAPACK_FORTRAN_STRLEN_END #define LAPACK_FORTRAN_STRLEN_END #endif #endif // CONFIG_H lapackpp-2024.10.26/config/config.py000066400000000000000000001035441470720400500167750ustar00rootroot00000000000000# Copyright (c) 2017-2023, University of Tennessee. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # This program is free software: you can redistribute it and/or modify it under # the terms of the BSD 3-Clause license. See the accompanying LICENSE file. from __future__ import print_function import os import shlex import subprocess from subprocess import PIPE import math import sys import time import re import tarfile import argparse import shutil # This relative import syntax works in both python2 and 3. from .ansicodes import font # Python 3 renames raw_input => input. if (sys.version_info.major < 3): input = raw_input #------------------------------------------------------------------------------- def urlretrieve( url, filename ): ''' Downloads url and saves to filename. Works for both Python 2 and 3, which differ in where urlretrieve is located. ''' if (sys.version_info.major >= 3): import urllib.request as urllib_request else: import urllib as urllib_request urllib_request.urlretrieve( url, filename ) # end #------------------------------------------------------------------------------- interactive_ = False # Function to get and set interactive flag. If True, config finds all possible # values and gives user a choice. If False, config picks the first valid value. # value = interactive() returns value of interactive. # interactive( value ) sets value of interactive. # Making this a function config.interactive() avoids issues with the # package __init__.py importing it if it were a variable. def interactive( value=None ): global interactive_ if (value is not None): interactive_ = value return interactive_ # end # ------------------------------------------------------------------------------ debug_ = False def debug( value=None ): global debug_ if (value is not None): debug_ = value return debug_ # end # ------------------------------------------------------------------------------ namespace_ = None def namespace( value ): return namespace_ def define( var, value=None ): txt = '-D' + namespace_ + '_' + var if (value): txt += '=' + value return txt # ------------------------------------------------------------------------------ # variables to replace instead of appending/prepending replace_vars = ['CC', 'CXX', 'NVCC', 'FC', 'AR', 'RANLIB', 'prefix'] # ------------------------------------------------------------------------------ # map file extensions to languages lang_map = { '.c': 'CC', '.cc': 'CXX', '.cxx': 'CXX', '.cpp': 'CXX', '.cu': 'NVCC', '.f': 'FC', '.f90': 'FC', '.f77': 'FC', '.F90': 'FC', '.F77': 'FC', } # ------------------------------------------------------------------------------ # map languages to compiler flags flag_map = { 'CC': 'CFLAGS', 'CXX': 'CXXFLAGS', 'NVCC': 'NVCCFLAGS', 'FC': 'FFLAGS', } # ------------------------------------------------------------------------------ def flatten( data, ltypes=(list, tuple) ): ''' Flattens nested list or tuple. Ex: flatten( [1, 2, [3, [4, 5], 6]] ) returns [1, 2, 3, 4, 5, 6] see http://rightfootin.blogspot.com/2006/09/more-on-python-flatten.html ''' ltype = type(data) data = list(data) i = 0 while i < len(data): while isinstance(data[i], ltypes): if not data[i]: data.pop(i) i -= 1 break else: data[i:i + 1] = data[i] i += 1 return ltype(data) # end #------------------------------------------------------------------------------- def get( dictionary, key ): ''' Returns dictionary[ key ] or '' ''' if (key in dictionary): return dictionary[ key ] else: return '' # end #------------------------------------------------------------------------------- def print_header( header ): ''' Prints a header, with bold font, both to console and the log. ''' txt = font.bold( header ) print( '\n' + '-'*80 + '\n' + txt, file=log ) print( '\n' + txt ) # end #------------------------------------------------------------------------------- def print_subhead( subhead ): ''' Prints a subhead, both to console and the log. ''' print( '-'*40 + '\n' + subhead, file=log ) print( subhead ) # end #------------------------------------------------------------------------------- def print_msg( msg ): ''' Prints msg, both to console and the log. ''' print( msg, file=log ) print( msg ) # end #------------------------------------------------------------------------------- def print_warn( msg ): ''' Prints warning msg, with bold red font, both to console and the log. ''' txt = font.bold( font.red( 'Warning: ' + msg ) ) print( txt, file=log ) print( txt ) # end #------------------------------------------------------------------------------- def print_test( label ): ''' If label is given, prints the label, both to console and the log. On the console, it doesn't print the trailing newline; a subsequent print_result() will print it. If no label is given, does nothing. This simplifies functions like compile_obj that take an optional label to print. ''' if (label): print( '-'*20 + '\n' + label, file=log ) print( '%-72s' % label, end='' ) sys.stdout.flush() # end #------------------------------------------------------------------------------- def print_result( label, rc, extra='' ): ''' If label is given, prints either "yes" (if rc == 0) or "no" (otherwise). Extra is printed after yes or no. If no label is given, does nothing. @see print_test(). ''' if (label): if (rc == 0): print( font.blue( 'yes' ), extra, file=log ) print( font.blue( ' yes' ), extra ) else: print( font.red( 'no' ), extra, file=log ) print( font.red( ' no' ), extra ) # end # ------------------------------------------------------------------------------ # Used for all errors. # Allows Python Exceptions to fall through, giving tracebacks. class Error( Exception ): pass class Quit( Error ): pass #------------------------------------------------------------------------------- class Environments( object ): ''' Manages stack of environments, which are dictionaries of name=value pairs. ''' # ---------------------------------------- def __init__( self ): ''' Initializes the environment stack. The bottom is os.environ. The top is an empty environment. ''' self.stack = [ os.environ, {} ] # ---------------------------------------- def push( self, env=None ): ''' Push an empty enviroment on the environment stack. If env is given, also merge env into the environment stack. ''' self.stack.append( {} ) if (env): self.merge( env ) # ---------------------------------------- def top( self ): ''' Return top-most environment in the environment stack. ''' return self.stack[-1] # ---------------------------------------- def pop( self ): ''' Remove the top-most environment from the environment stack. ''' if (len(self.stack) == 2): raise Error( "can't pop last 2 environments" ) return self.stack.pop() # ---------------------------------------- def __contains__( self, key ): ''' Returns true if a key exists in the environment stack. ''' for env in self.stack[::-1]: if (key in env): return True return False # ---------------------------------------- def __getitem__( self, key ): ''' Returns the value of the key, searching from the top of the environment stack down. As in a Makefile, unknown keys return empty string (''). Use 'x in environ' to test whether a key exists. ''' for env in self.stack[::-1]: if (key in env): return env[ key ] return '' # ---------------------------------------- def __setitem__( self, key, value ): ''' Sets the key's value in the top-most environment in the environment stack. ''' self.stack[ -1 ][ key ] = value # ---------------------------------------- def append( self, key, val ): ''' Append val to key's value, saving the result in the top-most environment in the enviornment stack. ''' orig = self[ key ] if (val): if (orig): val = orig + ' ' + val self[ key ] = val return orig # ---------------------------------------- def prepend( self, key, val ): ''' Prepend val to key's value, saving the result in the top-most environment in the enviornment stack. ''' orig = self[ key ] if (val): if (orig): val = val + ' ' + orig self[ key ] = val return orig # ---------------------------------------- def merge( self, env ): ''' Merges env, a dictionary of environment variables, into the existing environment stack. For most variables, the value in env is appended to any existing value. For LIBS, the value is prepended. For variables in config.replace_vars (like CXX), the value in env replaces the existing value. ''' for key in env: if (key in replace_vars): self[ key ] = env[ key ] elif (key == 'LIBS'): self.prepend( key, env[ key ] ) else: self.append( key, env[ key ] ) # end #------------------------------------------------------------------------------- def choose( prompt, choices ): ''' Asks the user to choose among the given choices. Returns the index of the chosen item in the range [0, len(choices)-1], or raises Error or Quit exceptions. ''' choices = list( choices ) n = len( choices ) if (n == 0): print( font.bold( font.red( 'none found' ) ) ) raise Error elif (n == 1): ##print() return 0 else: width = int( math.log10( n ) + 1 ) print( '\n' + prompt ) for i in range( n ): print( '[%*d] %s' % (width, i+1, choices[i]) ) while (True): print( 'Enter [1-%d] or quit: ' % (n), end='' ) sys.stdout.flush() i = input() if (i == 'q' or i == 'quit'): raise Quit try: i = int( i ) except: i = -1 if (i >= 1 and i <= len( choices )): ##print() return i-1 # end # end # end #------------------------------------------------------------------------------- def run( cmd, env=None ): ''' Runs the command cmd. cmd can be a string or a nested list. Pushes env beforehand and pops afterward. stdout and stderr are written to the log. Returns (return_code, stdout, stderr) from the command. Ex: run( ['gcc', '-c', 'file.c'], {'CPATH': '/opt/include'} ) runs: gcc -c file.c ''' environ.push( env ) if (not isinstance( cmd, str )): cmd = ' '.join( flatten( cmd )) print( '>>>', cmd, file=log ) cmd_list = shlex.split( cmd ) try: proc = subprocess.Popen( cmd_list, stdout=PIPE, stderr=PIPE ) (stdout, stderr) = proc.communicate() stdout = stdout.decode('utf-8') stderr = stderr.decode('utf-8') rc = proc.wait() log.write( stdout ) if (stderr): log.write( font.red( stderr ) ) print( 'exit status = %d' % rc, file=log ) except Exception as ex: print( 'Exception:', str(ex), file=log ) rc = -1 stdout = '' stderr = str(ex) environ.pop() return (rc, stdout, stderr) # end #------------------------------------------------------------------------------- def compile_obj( src, env=None, label=None ): ''' Compiles source file src into an object (.o) file. Pushes env beforehand and pops afterwards. If label is given, prints label & result. Returns (return_code, stdout, stderr) from the compiler. Ex: compile_obj( 'foo.c', {'CC': 'gcc'}, 'Test foo' ) runs: gcc $CFLAGS -c foo.c -o foo.o ''' environ.push( env ) print_test( label ) (base, ext) = os.path.splitext( src ) obj = base + '.o' lang = lang_map[ ext ] compiler = environ[ lang ] flags = environ[ flag_map[ lang ]] (rc, stdout, stderr) = run([ compiler, flags, '-c', src, '-o', obj ]) print_result( label, rc ) environ.pop() return (rc, stdout, stderr) # end #------------------------------------------------------------------------------- def link_exe( src, env=None, label=None ): ''' Links the object file (.o) associated with the source file src into an executable. Assumes compile_obj( src ) was called previously to generate the object file. Pushes env beforehand and pops afterward. If label is given, prints label & result. Returns (return_code, stdout, stderr) from the compiler. Ex: link_exe( 'foo.c', {'CC': 'gcc'}, 'Test foo' ) runs: gcc $LDFLAGS $LIBS foo.o -o foo ''' environ.push( env ) print_test( label ) (base, ext) = os.path.splitext( src ) obj = base + '.o' lang = lang_map[ ext ] compiler = environ[ lang ] LDFLAGS = environ['LDFLAGS'] LIBS = environ['LIBS'] or environ['LDLIBS'] (rc, stdout, stderr) = run([ compiler, obj, '-o', base, LDFLAGS, LIBS ]) print_result( label, rc ) environ.pop() return (rc, stdout, stderr) # end #------------------------------------------------------------------------------- def compile_exe( src, env=None, label=None ): ''' Compiles source file src into an object file via compile_obj(), then links it into an exe. Ex: compile_exe( 'foo.c', {'CC': 'gcc'}, 'Test foo' ) runs: gcc $CFLAGS -c foo.c -o foo.o gcc $LDFLAGS $LIBS foo.o -o foo ''' environ.push( env ) print_test( label ) (base, ext) = os.path.splitext( src ) obj = base + '.o' lang = lang_map[ ext ] compiler = environ[ lang ] LDFLAGS = environ['LDFLAGS'] LIBS = environ['LIBS'] or environ['LDLIBS'] (rc, stdout, stderr) = compile_obj( src ) if (rc == 0): (rc, stdout, stderr) = run([ compiler, obj, '-o', base, LDFLAGS, LIBS ]) print_result( label, rc ) environ.pop() return (rc, stdout, stderr) # end #------------------------------------------------------------------------------- # Ex: # compile_run( 'foo.c', {'CC': 'gcc'}, 'Test foo' ) def compile_run( src, env=None, label=None ): ''' Compiles source file src into an object file and exe via compile_exe(), then executes the exe. Ex: compile_exe( 'foo.c', {'CC': 'gcc'}, 'Test foo' ) runs: gcc $CFLAGS -c foo.c -o foo.o gcc $LDFLAGS $LIBS foo.o -o foo ./foo ''' environ.push( env ) print_test( label ) (base, ext) = os.path.splitext( src ) (rc, stdout, stderr) = compile_exe( src ) if (rc == 0): (rc, stdout, stderr) = run( './' + base ) print_result( label, rc ) environ.pop() return (rc, stdout, stderr) # end #------------------------------------------------------------------------------- def run_exe( src, env=None, label=None ): ''' Runs the exe associated with src. Assumes compile_exe( src ) was called previously to generate the exe. Ex: run_exe( 'foo.c', {'CC': 'gcc'}, 'Test foo' ) runs: ./foo ''' environ.push( env ) print_test( label ) (base, ext) = os.path.splitext( src ) (rc, stdout, stderr) = run( './' + base ) print_result( label, rc ) environ.pop() return (rc, stdout, stderr) # end #------------------------------------------------------------------------------- def prog_cxx( choices=['g++', 'c++', 'CC', 'cxx', 'icpc', 'xlc++', 'clang++'] ): ''' Searches for available C++ compilers from the list of choices. Sets CXX to the chosen one. ''' print_header( 'C++ compiler' ) cxx = environ['CXX'] if (cxx): print( 'Trying $CXX =', cxx ) choices = [ cxx ] passed = [] # CXX compilers, e.g., g++ or mpicxx actual = [] # Detected underlying compilers, e.g., g++ or clang++ for cxx in choices: print_test( cxx ) (rc, out, err) = compile_run( 'config/compiler_cxx.cc', {'CXX': cxx} ) # print (g++), (clang++), etc., as output by compiler_cxx, after yes if (rc == 0): cxx_actual = out.strip() out = '(' + cxx_actual + ')' actual.append( cxx_actual ) print_result( cxx, rc, out ) if (rc == 0): passed.append( cxx ) if (not interactive()): break # end # end i = choose( 'Choose C++ compiler:', passed ) environ['CXX'] = passed[i] environ['CXX_actual'] = actual[i] # end #------------------------------------------------------------------------------- def prog_cxx_flag( flags ): ''' Tests each flag in flags; the first that passes is added to CXXFLAGS. flags can be an individual string or an iterable (list, tuple, etc.). ''' if (type( flags ) == str): flags = [ flags ] # end for flag in flags: print_test( flag ) (rc, out, err) = compile_obj( 'config/compiler_cxx.cc', {'CXXFLAGS': flag} ) # assume a mention of the flag in stderr means it isn't supported if (flag in err): rc = 1 print_result( flag, rc ) if (rc == 0): environ.append( 'CXXFLAGS', flag ) break # end # end #------------------------------------------------------------------------------- def openmp( flags=['-fopenmp', '-qopenmp', '-openmp', '-omp', ''] ): ''' Tests for OpenMP support with one of the given flags. If a flag works, it is added to both CXXFLAGS and LDFLAGS. ''' print_header( 'OpenMP support' ) src = 'config/openmp.cc' for flag in flags: print_test( flag ) env = {'CXXFLAGS': flag, 'LDFLAGS': flag, 'HAS_OPENMP': True} (rc, out, err) = compile_run( src, env ) print_result( flag, rc ) if (rc == 0): environ.merge( env ) break # end # end #------------------------------------------------------------------------------- def cublas_library(): ''' Tests for linking CUDA and cuBLAS libraries. Does not actually run the resulting exe, to allow compiling with CUDA on a machine without GPUs. ''' # Find CUDA to add -I, -L, -rpath flags. # CUDA_PATH is used in NVIDIA Getting Started documentation; # CUDA_HOME is used in Spack CUDA package; # else infer from `which nvcc`. cuda_path = environ['CUDA_PATH'] if (not cuda_path): cuda_path = environ['CUDA_HOME'] if (not cuda_path): nvcc_path = shutil.which( 'nvcc' ) if (nvcc_path): (bin_path, nvcc) = os.path.split( nvcc_path ) (cuda_path, bin_) = os.path.split( bin_path ) cxxflags = define('HAVE_CUBLAS') ldflags = '' libs = '-lcusolver -lcublas -lcudart' if (cuda_path): incdir = os.path.join( cuda_path, 'include' ) if (os.path.exists( incdir )): cxxflags += ' -I' + incdir libdir = os.path.join( cuda_path, 'lib64' ) if (not os.path.exists( libdir )): libdir = os.path.join( cuda_path, 'lib' ) if (os.path.exists( libdir )): ldflags += '-L' + libdir + ' -Wl,-rpath,' + libdir # end print_subhead( 'CUDA and cuBLAS libraries' ) print_test( ' ' + cxxflags + ' ' + ldflags + ' ' + libs ) env = {'CXXFLAGS': cxxflags, 'LDFLAGS': ldflags, 'LIBS': libs} (rc, out, err) = compile_exe( 'config/cublas.cc', env ) print_result( libs, rc ) if (rc == 0): environ.merge( env ) else: raise Error( 'cuBLAS not found' ) # end #------------------------------------------------------------------------------- def rocblas_library(): ''' Tests for linking ROCm/HIP and rocBLAS libraries. Does not actually run the resulting exe, to allow compiling with ROCm on a machine without GPUs. ''' # Find ROCm to add -I, -L, -rpath flags. # ROCM_PATH is used in hipcc and Spack ROCm package; # else infer from `which hipcc`. rocm_path = environ['ROCM_PATH'] if (not rocm_path): hipcc_path = shutil.which( 'hipcc' ) if (hipcc_path): (bin_path, hipcc) = os.path.split( hipcc_path ) (rocm_path, bin_) = os.path.split( bin_path ) cxxflags = define('HAVE_ROCBLAS') ldflags = '' libs = '-lrocsolver -lrocblas -lamdhip64' if (rocm_path): incdir = os.path.join( rocm_path, 'include' ) if (os.path.exists( incdir )): cxxflags += ' -I' + incdir # Some versions of ROCm (5.1.3) have both lib and lib64 directories; # we need the lib directory. libdir = os.path.join( rocm_path, 'lib' ) if (not os.path.exists( libdir )): libdir = os.path.join( rocm_path, 'lib64' ) if (os.path.exists( libdir )): ldflags += ' -L' + libdir + ' -Wl,-rpath,' + libdir # end print_subhead( 'HIP/ROCm and rocBLAS libraries' ) print_test( ' ' + cxxflags + ' ' + ldflags + ' ' + libs ) env = {'CXXFLAGS': cxxflags, 'LDFLAGS': ldflags, 'LIBS': libs} (rc, out, err) = compile_exe( 'config/rocblas.cc', env ) print_result( libs, rc ) if (rc == 0): environ.merge( env ) else: raise Error( 'rocBLAS not found' ) # end #------------------------------------------------------------------------------- def sycl_onemkl_library(): ''' Tests for linking SYCL and oneMKL library. Does not actually run the resulting exe, to allow compiling on a machine without GPUs. ''' libs = '-lmkl_sycl -lsycl -lOpenCL' print_subhead( 'SYCL and oneMKL libraries' ) print_test( ' ' + libs ) # Intel compiler vars.sh defines $CMPLR_ROOT root = environ['CMPLR_ROOT'] or environ['CMPROOT'] inc = '' if (root): inc = '-I' + root + '/linux/include ' \ + '-I' + root + '/linux/include/sycl ' env = {'LIBS': libs, 'CXXFLAGS': inc + define('HAVE_SYCL') + ' -fsycl -fp-model=precise' } (rc, out, err) = compile_exe( 'config/onemkl.cc', env ) print_result( libs, rc ) if (rc == 0): environ.merge( env ) else: raise Error( 'oneMKL not found' ) # end #------------------------------------------------------------------------------- def gpu_blas(): gpu_backend = environ['gpu_backend'] or 'auto' print_header( 'GPU BLAS libraries: gpu_backend = ' + gpu_backend ) test_auto = re.search( r'\b(auto)\b', gpu_backend ) test_cuda = re.search( r'\b(cuda)\b', gpu_backend ) or test_auto test_rocm = re.search( r'\b(hip|rocm)\b', gpu_backend ) or test_auto test_sycl = re.search( r'\b(sycl)\b', gpu_backend ) or test_auto #----- CUDA gpu_blas_found = False if (test_cuda): try: cublas_library() gpu_blas_found = True except Error as ex: if (gpu_backend == 'cuda'): raise ex # fatal else: print_msg( font.red( 'skipping CUDA search' ) ) #----- ROCm if (not gpu_blas_found and test_rocm): try: rocblas_library() gpu_blas_found = True except Error as ex: if (gpu_backend in ('hip', 'rocm')): raise ex # fatal else: print_msg( font.red( 'skipping HIP/ROCm search' ) ) #----- SYCL if (not gpu_blas_found and test_sycl): try: sycl_onemkl_library() gpu_blas_found = True except Error as ex: if (gpu_backend == 'sycl'): raise ex # fatal else: print_msg( font.red( 'skipping SYCL search' ) ) if (not gpu_blas_found): print_warn( 'No GPU BLAS library found' ) # end #------------------------------------------------------------------------------- def get_package( name, directories, unique_file, repo_url, tar_url, tar_filename ): ''' Searches for a package, generally used for internal packages. Looks for a directory from given list of directories. It checks for existence of unique_file in the directory, to ensure the directory actually contains the source. If found, returns that directory. If none found, tries to 'git clone repo_url' to the last directory. If that fails, tries to download tar_url and unpack it to the last directory. ''' global log print_header( name ) for directory in directories: path = os.path.join( directory, unique_file ) print_test( path ) err = not os.path.exists( path ) print_result( directory, err ) if (not err): return directory # end if (repo_url): if (interactive()): print( name +' not found; git clone '+ repo_url +'? [Y/n] ', end='' ) sys.stdout.flush() i = input().lower() if (not interactive() or i in ('', 'y', 'yes')): cmd = 'git clone '+ repo_url +' '+ directory print_test( 'download: ' + cmd ) (err, stdout, stderr) = run( cmd ) print_result( 'download', err ) if (not err): return directory # end if (tar_url): if (interactive()): print( name +' not found; download from '+ tar_url +'? [Y/n] ', end='' ) sys.stdout.flush() i = input().lower() if (not interactive() or i in ('', 'y', 'yes')): try: print_test( 'download: '+ tar_url +' as '+ tar_filename ) urlretrieve( tar_url, tar_filename ) print( 'untar', tar_filename, file=log ) tar = tarfile.open( tar_filename ) files = tar.getnames() last = '' for f in files: # sanitize file names: disallow beginning with / or having ../ if (re.search( r'^/|\.\./', f )): print( 'skipping', f ) continue tar.extract( f ) lastfile = f # end # rename directory, # e.g., from icl-testsweeper-dbd960ebf706 to testsweeper # todo: os.path.sep intsead of '/'? dirs = re.split( '/', lastfile ) print( 'rename', dirs[0], directory, file=log ) os.rename( dirs[0], directory ) err = 0 except Exception as ex: print( 'Exception:', str(ex), file=log ) # end print_result( 'download', err ) if (not err): return directory # end # end # otherwise, not found return None # end #------------------------------------------------------------------------------- def extract_defines_from_flags( flags='CXXFLAGS', var='HEADER_DEFINES' ): ''' Extracts all "-Dname[=value]" defines from the given flags. Adds all "-Dname[=value]" defines to DEFINES. Adds all "#define name [value]" defines to HEADER_DEFINES. Stores all name=value defines for autoconf-like "#undef name" substitution in output_files(). ''' global environ, defines exp = r'(-D(\w+)(?:=(\S*))?) *' defs = re.findall( exp, environ[ flags ] ) environ[ flags ] = re.sub( exp, '', environ[ flags ] ).strip() header = '' for (name_value, name, value) in defs: environ.append( 'DEFINES', name_value ) defines[ name ] = value if (value): header += '#define '+ name +' '+ value + '\n' else: header += '#define '+ name + '\n' # end environ[ var ] = header # end #------------------------------------------------------------------------------- def sub_env( match ): ''' Given a re (regular expression) match object, returns value of environment variable. Used in output_files(). ''' return environ[ match.group(1) ] #------------------------------------------------------------------------------- def sub_define( match ): ''' Given a re regexp match object, returns "#define name [value]" or "// #undef name" Used in output_files(). ''' global defines name = match.group(1) if (name in defines): value = defines[ name ] if (value): return '#define '+ name +' '+ value else: return '#define '+ name else: return '// #undef '+ name # end #------------------------------------------------------------------------------- def read( filename ): ''' Reads and returns the entire contents of filename. ''' f = open( filename, 'r' ) txt = f.read() f.close() return txt # end #------------------------------------------------------------------------------- def write( filename, txt ): ''' Writes txt to filename. ''' f = open( filename, 'w' ) f.write( txt ) f.close() # end #------------------------------------------------------------------------------- def output_files( files ): ''' Create each file in files from file.in, substituting @foo@ with variable foo. This avoids re-creating the file if the contents did not change. files can be a single file or list of files. ''' print_header( 'Output files' ) if (isinstance( files, str )): files = [ files ] for fname in files: txt = read( fname + '.in' ) txt = re.sub( r'@(\w+)@', sub_env, txt ) txt = re.sub( r'#undef (\w+)', sub_define, txt ) exists = os.path.exists( fname ) if (exists and txt == read( fname )): print( fname, 'is unchanged' ) else: if (exists): bak = fname + '.bak' print( 'backing up', fname, 'to', bak ) os.rename( fname, bak ) # end print( 'creating', fname ) write( fname, txt ) # end # end # end #------------------------------------------------------------------------------- def parse_args(): ''' Parses command line options. Sets if interactive and if ansicodes are enabled. ''' global opts, parser, debug #-------------------- # Parse command line. We'll handle help ourselves. parser = argparse.ArgumentParser( add_help=False ) parser.add_argument( '-i', '--interactive', action='store_true', help='Find all available choices and ask user which to use;' +' otherwise use first choice found.' ) parser.add_argument( '--color', action='store', default='auto', help='Use ANSI colors: yes, no, or auto; default %(default)s.' ) parser.add_argument( '--debug', action='store_true', help='Enable debugging output.' ) parser.add_argument( '-h', '--help', action='store_true', help='Print help and exit.' ) parser.add_argument( 'options', nargs=argparse.REMAINDER, help='name=value pairs of options to define.' ) opts = parser.parse_args() # Parse name=value pairs. for arg in opts.options: s = re.search( '^(\w+)=(.*)', arg ) if (s): environ[ s.group(1) ] = s.group(2) else: print( 'Unknown argument:', arg ) exit(1) # end if (environ['color']): opts.color = environ['color'] font.set_enabled( opts.color ) if (environ['interactive']): opts.interactive = environ['interactive'] if (opts.interactive): interactive( True ) debug( opts.debug ) # end #------------------------------------------------------------------------------- def init( namespace, prefix='/usr/local' ): ''' Initializes config. Opens the logfile and deals with OS-specific issues. ''' global log, namespace_ namespace_ = namespace # Default prefix. if (not environ['prefix']): environ['prefix'] = prefix #-------------------- logfile = 'config/log.txt' print( 'opening log file ' + logfile + '\n' ) log = open( logfile, 'w' ) #-------------------- # Workaround if MacOS SIP may have prevented inheriting DYLD_LIBRARY_PATH. if (sys.platform.startswith('darwin') and 'LD_LIBRARY_PATH' not in os.environ and 'DYLD_LIBRARY_PATH' not in os.environ): txt = font.bold( 'NOTICE: $DYLD_LIBRARY_PATH was not set or not inherited.\n' ) if ('LIBRARY_PATH' in os.environ): os.environ['DYLD_LIBRARY_PATH'] = os.environ['LIBRARY_PATH'] txt += 'Setting $DYLD_LIBRARY_PATH = $LIBRARY_PATH to run test programs.\n' txt += '$LIBRARY_PATH = ' + os.environ['LIBRARY_PATH'] + '\n' else: txt += '$LIBRARY_PATH is not set. Leaving $DYLD_LIBRARY_PATH unset.\n' # end txt += ''' MacOS System Integrity Protection (SIP) prevents configure.py from inheriting $DYLD_LIBRARY_PATH. Using python3 configure.py directly (not via make), with a 3rd party python3 from python.org, Homebrew, etc. (i.e., not /usr/bin/python3), will allow $DYLD_LIBRARY_PATH to be inherited. ''' txt = font.red( txt ) txt += '-'*80 print( txt ) print( txt, file=log ) # end #-------------------- if (opts.help): parser.print_help() exit(0) # end # ------------------------------------------------------------------------------ # Initialize global variables here, rather than in init(), # so they are imported by __init__.py. environ = Environments() environ['argv'] = ' '.join( sys.argv ) environ['datetime'] = time.ctime() defines = {} # Parse command line early, so ANSI codes are enabled or disabled early on. parse_args() lapackpp-2024.10.26/config/cublas.cc000066400000000000000000000057261470720400500167410ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include #include #include #include //------------------------------------------------------------------------------ void error_check_( cudaError_t err, const char* file, int line ) { if (err != cudaSuccess) { printf( "CUDA error %d: %s at %s:%d\n", err, cudaGetErrorString(err), file, line ); exit(1); } } //------------------------------------------------------------------------------ void error_check_( cublasStatus_t err, const char* file, int line ) { if (err != CUBLAS_STATUS_SUCCESS) { printf( "cuBLAS error %d at %s:%d\n", err, file, line ); exit(1); } } #define error_check( err ) \ error_check_( (err), __FILE__, __LINE__ ) //------------------------------------------------------------------------------ int main() { double alpha = 2, beta = 3; int n = 2; double A[] = { 1, 2, 3, 4 }; double B[] = { 5, 4, 3, 2 }; double C[] = { 2, 3, 1, 0 }; double D[] = { 40, 61, 21, 28 }; cudaError_t err = cudaSetDevice( 0 ); if (err != cudaSuccess) { printf( "cudaSetDevice failed: %s (%d).\n" "Cannot run on GPU; skipping test.\n", cudaGetErrorString(err), err ); return 0; } double *dA, *dB, *dC; error_check( cudaMalloc( &dA, n*n*sizeof(double) ) ); error_check( cudaMalloc( &dB, n*n*sizeof(double) ) ); error_check( cudaMalloc( &dC, n*n*sizeof(double) ) ); assert( dA != nullptr ); assert( dB != nullptr ); assert( dC != nullptr ); // dA = A, dB = B, dC = c error_check( cudaMemcpy( dA, A, n*n*sizeof(double), cudaMemcpyDefault ) ); error_check( cudaMemcpy( dB, B, n*n*sizeof(double), cudaMemcpyDefault ) ); error_check( cudaMemcpy( dC, C, n*n*sizeof(double), cudaMemcpyDefault ) ); // C = alpha A B + beta C cublasHandle_t handle; error_check( cublasCreate( &handle ) ); error_check( cublasDgemm( handle, CUBLAS_OP_N, CUBLAS_OP_N, n, n, n, &alpha, dA, n, dB, n, &beta, dC, n ) ); error_check( cublasDestroy( handle ) ); // C = dC error_check( cudaMemcpy( C, dC, n*n*sizeof(double), cudaMemcpyDefault ) ); error_check( cudaFree( dA ) ); error_check( cudaFree( dB ) ); error_check( cudaFree( dC ) ); // verify C == D double result = 0; for (int i = 0; i < n*n; ++i) { printf( "C[%d] = %.2f, D = %.2f\n", i, C[i], D[i] ); result += std::abs( D[i] - C[i] ); } bool okay = (result == 0); printf( "%s\n", okay ? "ok" : "failed" ); return ! okay; } lapackpp-2024.10.26/config/essl_version.cc000066400000000000000000000011711470720400500201710ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include int main() { int v = iessl(); int version = int( v / 1000000 ); int release = int( (v % 1000000) / 10000 ); int modification = int( (v % 10000) / 100 ); int ptf = v % 100; printf( "ESSL_VERSION=%d.%d.%d.%d\n", version, release, modification, ptf ); return 0; } lapackpp-2024.10.26/config/hello.cc000066400000000000000000000005311470720400500165600ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include int main() { printf( "ok\n" ); return 0; } lapackpp-2024.10.26/config/lapack.py000066400000000000000000000670031470720400500167620ustar00rootroot00000000000000# Copyright (c) 2017-2023, University of Tennessee. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # This program is free software: you can redistribute it and/or modify it under # the terms of the BSD 3-Clause license. See the accompanying LICENSE file. from __future__ import print_function import os import re import config from config import print_header, print_subhead, print_msg, print_warn, \ print_test, print_result, define, Error, get #------------------------------------------------------------------------------- def get_fortran_manglings(): ''' Returns list of flags to test different Fortran name manglings. Setting one or more of: fortran_mangling=add_, fortran_mangling=lower, fortran_mangling=upper limits which manglings are returned. Ex: get_fortran_manglings() returns ['-D_FORTRAN_ADD_', '-D_FORTRAN_LOWER', '-D_FORTRAN_UPPER'] ''' # Warn about obsolete settings. if (config.environ['fortran_add_']): print_warn('Variable `fortran_add_` is obsolete; use fortran_mangling=add_') if (config.environ['fortran_lower']): print_warn('Variable `fortran_lower` is obsolete; use fortran_mangling=lower') if (config.environ['fortran_upper']): print_warn('Variable `fortran_upper` is obsolete; use fortran_mangling=upper') # FORTRAN_ADD_, FORTRAN_LOWER, DFORTRAN_UPPER are BLAS++/LAPACK++. manglings = [] fortran_mangling = config.environ['fortran_mangling'].lower() if ('add_' in fortran_mangling): manglings.append( define('FORTRAN_ADD_') ) if ('lower' in fortran_mangling): manglings.append( define('FORTRAN_LOWER') ) if ('upper' in fortran_mangling): manglings.append( define('FORTRAN_UPPER') ) if (not manglings): cxx_actual = config.environ['CXX_actual'] if (cxx_actual == 'xlc++'): # For IBM XL, change default mangling search order to lower, add_, upper, # ESSL includes all 3, but Netlib LAPACK has only one mangling. manglings = [define('FORTRAN_LOWER'), define('FORTRAN_ADD_'), define('FORTRAN_UPPER')] else: # For all others, mangling search order as add_, lower, upper, # since add_ is the most common. manglings = [define('FORTRAN_ADD_'), define('FORTRAN_LOWER'), define('FORTRAN_UPPER')] return manglings # end #------------------------------------------------------------------------------- def get_int_sizes(): ''' Returns list of flags to test different integer sizes. Setting one or more of: blas_int=int blas_int=int64 limits which sizes are returned. Ex: get_int_sizes() returns ['', '-D_ILP64'] where '' is compiler's default, usually 32-bit int in LP64. ''' # todo: repeated from below blas_int = config.environ['blas_int'].lower() test_int = re.search( r'\b(lp64|int|int32|int32_t)\b', blas_int ) is not None test_int64 = re.search( r'\b(ilp64|int64|int64_t)\b', blas_int ) is not None if (not blas_int or blas_int == 'auto'): test_int = True test_int64 = True int_sizes = [] if (test_int): int_sizes.append('') # i.e., default int if (test_int64): int_sizes.append( define('ILP64') ) return int_sizes # end #------------------------------------------------------------------------------- def compile_with_manglings( src, env, manglings, int_sizes ): ''' Tries to compile, link, and run source file src with each of the given manglings and integer sizes. Returns (returncode, stdout, stderr, env_copy) from either the successful run or the last unsuccessful run. Ex: compile_with_manglings( 'test.cc', {'CXXFLAGS': '-Wall'}, ['-D_FORTRAN_ADD_', '-D_FORTRAN_LOWER'], ['', '-D_ILP64'] ) tests: CXX -Wall -D_FORTRAN_ADD_ test.cc CXX -Wall -D_FORTRAN_ADD_ -D_ILP64 test.cc CXX -Wall -D_FORTRAN_LOWER test.cc CXX -Wall -D_FORTRAN_LOWER -D_ILP64 test.cc ''' rc = -1 for mangling in manglings: for size in int_sizes: print_test( ' ' + mangling +' '+ size ) # modify a copy to save in passed env2 = env.copy() env2['CXXFLAGS'] = get(env2, 'CXXFLAGS') +' '+ mangling +' '+ size (rc_link, out, err) = config.compile_exe( 'config/hello.cc', env2 ) # if hello didn't link, assume library not found if (rc_link != 0): print_result( 'label', rc_link ) break (rc, out, err) = config.compile_exe( src, env2 ) # if int32 didn't link, int64 won't either if (rc != 0): print_result( 'label', rc ) break # if int32 runs, skip int64 (rc, out, err) = config.run_exe( src ) print_result( 'label', rc ) if (rc == 0): break # end # break if library not found or on first mangling that works if (rc_link != 0 or rc == 0): break # end return (rc, out, err, env2) # end #------------------------------------------------------------------------------- def blas(): ''' Searches for BLAS in default libraries, MKL, ACML, ESSL, OpenBLAS, and Accelerate. Checks FORTRAN_ADD_, FORTRAN_LOWER, FORTRAN_UPPER. Checks int (LP64) and int64 (ILP64). Setting one or more of: blas = {mkl, acml, essl, openblas, accelerate, generic}; blas_int = {int, int64}; blas_threaded = {y, n}; blas_fortran = {gfortran, ifort}; fortran_mangling = {add_, lower, upper} in the environment or on the command line, limits the search space. ''' print_header( 'BLAS library' ) print_msg( 'Also detects Fortran name mangling and BLAS integer size.' ) # Warn about obsolete settings. if (config.environ['mkl']): print_warn('Variable `mkl` is obsolete; use blas=mkl') if (config.environ['acml']): print_warn('Variable `acml` is obsolete; use blas=acml') if (config.environ['essl']): print_warn('Variable `essl` is obsolete; use blas=essl') if (config.environ['openblas']): print_warn('Variable `openblas` is obsolete; use blas=openblas') if (config.environ['accelerate']): print_warn('Variable `accelerate` is obsolete; use blas=accelerate') if (config.environ['lp64']): print_warn('Variable `lp64` is obsolete; use blas_int=int') if (config.environ['ilp64']): print_warn('Variable `ilp64` is obsolete; use blas_int=int64') #---------------------------------------- # Parse options. BLAS_LIBRARIES = config.environ['BLAS_LIBRARIES'] blas = config.environ['blas'].lower() blas_fortran = config.environ['blas_fortran'].lower() blas_int = config.environ['blas_int'].lower() blas_threaded = config.environ['blas_threaded'].lower() #-------------------- BLAS_LIBRARIES # If testing BLAS_LIBRARIES, ignore other flags (blas, ...). test_blas_libraries = (BLAS_LIBRARIES != '') if (test_blas_libraries): blas = 'none' blas_fortran = '' blas_int = '' blas_threaded = '' if (config.debug()): print( "BLAS_LIBRARIES = '" + BLAS_LIBRARIES + "'\n" + "test_blas_libraries = ", test_blas_libraries, "\n" ) #-------------------- blas test_all = (not blas or blas == 'auto') test_acml = re.search( r'\b(acml)\b', blas ) is not None test_accelerate = re.search( r'\b(apple|accelerate)\b', blas ) is not None test_default = re.search( r'\b(cray|libsci|default)\b', blas ) is not None test_essl = re.search( r'\b(ibm|essl)\b', blas ) is not None test_mkl = re.search( r'\b(intel|mkl)\b', blas ) is not None test_openblas = re.search( r'\b(openblas)\b', blas ) is not None test_generic = re.search( r'\b(generic)\b', blas ) is not None if (config.debug()): print( "blas = '" + blas + "'\n" + "test_acml = ", test_acml, "\n" + "test_accelerate = ", test_accelerate, "\n" + "test_default = ", test_default, "\n" + "test_essl = ", test_essl, "\n" + "test_mkl = ", test_mkl, "\n" + "test_openblas = ", test_openblas, "\n" + "test_generic = ", test_generic, "\n" + "test_all = ", test_all, "\n" ) #-------------------- blas_fortran test_gfortran = re.search( r'\b(gfortran)\b', blas_fortran ) is not None test_ifort = re.search( r'\b(ifort)\b', blas_fortran ) is not None if (not blas_fortran or blas_fortran == 'auto'): test_gfortran = True test_ifort = True if (config.debug()): print( "blas_fortran = '" + blas_fortran + "'\n" + "test_gfortran = ", + test_gfortran, "\n" + "test_ifort = ", + test_ifort, "\n" ) #-------------------- blas_int test_int = re.search( r'\b(lp64|int|int32|int32_t)\b', blas_int ) is not None test_int64 = re.search( r'\b(ilp64|int64|int64_t)\b', blas_int ) is not None if (not blas_int or blas_int == 'auto'): test_int = True test_int64 = True if (config.debug()): print( "blas_int = '" + blas_int + "'\n" + "test_int = ", test_int, "\n" + "test_int64 = ", test_int64, "\n" ) #-------------------- blas_threaded test_threaded = re.search( r'\b(y|yes|true|on|1)\b', blas_threaded ) is not None test_sequential = re.search( r'\b(n|no|false|off|0)\b', blas_threaded ) is not None if (not blas_threaded or blas_threaded == 'auto'): test_threaded = True test_sequential = True if (config.debug()): print( "blas_threaded = '" + blas_threaded + "'\n" + "test_threaded = ", test_threaded, "\n" + "test_sequential = ", test_sequential, "\n" ) #---------------------------------------- # Build list of libraries to check. choices = [] cxx = config.environ['CXX'] cxx_actual = config.environ['CXX_actual'] has_openmp = config.environ['HAS_OPENMP'] #-------------------- BLAS_LIBRARIES if (test_blas_libraries): choices.append( ['BLAS_LIBRARIES', {'LIBS': BLAS_LIBRARIES}] ) #-------------------- default; Cray libsci if (test_all or test_default): # Sometimes BLAS is in default libraries (e.g., on Cray). choices.append( ['Default', {}] ) #-------------------- Intel MKL if (test_all or test_mkl): choices_ifort = [] choices_gfortran = [] if (test_threaded and has_openmp): t_core = ' -lmkl_core -lm' if (test_gfortran and cxx_actual == 'g++'): # GNU compiler + OpenMP: require gnu_thread library. if (test_int): choices_gfortran.append( ['Intel MKL (int, GNU Fortran conventions, threaded)', {'LIBS': '-lmkl_gf_lp64 -lmkl_gnu_thread' + t_core}]) if (test_int64): choices_gfortran.append( ['Intel MKL (int64, GNU Fortran conventions, threaded)', {'LIBS': '-lmkl_gf_ilp64 -lmkl_gnu_thread' + t_core}]) elif (test_ifort and cxx_actual in ('icpc', 'icpx')): # Intel compiler + OpenMP: require intel_thread library. if (test_int): choices_ifort.append( ['Intel MKL (int, Intel Fortran conventions, threaded)', {'LIBS': '-lmkl_intel_lp64 -lmkl_intel_thread' + t_core}]) if (test_int64): choices_ifort.append( ['Intel MKL (int64, Intel Fortran conventions, threaded)', {'LIBS': '-lmkl_intel_ilp64 -lmkl_intel_thread' + t_core}]) else: # MKL doesn't have libraries for other OpenMP backends. print( "Skipping threaded MKL for non-GNU, non-Intel compiler" ) # end threaded if (test_sequential): s_core = ' -lmkl_sequential -lmkl_core -lm' if (test_ifort): if (test_int): choices_ifort.append( ['Intel MKL (int, Intel Fortran conventions, sequential)', {'LIBS': '-lmkl_intel_lp64' + s_core}]) if (test_int64): choices_ifort.append( ['Intel MKL (int64, Intel Fortran conventions, sequential)', {'LIBS': '-lmkl_intel_ilp64' + s_core}]) # end if (test_gfortran): if (test_int): choices_gfortran.append( ['Intel MKL (int, GNU Fortran conventions, sequential)', {'LIBS': '-lmkl_gf_lp64' + s_core}]) if (test_int64): choices_gfortran.append( ['Intel MKL (int64, GNU Fortran conventions, sequential)', {'LIBS': '-lmkl_gf_ilp64' + s_core}]) # end # end # For Intel compilers, prefer Intel fortran interfaces first; # otherwise, prefer GNU fortran interfaces first. if (cxx_actual in ('icpc', 'icpx')): choices.extend( choices_ifort ) choices.extend( choices_gfortran ) else: choices.extend( choices_gfortran ) choices.extend( choices_ifort ) # end mkl #-------------------- IBM ESSL if (test_all or test_essl): if (test_threaded): if (test_int): choices.append( ['IBM ESSL int (lp64), threaded', {'LIBS': '-lesslsmp'}]) if (test_int64): choices.append( ['IBM ESSL int64 (ilp64), threaded', {'LIBS': '-lesslsmp6464'}]) if (test_sequential): if (test_int): choices.append( ['IBM ESSL int (lp64), sequential', {'LIBS': '-lessl'}]) if (test_int64): choices.append( ['IBM ESSL int64 (ilp64), sequential', {'LIBS': '-lessl6464'}]) # end essl #-------------------- OpenBLAS if (test_all or test_openblas): choices.append( ['OpenBLAS', {'LIBS': '-lopenblas'}]) #-------------------- Apple Accelerate if (test_all or test_accelerate): # macOS puts cblas.h in weird places. paths = [ '/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Headers', ] inc = '' for p in paths: if (os.path.exists( p + '/cblas.h' )): inc = '-I' + p + ' ' + define('HAVE_ACCELERATE_CBLAS_H') + ' ' break choices.append( ['MacOS Accelerate', {'LIBS': '-framework Accelerate', 'CXXFLAGS': inc + define('HAVE_ACCELERATE')}]) # end #-------------------- generic -lblas if (test_all or test_generic): choices.append( ['Generic BLAS', {'LIBS': '-lblas'}]) #-------------------- AMD ACML # Deprecated libraries last. if (test_all or test_acml): if (test_threaded): choices.append( ['AMD ACML (threaded)', {'LIBS': '-lacml_mp'}]) if (test_sequential): choices.append( ['AMD ACML (sequential)', {'LIBS': '-lacml'}]) # end #---------------------------------------- # Test choices. manglings = get_fortran_manglings() int_sizes = get_int_sizes() passed = [] print_subhead( 'BLAS (ddot) in:' ) for (label, env) in choices: title = label if ('LIBS' in env): title += '\n ' + env['LIBS'] print_subhead( title ) (rc, out, err, env2) = compile_with_manglings( 'config/blas.cc', env, manglings, int_sizes ) if (rc == 0): passed.append( (label, env2) ) if (not config.interactive()): break # end labels = map( lambda c: c[0], passed ) i = config.choose( 'Choose BLAS library:', labels ) config.environ.merge( passed[i][1] ) # end blas #------------------------------------------------------------------------------- def cblas(): ''' Searches for CBLAS library, first in already found BLAS library, then in -lcblas. Use blas() first to find BLAS library. ''' print_header( 'CBLAS library' ) choices = [ ['CBLAS (cblas_ddot) in BLAS library', {}], ['CBLAS (cblas_ddot) in -lcblas', {'LIBS': '-lcblas'}], ] passed = [] for (label, env) in choices: (rc, out, err) = config.compile_run( 'config/cblas.cc', env, label ) if (rc == 0): passed.append( (label, env) ) break # end labels = map( lambda c: c[0], passed ) i = config.choose( 'Choose CBLAS library:', labels ) config.environ.merge( passed[i][1] ) config.environ.append( 'CXXFLAGS', define('HAVE_CBLAS') ) # end cblas #------------------------------------------------------------------------------- # This code is structured similarly to blas(). def lapack(): ''' Search for LAPACK library, first in already found BLAS libraries, then in -llapack. Use blas() first to find BLAS library. This checks for `pstrf` to ensure we're getting a complete LAPACK, since `pstrf` has been in LAPACK for a long time, but is omitted from some libraries like ESSL and ATLAS that contain only selected routines like `potrf`. ''' print_header( 'LAPACK library' ) #---------------------------------------- # Parse options. LAPACK_LIBRARIES = config.environ['LAPACK_LIBRARIES'] lapack = config.environ['lapack'].lower() #-------------------- LAPACK_LIBRARIES # If testing LAPACK_LIBRARIES, ignore other flags (lapack, ...). test_lapack_libraries = (LAPACK_LIBRARIES != '') if (test_lapack_libraries): lapack = 'none' if (config.debug()): print( "LAPACK_LIBRARIES = '" + LAPACK_LIBRARIES + "'\n" + "test_lapack_libraries = ", test_lapack_libraries, "\n" ) #-------------------- lapack test_all = (not lapack or lapack == 'auto') test_default = re.search( r'\b(default)\b', lapack ) is not None test_generic = re.search( r'\b(generic)\b', lapack ) is not None if (config.debug()): print( "lapack = '" + lapack + "'\n" + "test_default = ", test_default, "\n" + "test_generic = ", test_generic, "\n" + "test_all = ", test_all, "\n" ) #---------------------------------------- # Build list of libraries to check. choices = [] #-------------------- LAPACK_LIBRARIES if (test_lapack_libraries): choices.append( ['LAPACK_LIBRARIES = ' + LAPACK_LIBRARIES, {'LIBS': LAPACK_LIBRARIES}] ) #-------------------- default (e.g., in BLAS library) if (test_all or test_default): choices.append( ['BLAS library', {}] ) #-------------------- generic -llapack if (test_all or test_generic): choices.append( ['generic -llapack', {'LIBS': '-llapack'}]) #---------------------------------------- # Test choices. passed = [] for (label, env) in choices: label = 'LAPACK (dpstrf) in ' + label (rc, out, err) = config.compile_run( 'config/lapack_pstrf.cc', env, label ) if (rc == 0): passed.append( (label, env) ) break # end labels = map( lambda c: c[0], passed ) i = config.choose( 'Choose LAPACK library:', labels ) config.environ.merge( passed[i][1] ) config.environ.append( 'CXXFLAGS', define('HAVE_LAPACK') ) # end lapack #------------------------------------------------------------------------------- def lapacke(): ''' Search for LAPACKE in existing BLAS/LAPACK libraries, found with blas() and lapack(), then in -llapacke. ''' print_header( 'LAPACKE library' ) choices = [ ['LAPACKE (LAPACKE_dpstrf) in LAPACK library', {}], ['LAPACKE (LAPACKE_dpstrf) in -llapacke', {'LIBS': '-llapacke'}], ] passed = [] for (label, env) in choices: (rc, out, err) = config.compile_run( 'config/lapacke_pstrf.cc', env, label ) if (rc == 0): passed.append( (label, env) ) break # end labels = map( lambda c: c[0], passed ) i = config.choose( 'Choose LAPACKE library:', labels ) config.environ.merge( passed[i][1] ) config.environ.append( 'CXXFLAGS', define('HAVE_LAPACKE') ) # end lapacke #------------------------------------------------------------------------------- def blas_float_return(): ''' Normally, float functions like sdot return float. f2c and g77 always returned double, even for float functions like sdot. This affects clapack and MacOS Accelerate. ''' (rc, out, err) = config.compile_run( 'config/return_float.cc', {}, 'BLAS (sdot) returns float as float (standard)' ) if (rc == 0): return (rc, out, err) = config.compile_run( 'config/return_float_f2c.cc', {}, 'BLAS (sdot) returns float as double (f2c convention)' ) if (rc == 0): config.environ.append( 'CXXFLAGS', define('HAVE_F2C') ) else: print_warn( 'unexpected error!' ) # end #------------------------------------------------------------------------------- def blas_complex_return(): ''' For complex valued functions like zdotc, GNU returns complex, while Intel ifort and f2c return the complex in a hidden first argument. ''' (rc, out, err) = config.compile_run( 'config/return_complex.cc', {}, 'BLAS (zdotc) returns complex (GNU gfortran convention)' ) if (rc == 0): return (rc, out, err) = config.compile_run( 'config/return_complex_argument.cc', {}, 'BLAS (zdotc) returns complex as hidden argument (Intel ifort convention)' ) if (rc == 0): config.environ.append( 'CXXFLAGS', define('COMPLEX_RETURN_ARGUMENT') ) else: print_warn( 'unexpected error!' ) # end #------------------------------------------------------------------------------- def lapack_version(): ''' Check for LAPACK version using ilaver(). ''' config.print_test( 'LAPACK version' ) (rc, out, err) = config.compile_run( 'config/lapack_version.cc' ) s = re.search( r'^LAPACK_VERSION=((\d+)\.(\d+)\.(\d+))', out ) if (rc == 0 and s): v = '%d%02d%02d' % (int(s.group(2)), int(s.group(3)), int(s.group(4))) # Don't use define() which adds second LAPACK_. config.environ.append( 'CXXFLAGS', '-DLAPACK_VERSION=' + v ) config.print_result( 'LAPACK', rc, '(' + s.group(1) + ')' ) else: config.print_result( 'LAPACK', rc ) # end #------------------------------------------------------------------------------- def lapack_xblas(): ''' Check for LAPACK routines that use XBLAS in found BLAS/LAPACK libraries. ''' (rc, out, err) = config.compile_run( 'config/lapack_xblas.cc', {}, 'LAPACK XBLAS (dposvxx) in LAPACK library' ) if (rc == 0): config.environ.append( 'CXXFLAGS', define('HAVE_XBLAS') ) # end #------------------------------------------------------------------------------- def lapack_matgen(): ''' Search for LAPACK matrix generation routines (tmglib) in found BLAS/LAPACK libraries, then in -llapacke. ''' choices = [ ['Matrix generation (dlagsy) in LAPACK library', {}], ['Matrix generation (dlagsy) in -ltmglib', {'LIBS': '-ltmglib'}], ] passed = [] for (label, env) in choices: (rc, out, err) = config.compile_run( 'config/lapack_matgen.cc', env, label ) if (rc == 0): config.environ.merge( env ) config.environ.append( 'CXXFLAGS', define('HAVE_MATGEN') ) break # end # end #------------------------------------------------------------------------------- def mkl_version(): ''' Check for MKL version via MKL_Get_Version(). ''' config.print_test( 'MKL version' ) (rc, out, err) = config.compile_run( 'config/mkl_version.cc' ) s = re.search( r'^MKL_VERSION=((\d+)\.(\d+)\.(\d+))', out ) if (rc == 0 and s): config.environ.append( 'CXXFLAGS', define('HAVE_MKL') ) config.print_result( 'MKL', rc, '(' + s.group(1) + ')' ) else: config.print_result( 'MKL', rc ) # end #------------------------------------------------------------------------------- def acml_version(): ''' Check for ACML version via acmlversion(). ''' config.print_test( 'ACML version' ) (rc, out, err) = config.compile_run( 'config/acml_version.cc' ) s = re.search( r'^ACML_VERSION=((\d+)\.(\d+)\.(\d+)\.(\d+))', out ) if (rc == 0 and s): config.environ.append( 'CXXFLAGS', define('HAVE_ACML') ) config.print_result( 'ACML', rc, '(' + s.group(1) + ')' ) else: config.print_result( 'ACML', rc ) # end #------------------------------------------------------------------------------- def essl_version(): ''' Check for ESSL version via iessl(). ''' config.print_test( 'ESSL version' ) (rc, out, err) = config.compile_run( 'config/essl_version.cc' ) s = re.search( r'^ESSL_VERSION=((\d+)\.(\d+)\.(\d+)\.(\d+))', out ) if (rc == 0 and s): config.environ.append( 'CXXFLAGS', define('HAVE_ESSL') ) config.print_result( 'ESSL', rc, '(' + s.group(1) + ')' ) else: config.print_result( 'ESSL', rc ) # end #------------------------------------------------------------------------------- def openblas_version(): ''' Check for OpenBLAS version via OPENBLAS_VERSION constant. ''' config.print_test( 'OpenBLAS version' ) (rc, out, err) = config.compile_run( 'config/openblas_version.cc' ) s = re.search( r'^OPENBLAS_VERSION=.*?((\d+)\.(\d+)\.(\d+))', out ) if (rc == 0 and s): config.environ.append( 'CXXFLAGS', define('HAVE_OPENBLAS') ) config.print_result( 'OpenBLAS', rc, '(' + s.group(1) + ')' ) else: config.print_result( 'OpenBLAS', rc ) # end #------------------------------------------------------------------------------- def vendor_version(): ''' Check for MKL, ACML, ESSL, or OpenBLAS version number in BLAS/LAPACK libraries. ''' # If we can, be smart looking for MKL, ESSL, or OpenBLAS version; # otherwise, check them all. LIBS = config.environ['LIBS'] if ('-lmkl' in LIBS): mkl_version() elif ('-lacml' in LIBS): acml_version() elif ('-lessl' in LIBS): essl_version() elif ('-lopenblas' in LIBS): openblas_version() elif ('-framework Accelerate' in LIBS): pass else: mkl_version() acml_version() essl_version() openblas_version() # end # end lapackpp-2024.10.26/config/lapack_matgen.cc000066400000000000000000000016711470720400500202510ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include "config.h" #define LAPACK_dlagsy FORTRAN_NAME(dlagsy, DLAGSY) #ifdef __cplusplus extern "C" #endif void LAPACK_dlagsy( lapack_int const* n, lapack_int const* k, double const* d, double* a, lapack_int const* lda, lapack_int* iseed, double* work, lapack_int* info ); int main() { const lapack_int n = 5, k = 5; lapack_int iseed[4] = { 0, 1, 2, 3 }; double d[ n ] = { 1, 2, 3, 4, 5 }; double A[ n*n ]; double work[ 2*n ]; lapack_int info = -1234; LAPACK_dlagsy( &n, &k, d, A, &n, iseed, work, &info ); bool okay = (info == 0); printf( "%s\n", okay ? "ok" : "failed" ); return ! okay; } lapackpp-2024.10.26/config/lapack_potrf.cc000066400000000000000000000035431470720400500201300ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include #include "config.h" #define LAPACK_dpotrf_base FORTRAN_NAME( dpotrf, DPOTRF ) #ifdef __cplusplus extern "C" #endif void LAPACK_dpotrf_base( const char* uplo, const lapack_int* n, double* A, const lapack_int* lda, lapack_int* info #ifdef LAPACK_FORTRAN_STRLEN_END , size_t uplo_len #endif ); #ifdef LAPACK_FORTRAN_STRLEN_END #define LAPACK_dpotrf( ... ) LAPACK_dpotrf_base( __VA_ARGS__, 1 ) #else #define LAPACK_dpotrf( ... ) LAPACK_dpotrf_base( __VA_ARGS__ ) #endif //------------------------------------------------------------------------------ int main() { // If lapack_int is 32-bit, but LAPACK actually interprets it as 64-bit, // LAPACK will see n = 0x500000005 and segfault. // If lapack_int is 64-bit, LAPACK can interpret it as 32-bit or 64-bit // to see n = 5 and pass. lapack_int n[] = { 5, 5 }; // symmetric positive definite A = L L^T, with exact L. // -1 values in upper triangle (viewed column-major) are not referenced. double A[] = { 4, 2, 0, 0, 0, -1, 5, 2, 0, 0, -1, -1, 5, 2, 0, -1, -1, -1, 5, 2, -1, -1, -1, -1, 5 }; double L[] = { 2, 1, 0, 0, 0, -1, 2, 1, 0, 0, -1, -1, 2, 1, 0, -1, -1, -1, 2, 1, -1, -1, -1, -1, 2 }; lapack_int info = -1; LAPACK_dpotrf( "lower", n, A, n, &info ); bool okay = (info == 0); for (int i = 0; i < 5*5; ++i) { okay = okay && (A[i] == L[i]); } printf( "%s\n", okay ? "ok" : "failed" ); return ! okay; } lapackpp-2024.10.26/config/lapack_pstrf.cc000066400000000000000000000036531470720400500201360ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include #include "config.h" #define LAPACK_dpstrf_base FORTRAN_NAME( dpstrf, DPSTRF ) #ifdef __cplusplus extern "C" #endif void LAPACK_dpstrf_base( const char* uplo, const lapack_int* n, double* A, const lapack_int* lda, lapack_int* ipiv, lapack_int* rank, const double* tol, double* work, lapack_int* info #ifdef LAPACK_FORTRAN_STRLEN_END , size_t uplo_len #endif ); #ifdef LAPACK_FORTRAN_STRLEN_END #define LAPACK_dpstrf( ... ) LAPACK_dpstrf_base( __VA_ARGS__, 1 ) #else #define LAPACK_dpstrf( ... ) LAPACK_dpstrf_base( __VA_ARGS__ ) #endif //------------------------------------------------------------------------------ int main() { // If lapack_int is 32-bit, but LAPACK actually interprets it as 64-bit, // LAPACK will see n = 0x500000005 and segfault. // If lapack_int is 64-bit, LAPACK can interpret it as 32-bit or 64-bit // to see n = 5 and pass. lapack_int n[] = { 5, 5 }; // symmetric positive definite A = L L^T. // -1 values in upper triangle (viewed column-major) are not referenced. double A[] = { 4, 2, 0, 0, 0, -1, 5, 2, 0, 0, -1, -1, 5, 2, 0, -1, -1, -1, 5, 2, -1, -1, -1, -1, 5 }; lapack_int ipiv[5] = { -1, -1, -1, -1, -1 }; lapack_int rank = -1; double tol = -1; double work[2*5]; lapack_int info = -1; // With pivoting in pstrf, P^T A P = L2 L2^T. // Don't have exact L2 for comparison. LAPACK_dpstrf( "lower", n, A, n, ipiv, &rank, &tol, work, &info ); bool okay = (info == 0) && (rank == 5); printf( "%s\n", okay ? "ok" : "failed" ); return ! okay; } lapackpp-2024.10.26/config/lapack_version.cc000066400000000000000000000013711470720400500204600ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include "config.h" #define LAPACK_ilaver FORTRAN_NAME( ilaver, ILAVER ) #ifdef __cplusplus extern "C" #endif void LAPACK_ilaver( lapack_int* major, lapack_int* minor, lapack_int* patch ); int main( int argc, char** argv ) { using llong = long long; lapack_int major, minor, patch; LAPACK_ilaver( &major, &minor, &patch ); printf( "LAPACK_VERSION=%lld.%02lld.%02lld\n", llong( major ), llong( minor ), llong( patch ) ); return 0; } lapackpp-2024.10.26/config/lapack_xblas.cc000066400000000000000000000037721470720400500201130ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include "config.h" #define LAPACK_dposvxx FORTRAN_NAME(dposvxx, DPOSVXX) #ifdef __cplusplus extern "C" #endif void LAPACK_dposvxx( char const* fact, char const* uplo, lapack_int const* n, lapack_int const* nrhs, double* a, lapack_int const* lda, double* af, lapack_int const* ldaf, char* equed, double* s, double* b, lapack_int const* ldb, double* x, lapack_int const* ldx, double* rcond, double* rpvgrw, double* berr, lapack_int const* n_err_bnds, double* err_bnds_norm, double* err_bnds_comp, lapack_int const* nparams, double* params, double* work, lapack_int* iwork, lapack_int* info ); int main() { const lapack_int n = 5, nrhs = 1, n_err_bnds = 3, nparams = 3; // symmetric positive definite double A[ n*n ] = { 4, 1, 0, 0, 0, 1, 4, 1, 0, 0, 0, 1, 4, 1, 0, 0, 0, 1, 4, 1, 0, 0, 0, 1, 4 }; double AF[ n*n ]; double B[ n*nrhs ] = { 1, 2, 3, 4, 5 }; double X[ n*nrhs ] = { 1, 2, 3, 4, 5 }; double S[ n ], rcond, rpivotgrowth, berr[ nrhs ]; double err_bnds_norm[ nrhs*n_err_bnds ], err_bnds_comp[ nrhs*n_err_bnds ]; double params[ nparams ] = { -1, -1, -1 }; double work[ 4*n ]; char equed = 'n'; lapack_int iwork[ n ]; lapack_int info = -1234; LAPACK_dposvxx( "n", "lower", &n, &nrhs, A, &n, AF, &n, &equed, S, B, &n, X, &n, &rcond, &rpivotgrowth, berr, &n_err_bnds, err_bnds_norm, err_bnds_comp, &nparams, params, work, iwork, &info ); bool okay = (info == 0); printf( "%s\n", okay ? "ok" : "failed" ); return ! okay; } lapackpp-2024.10.26/config/lapacke_potrf.cc000066400000000000000000000023611470720400500202720ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #if defined(BLAS_HAVE_MKL) || defined(LAPACK_HAVE_MKL) #if (defined(BLAS_ILP64) || defined(LAPACK_ILP64)) && ! defined(MKL_ILP64) #define MKL_ILP64 #endif #include #else #include #endif int main() { int n = 5; // symmetric positive definite A = L L^T, with exact L. // -1 values in upper triangle (viewed column-major) are not referenced. double A[] = { 4, 2, 0, 0, 0, -1, 5, 2, 0, 0, -1, -1, 5, 2, 0, -1, -1, -1, 5, 2, -1, -1, -1, -1, 5 }; double L[] = { 2, 1, 0, 0, 0, -1, 2, 1, 0, 0, -1, -1, 2, 1, 0, -1, -1, -1, 2, 1, -1, -1, -1, -1, 2 }; int info = LAPACKE_dpotrf( LAPACK_COL_MAJOR, 'l', n, A, n ); bool okay = (info == 0); for (int i = 0; i < 5*5; ++i) { okay = okay && (A[i] == L[i]); } printf( "%s\n", okay ? "ok" : "failed" ); return ! okay; } lapackpp-2024.10.26/config/lapacke_pstrf.cc000066400000000000000000000023221470720400500202730ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #if defined(BLAS_HAVE_MKL) || defined(LAPACK_HAVE_MKL) #if (defined(BLAS_ILP64) || defined(LAPACK_ILP64)) && ! defined(MKL_ILP64) #define MKL_ILP64 #endif #include #else #include #endif int main() { int n = 5; // symmetric positive definite A = L L^T. // -1 values in upper triangle (viewed column-major) are not referenced. double A[] = { 4, 2, 0, 0, 0, -1, 5, 2, 0, 0, -1, -1, 5, 2, 0, -1, -1, -1, 5, 2, -1, -1, -1, -1, 5 }; lapack_int ipiv[5] = { -1, -1, -1, -1, -1 }; lapack_int rank = -1; double tol = -1; // With pivoting in pstrf, P^T A P = L2 L2^T. // Don't have exact L2 for comparison. lapack_int info = LAPACKE_dpstrf( LAPACK_COL_MAJOR, 'l', n, A, n, ipiv, &rank, tol ); bool okay = (info == 0) && (rank == 5); printf( "%s\n", okay ? "ok" : "failed" ); return ! okay; } lapackpp-2024.10.26/config/mkl_version.cc000066400000000000000000000007461470720400500200150ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include int main() { MKLVersion v; MKL_Get_Version( &v ); printf( "MKL_VERSION=%d.%d.%d\n", v.MajorVersion, v.MinorVersion, v.UpdateVersion ); return 0; } lapackpp-2024.10.26/config/onemkl.cc000066400000000000000000000044101470720400500167420ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include #include #include #include #include //------------------------------------------------------------------------------ int main() { try { double alpha = 2, beta = 3; int n = 2; double A[] = { 1, 2, 3, 4 }; double B[] = { 5, 4, 3, 2 }; double C[] = { 2, 3, 1, 0 }; double D[] = { 40, 61, 21, 28 }; // enumerate devices std::vector< sycl::device > devices; auto platforms = sycl::platform::get_platforms(); for (auto& platform : platforms) { auto all_devices = platform.get_devices(); for (auto& device : all_devices) { if (device.is_gpu()) { devices.push_back( device ); } } } if (devices.size() == 0) { printf( "no sycl GPU devices\n" ); return -1; } sycl::queue queue( devices[0] ); double *dA, *dB, *dC; dA = (double*) sycl::malloc_shared( n*n*sizeof(double), queue ); dB = (double*) sycl::malloc_shared( n*n*sizeof(double), queue ); dC = (double*) sycl::malloc_shared( n*n*sizeof(double), queue ); // dA = A, dB = B, dC = c queue.memcpy( dA, A, n*n*sizeof(double) ); queue.memcpy( dB, B, n*n*sizeof(double) ); queue.memcpy( dC, C, n*n*sizeof(double) ); // C = alpha A B + beta C oneapi::mkl::blas::gemm( queue, oneapi::mkl::transpose::N, oneapi::mkl::transpose::N, n, n, n, alpha, dA, n, dB, n, beta, dC, n ); // C = dC queue.memcpy( dC, C, n*n*sizeof(double) ); sycl::free( dA, queue ); sycl::free( dB, queue ); sycl::free( dC, queue ); // verify C == D double result = 0; for (int i = 0; i < n*n; ++i) { printf( "C[%d] = %.2f, D = %.2f\n", i, C[i], D[i] ); result += std::abs( D[i] - C[i] ); } bool okay = (result == 0); printf( "%s\n", okay ? "ok" : "failed" ); return ! okay; } catch (...) { printf( "caught error\n" ); return -2; } } lapackpp-2024.10.26/config/openblas_version.cc000066400000000000000000000013441470720400500210300ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include // openblas_get_config int main() { const char* v = OPENBLAS_VERSION; printf( "OPENBLAS_VERSION=%s\n", v ); // since OPENBLAS_VERSION is defined in the header, it may work even // if we don't link with openblas. Calling an OpenBLAS-specific // function ensures we are linking with OpenBLAS. const char* config = openblas_get_config(); printf( "openblas_get_config=%s\n", config ); return 0; } lapackpp-2024.10.26/config/openmp.cc000066400000000000000000000010761470720400500167600ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include int main() { int nthreads = 1; int tid = 0; #pragma omp parallel { nthreads = omp_get_max_threads(); tid = omp_get_thread_num(); printf( "tid %d, nthreads %d\n", tid, nthreads ); } printf( "ok\n" ); return 0; } lapackpp-2024.10.26/config/return_complex.cc000066400000000000000000000016531470720400500205310ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include #include "config.h" #define BLAS_zdotc FORTRAN_NAME( zdotc, ZDOTC ) // result return directly #ifdef __cplusplus extern "C" #endif std::complex BLAS_zdotc( const blas_int* n, const std::complex* x, const blas_int* incx, const std::complex* y, const blas_int* incy ); int main() { blas_int n = 5, ione = 1; std::complex x[] = { 1, 2, 3, 4, 5 }; std::complex y[] = { 5, 4, 3, 2, 1 }; std::complex result = BLAS_zdotc( &n, x, &ione, y, &ione ); bool okay = (real(result) == 35); printf( "%s\n", okay ? "ok" : "failed" ); return ! okay; } lapackpp-2024.10.26/config/return_complex_argument.cc000066400000000000000000000017271470720400500224350ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include #include "config.h" #define BLAS_zdotc FORTRAN_NAME( zdotc, ZDOTC ) // result returned as *hidden argument* #ifdef __cplusplus extern "C" #endif void BLAS_zdotc( std::complex* result, const blas_int* n, const std::complex* x, const blas_int* incx, const std::complex* y, const blas_int* incy ); int main() { blas_int n = 5, ione = 1; std::complex x[] = { 1, 2, 3, 4, 5 }; std::complex y[] = { 5, 4, 3, 2, 1 }; std::complex result; BLAS_zdotc( &result, &n, x, &ione, y, &ione ); bool okay = (real(result) == 35); printf( "%s\n", okay ? "ok" : "failed" ); return ! okay; } lapackpp-2024.10.26/config/return_float.cc000066400000000000000000000015051470720400500201630ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include "config.h" #define BLAS_sdot FORTRAN_NAME( sdot, SDOT ) // returns *float* #ifdef __cplusplus extern "C" #endif float BLAS_sdot( const blas_int* n, const float* x, const blas_int* incx, const float* y, const blas_int* incy ); int main() { blas_int n = 5, ione = 1; float x[] = { 1, 2, 3, 4, 5 }; float y[] = { 5, 4, 3, 2, 1 }; float result = BLAS_sdot( &n, x, &ione, y, &ione ); bool okay = (result == 35); printf( "%s\n", okay ? "ok" : "failed" ); return ! okay; } lapackpp-2024.10.26/config/return_float_f2c.cc000066400000000000000000000015061470720400500207160ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #include #include "config.h" #define BLAS_sdot FORTRAN_NAME( sdot, SDOT ) // returns *double* #ifdef __cplusplus extern "C" #endif double BLAS_sdot( const blas_int* n, const float* x, const blas_int* incx, const float* y, const blas_int* incy ); int main() { blas_int n = 5, ione = 1; float x[] = { 1, 2, 3, 4, 5 }; float y[] = { 5, 4, 3, 2, 1 }; float result = BLAS_sdot( &n, x, &ione, y, &ione ); bool okay = (result == 35); printf( "%s\n", okay ? "ok" : "failed" ); return ! okay; } lapackpp-2024.10.26/config/rocblas.cc000066400000000000000000000063261470720400500171120ustar00rootroot00000000000000// Copyright (c) 2017-2023, University of Tennessee. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause // This program is free software: you can redistribute it and/or modify it under // the terms of the BSD 3-Clause license. See the accompanying LICENSE file. #ifndef __HIP_PLATFORM_HCC__ #define __HIP_PLATFORM_HCC__ #endif #include // Headers moved in ROCm 5.2 #if HIP_VERSION >= 50200000 #include #else #include #endif #include #include #include //------------------------------------------------------------------------------ void error_check_( hipError_t err, const char* file, int line ) { if (err != hipSuccess) { printf( "HIP error %d: %s at %s:%d\n", err, hipGetErrorString(err), file, line ); exit(1); } } //------------------------------------------------------------------------------ void error_check_( rocblas_status err, const char* file, int line ) { if (err != rocblas_status_success) { printf( "rocblas error %d: %s at %s:%d\n", err, rocblas_status_to_string(err), file, line ); exit(1); } } #define error_check( err ) \ error_check_( (err), __FILE__, __LINE__ ) //------------------------------------------------------------------------------ int main() { double alpha = 2, beta = 3; int n = 2; double A[] = { 1, 2, 3, 4 }; double B[] = { 5, 4, 3, 2 }; double C[] = { 2, 3, 1, 0 }; double D[] = { 40, 61, 21, 28 }; hipError_t err = hipSetDevice( 0 ); if (err != hipSuccess) { printf( "hipSetDevice failed: %s (%d).\n" "Cannot run on GPU; skipping test.\n", hipGetErrorString(err), err ); return 0; } double *dA, *dB, *dC; error_check( hipMalloc( &dA, n*n*sizeof(double) ) ); error_check( hipMalloc( &dB, n*n*sizeof(double) ) ); error_check( hipMalloc( &dC, n*n*sizeof(double) ) ); assert( dA != nullptr ); assert( dB != nullptr ); assert( dC != nullptr ); // dA = A, dB = B, dC = c error_check( hipMemcpy( dA, A, n*n*sizeof(double), hipMemcpyDefault ) ); error_check( hipMemcpy( dB, B, n*n*sizeof(double), hipMemcpyDefault ) ); error_check( hipMemcpy( dC, C, n*n*sizeof(double), hipMemcpyDefault ) ); // C = alpha A B + beta C rocblas_handle handle; error_check( rocblas_create_handle( &handle ) ); error_check( rocblas_dgemm( handle, rocblas_operation_none, rocblas_operation_none, n, n, n, &alpha, dA, n, dB, n, &beta, dC, n ) ); error_check( rocblas_destroy_handle( handle ) ); // C = dC error_check( hipMemcpy( C, dC, n*n*sizeof(double), hipMemcpyDefault ) ); error_check( hipFree( dA ) ); error_check( hipFree( dB ) ); error_check( hipFree( dC ) ); // verify C == D double result = 0; for (int i = 0; i < n*n; ++i) { printf( "C[%d] = %.2f, D = %.2f\n", i, C[i], D[i] ); result += std::abs( D[i] - C[i] ); } bool okay = (result == 0); printf( "%s\n", okay ? "ok" : "failed" ); return ! okay; } lapackpp-2024.10.26/configure.py000077500000000000000000000102531470720400500162410ustar00rootroot00000000000000#!/usr/bin/env python3 # # Copyright (c) 2017-2023, University of Tennessee. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # This program is free software: you can redistribute it and/or modify it under # the terms of the BSD 3-Clause license. See the accompanying LICENSE file. # # Usage: python3 configure.py [--interactive] from __future__ import print_function import sys import re import config from config import Error, font, print_warn, print_header import config.lapack #------------------------------------------------------------------------------- # header print( '-'*80 + '\n' + font.bold( font.blue( ' Welcome to LAPACK++.' ) ) + ''' By default, configure will automatically choose the first valid value it finds for each option. You can set it to interactive to find all possible values and give you a choice: ''' + font.blue( 'make config interactive=1' ) + ''' If you have multiple compilers, we suggest specifying your desired compiler by setting CXX, as the automated search may prefer a different compiler. For options, see the `INSTALL.md` file. Configure assumes environment variables CPATH, LIBRARY_PATH, and LD_LIBRARY_PATH are set so your compiler can find libraries. See INSTALL.md for more details. ''' + '-'*80 ) #------------------------------------------------------------------------------- def main(): config.init( namespace='LAPACK', prefix='/opt/slate' ) config.prog_cxx() print_header( 'C++ compiler flags' ) # Pick highest level supported. oneAPI needs C++17. # Crusher had issue with -std=c++20 (2022-07). config.prog_cxx_flag( ['-std=c++17', '-std=c++14', '-std=c++11']) config.prog_cxx_flag( '-O2' ) config.prog_cxx_flag( '-MMD' ) config.prog_cxx_flag( '-Wall' ) config.prog_cxx_flag( '-Wno-unused-local-typedefs' ) config.prog_cxx_flag( '-Wno-unused-function' ) #config.prog_cxx_flag( '-pedantic', # todo: conflict with ROCm 3.9.0 #config.prog_cxx_flag( '-Wshadow', # todo: conflict with ROCm 3.9.0 #config.prog_cxx_flag( '-Wmissing-declarations' ) #config.prog_cxx_flag( '-Wconversion' ) #config.prog_cxx_flag( '-Werror' ) config.openmp() config.lapack.blas() print() config.lapack.blas_float_return() config.lapack.blas_complex_return() config.lapack.vendor_version() # Must test mkl_version before cblas and lapacke, to define HAVE_MKL. try: config.lapack.cblas() except Error: print_warn( 'LAPACK++ needs CBLAS for testers.' ) config.lapack.lapack() config.lapack.lapack_version() # XBLAS and Matgen are optional try: config.lapack.lapack_xblas() except Error: print_warn( 'LAPACK++ will exclude wrappers for XBLAS.' ) try: config.lapack.lapack_matgen() except Error: print_warn( 'LAPACK++ will exclude wrappers for matgen.' ) try: config.lapack.lapacke() except Error: print_warn( 'LAPACK++ needs LAPACKE for testers.' ) config.gpu_blas() blaspp = config.get_package( 'BLAS++', ['../blaspp', './blaspp'], 'include/blas.hh', 'https://github.com/icl-utk-edu/blaspp', 'https://github.com/icl-utk-edu/blaspp/tarball/master', 'blaspp.tar.gz' ) if (not blaspp): raise Exception( 'LAPACK++ requires BLAS++.' ) testsweeper = config.get_package( 'TestSweeper', ['../testsweeper', blaspp + '/testsweeper', './testsweeper'], 'testsweeper.hh', 'https://github.com/icl-utk-edu/testsweeper', 'https://github.com/icl-utk-edu/testsweeper/tarball/master', 'testsweeper.tar.gz' ) if (not testsweeper): print_warn( 'LAPACK++ needs TestSweeper for testers.' ) config.extract_defines_from_flags( 'CXXFLAGS', 'lapackpp_header_defines' ) config.output_files( ['make.inc', 'include/lapack/defines.h'] ) print( 'log in config/log.txt' ) print( '-'*80 ) # end #------------------------------------------------------------------------------- try: main() except Error as ex: print_warn( 'A fatal error occurred. ' + str(ex) + '\nLAPACK++ could not be configured. Log in config/log.txt' ) exit(1) lapackpp-2024.10.26/docs/000077500000000000000000000000001470720400500146325ustar00rootroot00000000000000lapackpp-2024.10.26/docs/doxygen/000077500000000000000000000000001470720400500163075ustar00rootroot00000000000000lapackpp-2024.10.26/docs/doxygen/DoxygenLayout.xml000066400000000000000000000140321470720400500216440ustar00rootroot00000000000000 lapackpp-2024.10.26/docs/doxygen/doxyfile.conf000066400000000000000000003203501470720400500210040ustar00rootroot00000000000000# Doxyfile 1.8.11 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. # # All text after a single hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv # built into libc) for the transcoding. See http://www.gnu.org/software/libiconv # for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. # SLATE # Items that have been adjusted have # SLATE comment for easy searching PROJECT_NAME = "LAPACK++" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. PROJECT_NUMBER = "2024.10.26" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. # SLATE PROJECT_BRIEF = "LAPACK C++ API" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. # SLATE OUTPUT_DIRECTORY = docs/ # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. # The default value is: NO. CREATE_SUBDIRS = NO # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode # U+3044. # The default value is: NO. ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, # Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), # Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, # Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, # Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, # Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. # The default value is: YES. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is # used to form the text in various listings. Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated # text. Otherwise, the brief description is used as-is. If left blank, the # following values are used ($name is automatically replaced with the name of # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. # The default value is: NO. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. # The default value is: NO. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand # part of the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # # Note that you can specify absolute paths here, but also relative paths, which # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which # header file to include in order to use a class. If left blank only the name of # the header file containing the class definition is used. Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # first line (until the first dot) of a Javadoc-style comment as the brief # description. If set to NO, the Javadoc-style will behave just like regular Qt- # style comments (thus requiring an explicit @brief command for a brief # description.) # The default value is: NO. # SLATE JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus # requiring an explicit \brief command for a brief description.) # The default value is: NO. # SLATE QT_AUTOBRIEF = YES # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as # a brief description. This used to be the default behavior. The new default is # to treat a multi-line C++ comment block as a detailed description. Set this # tag to YES if you prefer the old behavior instead. # # Note that setting this tag to YES also means that rational rose comments are # not recognized any more. # The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new # page for each member. If set to NO, the documentation of a member will be part # of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: # name=value # For example adding # "sideeffect=@par Side Effects:\n" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all # members will be omitted, etc. # The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored # for that language. For instance, namespaces will be presented as packages, # qualified scopes will look different, etc. # The default value is: NO. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources. Doxygen will then generate output that is tailored for Fortran. # The default value is: NO. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for VHDL. # The default value is: NO. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, Javascript, # C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: # FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: # Fortran. In the later case the parser tries to guess whether the code is fixed # or free formatted code, this is the default for Fortran type files), VHDL. For # instance to make doxygen treat .inc files as Fortran files (default is PHP), # and .f files as C (default is Fortran), use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable # documentation. See http://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. # The default value is: YES. MARKDOWN_SUPPORT = YES # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or # globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should set this # tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); # versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. # The default value is: NO. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. # The default value is: NO. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: # http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES will make # doxygen to replace the get and set methods by a property in the documentation. # This will only work if the methods are indeed getting or setting a simple # type. If this is not the case, or you want to show the methods anyway, you # should set this option to NO. # The default value is: YES. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO # If one adds a struct or class to a group and this option is enabled, then also # any nested class or struct is added to the same group. By default this option # is disabled and one has to add nested compounds explicitly via \ingroup. # The default value is: NO. GROUP_NESTED_COMPOUNDS = NO # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent # subgrouping. Alternatively, this can be done per class using the # \nosubgrouping command. # The default value is: YES. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions # are shown inside the group in which they are included (e.g. using \ingroup) # instead of on a separate page (for HTML and Man pages) or section (for LaTeX # and RTF). # # Note that this feature does not work in combination with # SEPARATE_MEMBER_PAGES. # The default value is: NO. INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions # with only public data fields or simple typedef fields will be shown inline in # the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set # to NO, structs, classes, and unions are shown on a separate page (for HTML and # Man pages) or section (for LaTeX and RTF). # The default value is: NO. INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically be # useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be # an expensive process and often the same symbol appears multiple times in the # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small # doxygen will become slower. If the cache is too large, memory is wasted. The # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 # symbols. At the end of a run doxygen will report the cache usage and suggest # the optimal cache size from a speed point of view. # Minimum value: 0, maximum value: 9, default value: 0. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. # Note: This will also disable the warnings about undocumented members that are # normally produced when WARNINGS is set to YES. # The default value is: NO. EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. # SLATE: show static inline functions EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are # included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base name of # the file that contains the anonymous namespace. By default anonymous namespace # are hidden. # The default value is: NO. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation # section is generated. This option has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO, these classes will be included in the various overviews. This option # has no effect if EXTRACT_ALL is enabled. # The default value is: NO. # SLATE HIDE_UNDOC_CLASSES = YES # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO # If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will # append additional text to a page's title, such as Class Reference. If set to # YES the compound reference will be hidden. # The default value is: NO. HIDE_COMPOUND_REFERENCE = NO # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = YES # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each # grouped member an include statement to the documentation, telling the reader # which file to include in order to use the member. # The default value is: NO. SHOW_GROUPED_MEMB_INC = NO # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. # SLATE SORT_BRIEF_DOCS = YES # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and # destructors are listed first. If set to NO the constructors will appear in the # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief # member documentation. # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting # detailed member documentation. # The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will # be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the alphabetical # list. # The default value is: NO. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between # the prototype and the implementation of a member function even if there is # only one candidate or it is obvious which candidate to choose by doing a # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still # accept a match between prototype and implementation in such cases. # The default value is: NO. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo # list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test # list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. GENERATE_DEPRECATEDLIST = YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if ... \endif and \cond # ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the # documentation. If the initializer consists of more lines than specified here # it will be hidden. Use a value of 0 to hide initializers completely. The # appearance of the value of individual variables and macros / defines can be # controlled using \showinitializer or \hideinitializer command in the # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES, the # list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. # SLATE # When clicking through functions in Modules, Doxygen's navigation tree jumps # to the corresponding file if shown, making the use of Modules very cumbersome. SHOW_FILES = NO # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command command input-file, where command is the value of the # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. # SLATE LAYOUT_FILE = docs/doxygen/DoxygenLayout.xml # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to # standard output by doxygen. If QUIET is set to YES this implies that the # messages are off. # The default value is: NO. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. # The default value is: YES. WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. # SLATE WARN_IF_UNDOCUMENTED = NO # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some parameters # in a documented function, or documenting parameters that don't exist or using # markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete # parameter documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when # a warning is encountered. # The default value is: NO. WARN_AS_ERROR = NO # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). # SLATE WARN_LOGFILE = docs/doxygen/errors.txt #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. # SLATE INPUT = \ include \ src \ test/matrix_generator.cc \ docs/doxygen/groups.dox \ README.md \ INSTALL.md \ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: http://www.gnu.org/software/libiconv) for the list of # possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, # *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl, # *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js. FILE_PATTERNS = *.cc *.hh # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command: # # # # where is the value of the INPUT_FILTER tag, and is the # name of an input file. Doxygen will then use the output that the filter # program writes to standard output. If FILTER_PATTERNS is specified, this tag # will be ignored. # # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. INPUT_FILTER = tools/doxygen-filter.pl # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and # it is also possible to disable source filtering for a specific pattern using # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. # SLATE USE_MDFILE_AS_MAINPAGE = README.md #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be # generated. Documented entities will be cross-referenced with these sources. # # Note: To get rid of all source code in the generated output, make sure that # also VERBATIM_HEADERS is set to NO. # The default value is: NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # function all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. REFERENCES_LINK_SOURCE = YES # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the # source code will show a tooltip with additional information such as prototype, # brief description and links to the definition and documentation. Since this # will make the HTML file larger and loading of large files a bit slower, you # can opt to disable this feature. # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system # (see http://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global # - Enable SOURCE_BROWSER and USE_HTAGS in the config file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # # Doxygen will invoke htags (and that will in turn invoke gtags), so these # tools must be available from the command line (i.e. in the search path). # # The result: instead of the source browser generated by doxygen, the links to # source code will now point to the output of htags. # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is # specified. Set to NO to disable this. # See also: Section \class. # The default value is: YES. VERBATIM_HEADERS = YES # If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the # clang parser (see: http://clang.llvm.org/) for more accurate parsing at the # cost of reduced performance. This can be particularly helpful with template # rich C++ code for which doxygen's built-in parser lacks the necessary type # information. # Note: The availability of this option depends on whether or not doxygen was # generated with the -Duse-libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO # If clang assisted parsing is enabled you can provide the compiler with command # line options that you would normally use when invoking the compiler. Note that # the include paths will already be set by doxygen for the files and directories # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all # compounds will be generated. Enable this if the project contains a lot of # classes, structs, unions or interfaces. # The default value is: YES. ALPHABETICAL_INDEX = YES # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in # which the alphabetical index list will be split. # Minimum value: 1, maximum value: 20, default value: 5. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a # standard header. # # To get valid HTML the header file that includes any scripts and style sheets # that doxygen needs, which is dependent on the configuration options used (e.g. # the setting GENERATE_TREEVIEW). It is highly recommended to start with a # default header using # doxygen -w html new_header.html new_footer.html new_stylesheet.css # YourConfigFile # and then modify the file new_header.html. See also section "Doxygen usage" # for information on how to generate the default header that doxygen normally # uses. # Note: The header is subject to change so you typically have to regenerate the # default header when upgrading to a newer version of doxygen. For a description # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard # footer. See HTML_HEADER for more information on how to generate a default # footer and what special commands can be used inside the footer. See also # section "Doxygen usage" for information on how to generate the default footer # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of # the HTML output. If left blank doxygen will generate a default style sheet. # See also section "Doxygen usage" for information on how to generate the style # sheet that doxygen normally uses. # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as # it is more robust and this tag (HTML_STYLESHEET) will in the future become # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the # standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use grayscales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not # change the gamma. # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to YES can help to show when doxygen was last run and thus if the # documentation is up to date. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = NO # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to # such a level that at most the specified number of entries are visible (unless # a fully collapsed tree already exceeds this amount). So setting the number of # entries 1 will produce a full collapsed tree by default. 0 is a special value # representing an infinite number of entries and will result in a full expanded # tree by default. # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development # environment (see: http://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "Doxygen generated docs" # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop # (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML # files are now used as the Windows 98 help format, and will replace the old # Windows help format (.hlp) on all Windows platforms in the future. Compressed # HTML files also contain an index, a table of contents, and you can search for # words in the documentation. The HTML workshop also contains a viewer for # compressed HTML files. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help # (.qch) of the generated HTML documentation. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace # (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual # Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To # install this plugin and make it available under the help contents menu in # Eclipse, the contents of the directory containing the HTML and XML files needs # to be copied into the plugins directory of eclipse. The name of the directory # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. # After copying Eclipse needs to be restarted before the help appears. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this # name. Each documentation set should have its own identifier. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top # of each HTML page. A value of NO enables the index and the value YES disables # it. Since the tabs in the index contain the same information as the navigation # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag # value is set to YES, a side panel will be generated containing a tree-like # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has # the same information as the tab index, you could consider setting # DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. # SLATE GENERATE_TREEVIEW = YES # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # # Note that a value of 0 will completely suppress the enum values from appearing # in the overview section. # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. # SLATE: wider TREEVIEW_WIDTH = 350 # If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML # output directory to force them to be regenerated. # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in # the HTML output directory before the changes have effect. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. # SLATE USE_MATHJAX = YES # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: # http://docs.mathjax.org/en/latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory # should contain the MathJax.js script. For instance, if the mathjax directory # is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from http://www.mathjax.org before deployment. # The default value is: http://cdn.mathjax.org/mathjax/latest. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = TeX/AMSmath # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site # (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and # should work on any modern browser. Note that when using HTML help # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) # there is already a search function so this one should typically be disabled. # For large projects the javascript based search engine can be slow, then # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to # search using the keyboard; to jump to the search box use + S # (what the is depends on the OS and browser, but it is typically # , /