Coder Social home page Coder Social logo

scivision / lapack95 Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 3.0 2.93 MB

CMake enhanced Netlib LAPACK95

Home Page: https://www.netlib.org/lapack95/

License: BSD 3-Clause "New" or "Revised" License

Fortran 37.49% CMake 61.82% MATLAB 0.44% Mathematica 0.25%
lapack95

lapack95's Introduction

LAPACK95

DOI ci_linux

CMake enhanced Netlib LAPACK95, downloading and using original unmodified source code. Easy to build and include in most projects and operating system.

Option -Darith= sets which precision to build (default d):

  • s: float32
  • d: float64
  • c: complex32
  • z: complex64

Build with CMake and a Fortran compiler. The build yields under the build/ director:

  • liblapack95.a
  • Fortran module files in include/*.mod.
cmake -B build
cmake --build build

To install under ~/.local/

cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local -B build

cmake --build build --parallel

cmake --install build

Use in a cmake project

This library can be used inside a cmake project by adding this repository with add_subdirectory. One can for example use FetchContent in your existing project:

cmake_minimum_required(VERSION 3.14)

project(myproject Fortran)

include(FetchContent)
FetchContent_Declare(
    lapack95
    GIT_REPOSITORY https://github.com/scivision/LAPACK95.git
)

FetchContent_MakeAvailable(lapack95)

add_executable(myexe ${CMAKE_CURRENT_SOURCE_DIR}/myexe.f90)
target_link_libraries(myexe ${LAPACK_LIBRARIES} lapack95)

Examples

! Double precision
use la_precision, only: wp => dp
use f95_lapack, only: la_gesv

real(wp) :: A(3,3), b(3)

call random_number(A)
b(:) = 3*A(:,1) + 2*A(:,2) - A(:,3)

! Solve Ax=b, overwrite b with solution
call la_gesv(A,b)

print *, b
end program

! Output (exact: 3 2 -1):
! 2.9999999999999978        2.0000000000000018       -1.0000000000000004

lapack95's People

Contributors

scivision avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.