|
|
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Compiling Fortran sources in TheIde
Compiling Fortran sources in TheIde [message #24712] |
Thu, 28 January 2010 15:12  |
 |
koldo
Messages: 3432 Registered: August 2008
|
Senior Veteran |
|
|
Hello all
I have some .for and .c files that form a command line program in Windows, that I would like to compile from TheIde.
Is it possible ?. Do you have any experience ?
In my first try it seems that TheIde does not consider them source code and do not try to compile them.
Best regards
Koldo
Best regards
Iñaki
|
|
|
|
|
Re: Compiling Fortran sources in TheIde [message #28620 is a reply to message #24712] |
Wed, 08 September 2010 11:33   |
|
koldo wrote on Thu, 28 January 2010 15:12 | Hello all
I have some .for and .c files that form a command line program in Windows, that I would like to compile from TheIde.
Is it possible ?. Do you have any experience ?
In my first try it seems that TheIde does not consider them source code and do not try to compile them.
Best regards
Koldo
|
Hi Koldo,
Project > Custom build steps can be used to setup action to take for the .for files. The hard part would be probably tricking theide to use the resulting object files during linking (Maybe having a empty cpp file with the same name?).
Be aware that although it looks simple at first, it has some hidden traps It took me a while to figure out last time I used it (with flex and bison files).
Honza
|
|
|
|
|
|
Re: Compiling Fortran sources in TheIde [message #50438 is a reply to message #46167] |
Wed, 31 October 2018 09:00   |
|
I tried to compile gfortran + U++ under linux.
I make template.
If you want compile only fortran module = select Fortran Only Package.
If you want fortran + U++ use "Fortram i C++ Core package"
Example code, that created by template consist of call fortran subroutines from C++ and C++ functions from fortran code.
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
Re: Compiling Fortran sources in TheIde [message #50440 is a reply to message #50439] |
Wed, 31 October 2018 09:10   |
|
Debugger work with this files (.FOR and .F90) perfectly.
Variables are watchable.
structures and arrays are watchable too.
It would be appropriate to tell that theide supports gfortran, if not one "BUT".
The editor does not support a fortran-syntax highlightings.
By search of a context in all files of a directory of a packet, the editor confuses row numbers. For example finds entrance of a required context on the 52nd line, and really it appears on the 83rd line.
Colleagues, prompt where to float?
Where to look for the decision?
What file of TheIde source codes to try to adjust?
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
Re: Compiling Fortran sources in TheIde [message #52146 is a reply to message #52138] |
Mon, 29 July 2019 10:03   |
 |
koldo
Messages: 3432 Registered: August 2008
|
Senior Veteran |
|
|
An additional detail.
Actual demo launches a SEGFAULT using gfortran 64 bits.
To fix it, this could be done:
- In Fortran code, declare string as
character(len=80) :: cc = char(0)
- In C code, remove
cc[ll--] = '\0'; // NULL terminate the string
This is due in void writelog_( char *cc, int ll ), ll has the original dimension (80), but as gfortran seems to trim the length to the real string, returned string is shorter so assigning a '\0' to 80-1 access to non allocated memory, creatintg the SEGFAULT
- Assign the class pointer in the constructor:
tfp = this;
If not, calling tfp->WriteLog(cc); may fail.
Best regards
Iñaki
|
|
|
|
Re: Compiling Fortran sources in TheIde [message #52154 is a reply to message #52149] |
Tue, 30 July 2019 07:55  |
 |
koldo
Messages: 3432 Registered: August 2008
|
Senior Veteran |
|
|
Hi Sergey
I think the SEGFAULT has nothing to do with integer sizes. It was produced after this line
What I meant is that ll returns 80, the initial declaration size. However gfortran really allocates the size of the string, I mean, it shrinks the 80 to the real size. This way cc[ll--] = '\0' corrupts memory.
Best regards
Iñaki
|
|
|
Goto Forum:
Current Time: Sat Apr 26 20:27:17 CEST 2025
Total time taken to generate the page: 0.01969 seconds
|
|
|