<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Can't link openblas or lapack]]></title>
		<link>http://forums.approximatrix.com/viewtopic.php?id=1014</link>
		<atom:link href="http://forums.approximatrix.com/extern.php?action=feed&amp;tid=1014&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Can't link openblas or lapack.]]></description>
		<lastBuildDate>Sat, 13 Jun 2026 13:24:16 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Can't link openblas or lapack]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=4608#p4608</link>
			<description><![CDATA[<p>Here is the module: </p><p>module burgMemcof<br />&nbsp; &nbsp; use iso_c_binding, only: C_DOUBLE, C_INT<br />&nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; <br />!&nbsp; &nbsp; interface<br />!&nbsp; &nbsp; &nbsp; &nbsp; subroutine dgels(trans, m, n, nrhs, a, lda, b, ldb, work, lwork, info) bind(C, name=&quot;dgels_&quot;)<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ! Pull the types directly into the interface block itself<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; use, intrinsic :: iso_c_binding, only: C_CHAR, C_INT, C_DOUBLE<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; implicit none<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; character(kind=C_CHAR) :: trans<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; integer(kind=C_INT)&nbsp; &nbsp; :: m, n, nrhs, lda, ldb, lwork, info<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; real(kind=C_DOUBLE)&nbsp; &nbsp; :: a(*), b(*), work(*)<br />!&nbsp; &nbsp; &nbsp; &nbsp; end subroutine dgels<br />!&nbsp; &nbsp; end interface</p><p>&nbsp; &nbsp; <br />contains</p><p>subroutine linRegMA(residual, arCoefNum, maCoefNum, sampleSize, linRegEst) BIND(C, NAME=&quot;linRegMA&quot;)<br />&nbsp; &nbsp; use iso_c_binding, only: C_DOUBLE, C_INT<br />&nbsp; &nbsp; implicit none<br />&nbsp; &nbsp; !GCC$ ATTRIBUTES DLLEXPORT :: linRegMA</p><p>&nbsp; &nbsp; ! Inputs<br />&nbsp; &nbsp; real(C_DOUBLE), dimension(*), intent(in) :: residual<br />&nbsp; &nbsp; integer(C_INT), intent(in) :: arCoefNum, maCoefNum, sampleSize</p><p>&nbsp; &nbsp; ! Output<br />&nbsp; &nbsp; real(C_DOUBLE), dimension(*), intent(out) :: linRegEst</p><p>&nbsp; &nbsp; ! Local variables<br />&nbsp; &nbsp; integer(C_INT) :: m, n<br />&nbsp; &nbsp; integer(C_INT) :: i, j<br />&nbsp; &nbsp; real(C_DOUBLE), allocatable :: designMatrix(:,:), targetSet(:)<br />&nbsp; &nbsp; real(C_DOUBLE), allocatable :: work(:)<br />&nbsp; &nbsp; integer(C_INT) :: lwork, info<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; external dgels<br />&nbsp; &nbsp; ! -----------------------------<br />&nbsp; &nbsp; ! Compute dimensions<br />&nbsp; &nbsp; ! -----------------------------<br />&nbsp; &nbsp; m = sampleSize - (arCoefNum + maCoefNum)<br />&nbsp; &nbsp; n = maCoefNum + 1&nbsp; &nbsp; &nbsp; ! +1 for intercept column</p><p>&nbsp; &nbsp; ! -----------------------------<br />&nbsp; &nbsp; ! Allocate arrays<br />&nbsp; &nbsp; ! -----------------------------<br />&nbsp; &nbsp; allocate(designMatrix(m, n))<br />&nbsp; &nbsp; allocate(targetSet(m))</p><p>&nbsp; &nbsp; ! -----------------------------<br />&nbsp; &nbsp; ! Build targetSet<br />&nbsp; &nbsp; ! Mathematica: residual[[arCoefNum + maCoefNum + 1 ;; sampleSize]]<br />&nbsp; &nbsp; ! -----------------------------<br />&nbsp; &nbsp; do i = 1, m<br />&nbsp; &nbsp; &nbsp; &nbsp; targetSet(i) = residual(arCoefNum + maCoefNum + i)<br />&nbsp; &nbsp; end do</p><p>&nbsp; &nbsp; ! -----------------------------<br />&nbsp; &nbsp; ! Build design matrix<br />&nbsp; &nbsp; ! Column 1 = intercept = 1.0<br />&nbsp; &nbsp; ! Columns 2..n = lagged residual&nbsp; values<br />&nbsp; &nbsp; ! -----------------------------<br />&nbsp; &nbsp; designMatrix(:,1) = 1.0_C_DOUBLE</p><p>&nbsp; &nbsp; do j = 1, maCoefNum<br />&nbsp; &nbsp; &nbsp; &nbsp; do i = 1, m<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; designMatrix(i, j+1) = residual(arCoefNum + j + (i-1))<br />&nbsp; &nbsp; &nbsp; &nbsp; end do<br />&nbsp; &nbsp; end do</p><p>&nbsp; &nbsp; ! -----------------------------<br />&nbsp; &nbsp; ! Solve Least Squares using DGELS<br />&nbsp; &nbsp; ! A = designMatrix (m x n)<br />&nbsp; &nbsp; ! B = targetSet (m x 1)<br />&nbsp; &nbsp; ! DGELS overwrites B with solution coefficients<br />&nbsp; &nbsp; ! -----------------------------<br />&nbsp; &nbsp; lwork = -1<br />&nbsp; &nbsp; allocate(work(1))</p><p>&nbsp; &nbsp; ! Workspace query<br />&nbsp; &nbsp; call dgels(&#039;N&#039;, m, n, 1, designMatrix, m, targetSet, m, work, lwork, info)</p><p>&nbsp; &nbsp; lwork = int(work(1))<br />&nbsp; &nbsp; deallocate(work)<br />&nbsp; &nbsp; allocate(work(lwork))</p><p>&nbsp; &nbsp; ! Actual solve<br />&nbsp; &nbsp; call dgels(&#039;N&#039;, m, n, 1, designMatrix, m, targetSet, m, work, lwork, info)</p><p>&nbsp; &nbsp; if (info /= 0) then<br />&nbsp; &nbsp; &nbsp; &nbsp; print *, &quot;DGELS failed with INFO=&quot;, info<br />&nbsp; &nbsp; end if</p><p>&nbsp; &nbsp; ! -----------------------------<br />&nbsp; &nbsp; ! Extract coefficients<br />&nbsp; &nbsp; ! DGELS stores solution in first n entries of targetSet<br />&nbsp; &nbsp; ! -----------------------------<br />&nbsp; &nbsp; linRegEst(1:n) = targetSet(1:n)</p><p>&nbsp; &nbsp; ! Cleanup<br />&nbsp; &nbsp; deallocate(designMatrix, targetSet, work)<br />end subroutine linRegMA</p><br /><p>subroutine memcof(tseries, n, m, xms, d) BIND(C, NAME=&quot;memcof&quot;)<br />&nbsp; &nbsp; implicit none<br />&nbsp; &nbsp; !GCC$ ATTRIBUTES DLLEXPORT :: memcof<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; ! Argument Types<br />&nbsp; &nbsp; integer(C_INT), value :: n, m<br />&nbsp; &nbsp; real(C_DOUBLE), intent(out) :: xms<br />&nbsp; &nbsp; real(C_DOUBLE), dimension(*), intent(in) :: tseries<br />&nbsp; &nbsp; real(C_DOUBLE), dimension(*), intent(out) :: d</p><p>&nbsp; &nbsp; ! Local variables - Must match C_DOUBLE for precision<br />&nbsp; &nbsp; integer(C_INT) :: i, j, k<br />&nbsp; &nbsp; real(C_DOUBLE) :: p, pneum, denom<br />&nbsp; &nbsp; real(C_DOUBLE), allocatable :: wk1(:), wk2(:), wkm(:)</p><p>&nbsp; &nbsp; allocate(wk1(n), wk2(n), wkm(m))</p><p>&nbsp; &nbsp; ! Initial power estimate<br />&nbsp; &nbsp; p = 0.0_C_DOUBLE<br />&nbsp; &nbsp; do j = 1, n<br />&nbsp; &nbsp; &nbsp; &nbsp; p = p + tseries(j)**2<br />&nbsp; &nbsp; end do<br />&nbsp; &nbsp; xms = p / n</p><p>&nbsp; &nbsp; ! Initialize forward/backward prediction arrays<br />&nbsp; &nbsp; wk1(1:n) = tseries(1:n)<br />&nbsp; &nbsp; wk2(1:n-1) = tseries(2:n)</p><p>&nbsp; &nbsp; ! Burg recursion<br />&nbsp; &nbsp; do k = 1, m<br />&nbsp; &nbsp; &nbsp; &nbsp; pneum = 0.0_C_DOUBLE<br />&nbsp; &nbsp; &nbsp; &nbsp; denom = 0.0_C_DOUBLE<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; do j = 1, n - k<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pneum = pneum + wk1(j) * wk2(j)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; denom = denom + wk1(j)**2 + wk2(j)**2<br />&nbsp; &nbsp; &nbsp; &nbsp; end do<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; d(k) = 2.0_C_DOUBLE * pneum / denom<br />&nbsp; &nbsp; &nbsp; &nbsp; xms = xms * (1.0_C_DOUBLE - d(k)**2)</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (k &gt; 1) then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; do i = 1, k-1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; d(i) = wkm(i) - d(k) * wkm(k-i)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end do<br />&nbsp; &nbsp; &nbsp; &nbsp; end if</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (k == m) exit</p><p>&nbsp; &nbsp; &nbsp; &nbsp; wkm(1:k) = d(1:k)</p><p>&nbsp; &nbsp; &nbsp; &nbsp; do j = 1, n - k - 1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wk1(j) = wk1(j) - wkm(k) * wk2(j)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wk2(j) = wk2(j+1) - wkm(k) * wk1(j+1)<br />&nbsp; &nbsp; &nbsp; &nbsp; end do<br />&nbsp; &nbsp; end do</p><p>&nbsp; &nbsp; deallocate(wk1, wk2, wkm)<br />end subroutine memcof<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />subroutine SymGFilter(tseries, n, lag, width, fout) BIND(C, NAME=&quot;SymGFilter&quot;)<br />&nbsp; implicit none<br />&nbsp; !GCC$ ATTRIBUTES DLLEXPORT :: SymGFilter<br />&nbsp; <br />&nbsp; integer(C_INT), value :: n, lag<br />&nbsp; real(C_DOUBLE), intent(in) :: width<br />&nbsp; real(C_DOUBLE), dimension(*), intent(in) :: tseries<br />&nbsp; real(C_DOUBLE), dimension(*), intent(out) :: fout</p><p>&nbsp; integer(C_INT) :: i, k, fil_len<br />&nbsp; real(C_DOUBLE) :: sigma, norm, pi<br />&nbsp; real(C_DOUBLE), allocatable :: kernel(:)<br />&nbsp; pi = 3.141592653589793_C_DOUBLE</p><p>&nbsp; ! Filter length = 2*lag - 1<br />&nbsp; fil_len = 2*lag - 1</p><p>&nbsp; allocate(kernel(fil_len))</p><p>&nbsp; ! Compute sigma<br />&nbsp; sigma = real(lag, kind = C_DOUBLE)/width</p><p>&nbsp; ! Build Gaussian kernel centered at index lag<br />&nbsp; do k = 1, fil_len<br />&nbsp; &nbsp; &nbsp;kernel(k) = exp( - (real(k - lag, kind = C_DOUBLE))**2 / (2.0_C_DOUBLE * sigma**2) ) &amp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/ (sqrt(2.0_C_DOUBLE * pi) * sigma)<br />&nbsp; end do</p><p>&nbsp; ! Normalize kernel<br />&nbsp; norm = 0.0_C_DOUBLE<br />&nbsp; do k = 1, fil_len<br />&nbsp; &nbsp; &nbsp;norm = norm + kernel(k)<br />&nbsp; end do<br />&nbsp; kernel = kernel / norm</p><p>&nbsp; ! Initialize output<br />&nbsp; do i = 1, n<br />&nbsp; &nbsp; &nbsp; fout(i) = 0.0_C_DOUBLE<br />&nbsp; end do</p><p>&nbsp; ! Convolution: valid region only<br />&nbsp; do i = lag, n - lag + 1<br />&nbsp; &nbsp; &nbsp;fout(i + lag - 1) = sum( kernel(:) * tseries(i - lag + 1 : i + lag - 1) )<br />&nbsp; end do</p><p>&nbsp; deallocate(kernel)<br />end subroutine SymGFilter<br />&nbsp; &nbsp; <br />end module burgMemcof</p>]]></description>
			<author><![CDATA[null@example.com (guitarfdm)]]></author>
			<pubDate>Sat, 13 Jun 2026 13:24:16 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=4608#p4608</guid>
		</item>
		<item>
			<title><![CDATA[Re: Can't link openblas or lapack]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=4607#p4607</link>
			<description><![CDATA[<p>I tried a reinstall as admin with virus software turned off, and it is still not here. There is an openblas_config.h in the C:\Program Files (x86)\Simply Fortran 3\mingw-w64\x86_64-w64-mingw32\include but no <br />libopenblas.a, libopenblas.dll.a, openblas.dll.</p><p>Microsoft Windows 11 Professional (x64) Build 26200.8655 (25H2)</p><p>It tries to auto-link and fails.</p><p>here is the compiler output:<br />Generating fortran-library.dll<br />build\burgMemcof.o: In function `linRegMA&#039;:<br />- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <br />C:\Users\Admin\Fortran\Burg/./burgMemcof.f90:84: undefined reference to `dgels&#039;<br />- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <br />C:\Users\Admin\Fortran\Burg/./burgMemcof.f90:91: undefined reference to `dgels&#039;<br />collect2.exe: error: ld returned 1 exit status<br />Error: Last command making (fortran-library.dll) returned a bad status<br />Error: Make execution terminatedcompiler output.</p>]]></description>
			<author><![CDATA[null@example.com (guitarfdm)]]></author>
			<pubDate>Sat, 13 Jun 2026 13:20:20 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=4607#p4607</guid>
		</item>
		<item>
			<title><![CDATA[Can't link openblas or lapack]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=4606#p4606</link>
			<description><![CDATA[<p>I can&#039;t link to blas or lapack. In fact, I can&#039;t even find lapack or blas.</p>]]></description>
			<author><![CDATA[null@example.com (guitarfdm)]]></author>
			<pubDate>Sat, 13 Jun 2026 05:42:35 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=4606#p4606</guid>
		</item>
	</channel>
</rss>
