I was using the makefile code (below), with a Fortran77 compiler it worked to my satisfaction but I attempted to use the same code in partnership with an Intel Fortran Compiler (IFORT) and it does not work well at all.
Can anyone offer any suggestions on improving the code?
davidism
69.4k1313 gold badges203203 silver badges205205 bronze badges
user3758608user3758608
1 Answer
This is a pretty simple makefile and the only real change needed is to change
f77 = pfg77 to f77 = ifort . I'm not sure that ifort will like the -O4 option (O3 is the highest level in documentation for ifort), so you might change that just to make sure you get optimization.
There are two other issues not related to the makefile that could be causing you problems.
To provide any specific help beyond these generalities, the actual errors produced by the compiler or by make need to be provided.
caseycasey
6,05011 gold badge1818 silver badges3131 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged compiler-errorsmakefilefortranintel-fortran or ask your own question.
I am trying to use f2py to interface my python programs with my Fortran modules.
I am on a Win7 platform.
I use latest Anaconda 64 (1.7) as a Python+NumPy stack.
My Fortran compiler is the latest Intel Fortran compiler 64 (version 14.0.0.103 Build 20130728).
I have been experiencing a number of issues when executing
f2py -c -m PyModule FortranModule.f90 --fcompiler=intelvem
The last one, which I can't seem to sort out is that it looks like the sequence of flags f2py/distutils passes to the compiler does not match what ifort expects.
I get a series of warning messages regarding unknown options when ifort is invoked.
I suspect this is related to the errors I get from the linker at the end
and it concludes with a plain
My guess is that this is because the /link flag is missing in the sequence of options. Because of this, the /l /L options are not passed to the linker and the compiler believes these are addressed to him.
The ifort command generated by f2py looks like this:
I have no idea why the '-dll' is repeated twice (I had to change that flag from an original '-shared').
Now, I have tried to look into the f2py and distutils codes but haven't figured out how to bodge an additional /link in the command output. I haven't even been able to locate where this output is generated.
If anyone has encountered this problem in the past and/or may have some suggestions, I would very much appreciate it.
Thank you for your time
vaultah
29.2k99 gold badges8181 silver badges110110 bronze badges
TeslaTesla
2 Answers
I encountered similar problems with my own code some time ago. If I understand the comments correctly you already used the approach that worked for me, so this is just meant as clarification and summary for all those that struggle with f2py and dependencies:
f2py seems to have problems resolving dependecies on external source files. If the external dependencies get passed to f2py as already compiled object files though, the linking works fine and the python library gets build without problems.
The easiest solution therefore seems to be:
A simple python skript could look like this (pycompile.py):
A more flexible solution for large projects could be provided via Makefile, as dicussed by @bdforbes in the comments (for reference) or a custom CMake User Command in combination with the above skript:
with modified pycompile:
Max GraserMax Graser
The library path is specified using /LIBPATH not /L
cupcup
4,80522 gold badges1010 silver badges2828 bronze badges
Not the answer you're looking for? Browse other questions tagged python-2.7fortrandistutilsintel-fortranf2py or ask your own question.
I'm using the intel fortran compiler (
ifort ) in an mpi environment. It turns out that my code has a buffer overflow as I compiled with the flags -g -O2 -check bounds . After running a while, I get this message:
This is great -- I now know that I'm overrunning Martijn Pieters♦
XX , but where? using gfortran , -fbounds-check would give me a file and line number. Is there any way that I can get that with ifort ?
744k157157 gold badges26772677 silver badges24122412 bronze badges
mgilsonmgilson
219k4141 gold badges433433 silver badges547547 bronze badges
1 Answer
A
-traceback flag may be used with Intel and Portland Group Fortran compilers to request additional information to be generated in object files for line and source traceback. When a severe error occurs during run time, the program will attempt to report line number and source file where the error occured, as well as line numbers and source files from parent procedures where the calls were made.
Equivalent flag for gfortran is Vladimir F
-fbacktrace .
Free Intel Fortran Compiler
42.3k44 gold badges4141 silver badges7373 bronze badges
milancurcicmilancurcic
5,08922 gold badges2929 silver badges4242 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged fortrancommand-line-argumentsintel-fortran or ask your own question.
I'm trying to compile OpenMPI 1.10.2 using the Intel Fortran compiler (ifort) installed with graphic interface.When configuring
(as told by README to set a different compiler) I get the following error
Looking in the config.log file I read this:
So I tried running ifort alone, and it works.Also, I can't find the conftest.f file.
Same issues with icc (Intel c++ compiler). Direct link buell.
I think there is some path to put in, but don't know how.
GabrieleGabriele
1 Answer
Yes, your
ifort should be in the PATH .
Change
<path_to_your_ifort_binary> to the real directory.
The other way, Intel compiler has a script file,
ifortvars.sh , which does the work with all variables for you. Taking into account that is a directory where Intel Compiler is installed, add to your ~/.bashrc :
The third way to try is to use
compilervars.sh from Intel Composer. Please, see here.
Community♦
John_WestJohn_West
Not the answer you're looking for? Browse other questions tagged compileconfigure or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |