Author Topic: First impression of C::B - Perforce and Intel Fortran issues  (Read 12699 times)

Offline pclausen

  • Single posting newcomer
  • *
  • Posts: 7
First impression of C::B - Perforce and Intel Fortran issues
« on: November 09, 2010, 06:16:42 pm »
Hi

I'm working as developer on Linux using mainly C/C++ and Fortran (Intel Compilers: icpc and ifort). We have been looking for a new IDE since the C-Forge project died. Due to CMake and the integration of C::B therein I wanted to take a look into the Pros/Cons of C::B. The competition is Eclipse and Kdevelop.

My general first impression is really good. The Fortran Plugin http://darmar.vgtu.lt looks really neat but I have to see how it really performs in our mixed C++ and Fortran 90-code.

I have exported our CMake-project and its really beautifully imported into C::B. It would have been nice if compiler settings were also read from CMake but that does not matter much - I can live with changing that manually.

I have two main issues:
1. Perforce integration: We use Perforce which means that Perforce integration is pretty much a KO-criterion. However, it would be sufficient to simply being able to check out files when editing. Something like:
   $ p4 edit $current_file_in_CB$
Can I add this myself or hack it somehow? A button in C::B doing the above would also be OK.

2. Fortran compiler jump to error does not work. The output of ifort i a bit different than icpc but I read somewhere that C::B uses regex's to parse the output. Can I somehow fix it myself or have I overlooked some setting ?
Code
IFORT: fortcom: Error: /scratch/users/clausen/Repository/main/development/baseline/source/prog_dev/prog_hp2/bead_steu.f90, line 69: A specification statement cannot appear in the executable section.
ICPC: /scratch/users/clausen/Repository/main/development/baseline/source/onf/fem2onf/fem2onf.cpp(30): error: identifier "dflmdfb" is undefined

I am uncertain whether I'm posting in the correct tread because I am not that experienced in posting in forums. Thanks in advance for you advice.

Best regards

Peter

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: First impression of C::B - Perforce and Intel Fortran issues
« Reply #1 on: November 09, 2010, 08:33:43 pm »
You can modify the parsing in:
Settings -> Compiler & Debugger -> Compiler -> Ifort -> Other settings -> Advanced button -> Output parsing...

