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

  • SEARCH
  • Home
  • 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 8490871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:15:06+00:00 2026-06-10T22:15:06+00:00

I have linked a C++ program with fortran dagmg.f90 routine from AGMG library. Initially

  • 0

I have linked a C++ program with fortran dagmg.f90 routine from AGMG library. Initially the sparse matrix is built by Eigen library in CRS format and then i convert it to the required format for fortran routine. AGMG runs and calculates the number of non-zeros and displays the number of unknowns. But then it suddenly displays segmentation fault. I am unable to figure out what is the reasons behind it.

    int jatest[NNZ];
int iatest[nodes+1];
double bftest[nodes];
double VXtest[nodes];
// code to convert Af into a, ja, ia vectors for AGMG
double *aptr; int* japtr; int* iaptr;
aptr = Af.valuePtr();
japtr = Af.innerIndexPtr();
iaptr = Af.outerIndexPtr();
for (i = 0; i < NNZ ; i++ ){
  atest[i] = aptr[i];
  jatest[i] = japtr[i] + 1;
 // cout << atest[i] << "\t" << japtr[i] << endl;
}
for ( i = 0; i <= nodes; i++){
  iatest[i] = iaptr[i] + 1;
   }
 dagmg_(nodes,atest,jatest,iatest,bftest,VXtest,ijob,iprint,nrest,iter,tol);

The output looks like this:

*ENTERING AGMG ************************************

Number of unknowns: 17
**
Nonzeros : 51 (per row: 3.00)

Segmentation fault

Why am i getting this fault ???

  • 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-06-10T22:15:08+00:00Added an answer on June 10, 2026 at 10:15 pm

    Problem solved :

    Actually the problem was with the LAPACK function being called by AGMG for direct solution to the coarsest level. After changing the lapack libraries linked to the AGMG, this problem of segmentation fault is solved.

    Just for reference :

    g++ *.o ~/lapack-3.4.1/liblapack.a ~/CLAPACK-3.2.1/lapack_LINUX.a ~/mylibs/blas_LINUX.a ~/CLAPACK-3.2.1/blas_LINUX.a ~/CLAPACK-3.2.1/F2CLIBS/libf2c.a ~/lapack-3.4.1/liblapack.a -o myexe -lgfortran
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have linked a library with my program. It works fine. The only problem
I have a program, myprogram , which is linked with a static convenience library,
I have a static linkable library of C and Fortran routines compiled and linked
I have built OpenSSL for Android(using ndk-build) and have linked it to my program.
I have a program which places structures in a linked list based on the
I have a 'server' program that updates many linked lists in shared memory in
I have linked a form from campaign monitor to a mobile site and I
For some unfortunate reasons, I have to convert a proprietary and binary library from
HI :) I have a program about linked lists and we're supposed to be
I'm working on a program using doubly linked lists. I have already gotten the

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.