Building Kwant from tarball on Mac OSX

My system, OSX 10.6.8 I installed latest lapack/blas through fink. I also tried to write a kwant/build.conf file for specifying those libraries, but apparently it didn't work. I started with only the folowing lines in build.conf $cat build.conf [lapack] libraries = liblapacke.dylib library_dirs = /sw/include/lapack/ /sw/lib/lapack/ which is the location of lapack stuff as installed by fink -at least what I think contains the relevant part. I also tried with libraries = libclapack.dylib libf77lapack.dylib liblapack.dylib library_dirs = /usr/lib/ extra_link_args = -dynamiclib -fPIC However, python setup.py build ends up reporting just a default lapack & blas installation, so obviously my build.conf didn't work. That things don't work is confirmed when running $python setup.py install running install running build running build_tut running build_py running build_ext **************** Build summary **************** Default LAPACK and BLAS No MUMPS support running install_lib running install_egg_info Removing /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant-1.0.2-py2.7.egg-info Writing /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant-1.0.2-py2.7.egg-info $python -c 'import kwant; kwant.test()' Traceback (most recent call last): File "<string>", line 1, in <module> File "kwant/__init__.py", line 14, in <module> exec 'from . import {0}'.format(module) File "<string>", line 1, in <module> File "kwant/system.py", line 17, in <module> from . import physics, _system File "kwant/physics/__init__.py", line 14, in <module> exec 'from . import {0}'.format(module) File "<string>", line 1, in <module> File "kwant/physics/leads.py", line 16, in <module> from .. import linalg as kla File "kwant/linalg/__init__.py", line 10, in <module> from . import lapack ImportError: cannot import name lapack Can you help me in getting my lapack libraries correctly located by the build process? I will post the complete list of lapack/blas related directories populated by my fink installation if you need it. This seems the only thing holding me back from getting kwant running, and thus, runnning the examples and simulations from the course.

Dear Pol, a few comments: - in principle libf77blas should be the correct one; lapacke is the (relatively new) C interface, kwant uses the standard Fortran interface. - the Mac also comes already with an optimized blas and Lapack, if you don't specify your own libs kwant should be linked against these. In my experience, the ones provided by Macos have a good performance - The install script should show all the individual compile steps - I don't see this in your output. Can you send a full output from "python setup.py install" in a fresh copy of the kwant directory from the tar.gz file? Best, Michael

Hi Michael, thanks for your help. 1.- The only libraries that came with my Mac (I had forgotten about them) are $find /usr/lib/ \( -iname "*lapack*" -or -iname "*blas*" \) /usr/lib//libblas.dylib /usr/lib//libcblas.dylib /usr/lib//libclapack.dylib /usr/lib//libf77lapack.dylib /usr/lib//liblapack.dylib I'd assume the fortran blas lib is the first one, despite not having the f77 string. 2.-The Kwant build process doesn't seem to find them though. I removed all I had previously build/installed and started over untarring, building and installing. Here the full install output $python setup.py install --record install.record running install running build running build_tut running build_py running build_ext **************** Build summary **************** Default LAPACK and BLAS No MUMPS support running install_lib copying build/lib.macosx-10.6-intel-2.7/kwant/_system.so -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant copying build/lib.macosx-10.6-intel-2.7/kwant/graph/core.so -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/graph copying build/lib.macosx-10.6-intel-2.7/kwant/graph/slicer.so -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/graph copying build/lib.macosx-10.6-intel-2.7/kwant/graph/utils.so -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/graph copying build/lib.macosx-10.6-intel-2.7/kwant/linalg/lapack.so -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/linalg running install_egg_info Writing /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant-1.0.2-py2.7.egg-info writing list of installed files to 'install.record' I also copy here the ouput of the build step: $python setup.py build >& build.record $cat build.record running build running build_tut running build_py creating build creating build/lib.macosx-10.6-intel-2.7 creating build/lib.macosx-10.6-intel-2.7/kwant copying kwant/__init__.py -> build/lib.macosx-10.6-intel-2.7/kwant copying kwant/_static_version.py -> build/lib.macosx-10.6-intel-2.7/kwant copying kwant/builder.py -> build/lib.macosx-10.6-intel-2.7/kwant copying kwant/digest.py -> build/lib.macosx-10.6-intel-2.7/kwant copying kwant/lattice.py -> build/lib.macosx-10.6-intel-2.7/kwant copying kwant/plotter.py -> build/lib.macosx-10.6-intel-2.7/kwant copying kwant/rmt.py -> build/lib.macosx-10.6-intel-2.7/kwant copying kwant/system.py -> build/lib.macosx-10.6-intel-2.7/kwant copying kwant/version.py -> build/lib.macosx-10.6-intel-2.7/kwant creating build/lib.macosx-10.6-intel-2.7/kwant/graph copying kwant/graph/__init__.py -> build/lib.macosx-10.6-intel-2.7/kwant/graph copying kwant/graph/defs.py -> build/lib.macosx-10.6-intel-2.7/kwant/graph copying kwant/graph/dissection.py -> build/lib.macosx-10.6-intel-2.7/kwant/graph creating build/lib.macosx-10.6-intel-2.7/kwant/graph/tests copying kwant/graph/tests/__init__.py -> build/lib.macosx-10.6-intel-2.7/kwant/graph/tests copying kwant/graph/tests/test_core.py -> build/lib.macosx-10.6-intel-2.7/kwant/graph/tests copying kwant/graph/tests/test_dissection.py -> build/lib.macosx-10.6-intel-2.7/kwant/graph/tests copying kwant/graph/tests/test_scotch.py -> build/lib.macosx-10.6-intel-2.7/kwant/graph/tests copying kwant/graph/tests/test_slicer.py -> build/lib.macosx-10.6-intel-2.7/kwant/graph/tests copying kwant/graph/tests/test_utils.py -> build/lib.macosx-10.6-intel-2.7/kwant/graph/tests creating build/lib.macosx-10.6-intel-2.7/kwant/linalg copying kwant/linalg/__init__.py -> build/lib.macosx-10.6-intel-2.7/kwant/linalg copying kwant/linalg/cmumps.py -> build/lib.macosx-10.6-intel-2.7/kwant/linalg copying kwant/linalg/decomp_ev.py -> build/lib.macosx-10.6-intel-2.7/kwant/linalg copying kwant/linalg/decomp_lu.py -> build/lib.macosx-10.6-intel-2.7/kwant/linalg copying kwant/linalg/decomp_schur.py -> build/lib.macosx-10.6-intel-2.7/kwant/linalg copying kwant/linalg/f_lapack.py -> build/lib.macosx-10.6-intel-2.7/kwant/linalg copying kwant/linalg/fortran_helpers.py -> build/lib.macosx-10.6-intel-2.7/kwant/linalg copying kwant/linalg/lll.py -> build/lib.macosx-10.6-intel-2.7/kwant/linalg copying kwant/linalg/mumps.py -> build/lib.macosx-10.6-intel-2.7/kwant/linalg creating build/lib.macosx-10.6-intel-2.7/kwant/linalg/tests copying kwant/linalg/tests/__init__.py -> build/lib.macosx-10.6-intel-2.7/kwant/linalg/tests copying kwant/linalg/tests/_test_utils.py -> build/lib.macosx-10.6-intel-2.7/kwant/linalg/tests copying kwant/linalg/tests/test_linalg.py -> build/lib.macosx-10.6-intel-2.7/kwant/linalg/tests copying kwant/linalg/tests/test_lll.py -> build/lib.macosx-10.6-intel-2.7/kwant/linalg/tests copying kwant/linalg/tests/test_mumps.py -> build/lib.macosx-10.6-intel-2.7/kwant/linalg/tests creating build/lib.macosx-10.6-intel-2.7/kwant/physics copying kwant/physics/__init__.py -> build/lib.macosx-10.6-intel-2.7/kwant/physics copying kwant/physics/dispersion.py -> build/lib.macosx-10.6-intel-2.7/kwant/physics copying kwant/physics/leads.py -> build/lib.macosx-10.6-intel-2.7/kwant/physics copying kwant/physics/noise.py -> build/lib.macosx-10.6-intel-2.7/kwant/physics creating build/lib.macosx-10.6-intel-2.7/kwant/physics/tests copying kwant/physics/tests/__init__.py -> build/lib.macosx-10.6-intel-2.7/kwant/physics/tests copying kwant/physics/tests/test_dispersion.py -> build/lib.macosx-10.6-intel-2.7/kwant/physics/tests copying kwant/physics/tests/test_leads.py -> build/lib.macosx-10.6-intel-2.7/kwant/physics/tests copying kwant/physics/tests/test_noise.py -> build/lib.macosx-10.6-intel-2.7/kwant/physics/tests creating build/lib.macosx-10.6-intel-2.7/kwant/solvers copying kwant/solvers/__init__.py -> build/lib.macosx-10.6-intel-2.7/kwant/solvers copying kwant/solvers/common.py -> build/lib.macosx-10.6-intel-2.7/kwant/solvers copying kwant/solvers/default.py -> build/lib.macosx-10.6-intel-2.7/kwant/solvers copying kwant/solvers/mumps.py -> build/lib.macosx-10.6-intel-2.7/kwant/solvers copying kwant/solvers/sparse.py -> build/lib.macosx-10.6-intel-2.7/kwant/solvers creating build/lib.macosx-10.6-intel-2.7/kwant/solvers/tests copying kwant/solvers/tests/__init__.py -> build/lib.macosx-10.6-intel-2.7/kwant/solvers/tests copying kwant/solvers/tests/_test_sparse.py -> build/lib.macosx-10.6-intel-2.7/kwant/solvers/tests copying kwant/solvers/tests/test_mumps.py -> build/lib.macosx-10.6-intel-2.7/kwant/solvers/tests copying kwant/solvers/tests/test_sparse.py -> build/lib.macosx-10.6-intel-2.7/kwant/solvers/tests creating build/lib.macosx-10.6-intel-2.7/kwant/tests copying kwant/tests/__init__.py -> build/lib.macosx-10.6-intel-2.7/kwant/tests copying kwant/tests/test_builder.py -> build/lib.macosx-10.6-intel-2.7/kwant/tests copying kwant/tests/test_comprehensive.py -> build/lib.macosx-10.6-intel-2.7/kwant/tests copying kwant/tests/test_lattice.py -> build/lib.macosx-10.6-intel-2.7/kwant/tests copying kwant/tests/test_plotter.py -> build/lib.macosx-10.6-intel-2.7/kwant/tests copying kwant/tests/test_rmt.py -> build/lib.macosx-10.6-intel-2.7/kwant/tests copying kwant/tests/test_system.py -> build/lib.macosx-10.6-intel-2.7/kwant/tests running build_ext building 'kwant._system' extension creating build/temp.macosx-10.6-intel-2.7 creating build/temp.macosx-10.6-intel-2.7/kwant gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ikwant/graph -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c kwant/_system.c -o build/temp.macosx-10.6-intel-2.7/kwant/_system.o In file included from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1760, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from kwant/_system.c:303: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1630: warning: ‘_import_array’ defined but not used /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__ufunc_api.h:242: warning: ‘_import_umath’ defined but not used In file included from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1760, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from kwant/_system.c:303: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1630: warning: ‘_import_array’ defined but not used /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__ufunc_api.h:242: warning: ‘_import_umath’ defined but not used gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g build/temp.macosx-10.6-intel-2.7/kwant/_system.o -o build/lib.macosx-10.6-intel-2.7/kwant/_system.so building 'kwant.graph.core' extension creating build/temp.macosx-10.6-intel-2.7/kwant/graph gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c kwant/graph/core.c -o build/temp.macosx-10.6-intel-2.7/kwant/graph/core.o In file included from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1760, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from kwant/graph/core.c:303: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1630: warning: ‘_import_array’ defined but not used /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__ufunc_api.h:242: warning: ‘_import_umath’ defined but not used In file included from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1760, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from kwant/graph/core.c:303: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1630: warning: ‘_import_array’ defined but not used /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__ufunc_api.h:242: warning: ‘_import_umath’ defined but not used gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g build/temp.macosx-10.6-intel-2.7/kwant/graph/core.o -o build/lib.macosx-10.6-intel-2.7/kwant/graph/core.so building 'kwant.graph.utils' extension gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c kwant/graph/utils.c -o build/temp.macosx-10.6-intel-2.7/kwant/graph/utils.o In file included from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1760, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from kwant/graph/utils.c:303: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1630: warning: ‘_import_array’ defined but not used /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__ufunc_api.h:242: warning: ‘_import_umath’ defined but not used kwant/graph/utils.c: In function ‘__pyx_pw_5kwant_5graph_5utils_5induced_subgraph’: kwant/graph/utils.c:2707: warning: ‘__pyx_pybuffernd_sub_edge_weights.diminfo[0].strides’ may be used uninitialized in this function kwant/graph/utils.c:2707: note: ‘__pyx_pybuffernd_sub_edge_weights.diminfo[0].strides’ was declared here kwant/graph/utils.c:2707: warning: ‘__pyx_pybuffernd_sub_edge_weights.diminfo[0].shape’ may be used uninitialized in this function kwant/graph/utils.c:2707: note: ‘__pyx_pybuffernd_sub_edge_weights.diminfo[0].shape’ was declared here In file included from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1760, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from kwant/graph/utils.c:303: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1630: warning: ‘_import_array’ defined but not used /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__ufunc_api.h:242: warning: ‘_import_umath’ defined but not used kwant/graph/utils.c: In function ‘__pyx_pw_5kwant_5graph_5utils_5induced_subgraph’: kwant/graph/utils.c:2707: warning: ‘__pyx_pybuffernd_sub_edge_weights.diminfo[0].strides’ may be used uninitialized in this function kwant/graph/utils.c:2707: note: ‘__pyx_pybuffernd_sub_edge_weights.diminfo[0].strides’ was declared here kwant/graph/utils.c:2707: warning: ‘__pyx_pybuffernd_sub_edge_weights.diminfo[0].shape’ may be used uninitialized in this function kwant/graph/utils.c:2707: note: ‘__pyx_pybuffernd_sub_edge_weights.diminfo[0].shape’ was declared here gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g build/temp.macosx-10.6-intel-2.7/kwant/graph/utils.o -o build/lib.macosx-10.6-intel-2.7/kwant/graph/utils.so building 'kwant.graph.slicer' extension creating build/temp.macosx-10.6-intel-2.7/kwant/graph/c_slicer gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c kwant/graph/slicer.c -o build/temp.macosx-10.6-intel-2.7/kwant/graph/slicer.o In file included from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1760, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from kwant/graph/slicer.c:303: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1630: warning: ‘_import_array’ defined but not used /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__ufunc_api.h:242: warning: ‘_import_umath’ defined but not used In file included from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1760, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from kwant/graph/slicer.c:303: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1630: warning: ‘_import_array’ defined but not used /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__ufunc_api.h:242: warning: ‘_import_umath’ defined but not used gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c kwant/graph/c_slicer/partitioner.cc -o build/temp.macosx-10.6-intel-2.7/kwant/graph/c_slicer/partitioner.o cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ kwant/graph/c_slicer/partitioner.cc: In member function ‘void Partitioner::bisectFirst(std::vector<int, std::allocator<int> >&, std::vector<int, std::allocator<int> >&, double, int, int)’: kwant/graph/c_slicer/partitioner.cc:122: warning: comparison between signed and unsigned integer expressions cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ kwant/graph/c_slicer/partitioner.cc: In member function ‘void Partitioner::bisectFirst(std::vector<int, std::allocator<int> >&, std::vector<int, std::allocator<int> >&, double, int, int)’: kwant/graph/c_slicer/partitioner.cc:122: warning: comparison between signed and unsigned integer expressions gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c kwant/graph/c_slicer/slicer.cc -o build/temp.macosx-10.6-intel-2.7/kwant/graph/c_slicer/slicer.o cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ g++-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g build/temp.macosx-10.6-intel-2.7/kwant/graph/slicer.o build/temp.macosx-10.6-intel-2.7/kwant/graph/c_slicer/partitioner.o build/temp.macosx-10.6-intel-2.7/kwant/graph/c_slicer/slicer.o -o build/lib.macosx-10.6-intel-2.7/kwant/graph/slicer.so building 'kwant.linalg.lapack' extension creating build/temp.macosx-10.6-intel-2.7/kwant/linalg gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c kwant/linalg/lapack.c -o build/temp.macosx-10.6-intel-2.7/kwant/linalg/lapack.o In file included from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1760, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from kwant/linalg/lapack.c:303: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1630: warning: ‘_import_array’ defined but not used /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__ufunc_api.h:242: warning: ‘_import_umath’ defined but not used In file included from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1760, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17, from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from kwant/linalg/lapack.c:303: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1630: warning: ‘_import_array’ defined but not used /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__ufunc_api.h:242: warning: ‘_import_umath’ defined but not used gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g build/temp.macosx-10.6-intel-2.7/kwant/linalg/lapack.o -llapack -lblas -o build/lib.macosx-10.6-intel-2.7/kwant/linalg/lapack.so **************** Build summary **************** Default LAPACK and BLAS No MUMPS support On Sat, Feb 7, 2015 at 12:51 PM, Michael Wimmer < wimmer@lorentz.leidenuniv.nl> wrote:

Hi Pol, in principle the build output you sent looks fine. This installation of kwant does not work, too? Two things that come to my mind: 1. When you import kwant in python, make sure you are not in the kwant directory (but somewhere else), this could lead to trouble for you 2. Instead of 'import kwant', can you try 'import kwant.linalg.lapack'? This may give a more specific error message. Best, Michael On 07.02.2015 21:37, Pol Nasam wrote:

Thanks Michael. Well, changing directory did make a difference. However, I get now a segmentation fault: $python -c 'import kwant; kwant.test()' /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/solvers/sparse.py:94: RuntimeWarning: The installed SciPy does not use UMFPACK. Instead, SciPy will use the version of SuperLu it is shipped with. Performance can be very poor in this case. "Performance can be very poor in this case.", RuntimeWarning) ........................SSS........Segmentation fault Right now I don't care about the MUPS lib. Thinking on having first kwant running ok, before reinstalling with MUPS. It seems to be there is some minor, even obvious, but essential step that I may be missing. The not testing things in the same directory where kwant was untarred should come in the install readme, for instance. But what else could I be missing now? Cheers, On Sun, Feb 8, 2015 at 11:34 AM, Michael Wimmer < wimmer@lorentz.leidenuniv.nl> wrote:
import kwant

Hi Pol, can you run kwant.test as 'kwant.test(verbose=2)' to see at which test the segfault occurs? I don't remember all the details, but MacOSX 10.6 was a bit special in that there was some mix of 32bit and 64bit. It might be some tricky stuff ... Best, Michael On , Pol Nasam wrote:

Thanks Michael, Here the ouput with verbosity=2 $python -c 'import kwant; kwant.test(verbose=2)' >& Kwant-test-verbose2.txt $cat Kwant-test-verbose2.txt /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/solvers/sparse.py:94: RuntimeWarning: The installed SciPy does not use UMFPACK. Instead, SciPy will use the version of SuperLu it is shipped with. Performance can be very poor in this case. "Performance can be very poor in this case.", RuntimeWarning) kwant.graph.tests.test_core.test_empty ... ok kwant.graph.tests.test_core.test_num_nodes ... ok kwant.graph.tests.test_core.test_large ... ok kwant.graph.tests.test_core.test_small ... ok kwant.graph.tests.test_core.test_negative_node_ids ... ok kwant.graph.tests.test_core.test_add_edges ... ok kwant.graph.tests.test_core.test_edge_ids ... ok kwant.graph.tests.test_slicer.test_rectangle ... ok kwant.graph.tests.test_utils.test_make_undirected ... ok kwant.graph.tests.test_utils.test_remove_duplicates ... ok kwant.graph.tests.test_utils.test_induced_subgraph ... ok kwant.linalg.tests.test_linalg.test_gen_eig ... ok kwant.linalg.tests.test_linalg.test_lu ... ok kwant.linalg.tests.test_linalg.test_rcond_from_lu ... ok kwant.linalg.tests.test_linalg.test_schur ... ok kwant.linalg.tests.test_linalg.test_convert_r2c_schur ... ok kwant.linalg.tests.test_linalg.test_order_schur ... ok kwant.linalg.tests.test_linalg.test_evecs_from_schur ... ok kwant.linalg.tests.test_linalg.test_gen_schur ... ok kwant.linalg.tests.test_linalg.test_convert_r2c_gen_schur ... ok kwant.linalg.tests.test_linalg.test_order_gen_schur ... ok kwant.linalg.tests.test_linalg.test_evecs_from_gen_schur ... ok kwant.linalg.tests.test_lll.test_lll ... ok kwant.linalg.tests.test_lll.test_cvp ... ok kwant.linalg.tests.test_mumps.test_lu_with_dense ... SKIP: Skipping test: test_lu_with_dense: Test skipped due to test condition kwant.linalg.tests.test_mumps.test_schur_complement_with_dense ... SKIP: Skipping test: test_schur_complement_with_dense: Test skipped due to test condition Test if MUMPSError -9 is properly caught by increasing memory ... SKIP: Skipping test: test_error_minus_9: Test skipped due to test condition kwant.physics.tests.test_dispersion.test_band_energies ... ok kwant.physics.tests.test_leads.test_analytic_numeric ... ok Selfenergy with an invertible hopping matrix, and degenerate bands. ... ok This is a testcase with invertible hopping matrices, ... ok This testcase features a rectangular (and hence singular) ... ok This testcase features a singular, square hopping matrices ... ok This testcase features a rectangular (and hence singular) ... ok This testcase features a rectangular (and hence singular) ... ok kwant.physics.tests.test_leads.test_singular_h_and_t ... And here it segfaults... On Sun, Feb 8, 2015 at 2:24 PM, wimmer <wimmer@lorentz.leidenuniv.nl> wrote:

Dear Pol, very hard to say what the problem is. I couldn't find a Mac with OSX 10.6, so I cannot reproduce the error. Have you tried to install kwant using homebrew? That still supports OSX 10.6, I believe. Otherwise, you could still try to use a different blas or lapack, as you tried originally, and see if the problem goes away. Note that build.conf must be in the same directory as setup.py. Also, the line libraries should only contain the library name without the "lib" in front, and without the trailing ".dylib. Then you should be able to use a custom BLAS and LAPACK installation Best, Michael On 09.02.2015 14:47, Pol Nasam wrote:

Michael Wimmer wrote:
very hard to say what the problem is. I couldn't find a Mac with OSX 10.6, so I cannot reproduce the error.
Dear Pol, If everything fails, you can also install Kwant inside a Virtualbox virtual machine running some variant of GNU/Linux (Ubuntu is probably the easiest). Installing Kwant on a Debian-based system like Ubuntu is straightforward. This setup works well, and the performance of Kwant running inside a VM is actually acceptable for most applications. Virtualbox even has a “seamless mode” where the desktop of the VM is invisible, and programs running under the VM appear directly on your native desktop. Christoph

Thanks Christoph. I'm trying that as well. I have some problems of space in my laptop that have complicated the whole process as well. Michael mentioned homebrew, but having those space issues and already fink installed, it seems too much effort -or at least it seemed... Anyway, it seems unreasonable to have homebrew and fink, and I'm been happy with my fink installation so far. I'd say I miss a bit more verbosity/detail during the build and install steps, or even the test step, that could give a better clue to what's going wrong. Why can't kwant "import lapack" during that test? As to distros, I haven't touch ubuntu since that unity crap. Hopefully I can't get a debian machine running and kwant gives there no problem to install. Pol On Mon, Feb 9, 2015 at 5:34 PM, Christoph Groth <christoph.groth@cea.fr> wrote:

