[f2py] compilation appears successful

Paul Anton Letnes <[email protected]> Thu, 17 Mar 2011 21:54:42 +0100
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
...but it is not (it seems), as you may have guessed. I am not sure how to go about finding the error, so I attach the error message and compilation output, and I hope that someone wiser than me can point me in the right direction for further debugging!

f2py is great, but sometimes I am still stumped by (my own) confusing errors.

Best regards,
Paul.

+++ Python error +++
>>> import spheresubpy
Traceback (most recent call last):
  File "<input>", line 1, in <module>
ImportError: dlopen(/Users/paulanto/Code/NanoSpheresSubstrate/spheresubpy.so, 2): Symbol not found: _translate_1d_periodic_
  Referenced from: /Users/paulanto/Code/NanoSpheresSubstrate/spheresubpy.so
  Expected in: flat namespace
 in /Users/paulanto/Code/NanoSpheresSubstrate/spheresubpy.so

+++ Compilation output +++
% make clean && make                                                                                                                      [21:49:17 on 11-03-17]
rm -f spheresubpy.so spheresub.o spheresub.mod gmon.out a.out ftest
rm -f *.pyc
rm -f tags
gfortran -fPIC -c spheresub.f95 -g -pg -fbounds-check -ftrapv -fno-automatic -Wall -Wuninitialized -O0 -pedantic -fimplicit-none 
f2py -c -m spheresubpy spheresubpy.f95 spheresub.o --f90flags=' -g -pg -fbounds-check -ftrapv -fno-automatic -Wall -Wuninitialized -O0 -pedantic -fimplicit-none' --f90exec=gfortran 
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "spheresubpy" sources
f2py options: []
f2py:> /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7/spheresubpymodule.c
creating /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb
creating /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7
Reading fortran codes...
	Reading file 'spheresubpy.f95' (format:free)
Post-processing...
	Block: spheresubpy
			Block: spheresubpy
In: :spheresubpy:spheresubpy.f95:spheresubpy
get_parameters: got "name 'periodic' is not defined" on 'periodic'
In: :spheresubpy:spheresubpy.f95:spheresubpy
get_parameters: got "name 'periodic' is not defined" on 'periodic'
In: :spheresubpy:spheresubpy.f95:spheresubpy
get_parameters: got "name 'periodic' is not defined" on 'periodic'
In: :spheresubpy:spheresubpy.f95:spheresubpy
get_parameters: got "name 'nrhs' is not defined" on 'nrhs'
				Block: w_hlm
				Block: w_coeff_index
				Block: w_coeff_index_b
				Block: w_calc_psi
				Block: w_calc_blm
				Block: w_setup_rhs
				Block: w_setup_lhs
Post-processing (stage 2)...
	Block: spheresubpy
		Block: unknown_interface
			Block: spheresubpy
				Block: w_hlm
				Block: w_coeff_index
				Block: w_coeff_index_b
				Block: w_calc_psi
				Block: w_calc_blm
				Block: w_setup_rhs
				Block: w_setup_lhs
Building modules...
	Building module "spheresubpy"...
		Constructing F90 module support for "spheresubpy"...
		  Variables: w_periodic_2d w_periodic_no w_periodic_1d w_nrhs
		Creating wrapper for Fortran function "w_hlm"("w_hlm")...
			Constructing wrapper function "spheresubpy.w_hlm"...
			  w_hlm = w_hlm(lj,mj,li,mi)
		Creating wrapper for Fortran function "w_coeff_index"("w_coeff_index")...
			Constructing wrapper function "spheresubpy.w_coeff_index"...
			  w_coeff_index = w_coeff_index(lmax,i,l,m)
		Creating wrapper for Fortran function "w_coeff_index_b"("w_coeff_index_b")...
			Constructing wrapper function "spheresubpy.w_coeff_index_b"...
			  w_coeff_index_b = w_coeff_index_b(lmax,i,l,m)
			Constructing wrapper function "spheresubpy.w_calc_psi"...
			  psi = w_calc_psi(xs,ys,zs,spheredata,epsilon_plus,epsilon_minus,lmax,buried,alm,blm,periodic,n_unit_cells,lattice_b1,lattice_b2,lattice_xi,k1,k2)
			Constructing wrapper function "spheresubpy.w_calc_blm"...
			  blm = w_calc_blm(alm,beta,spheredata,lmax,epsilon_plus,epsilon_minus,buried,periodic,lattice_b1,lattice_b2,lattice_xi,k1,k2,n_unit_cells)
			Constructing wrapper function "spheresubpy.w_setup_rhs"...
			  blm_rhs = w_setup_rhs(spheredata,lmax,epsilon_plus,epsilon_minus,buried)
			Constructing wrapper function "spheresubpy.w_setup_lhs"...
			  a = w_setup_lhs(spheredata,epsilon_plus,epsilon_minus,lmax,buried,periodic,n_unit_cells,lattice_b1,lattice_b2,lattice_xi,k1,k2)
	Wrote C/API module "spheresubpy" to file "/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7/spheresubpymodule.c"
	Fortran 90 wrappers are saved to "/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7/spheresubpy-f2pywrappers2.f90"
  adding '/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7/fortranobject.c' to sources.
  adding '/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7' to include_dirs.