If you fix the parsing probably you could provide a patch :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: First impression of C::B - Perforce and Intel Fortran issues
« Reply #2 on: November 09, 2010, 11:51:18 pm »
I have once written a plug-in for clearcase, I think it can be used as a starting point and changing it a bit so it works for perforce might not be that difficult.
I might be able to help on this, if you could provide me the commands to execute (so I don't have to read too much of the manual ;-) ).
I experimented with perforce about 8 years ago, but I ahve been planning of reinstating it at home as my personal version control system.

So let's say the perforce issue could be solved, maybe insmall increments, but at least there will be progress.

Offline pclausen

  • Single posting newcomer
  • *
  • Posts: 7
Re: First impression of C::B - Perforce and Intel Fortran issues
« Reply #3 on: November 10, 2010, 05:31:20 pm »
@oBFusCATed: Thanks, I'll look into that

@killerbot: That sounds cool. I'll try to list what I use  - which may only be a subset of what most people use, but hey that a starting point. There is a free Perforce-download at: http://www.perforce.com/perforce/download_eval.html

Important Perforce (p4) commands
The only thing I am really really missing is "check out current file" which is

Code
$ p4 edit <current_file> 

if this can be automatically done by "Replace in files ..." I would be laughing !  :-D

Often used Perforce (p4) commands
Our usual workflow is to only checkout in the IDE. I have even done a bit of Python programming in Eclipse which has a full blown Perforce integration, but I (and my colleagues) mostly use Perforce's own client (P4v) for the rest (submit, adding files, ...).

For IDE integratino you would need to know if a file is in source control or not. This can be done in different ways but I guess following should do the job:
Code
p4 files *
//depot/main/development/baseline/source/CMakeLists.txt#17 - edit change 46261 (text)
CMakeLists.txt~ - no such file(s).

Often used commands would be:

        sync       Synchronize the client with its view of the depot
Code
p4 sync ./...
                     Above Syncs current dir and subdirs
        add        Open a new file to add it to the depot
        edit       Open an existing file for edit
        delete     Open an existing file to delete it from the depot

        resolve    Merge open files with other revisions or files
        revert     Discard changes from an opened file
        submit     Submit open files to the depot

And also:

        change      Create or edit a changelist description
        diff        Display diff of client file with depot file
        diff2       Display diff of two depot files
        filelog     List revision history of files

Of course Perforce is capable of much more (about 85 commands) and we are only using the outmost basics.

If I can in any way help to test I would be very happy. Compiling is no problem (I guess) but I have never done GUI-programming...

Best regards

Peter

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: First impression of C::B - Perforce and Intel Fortran issues
« Reply #4 on: November 10, 2010, 07:54:52 pm »
The only thing I am really really missing is "check out current file" which is

Code
$ p4 edit <current_file> 
You can add a tool for that -> Tools -> Configure tools
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline pclausen

  • Single posting newcomer
  • *
  • Posts: 7
Re: First impression of C::B - Perforce and Intel Fortran issues
« Reply #5 on: November 11, 2010, 11:35:30 am »
WOW, that's pretty cool !

I've added: Tools --> Configure Tools --> Add ...
Name: P4Edit
Executable: /store2/develop/perforce/p4
Parameters: edit ${ACTIVE_EDITOR_FILENAME}

* Launch tool hidden with standard output redirect

Thus, I can edit files by just: ctrl-E  using a shortcut: Settings --> Editor --> Keyboard Shortcuts

I've added the ifort regex (must be moved before the C-regexes, dont really know why)
Settings -> Compiler & Debugger -> Compiler -> Ifort -> Other settings -> Advanced button -> Output parsing...

Description: Compilation error ifort
Type: Error
Regex: fortcom:[ \t]+[Ee]rror[ \t]*:[ \t]*([{}() \t#%$~A-Za-z0-9_:+/\.-]+)[, \t]+line[ \t]+([0-9]+)[: \t]+(.*)
Message: 3
Filename: 1
Line:2


Description: Compilation warning ifort
Type: Error
Regex: fortcom:[ \t]+[Ww]arning[ \t]*:[ \t]*([{}() \t#%$~A-Za-z0-9_:+/\.-]+)[, \t]+line[ \t]+([0-9]+)[: \t]+(.*)
Message: 3
Filename: 1
Line:2

Thumbs up and thanks guys! Could you add this to the Intel-compiler options by default? I do not see why not...

One minor issue: If line nr is 0 (happens when Fortran names are too long) then Code::Blocks cant jump to file. Example compiler output:
Code
fortcom: Warning: /scratch/users/clausen/Repository/main/development/baseline/source/prog_dev/prog_mod/s_cell_reg.f90, line 0: Global name too long, shortened from: cell_raster_mp_s_get_nd_in_area_gad_brute_force_$BLK.coordinate_transformation_mp_command_id_name_ to: ll_raster_mp_s_get_nd_in_area_gad_brute_force_$BLK.coordinate_transformation_mp_command_id_name_

I'll be back when I have some more experience with C::B

/Peter
« Last Edit: November 12, 2010, 01:22:15 pm by pclausen »

Offline xunxun

  • Almost regular
  • **
  • Posts: 187
Re: First impression of C::B - Perforce and Intel Fortran issues
« Reply #6 on: November 11, 2010, 04:57:56 pm »
One minor issue: If line nr is 0 (happens when Fortran names are too long) then Code::Blocks cant jump to file. Example compiler output:
Code
fortcom: Warning: /scratch/users/clausen/Repository/main/development/baseline/source/prog_dev/prog_mod/s_cell_reg.f90, line 0: Global name too long, shortened from: cell_raster_mp_s_get_nd_in_area_gad_brute_force_$BLK.coordinate_transformation_mp_command_id_name_ to: ll_raster_mp_s_get_nd_in_area_gad_brute_force_$BLK.coordinate_transformation_mp_command_id_name_

I'll be back when I have some more experience with C::B

/Peter

This is a warnning, and you can add a warning regx rule.
Regards,
xunxun

Offline pclausen

  • Single posting newcomer
  • *
  • Posts: 7
Re: First impression of C::B - Perforce and Intel Fortran issues
« Reply #7 on: November 12, 2010, 12:01:31 pm »
This is a warnning, and you can add a warning regx rule.

Yes I know, and all other warnings work - but not when line number = 0 as it is in this case.

/Peter


Offline xunxun

  • Almost regular
  • **
  • Posts: 187
Re: First impression of C::B - Perforce and Intel Fortran issues
« Reply #8 on: November 12, 2010, 04:56:38 pm »
This is a warnning, and you can add a warning regx rule.

Yes I know, and all other warnings work - but not when line number = 0 as it is in this case.

/Peter



Could you show your some source code? I don't know what "Fortran names are too long"'s meaning is. I think "Fortran names are too long" may occur some error as "This symbol has too many characters".
Regards,
xunxun

Offline pclausen

  • Single posting newcomer
  • *
  • Posts: 7
Re: First impression of C::B - Perforce and Intel Fortran issues
« Reply #9 on: November 23, 2010, 05:52:18 pm »
Its been a while - and I still like Code::Blocks   :D

Could you show your some source code? I don't know what "Fortran names are too long"'s meaning is. I think "Fortran names are too long" may occur some error as "This symbol has too many characters".

The code is:
Code
MODULE CELL_RASTER
.....
contains
  subroutine s_get_nd_in_area_gad_brute_force (minp, &
    &                                          maxp)
    use coordinate_transformation
    ...
   end subroutine

Generates the warning:

Code
fortcom: Warning: /scratch/users/clausen/Repository/main/development/baseline/source/prog_dev/prog_mod/s_cell_reg.f90, line 0: Global name too long, shortened from: cell_raster_mp_s_get_nd_in_area_gad_brute_force_$BLK.coordinate_transformation_mp_design_cycle_aktuell_ to: ster_mp_s_get_nd_in_area_gad_brute_force_$BLK.coordinate_transformation_mp_design_cycle_aktuell_
I fixed it by including the USE-statement in the top of module statement - the way it should be! Still, Code::Blocks chokes on the "line 0"



Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: First impression of C::B - Perforce and Intel Fortran issues
« Reply #10 on: November 23, 2010, 10:10:21 pm »
Its been a while - and I still like Code::Blocks   :D
Nice to hear !

Still, Code::Blocks chokes on the "line 0"

I don't see a possibility to do anything other.
If C::B does not get a valid line-number it can not jump to the error.
In this cases (line <= 0) the DoGotoError-function just returns.

The regexes are saved in ~/.codeblocks/default.conf on linux.
You can export the compiler-set in question (<compiler><sets><icc> for default Intel C/C++) with cb_share_config and import it on other machines.

Copied (cloned) compiler sets are stored in <compiler><user_sets> .

Offline xunxun

  • Almost regular
  • **
  • Posts: 187
Re: First impression of C::B - Perforce and Intel Fortran issues
« Reply #11 on: November 24, 2010, 05:41:00 am »
Its been a while - and I still like Code::Blocks   :D

Could you show your some source code? I don't know what "Fortran names are too long"'s meaning is. I think "Fortran names are too long" may occur some error as "This symbol has too many characters".

The code is:
Code
MODULE CELL_RASTER
.....
contains
  subroutine s_get_nd_in_area_gad_brute_force (minp, &
    &                                          maxp)
    use coordinate_transformation
    ...
   end subroutine

Generates the warning:

Code
fortcom: Warning: /scratch/users/clausen/Repository/main/development/baseline/source/prog_dev/prog_mod/s_cell_reg.f90, line 0: Global name too long, shortened from: cell_raster_mp_s_get_nd_in_area_gad_brute_force_$BLK.coordinate_transformation_mp_design_cycle_aktuell_ to: ster_mp_s_get_nd_in_area_gad_brute_force_$BLK.coordinate_transformation_mp_design_cycle_aktuell_
I fixed it by including the USE-statement in the top of module statement - the way it should be! Still, Code::Blocks chokes on the "line 0"




Sorry, I can't reproduce your warnning.
I use intel c/c++/fortran compiler 12.
Regards,
xunxun

Offline pclausen

  • Single posting newcomer
  • *
  • Posts: 7
Re: First impression of C::B - Perforce and Intel Fortran issues
« Reply #12 on: November 24, 2010, 01:59:51 pm »
Still, Code::Blocks chokes on the "line 0"

I don't see a possibility to do anything other.
If C::B does not get a valid line-number it can not jump to the error.
In this cases (line <= 0) the DoGotoError-function just returns.

hmm, well, I would have expected C::B to go to the file, which it does not. In my humble opinion the behavior should be:
Code
 if (line <=0) {line = 1;} 
. But its no biggy...