Thanks both for being there. I just wanted to add, I'm no newbie when it comes to compile, install an OS, or code, but sometimes the _force_ is not with one. Case in point, my Virtualbox crashed when almost finishing my Debian installation complaining about insufficient memory...I've 8GB and only Chrome open, and the latest Vbox version! I never saw that before and I've setup my share of virtual machines! Maybe I'll have to reconsider homebrew...or simply give up if there is no other way of having kwant accept the the lapack libs that came with my Xcode copy. Speaking of that, might the problem be that my lapack copy is too old a version? My mac is from 2009 and I downloaded that Xcode in 2010. Could find out the precise version if that helps clarifying things. Regards, Pol On Mon, Feb 9, 2015 at 5:34 PM, Christoph Groth <christoph.groth@cea.fr> wrote:
install Kwant inside a Virtualbox virtual machin

Hi Pol, I am developing Kwant on a computer that runs Debian “testing” and we run it in our lab on our cluster that runs Debian “stable”. Anton (and I believe Michael) are using Ubuntu. Debian-based Linuxes are the platform where Kwant is at home. You said that you don’t like Ubuntu’s Unity. I don’t either. Note that Ubuntu doesn’t force you to use any specific window manager. It’s not even more complicated to install, as there are “xubuntu” and “kubuntu” specialized installers. Pol Nasam wrote:
Virtualbox crashed while you were installing Debian, or while you were installing Kwant? Neither should happen. 8 GB RAM should be more than enough to even run several virtual machines at the same time. Give your VM 1 or 2 GB of RAM, that is more than sufficient. If virtualbox keeps crashing, that must be a problem with running virtualbox on your machine. Christoph

