Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic TAU (steve huntington)
Decrease font size
Increase font size
Topic Title: Can Tau import cpp with gcc?
Topic Summary: Import cpp header files in Tau G2 with gcc installed
Created On: 3-Mar-2005 21:17
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by suneel santharam, on Friday, March 11, 2005 4:46 PM

Answer:
Hi Tom,

I too have the same setup as your's with TAU G2 2.4 version.

I am able to import the below enum successfully.
typedef enum x
{
Red,
Green
};

I would suggest to try again with a new import package.
If you still face the issue. I would like to receive your model to investigate.

Best Regards,
Suneel.
 3-Mar-2005 21:17
User is offline View Users Profile Print this message


Tom Pelkey

Posts: 2
Joined: 2-Mar-2005

I have installed gcc for Tau G2 model verification (which works).  When I attempt to import an enum typedef in a cpp header file (.h), I get the following preprocessor errors:

TCI0007: Could not spawn preprocessor subprocess. (Error)
TCI0014: Failed to preprocess input file. (Error)

To me this error indicates Tau can't find gcc which is in the path and does work with model verification. 
Also, I set the C/C++ Dialect attribute of the ImportedDefinitions package to GNU C/C++.

Can Tau import cpp header files using gcc?  If so, what is required?

Thanks!
Tom

Report this to a Moderator Report this to a Moderator
 11-Mar-2005 07:12
User is offline View Users Profile Print this message


suneel santharam

Posts: 15
Joined: 4-Sep-2003

Answer Answer
Hi Tom,

I too have the same setup as your's with TAU G2 2.4 version.

I am able to import the below enum successfully.
typedef enum x
{
Red,
Green
};

I would suggest to try again with a new import package.
If you still face the issue. I would like to receive your model to investigate.

Best Regards,
Suneel.
Report this to a Moderator Report this to a Moderator
 11-Mar-2005 19:29
User is offline View Users Profile Print this message


Tom Pelkey

Posts: 2
Joined: 2-Mar-2005

Hi Suneel,

I saved your enum in simple.h
Then,
File/Import... C/C++,
Add Files...simple.h, 
Selected Header files contain only C,
Selected gnu c/c++ dialect,
Unchecked Import now
Finish
This created ImportedDefinitions package under the Model Package.
Next, I updated the preprocessor to point to my gcc.exe (this fixed the 1st error I reported)
Right click on the ImportedDefinitions package in the Model View and selected Import C/C++
It generated the following errors:

TCI0013: Preprocessing... (Information)
gcc: C:\\WINDOWS\\temp\\cc2: No such file or directory (Information)
gcc: compilation of header file requested (Information)
TCI0031: Cannot open preprocessed tempfile C:\WINDOWS\temp\cc2 (Error)
TCI0014: Failed to preprocess input file. (Error)

In my first message Tau couldn't find gcc.  Now that I point to gcc, it cannot create temp\cc2 directory.

I would appreciate any help on this.

I didn't see a way to attach my project files.

Thanks!
Tom

Report this to a Moderator Report this to a Moderator
 16-Mar-2005 08:37
User is offline View Users Profile Print this message


suneel santharam

Posts: 15
Joined: 4-Sep-2003

Hi Tom,

Can you give me your email id I can send you my model.

Just for your information:
-----------------------------
In TAU G2 2.3 for importing a header file I used a bat file for "gcc" as below:

@set PATH=C:\cygwin\bin;%PATH%
cpp -xc++ -Wall %4 %3 %1 %2.i
@copy %2.i %2

in the "Preprocessor" option.

However, this is not need in TAU G2 2.4 release.

Best Regards,
Suneel...




Report this to a Moderator Report this to a Moderator
 26-Apr-2005 12:17
User is offline View Users Profile Print this message


Miriam van Soest

Posts: 4
Joined: 26-Apr-2005

Hi Suneel, I am trying to do the same, but I have one problem. I am working of a windows environment, and I tried to access the h files via a samba share (and use cygwin + gcc). It cannot resolve some h files, because of the fact that links are not vissible over samba share. Is there a way to still generate output, although it gets these errors? Best regards, Miriam
Report this to a Moderator Report this to a Moderator
 11-May-2005 08:29
User is offline View Users Profile Print this message


Wim Schaap

Posts: 1
Joined: 15-Apr-2005

Yesterday I had the same issue and was able to resolve it:

In your project directory you have to create a mycpp.bat file containing:

gcc -E -v -x c++ %1 -o %2.i
@copy %2.i %2



It seems that if you would like to add more header files for import, TAU has a problem: It's then better to create a new package for import.
Here is my question: I would like to be able to import macros....

Report this to a Moderator Report this to a Moderator
 10-Mar-2006 07:58
User is offline View Users Profile Print this message


