← Back to team overview

dolfin team mailing list archive

Re: Dolfin + Python: instant.recompile error

 

Alright, the culprit is the file /usr/lib/pkgconfig/ufc-1.pc which
listed the wrong path as -Cflag. After changing this to the correct
path, everything works fine.
I'll try and figure out how I can deal with this in Gentoo's build system.
Cheers,
Nico


On Wed, Jul 21, 2010 at 8:59 AM,  <kent-and@xxxxxxxxx> wrote:
>
> The swig include path is generated in
> dolfin/site-packages/dolfin/compilemodules/__init__.py
>
> It uses pkg-config. Check for instance:
> instant.header_and_libs_from_pkgconfig("dolfin")
>
> Kent
>
>> Whoops.
>>
>> ======================= *snip* =======================
>> import os
>> from distutils.core import setup, Extension
>> name = 'form_f55a0ed732d467a819b8cacd060d86f2b9674887'
>> swig_cmd =r'swig -python
>> -I/var/tmp/paludis/sci-mathematics-ufc-1.4.1/image/usr/include
>> -I/usr/lib64/python2.6/site-packages/instant/swig -c++ -I. -O
>> form_f55a0ed732d467a819b8cacd060d86f2b9674887.i'
>> os.system(swig_cmd)
>> sources = ['form_f55a0ed732d467a819b8cacd060d86f2b9674887_wrap.cxx']
>> setup(name = 'form_f55a0ed732d467a819b8cacd060d86f2b9674887',
>>       ext_modules = [Extension('_' +
>> 'form_f55a0ed732d467a819b8cacd060d86f2b9674887',
>>                      sources,
>>
>> include_dirs=['/var/tmp/paludis/sci-mathematics-ufc-1.4.1/image/usr/include',
>> '/usr/include'],
>>                      library_dirs=[],
>>                      libraries=[] , extra_compile_args=['-O0'] )])
>> ======================= *snap* =======================
>>
>>
>>
>>
>>
>> On Wed, Jul 21, 2010 at 7:43 AM, Nico Schlömer <nico.schloemer@xxxxxxxxx>
>> wrote:
>>>> Further, you should look in the
>>>> setup.py file.
>>>>
>>>> The swig_cmd shows you the include files passed to swig (with -I).
>>>
>>> Alright, this appears to be the problem. The contents of setup,py read
>>>
>>> ======================= *snip* =======================
>>>
>>> ======================= *snap* =======================
>>>
>>> where /var/tmp/paluds/[...] is the folder in which -- during the
>>> installation process -- the compilation takes place. After that, the
>>> generated files are actually moved to /usr/[...]. It seems that I'll
>>> need to tell UFC to include /usr/include/ rather than /var/tmp/[...].
>>>
>>> Is the setup.py gererated by DOLFIN or UFC? Any idea how to fix this
>>> anyway?
>>>
>>> Cheers,
>>> Nico
>>>
>>>
>>>
>>> On Wed, Jul 21, 2010 at 6:02 AM, Kent Andre <kent-and@xxxxxxxxx> wrote:
>>>>
>>>> Sorry, didn't see your remark on ufc later in the mail.
>>>> If you go to the directory
>>>>
>>>> /tmp/tmpaR40ea2010-7-20-23-30_instant/
>>>>
>>>> And have a look in the *.i file there, you will see
>>>> that the ufc.i file is included as:
>>>>
>>>> %}
>>>> %import "swig/ufc.i"
>>>> %pythoncode %{
>>>> '''
>>>> %}
>>>>
>>>> which means that swig needs to know where ufc.i is.
>>>> Further, you should look in the
>>>> setup.py file.
>>>>
>>>> The swig_cmd shows you the include files passed to swig (with -I).
>>>>
>>>> Somehow dolfin does not know about the ufc.i file, it seems.
>>>>
>>>> Kent
>>>>
>>>> On Tue, 2010-07-20 at 23:39 -0400, Nico Schlömer wrote:
>>>>> Hi all,
>>>>>
>>>>> I'm taking first steps with Dolfin here, and the first thing I did I
>>>>> create/update the necessary build files for Gentoo
>>>>> <https://bugs.gentoo.org/show_bug.cgi?id=131729>. :)
>>>>> Everything seems to work out alright, at least the demos show somewhat
>>>>> reasonable results.
>>>>> This is with one exception: I couldn't get the Python interface to run
>>>>> yet. The individual tests/demos for all the dependent libraries work
>>>>> out, but for, e.g., dolfin-0.9.8/demo/fem/simple/python I would get
>>>>> the error message
>>>>>
>>>>> ================================= *snip*
>>>>> =================================
>>>>> Calling FFC just-in-time (JIT) compiler, this may take some time.
>>>>> In instant.recompile: The module did not compile, see
>>>>> '/tmp/tmpaR40ea2010-7-20-23-30_instant/form_f55a0ed732d467a819b8cacd060d86f2b9674887/compile.log'
>>>>> Traceback (most recent call last):
>>>>>   File "demo.py", line 21, in <module>
>>>>>     V = FunctionSpace(mesh, "CG", 1)
>>>>>   File
>>>>> "/usr/lib64/python2.6/site-packages/dolfin/function/functionspace.py",
>>>>> line 230, in __init__
>>>>>     FunctionSpaceBase.__init__(self, mesh, element)
>>>>>   File
>>>>> "/usr/lib64/python2.6/site-packages/dolfin/function/functionspace.py",
>>>>> line 44, in __init__
>>>>>     ufc_element, ufc_dofmap = jit(self._ufl_element)
>>>>>   File
>>>>> "/usr/lib64/python2.6/site-packages/dolfin/compilemodules/jit.py",
>>>>> line 44, in mpi_jit
>>>>>     return local_jit(*args, **kwargs)
>>>>>   File
>>>>> "/usr/lib64/python2.6/site-packages/dolfin/compilemodules/jit.py",
>>>>> line 103, in jit
>>>>>     return jit_compile(form, parameters=p, common_cell=common_cell)
>>>>>   File "/usr/lib64/python2.6/site-packages/ffc/jitcompiler.py", line
>>>>> 56, in jit
>>>>>     return jit_element(object, parameters)
>>>>>   File "/usr/lib64/python2.6/site-packages/ffc/jitcompiler.py", line
>>>>> 135, in jit_element
>>>>>     (compiled_form, module, form_data) = jit_form(form, parameters)
>>>>>   File "/usr/lib64/python2.6/site-packages/ffc/jitcompiler.py", line
>>>>> 107, in jit_form
>>>>>     cache_dir = cache_dir)
>>>>>   File "/usr/lib64/python2.6/site-packages/ufc_utils/build.py", line
>>>>> 63, in build_ufc_module
>>>>>     **kwargs)
>>>>>   File "/usr/lib64/python2.6/site-packages/instant/build.py", line
>>>>> 474, in build_module
>>>>>     recompile(modulename, module_path, setup_name,
>>>>> new_compilation_checksum)
>>>>>   File "/usr/lib64/python2.6/site-packages/instant/build.py", line
>>>>> 100, in recompile
>>>>>     "compile, see '%s'" % compile_log_filename)
>>>>>   File "/usr/lib64/python2.6/site-packages/instant/output.py", line
>>>>> 49, in instant_error
>>>>>     raise RuntimeError(text)
>>>>> RuntimeError: In instant.recompile: The module did not compile, see
>>>>> '/tmp/tmpaR40ea2010-7-20-23-30_instant/form_f55a0ed732d467a819b8cacd060d86f2b9674887/compile.log'
>>>>> ================================= *snap*
>>>>> =================================
>>>>>
>>>>> The compile.log says
>>>>>
>>>>> ================================= *snip*
>>>>> =================================
>>>>> form_f55a0ed732d467a819b8cacd060d86f2b9674887.i:31: Error: Unable to
>>>>> find 'swig/ufc.i'
>>>>> running build_ext
>>>>> building '_form_f55a0ed732d467a819b8cacd060d86f2b9674887' extension
>>>>> creating build
>>>>> creating build/temp.linux-x86_64-2.6
>>>>> g++ -fPIC
>>>>> -I/var/tmp/paludis/sci-mathematics-ufc-1.4.1/image/usr/include
>>>>> -I/usr/include -I/usr/include/python2.6 -c
>>>>> form_f55a0ed732d467a819b8cacd060d86f2b9674887_wrap.cxx -o
>>>>> build/temp.linux-x86_64-2.6/form_f55a0ed732d467a819b8cacd060d86f2b9674887_wrap.o
>>>>> -O0
>>>>> g++: form_f55a0ed732d467a819b8cacd060d86f2b9674887_wrap.cxx: No such
>>>>> file or directory
>>>>> g++: no input files
>>>>> error: command 'g++' failed with exit status 1
>>>>> ================================= *snap*
>>>>> =================================
>>>>>
>>>>> The corresponding C++ demo in dolfin-0.9.8/demo/fem/simple/cpp works
>>>>> fine. I assume there's something wrong with the installation, but I
>>>>> have no idea what it could be. Also, the fact that it can't find the
>>>>> file swig.ufc.i is a bit weird as this one is located at
>>>>> /usr/include/swig/ufc.i in my system, i.e., a very standard path.
>>>>> Hints, anyone?
>>>>>
>>>>> Cheers,
>>>>> Nico
>>>>>
>>>>> _______________________________________________
>>>>> Mailing list: https://launchpad.net/~dolfin
>>>>> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
>>>>> Unsubscribe : https://launchpad.net/~dolfin
>>>>> More help   : https://help.launchpad.net/ListHelp
>>>>
>>>>
>>>>
>>>
>>
>
>
>



References