Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
koldo is currently offline  koldo
Messages: 3354
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 #28609 is a reply to message #24712] Wed, 08 September 2010 10:47 Go to previous messageGo to next message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
Koldo,

No idea about TheIde capabilities, but if you are really interested in Fortran, there are some options available; among them, I recommend (Eclipse+Photran)+gFortran compiler.

Best wishes,

Javier
Re: Compiling Fortran sources in TheIde [message #28615 is a reply to message #28609] Wed, 08 September 2010 11:02 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Thank you Javier

Best regards
Iñaki
Re: Compiling Fortran sources in TheIde [message #28620 is a reply to message #24712] Wed, 08 September 2010 11:33 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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 Wink 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 #28621 is a reply to message #28620] Wed, 08 September 2010 11:38 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Thank you all.

For now I do not need it but I will take it into account.

(ah, in a recent post Mirek told that somebody included java files in TheIDE Smile)


Best regards
Iñaki
Re: Compiling Fortran sources in TheIde [message #28623 is a reply to message #28621] Wed, 08 September 2010 11:41 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Yes, Java is supported. If you need it, you might add FortranBuilder as well Wink

Honza
icon4.gif  Re: Compiling Fortran sources in TheIde [message #46167 is a reply to message #28623] Mon, 21 March 2016 14:32 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

How to pass to Custom build steps some Flags like Debug or defined Flags (like GUI).?

(I try to setup compile gfortran from TheIde, and all very well, but can't decide how to pass something other than the files path)


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}

[Updated on: Mon, 21 March 2016 14:32]

Report message to a moderator

Re: Compiling Fortran sources in TheIde [message #50438 is a reply to message #46167] Wed, 31 October 2018 09:00 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

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 #50439 is a reply to message #50438] Wed, 31 October 2018 09:01 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

One more template
"Fortran only"


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 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

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 #52138 is a reply to message #50440] Thu, 25 July 2019 14:31 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Thank you Sergey

It works!

I just have to add -lgfortran in "Common link options".


Best regards
Iñaki
Re: Compiling Fortran sources in TheIde [message #52146 is a reply to message #52138] Mon, 29 July 2019 10:03 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
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 #52149 is a reply to message #52146] Mon, 29 July 2019 12:34 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

May be. Fortran and C++ differently use size of integer in 64 bit mode.

Use int32_t or int64_t in C++ and INTEGER(8 ) or INTEGER(4) in fortran.

Unfortunately, upt have to rewrite under 64bit Fortran.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}

[Updated on: Mon, 29 July 2019 12:34]

Report message to a moderator

Re: Compiling Fortran sources in TheIde [message #52154 is a reply to message #52149] Tue, 30 July 2019 07:55 Go to previous message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hi Sergey

I think the SEGFAULT has nothing to do with integer sizes. It was produced after this line
cc[ll--] = '\0'

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
Previous Topic: How to inspect memory at pointer-address while debugging
Next Topic: large exe size
Goto Forum:
  


Current Time: Thu Mar 28 11:29:42 CET 2024

Total time taken to generate the page: 0.02663 seconds