Aitor Illarramendi

Posts: 38
Joined: 20-Feb-2006

Hello: Just a question. Supose that I have a C++ application which I develop it in Tru64 and Linux environments. I've the source code. I pass it to windows in order to do reverse engineering with TAU windows client (more friendly). But I have TI00031 errors due to no header references. My code has a lot of dependences. For example, some of them to Qt libraries. So, it implies to have added to the import project all the .h header files of Qt... And then? The .h files of Qt will imply new references that Qt could do with other libraries? So I have only this solution? Install TAU Linux client and do reverse engineering in the same environment for development? So I have to add all the header files manually... Or... There is a way to limit the depth of the reverse engineering analysis for the preprocessor. I mean, I only want the model of my classes. Never mind of how Qt has organized it's own classes. Can TAU abstract this types, definitions and classes and make the model without having to define (manually and one by one) all the third party artifacts that I don't need to see more than a reference? Best regards.
Report this to a Moderator Report this to a Moderator
 10-Mar-2006 10:49
User is offline View Users Profile Print this message


Aitor Illarramendi

Posts: 38
Joined: 20-Feb-2006

Another question: What about TAU Linux client? Is for 2.4 Kernels. Are there any enhancements for more modern 2.6 kernels? Best regards.
Report this to a Moderator Report this to a Moderator
 10-Mar-2006 12:52
User is offline View Users Profile Print this message


Greg Gorman

Posts: 75
Joined: 4-Oct-2002

quote:

Originally posted by: Aitor Illarramendi Amilibia
Another question:

What about TAU Linux client? Is for 2.4 Kernels. Are there any enhancements for more modern 2.6 kernels?

Best regards.


Aitor,
The next release of TAU/Archictect and TAU/Developer (v2.7) will be supported for RedHat Enterprise 4 (2.6 kernel). it will also be supported on Solaris 10. The release is scheduled for April/May 2006.

Greg

-------------------------
Greg Gorman
Vice President, Product Management
Modeling and Test Products
Telelogic AB
Report this to a Moderator Report this to a Moderator
 10-Mar-2006 12:53
User is offline View Users Profile Print this message


Greg Gorman

Posts: 75
Joined: 4-Oct-2002

quote:

Originally posted by: Aitor Illarramendi Amilibia
Hello:

Just a question.

Supose that I have a C++ application which I develop it in Tru64 and Linux environments.

I've the source code. I pass it to windows in order to do reverse engineering with TAU windows client (more friendly).

But I have TI00031 errors due to no header references.

My code has a lot of dependences. For example, some of them to Qt libraries.

So, it implies to have added to the import project all the .h header files of Qt...

And then? The .h files of Qt will imply new references that Qt could do with other libraries?

So I have only this solution?

Install TAU Linux client and do reverse engineering in the same environment for development? So I have to add all the header files manually...

Or...

There is a way to limit the depth of the reverse engineering analysis for the preprocessor.

I mean, I only want the model of my classes. Never mind of how Qt has organized it's own classes.

Can TAU abstract this types, definitions and classes and make the model without having to define (manually and one by one) all the third party artifacts that I don't need to see more than a reference?

Best regards.


Aitor,
One way to do it is to mark the libraries as <<informal>>. That way they should not be checked any more.

Greg

-------------------------
Greg Gorman
Vice President, Product Management
Modeling and Test Products
Telelogic AB
Report this to a Moderator Report this to a Moderator
 10-Mar-2006 14:46
User is offline View Users Profile Print this message


Aitor Illarramendi

Posts: 38
Joined: 20-Feb-2006

Thanx for both replies
Report this to a Moderator Report this to a Moderator
 13-Mar-2006 08:46
User is offline View Users Profile Print this message


Aitor Illarramendi

Posts: 38
Joined: 20-Feb-2006

Greg, thought yo were talking about using a special case of #include directive that was using twice << and >> instead of once. This misleading was due I don't have an extense experience in C/C++ preprocessor. I have noticed that I was wrong. Are you trying to talk to me about <> like stereotype instead of what I was thinking? I don't understand then what you mean. I'm trying to import C/C++ classes from zero. Pure reverse engineering. I have no classes in the model. And so, I can't define yet any stereotypes. The problem is that my classes use Qt libraries. And the preprocessor is asking for them. I could try to put TAU in a development environment (unlucky, because TAU is only for 2.4 Linux kernels and we have 2.6 ones). Anyways, and what if after adding all Qt headers the preprocessor starts to ask for headers that Qt uses from the system or other libraries? How we could stop/limit that? Best regards.
Report this to a Moderator Report this to a Moderator
 13-Mar-2006 08:51
User is offline View Users Profile Print this message


Aitor Illarramendi

Posts: 38
Joined: 20-Feb-2006

