Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F2PY installation crashes sometimes #22

Closed
aichhorn opened this issue Jan 27, 2012 · 5 comments
Closed

F2PY installation crashes sometimes #22

aichhorn opened this issue Jan 27, 2012 · 5 comments

Comments

@aichhorn
Copy link
Member

The f2py call for the fortran modules is not always stable. The BuildF2PYModule of cmake executes the command
f2py -c --f90exec= ....
This results in many cases in bad linking of the library file. Instead, the command should be
f2py -c --fcompiler= ...
where is gnu95 or intelem, for example. Problem: can not be detected easily. Maybe set gnu95 as standard, that should work always.

@parcollet
Copy link
Member

Do you mean that in FindBuildF2pyModule.cmake line 38
... --f90exec=${CMAKE_Fortran_COMPILER} ...
CMAKE_Fortran_COMPILER is wrong ?
So cmake does not detect correctly the fortran compiler on your machine ??

What if we put gnu95 as a standard and people want to compile with ifort ?

@aichhorn
Copy link
Member Author

The CMAKE_Fortran_COMPILER is correct in the module, the problem is that one should not use the --f90exec flag with specifying just the F90 executable. That leads to wrong linking in many cases.
The --fcompiler is the better flag, but you do not give the executable, but the 'vendor'. The two flags behave differently. The point is, if you put just --f90exec=ifort, then the .so is compiled with ifort, linked to some gfortran libraries.
One could introduce a variable, like CMAKE_F2PY_vendor, that specifies the vendor and is set to gnu95 by default. If wanted, can be changed by hand. Detection of the possible values of -fcompiler can be done by
f2py -c --help-fcompiler

@mferrero
Copy link
Member

@aichhorn: is there a way to reproduce this issue? I would like to avoid the vendor flag. Are you sure the fact that there are links to libgfortran is not a consequence of linking to lapack?

@aichhorn
Copy link
Member Author

Right now, I cannot reproduce this issue myself either. I tried all possible combinations of gfortran and ifort, with lapack and without, and everything worked out fine. This seems to be a well hidden problem in the f2py linking procedure that I don't understand.
(I tried it for the modules vertex.so and hubbard_I.so) We could close this issue, if nobody else is having this problem.

@mferrero
Copy link
Member

OK, let's close the issue for now and if ever the problem appears again we can still reopen it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants