This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Error when building with dorsal because of deprecated numpy api

+1 vote

Hello,
having got through my previous problem, I have run into another issue. The build fails because it calls onto an API that is deprecated in the numpy 1.8.0.dev version, that I am using.
Is there a workaround, or do I have to downgrade to numpy 1.7 ?

Below are the last lines of the log.

running build_ext
building 'ffc.time_elements_ext' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/ffc
creating build/temp.linux-x86_64-2.7/ffc/ext
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c ffc/ext/time_elements_interface.cpp -o build/temp.linux-x86_64-2.7/ffc/ext/time_elements_interface.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1736:0,
                 from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h:17,
                 from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from ffc/ext/time_elements_interface.cpp:25:
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: #warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_deprecated_api.h:23:2: error: #error Should never include npy_deprecated_api directly.
In file included from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_deprecated_api.h:126:0,
                 from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1736,
                 from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h:17,
                 from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from ffc/ext/time_elements_interface.cpp:25:
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/old_defines.h:6:2: error: #error The header "old_defines.h" is deprecated as of NumPy 1.7.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Follow up:
This issue was fixed , thanks to Johan Hake. However, there seems to be a similar problem left that is related to swig (see below). It occurs after the removal of all previously built files.

Btw., when I build the latest stable release, I don't have any troubles.

[ 98%] Building CXX object
dolfin/swig/modules/mesh/CMakeFiles/_mesh.dir/modulePYTHON_wrap.cxx.o
make[2]: ***
[dolfin/swig/modules/function/CMakeFiles/_function.dir/modulePYTHON_wrap.cxx.o]
Error 1
make[2]: Leaving directory
`/home/thrasher/software/FEniCS/src/dolfin/dorsal_build_dir'
make[1]: *** [dolfin/swig/modules/function/CMakeFiles/_function.dir/all]
Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: ***
[dolfin/swig/modules/io/CMakeFiles/_io.dir/modulePYTHON_wrap.cxx.o] Error 1
make[2]: Leaving directory
`/home/thrasher/software/FEniCS/src/dolfin/dorsal_build_dir'
make[1]: *** [dolfin/swig/modules/io/CMakeFiles/_io.dir/all] Error 2
In file included from /usr/include/python2.7/numpy/ndarraytypes.h:1728:0,
                 from /usr/include/python2.7/numpy/ndarrayobject.h:17,
                 from /usr/include/python2.7/numpy/arrayobject.h:15,
                 from
/home/thrasher/software/FEniCS/src/dolfin/dorsal_build_dir/dolfin/swig/modules/mesh/modulePYTHON_wrap.cxx:4023:
/usr/include/python2.7/numpy/npy_deprecated_api.h:11:2: warning:
#warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
/usr/include/python2.7/numpy/npy_deprecated_api.h:23:2: error: #error
Should never include npy_deprecated_api directly.
make[2]: ***
[dolfin/swig/modules/la/CMakeFiles/_la.dir/modulePYTHON_wrap.cxx.o] Error 1
make[2]: Leaving directory
`/home/thrasher/software/FEniCS/src/dolfin/dorsal_build_dir'
make[1]: *** [dolfin/swig/modules/la/CMakeFiles/_la.dir/all] Error 2
make[2]: ***
[dolfin/swig/modules/mesh/CMakeFiles/_mesh.dir/modulePYTHON_wrap.cxx.o]
Error 1
make[2]: Leaving directory
`/home/thrasher/software/FEniCS/src/dolfin/dorsal_build_dir'
make[1]: *** [dolfin/swig/modules/mesh/CMakeFiles/_mesh.dir/all] Error 2
make[1]: Leaving directory
`/home/thrasher/software/FEniCS/src/dolfin/dorsal_build_dir'
make: *** [all] Error 2
make: Leaving directory
`/home/thrasher/software/FEniCS/src/dolfin/dorsal_build_dir'
Failure with exit status: 2
Exit message: There was a problem building dolfin.
asked Jul 11, 2013 by Jan FEniCS User (8,290 points)
edited Jul 12, 2013 by Jan

1 Answer

+1 vote
 
Best answer

This is a bug in the building of the extension module of ffc. It should be fixed in the the master branch of FFC.

answered Jul 11, 2013 by johanhake FEniCS Expert (22,480 points)
selected Jul 13, 2013 by Jan

Thanks for the fix. But there seems to be another issue that I wasn't able to resolve by removing all previously built files. I have updated my question.

I cannot reproduce the error. However it looks like your DOLFIN CMake pickes up system version of NumPy. Is it possible for you to remove that?

OK, I will try to remove my numpy 1.8. .

Now that I am downgraded to Numpy 1.7.1 everything is alright.

Ok, what I suggested was to remove the system numpy. That might not be possible because of dependencies.

Yes, the removal of system's numpy affects a number of other packages. That's why I thought it easier to do the downgrade.

Has the Dorsal bug with building boost_1_51_0 been fixed?
...