Hi Christoph, Latest update: I got Kwant test working on a virtual box with lubuntu. I think I may have had a broken Vbox update when going to 4.3.20, and thus decided to install the 4.2.28 branch. That I think is anecdotical and the point was to first completely remove the old version before installing the new one -auto update was broken, thus the manual update. But that might not be all. The crash with Debian was when installing. However, I've noticed some issues when installing Guest Additions (Vbox cpu% goes +100% without the the guest OS doing nothing, and it seems to eat quite some memory as well). With guest-kernel panic included when rebooting after Guest Add's install. Booting my guest lubuntu in recovery mode and from there into resuming boot, went fine and I think it's ok again now. So, not sure what happened but I think I do have now a virtual box with kwant running. Another time I'll deal with the MUMPS libs. I don't mind solving these issues; the real frustrating thing is just how much time these things may consume. Again, thanks a lot for your support. Regards, Pol

My bad, I think. The kwant test actually warned about my SCIPY installation (in lubuntu) not using UMFPACK, and remarking twice that "Performance can be very poor"! I'll called it a lapsus linguae and take it for granted MUMPS is installed. I'll see what happens when I test one of your simulations/exercises. Thanks! Pol On Tue, Feb 10, 2015 at 6:36 PM, Anton Akhmerov <anton.akhmerov@gmail.com> wrote:

