Setting Flags in XCode for ifort

Setting Flags in XCode for ifort

Hi,
I am using OX 10.8.2, XCode 4.5.2 and Intel Fortran Composeer XE 2013.
I am trying to get a debugger to work.
In the Intallation Guide and Release notes it says, I should use the following options
-g -save-temps -fpic –Wl,-no-pie

On this forum (http://software.intel.com/en-us/forums/topic/271178), it says I should use:
-g -save-temps -fpic -Wl,-no_pie

So far so good. But where do I set these flags in XCode? I admit that I have never used it before. I am assuming somewhere within the "Build Settings"? There are quite a few options related to ifort, but I am not sure where.

Thanks for your help,
Cheers,
Claus

7 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
mecej4的头像

I think that these flags are for use as described when compiling from the command line.

-g -save-temps -fpic

are options for use by the Fortran compiler, whereas

–Wl,-no-pie

tells the compiler "pass '-no-pie' to the linker". I do not have a Mac, but I think that an IDE would have places where you specify compiler options and other places where you specify linker options.

The settings only impact debugging with IDB outside Xcode because IDB does not integrate into Xcode. Xcode uses GDB only.

I’m still learning Xcode 4.x myself, so I’m not sure how your Xcode layout compares to mine, but in the project view (left-side panel), click the project name. This may render a projects and targets view to the right which may include visibility of the Build Settings/Phases. Under Build settings, scroll down to the section Intel® Fortran Compiler XE 13.0 (Limited Feature) - Command Line section where you will find the Additional options setting. Left-click the field once to select, then left-click again to make the field setting editable. You can add the options indicated.

The correct form is (underscore) -Wl,-no_pie

Thanks, that started to shed some light into the tunnel.

I put

-g -save-temps -fpic

under Deployment -- additional Strip Flags -- Debug

Under Linking, I found "Other Linker Flags", and there I put under "Debug"

–Wl,-no-pie

Now, the first one works fine. The second one gives an error

/ifort-13.0: error #10236: File not found: '–Wl,-no-pie'

So I am guessing this is the wrong place. But where is the right place?

What might also be an issue is that in XCode under
Product -- Debug
pretty much everything is greyed out.

I'd appreciate any pointers.

Thanks Kevin,

- I found the "Command Line" section, and placed the settings there.
- What does "debugging with IDB outside Xcode" mean, and how does it work?

Quote:

Kevin Davis (Intel) wrote:

The settings only impact debugging with IDB outside Xcode because IDB does not integrate into Xcode. Xcode uses GDB only.

I’m still learning Xcode 4.x myself, so I’m not sure how your Xcode layout compares to mine, but in the project view (left-side panel), click the project name. This may render a projects and targets view to the right which may include visibility of the Build Settings/Phases. Under Build settings, scroll down to the section Intel® Fortran Compiler XE 13.0 (Limited Feature) - Command Line section where you will find the Additional options setting. Left-click the field once to select, then left-click again to make the field setting editable. You can add the options indicated.

Debugging outside Xcode means you must run IDB from the command-line under a terminal window. It works the same as using GDB from the command-line if you are familiar with that. You cannot use IDB under the Xcode GUI. I haven't tied yet, but you might have some limited debug capability of Fortran under Xcode.

mecej4的头像

This is in reply to Response #3 (numbering the original post as 0 -- [INTEL, PLEASE NUMBER THE POSTS IN A THREAD]).

The "-Wl," prefix tells the compiler, "what follows is an option to the linker, not to you". If you directly specify linker options in an IDE, put only the parts that follow the "-Wl," prefix.

登陆并发表评论。