copying /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/f2py/src/fortranobject.c -> /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7
copying /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/f2py/src/fortranobject.h -> /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7
  adding '/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7/spheresubpy-f2pywrappers2.f90' to sources.
build_src: building npy-pkg config files
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize NAGFCompiler
Found executable /opt/local/bin/gfortran
Could not locate executable f95
nag: no Fortran 77 compiler found
nag: no Fortran 77 compiler found
customize AbsoftFCompiler
Could not locate executable f77
absoft: no Fortran 77 compiler found
absoft: no Fortran 77 compiler found
customize IBMFCompiler
Could not locate executable xlf
ibm: no Fortran 77 compiler found
Could not locate executable xlf95
ibm: no Fortran 77 compiler found
customize IntelFCompiler
Could not locate executable ifort
Could not locate executable ifc
customize GnuFCompiler
Found executable /opt/local/bin/gfortran-mp-4.4
gnu: no Fortran 90 compiler found
gnu: no Fortran 90 compiler found
customize Gnu95FCompiler
customize Gnu95FCompiler
customize Gnu95FCompiler using build_ext
building 'spheresubpy' extension
compiling C sources
C compiler: /usr/bin/gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -pipe -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes

creating /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/var
creating /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/var/folders
creating /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/var/folders/5A
creating /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI
creating /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-
creating /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb
creating /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7
compile options: '-I/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7 -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
gcc-4.2: /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7/fortranobject.c
gcc-4.2: /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7/spheresubpymodule.c
compiling Fortran 90 module sources
Fortran f77 compiler: /opt/local/bin/gfortran -Wall -ffixed-form -fno-second-underscore -fPIC -O3 -funroll-loops
Fortran f90 compiler: gfortran -g -pg -fbounds-check -ftrapv -fno-automatic -Wall -Wuninitialized -O0 -pedantic -fimplicit-none -fPIC -O3 -funroll-loops
Fortran fix compiler: gfortran -Wall -ffixed-form -fno-second-underscore -g -pg -fbounds-check -ftrapv -fno-automatic -Wall -Wuninitialized -O0 -pedantic -fimplicit-none -fPIC -O3 -funroll-loops
compile options: '-I/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7 -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
extra options: '-J/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/ -I/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/'
gfortran:f90: spheresubpy.f95
compiling Fortran sources
Fortran f77 compiler: /opt/local/bin/gfortran -Wall -ffixed-form -fno-second-underscore -fPIC -O3 -funroll-loops
Fortran f90 compiler: gfortran -g -pg -fbounds-check -ftrapv -fno-automatic -Wall -Wuninitialized -O0 -pedantic -fimplicit-none -fPIC -O3 -funroll-loops
Fortran fix compiler: gfortran -Wall -ffixed-form -fno-second-underscore -g -pg -fbounds-check -ftrapv -fno-automatic -Wall -Wuninitialized -O0 -pedantic -fimplicit-none -fPIC -O3 -funroll-loops
compile options: '-I/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7 -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
extra options: '-J/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/ -I/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/'
gfortran:f90: /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7/spheresubpy-f2pywrappers2.f90
/opt/local/bin/gfortran -Wall -Wall -undefined dynamic_lookup -bundle /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7/spheresubpymodule.o /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7/fortranobject.o /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/spheresubpy.o /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb/src.macosx-10.6-x86_64-2.7/spheresubpy-f2pywrappers2.o spheresub.o -L/opt/local/lib/gcc45/gcc/x86_64-apple-darwin10/4.5.2 -lgfortran -o ./spheresubpy.so
running scons
Removing build directory /var/folders/5A/5AGb4GQfEAKf-5kSrBqG+++++TI/-Tmp-/tmpZ2g_Bb