[f2py] Compiling 64-bit with f2py

Thomas Robitaille <[email protected]>
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
Hi,

I've installed 64-bit version of python, numpy, etc. and am trying to  
compile a fortran 90 source file to make a 64-bit .so file. If I run

f2py-64 -m densities -c densities.f90

I still get a 32-bit .so file:

valinor:scripts tom$ file densities.so
densities.so: Mach-O bundle i386

So I can tell f2py to use -m64 as a flag:

f2py-64 -m densities.so -c densities.f90 --f77flags="-m64" -- 
f90flags="-m64"

which would nearly work, except that the last 'linking' command seems  
to ignore the flags (see below for log). All other compile commands  
with gcc or gfortran include the appropriate flags. Is there a way to  
force the last command to also take the -m64 flag?

Thanks for any help,

Thomas

...
gfortran:f90: densities.f90
compiling Fortran sources
Fortran f77 compiler: gfortran -m64 -fPIC -O3 -funroll-loops
Fortran f90 compiler: gfortran -m64 -fPIC -O3 -funroll-loops
Fortran fix compiler: gfortran -Wall -ffixed-form -fno-second- 
underscore -m64 -fPIC -O3 -funroll-loops
compile options: '-I/var/folders/3D/3DzuaNUkHrK3gsAbqFyL0U+++TI/-Tmp-/ 
tmpGGXlUu/src.macosx-10.5-universal-2.6 -I/Library/Frameworks/ 
Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/ 
include -I/Library/Frameworks/Python.framework/Versions/2.6/include/ 
python2.6 -c'
extra options: '-J/var/folders/3D/3DzuaNUkHrK3gsAbqFyL0U+++TI/-Tmp-/ 
tmpGGXlUu/densities -I/var/folders/3D/3DzuaNUkHrK3gsAbqFyL0U+++TI/- 
Tmp-/tmpGGXlUu/densities'
gfortran:f90: /var/folders/3D/3DzuaNUkHrK3gsAbqFyL0U+++TI/-Tmp-/ 
tmpGGXlUu/src.macosx-10.5-universal-2.6/densities/so-f2pywrappers2.f90
/usr/bin/gfortran -Wall -Wall -undefined dynamic_lookup -bundle /var/ 
folders/3D/3DzuaNUkHrK3gsAbqFyL0U+++TI/-Tmp-/tmpGGXlUu/var/folders/3D/ 
3DzuaNUkHrK3gsAbqFyL0U+++TI/-Tmp-/tmpGGXlUu/src.macosx-10.5- 
universal-2.6/densities/somodule.o /var/folders/3D/ 
3DzuaNUkHrK3gsAbqFyL0U+++TI/-Tmp-/tmpGGXlUu/var/folders/3D/ 
3DzuaNUkHrK3gsAbqFyL0U+++TI/-Tmp-/tmpGGXlUu/src.macosx-10.5- 
universal-2.6/fortranobject.o /var/folders/3D/3DzuaNUkHrK3gsAbqFyL0U++ 
+TI/-Tmp-/tmpGGXlUu/densities.o /var/folders/3D/3DzuaNUkHrK3gsAbqFyL0U+ 
++TI/-Tmp-/tmpGGXlUu/var/folders/3D/3DzuaNUkHrK3gsAbqFyL0U+++TI/-Tmp-/ 
tmpGGXlUu/src.macosx-10.5-universal-2.6/densities/so-f2pywrappers2.o - 
L/usr/local/gfortran/lib/gcc/i386-apple-darwin8.10.1/4.4.0/x86_64 - 
lgfortran -o ./densities/so.so
ld warning: in /var/folders/3D/3DzuaNUkHrK3gsAbqFyL0U+++TI/-Tmp-/ 
tmpGGXlUu/densities.o, file is not of required architecture
ld warning: in /var/folders/3D/3DzuaNUkHrK3gsAbqFyL0U+++TI/-Tmp-/ 
tmpGGXlUu/var/folders/3D/3DzuaNUkHrK3gsAbqFyL0U+++TI/-Tmp-/tmpGGXlUu/ 
src.macosx-10.5-universal-2.6/densities/so-f2pywrappers2.o, file is  
not of required architecture
ld warning: in /usr/local/gfortran/lib/gcc/i386-apple- 
darwin8.10.1/4.4.0/x86_64/libgfortranbegin.a, file is not of required  
architecture
ld warning: in /usr/local/gfortran/lib/gcc/i386-apple- 
darwin8.10.1/4.4.0/x86_64/libgcc.a, file is not of required architecture
running scons
Removing build directory /var/folders/3D/3DzuaNUkHrK3gsAbqFyL0U+++TI/- 
Tmp-/tmpGGXlUu
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.