Thanks Michael. I'm trying two different paths here: 1) see if I come up with a build.conf that is correctly recognized (before it looked it wasn't, but that may be because of my wrong syntax in name the libs). I'm trying first with the lapack/blas that I got time ago when installing Xcode. My build.conf seems to be working now. Build says [...] **************** Build summary **************** User-configured LAPACK and BLAS Great. The install does not complain either (not that it did say much before either). However, the test fails miserably again $python -c 'import kwant; kwant.test()' Traceback (most recent call last): File "<string>", line 1, in <module> File "kwant/__init__.py", line 14, in <module> exec 'from . import {0}'.format(module) File "<string>", line 1, in <module> File "kwant/system.py", line 17, in <module> from . import physics, _system File "kwant/physics/__init__.py", line 14, in <module> exec 'from . import {0}'.format(module) File "<string>", line 1, in <module> File "kwant/physics/leads.py", line 16, in <module> from .. import linalg as kla File "kwant/linalg/__init__.py", line 10, in <module> from . import lapack ImportError: cannot import name lapack Should I use some extra compile/linking arguments in the build.con file? if so, which ones? My build.conf was [lapack] libraries = f77lapack blas library_dirs = /usr/lib/ 2) The second path is installing it via a virtual machine, as Christoph mentions in his reply. On Mon, Feb 9, 2015 at 4:46 PM, Michael Wimmer <wimmer@lorentz.leidenuniv.nl
wrote:

Hi Pol, as for route 1: - what confuses me a little bit is the naming of your libraries - this seems somewhat non-standard. Can you point me to a place at the fink homepage where infos about the lapack libs is found? Or is this not the fink lapack/blas? - Trying "import kwant.linalg.lapack" (again outside the kwant directory) can sometimes give a more specific error message, such as missing symbols etc. Best, Michael On 10.02.2015 00:37, Pol Nasam wrote:

Hi Michael, A) f77lapack & blas refer to the libraries that I came with my OSX (or rather my Xcode version). These live under $find /usr/lib \( -iname "*lapack*" -or -iname "*blas*" \) /usr/lib/libblas.dylib /usr/lib/libcblas.dylib /usr/lib/libclapack.dylib /usr/lib/libf77lapack.dylib /usr/lib/liblapack.dylib Initially I completely forgot I already had them installed and that's why I pulled the fink install lapack. However, I double-checked the fink libs and, you were right, these were the C version. I quick search didn't give any way of "fink-ing" the fortran versions, so I gave up along the fink path. B) I'll give it another try to building kwant and see what hints that import of yours provides. I'll let you know. Again, thanks for your help as well. Regards, Pol On Tue, Feb 10, 2015 at 2:28 AM, Michael Wimmer < wimmer@lorentz.leidenuniv.nl> wrote:

(The list server complained about my initial reply being too long. Here in two parts) Hi Michael, thanks for your help. 1.- The only libraries that came with my Mac (I had forgotten about them) are $find /usr/lib/ \( -iname "*lapack*" -or -iname "*blas*" \) /usr/lib//libblas.dylib /usr/lib//libcblas.dylib /usr/lib//libclapack.dylib /usr/lib//libf77lapack.dylib /usr/lib//liblapack.dylib I'd assume the fortran blas lib is the first one, despite not having the f77 string. 2.-The Kwant build process doesn't seem to find them though. I removed all I had previously build/installed and started over untarring, building and installing. Here the full install output $python setup.py install --record install.record running install running build running build_tut running build_py running build_ext **************** Build summary **************** Default LAPACK and BLAS No MUMPS support running install_lib copying build/lib.macosx-10.6-intel-2.7/kwant/_system.so -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant copying build/lib.macosx-10.6-intel-2.7/kwant/graph/core.so -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/graph copying build/lib.macosx-10.6-intel-2.7/kwant/graph/slicer.so -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/graph copying build/lib.macosx-10.6-intel-2.7/kwant/graph/utils.so -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/graph copying build/lib.macosx-10.6-intel-2.7/kwant/linalg/lapack.so -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/linalg running install_egg_info Writing /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant-1.0.2-py2.7.egg-info writing list of installed files to 'install.record' Next I send the build step ouput. Cheers On Sat, Feb 7, 2015 at 12:51 PM, Michael Wimmer < wimmer@lorentz.leidenuniv.nl> wrote:
participants (5)
-
Anton Akhmerov
-
Christoph Groth
-
Michael Wimmer
-
Pol Nasam
-
wimmer