Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6977925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:41:18+00:00 2026-05-27T17:41:18+00:00

I have been exploring algorithms that require some work on matrices, and I have

  • 0

I have been exploring algorithms that require some work on matrices, and I have gotten some straightforward code working on my Linux machine. Here is an excerpt:

extern "C" {
    // link w/ LAPACK
    extern void dpptrf_(const char *uplo, const int *n, double *ap, int *info);
    extern void dpptri_(const char *uplo, const int *n, double *ap, int *info);
    // BLAS todo: get sse2 up in here (ATLAS?)
    extern void dgemm_(const char *transa, const char *transb, const int *m,
            const int *n, const int *k, const double *alpha, const double *a,
            const int *lda, const double *b, const int *ldb, const double *beta,
            double *c, const int *ldc);
}

// in-place: be sure that (N*(N+1)/2) doubles have been initialized
inline void invert_mat_sym_packed(double *vd, int n) {
    int out = 0;
    dpptrf_("U",&n,vd,&out);
    ASSERT(!out);
    dpptri_("U",&n,vd,&out);
    ASSERT(!out);
}

// use with col-major ordering!!!
inline void mult_cm(double *a, double *b, double alpha, int m, int k, int n, double *c) {
    int lda = m, ldb = k, ldc = m; double beta = 1.0;
    dgemm_("N","N",&m,&n,&k,&alpha,a,&lda,b,&ldb,&beta,c,&ldc);
}

all I had to do was sudo apt-get install liblapack, and link against the library.

I am now trying to get this code working from MinGW using the 32-bit dll’s from here but I am seeing segfaults and invalid output. I will proceed with gdb to determine the location of the error but I suspect there’s a better, cleaner, more portable way to get this done.

What I did to get it to compile was install fortran for mingw (mingw-get install fortran) and link to the 32bit BLAS and LAPACK dll’s from the earlier link.

I’m not sure how much I’m missing here… How does everybody else get their LAPACK going when coding with gcc for win32?

What I’m looking for is an easy-to-use C interface. I don’t want wrapper classes all over the place.

I tried to find a download for Intel MKL… Ain’t even free software!?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:41:19+00:00Added an answer on May 27, 2026 at 5:41 pm

    I solved the problem. It had nothing to do with the way I was calling the routines, I failed to memset my buffers to zero prior to accumulating values onto them.

    Calling fortran routines is basically just as straightforward as it is to do from Linux.

    However, another rather serious problem has appeared: Once I use the lapack routines my program no longer handles exceptions. See here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have been recently exploring some of the Javascript mobile frameworks that can
Lately, i have been exploring the source code of OutputCache attribute in asp.net mvc-3
Actually I am studying this algorithm and I have been exploring his code (which
I'm doing some R&D work, and as such am exploring design patterns. I have
Have been looking at the MVC storefront and see that IQueryable is returned from
I have been working on a web services related project for about the last
I have been working with Visual Studio (WinForm and ASP.NET applications using mostly C#)
I have been searching everywhere for the following functionality in Lisp, and have gotten
Recently I have been exploring using the fancy new dynamic keyword introduced in C#
I have recently been exploring the Tornado web framework to serve a lot of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.