Author Topic: Ubuntu Debugger  (Read 8297 times)

Yaakov

  • Sr. Member
  • ****
  • Posts: 323
Ubuntu Debugger
« on: March 15, 2016, 02:12:53 AM »
Hi everyone,

how can i check my own f-codes in FEAP in Ubuntu, e.g. user-element, user-material.

firstly, i cheke grammatic errors with help of make install command.

but how can i check logical oder dimensional errors (i check codes errors by myself as i write codes) in Debugger.

Many thanks in advance!

Jakob
Let's boost FEAP's performance!

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2647
Re: Ubuntu Debugger
« Reply #1 on: March 15, 2016, 07:14:59 AM »
Ubuntu should have gdb for debugging.

Or you can output the information for a simple problem you can check by hand to see if the results are correct.

Feap has a matrix output routine for real quantities:

For example if you have:

real*8  aa(nd,nc)

you can output part of the array using

call mprint(aa,nrow,ncol,nd,'AA')

A similar routine exists for integer (integer*4) as call iprint(ia,nrow,ncol,nd,'IA')

In the above 'ND' is the first dimension, 'NROW','NCOL' the amount you would like to output.

EXAMPLE

real*8  c(6,7)

call mprint(c,6,7,6,'C")

would output the entire array.

Yaakov

  • Sr. Member
  • ****
  • Posts: 323
Re: Ubuntu Debugger
« Reply #2 on: March 17, 2016, 10:59:52 AM »
Dear Prof. Taylor,

Thanks very much for your answer, now i use simple way for debugger
e.g.    write(*,*) 'isw:',isw
        read(*,'(a)')
the next time, i will try feap own debugger.


Let's boost FEAP's performance!

JStorm

  • Sr. Member
  • ****
  • Posts: 250
Re: Ubuntu Debugger
« Reply #3 on: April 19, 2016, 06:13:19 AM »
gdb in ubuntu is working pretty well und most IDE and some text editors
provides an GUI for easy using, e.g. geany, eclipse,...

Enginit

  • Jr. Member
  • **
  • Posts: 46
Re: Ubuntu Debugger
« Reply #4 on: June 02, 2019, 10:20:18 AM »
Dear Mr. JStorm,

In the same topic problem, I also use the Codeblock IDE to check for codes that are independent of the FEAP library.
I wonder you have any hint on the way you debug your element in the IDE (as you suggest geany or eclipse).
I mean you element always calls FEAP library so it is impossible to debug on these IDE without any special treatment.

Best regards

JStorm

  • Sr. Member
  • ****
  • Posts: 250
Re: Ubuntu Debugger
« Reply #5 on: June 02, 2019, 11:23:03 AM »
Are you familiar with debugging of compiled code like Fortran, C, etc.? Debugging FEAP does not need any special treatment.

Enginit

  • Jr. Member
  • **
  • Posts: 46
Re: Ubuntu Debugger
« Reply #6 on: June 02, 2019, 01:54:38 PM »
No, since I am new to Fortran.
I only debug my element by print out variables on the screen to trace where the bug is.
I wonder there is any way to debug FEAP element in a more friendly IDE like Geany, eclipse as you suggested.
I tried with Codeblock but the problem is that FEAP user element always includes FEAP library which makes it impossible to debug on an IDE like Codeblock.
Are you debugging your elements in those IDEs or only via gdb?

JStorm

  • Sr. Member
  • ****
  • Posts: 250
Re: Ubuntu Debugger
« Reply #7 on: June 02, 2019, 10:24:45 PM »
You can also use Codeblock IDE for debugging with GDB as backend. The debugger do not care that FEAP is compiled into a library.

Before bothering with FEAP, read a HowTo about debugging Fortran code. Than create a simple HelloWorld Fortran project and make sure you can debug this (setting breakpoints and check content of variables). Finally, check that you have compiled FEAP with the debugging flag (if not then recompile all) and run the debugger on FEAP.

Enginit

  • Jr. Member
  • **
  • Posts: 46
Re: Ubuntu Debugger
« Reply #8 on: June 03, 2019, 01:17:25 AM »
Thank you very much for your helpful suggestion.

I have some experiences to debug code with breakpoints (Matlab, Java on Eclipse).
As you suggested, the new things to me now are:
1. Use Codeblock IDE for debugging with GDB as backend
2. Compiled FEAP with the debugging flag
I really appreciate if you can show me any example or relevant link.

Best regards

JStorm

  • Sr. Member
  • ****
  • Posts: 250
Re: Ubuntu Debugger
« Reply #9 on: June 03, 2019, 01:24:42 AM »
I have never used Code::Blocks. You should look for help in Code::Blocks or Fortran user forums in order to learn debugging, because this is a basic skill for coding in FEAP.  I have found this explanation: http://wiki.codeblocks.org/index.php/Debugging_with_Code::Blocks. In case you want to use another IDE, then search the IDE's name + debugging to find the manuals and user forums.

Enginit

  • Jr. Member
  • **
  • Posts: 46
Re: Ubuntu Debugger
« Reply #10 on: June 03, 2019, 01:45:40 AM »
Thank you very much for your kind help.