mmm... I've found that I can check the stereotype in the Import package. I've checked this one: TTDPredefinedStereotypes::informal. Anyways, the problem is still there. It's looking for the included files anyway. Best regards.
Report this to a Moderator Report this to a Moderator
 24-Mar-2006 14:52
User is offline View Users Profile Print this message


Greg Gorman

Posts: 75
Joined: 4-Oct-2002

Aitor, Let me check with support. I think you have to have them available because the importer is trying to make the model complete. You at least have to have the -I paths correct so it can parse them.

We are doing more work in v2.7 to make it easier to import C++ (and it will also support Linux 2.6 kernels).

Greg

-------------------------
Greg Gorman
Vice President, Product Management
Modeling and Test Products
Telelogic AB
Report this to a Moderator Report this to a Moderator
 24-Mar-2006 15:02
User is offline View Users Profile Print this message


Aitor Illarramendi

Posts: 38
Joined: 20-Feb-2006

Yeah... ... our solution has gone in that direction --> point with -I to all the header references needed. That works. But you receive an incredible amount of class and type definitions (for example of third party libraries) which you don't really need for your modelling purposes. I mean, if I want to do reverse engineering of my C++ code and it uses Qt, STL or any other kind of utility libraries from third party software, I don't want to see them in the model, not at least at the same level as my own code, or at least to view them separatelly. I don't know, perhaps the solution could be by the differentiation in the import wizard between developers code and reference library paths in order to create a more readable model. We are working on it. One colleague is trying to "parse" third party classes and definitions with a TAU SDK script (I think). He has posted a question about it if I remember well. Many thanks Greg. Best regards.
Report this to a Moderator Report this to a Moderator
 24-Mar-2006 15:11
User is offline View Users Profile Print this message


Greg Gorman

Posts: 75
Joined: 4-Oct-2002

I think there is a way to still have the -I include directories but to not process them. My 2.6 version has a checkbox on the Package with the cppImportSpecification stereotype that says "Do not import definitons from included header files" and that should turn off the import of the libraries.

You can also try the Selective Import field to only process those exact files.

Hopefully when we ship 2.7 you will have an easier time.

Greg

-------------------------
Greg Gorman
Vice President, Product Management
Modeling and Test Products
Telelogic AB
Report this to a Moderator Report this to a Moderator
 24-Mar-2006 15:12
User is offline View Users Profile Print this message


Greg Gorman

Posts: 75
Joined: 4-Oct-2002

You can also skip the Wizard, which does some things you may not want, and just have it create the Import package. Then you can set some advanced options first and then import the code by right-clicking on the Package and doing Import C/C++.

-------------------------
Greg Gorman
Vice President, Product Management
Modeling and Test Products
Telelogic AB
Report this to a Moderator Report this to a Moderator
 24-Mar-2006 15:16
User is offline View Users Profile Print this message


Aitor Illarramendi

Posts: 38
Joined: 20-Feb-2006

Many thanks Greg! I'll try both. Surelly (because of being in a hurry) we haven't seen those options, sorry Many thanks again. Best regards.
Report this to a Moderator Report this to a Moderator
 31-Jul-2006 20:58
User is offline View Users Profile Print this message


Ronak Patel

Posts: 2
Joined: 31-Jul-2006

Hello All,

I am a newbie when it comes to using TAU's Reverse Engineering capability. Here is my problem:

I have a large pile of C++ classes and libraries for Applications that I created on Fedora Core 5/gcc 4.1. I have TAU G2.7 installed on Windows2000/Visual Studios .NET 2005. I copied all of the source code from the Fedora Core machine to the Windows 2000 machine.

When I try to reverse engineer any C++ code, regardless of the file, I get an error that the preprocessor subprocess could not be launched. I don't see anything in TAU's help section that mentions what to do about this.

Can anyone help me get TAU to import C++ code without any hassle?

Report this to a Moderator Report this to a Moderator
 31-Jul-2006 21:42
User is offline View Users Profile Print this message


Greg Gorman

Posts: 75
Joined: 4-Oct-2002

Hi Ronak,
It is trying to run the C++ pre-processor on the files. With VS .NET I have to run a small bat file first to make sure the environment and paths are set properly.

I created a file called "StartTAU2.7.bat" and put these lines in it:
call "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat"
"c:\program files\telelogic\tau_2.7\bin\vcs.exe"

and then put a shortcut to it on my desktop and start bar. That's how I start TAU now, and it will always have the right environment for VS.

See if that helps you.
Greg

-------------------------
Greg Gorman
Vice President, Product Management
Modeling and Test Products
Telelogic AB
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic TAU forum.
There are currently 0 users logged in.
The most users ever online was 15 on 31-Mar-2008 at 16:22.
There are currently 0 guests browsing this forum, which makes a total of 0 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.