OTB python bindings not compatible with numpy 1.19
Description
when I run
sudo /opt/cmake-${CMAKE_VERSION}-Linux-x86_64/bin/ctest -S ${OTB_INSTALL_DIRPATH}/share/otb/swig/build_wrapping.cmake -VV
with numpy >= 1.19 the script fails.
Outputs:
* Extra verbosity turned on
Reading Script: /opt/otb-7.3.0/share/otb/swig/build_wrapping.cmake
SetCTestConfiguration:SourceDirectory:/opt/otb-7.3.0/share/otb/swig
SetCTestConfiguration:BuildDirectory:/opt/otb-7.3.0/share/otb/swig/build
Run dashboard with model Experimental
Source directory: /opt/otb-7.3.0/share/otb/swig
Build directory: /opt/otb-7.3.0/share/otb/swig/build
Site:
Build name: (empty)
Use Experimental tag: 20210723-1008
SetCTestConfiguration:BuildDirectory:/opt/otb-7.3.0/share/otb/swig/build
SetCTestConfiguration:SourceDirectory:/opt/otb-7.3.0/share/otb/swig
SetCTestConfiguration:ConfigureCommand:"/opt/cmake-3.18.6-Linux-x86_64/bin/cmake" "-DCMAKE_INSTALL_PREFIX=/opt/otb-7.3.0" "-DCMAKE_INSTALL_RPATH=/opt/otb-7.3.0/lib" "-DCMAKE_BUILD_TYPE=Release" "-GUnix Makefiles" "/opt/otb-7.3.0/share/otb/swig"
Configure project
Configure with command: "/opt/cmake-3.18.6-Linux-x86_64/bin/cmake" "-DCMAKE_INSTALL_PREFIX=/opt/otb-7.3.0" "-DCMAKE_INSTALL_RPATH=/opt/otb-7.3.0/lib" "-DCMAKE_BUILD_TYPE=Release" "-GUnix Makefiles" "/opt/otb-7.3.0/share/otb/swig"
Run command: "/opt/cmake-3.18.6-Linux-x86_64/bin/cmake" "-DCMAKE_INSTALL_PREFIX=/opt/otb-7.3.0" "-DCMAKE_INSTALL_RPATH=/opt/otb-7.3.0/lib" "-DCMAKE_BUILD_TYPE=Release" "-GUnix Makefiles" "/opt/otb-7.3.0/share/otb/swig"
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found PythonInterp: /usr/bin/python3 (found version "3.6.9")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found version "2.7.17")
-- Found Numpy: /home/eouser/.local/lib/python3.6/site-packages/numpy/core/include
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/otb-7.3.0/share/otb/swig/build
Command exited with the value: 0
SetCTestConfiguration:BuildDirectory:/opt/otb-7.3.0/share/otb/swig/build
SetCTestConfiguration:SourceDirectory:/opt/otb-7.3.0/share/otb/swig
SetMakeCommand:/opt/cmake-3.18.6-Linux-x86_64/bin/cmake --build . --config "Release" --target "install" -- -i
SetCTestConfiguration:MakeCommand:/opt/cmake-3.18.6-Linux-x86_64/bin/cmake --build . --config "Release" --target "install" -- -i
Build project
MakeCommand:/opt/cmake-3.18.6-Linux-x86_64/bin/cmake --build . --config "Release" --target "install" -- -i
Run command: "/opt/cmake-3.18.6-Linux-x86_64/bin/cmake" "--build" "." "--config" "Release" "--target" "install" "--" "-i"
Scanning dependencies of target PythonWrapperLib
[ 20%] Building CXX object CMakeFiles/PythonWrapperLib.dir/itkPyCommand.cxx.o
[ 40%] Building CXX object CMakeFiles/PythonWrapperLib.dir/otbApplicationPYTHON_wrap.cxx.o
In file included from /usr/include/x86_64-linux-gnu/bits/types/stack_t.h:23:0,
from /usr/include/signal.h:303,
from /home/eouser/.local/lib/python3.6/site-packages/numpy/core/include/numpy/npy_interrupt.h:23,
from /home/eouser/.local/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:5,
from /opt/otb-7.3.0/share/otb/swig/otbApplicationPYTHON_wrap.cxx:6537:
/opt/otb-7.3.0/share/otb/swig/otbApplicationPYTHON_wrap.cxx: In function ‘void init_otbApplication()’:
/home/eouser/.local/lib/python3.6/site-packages/numpy/core/include/numpy/__multiarray_api.h:1531:151: error: return-statement with a value, in function returning 'void' [-fpermissive]
#define import_array() {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); return NULL; } }
^
/opt/otb-7.3.0/share/otb/swig/otbApplicationPYTHON_wrap.cxx:65796:3: note: in expansion of macro ‘import_array’
import_array();
^
[ 60%] Building CXX object CMakeFiles/PythonWrapperLib.dir/otbProgressReporterManager.cxx.o
[ 80%] Building CXX object CMakeFiles/PythonWrapperLib.dir/otbPythonLogOutput.cxx.o
[100%] Linking CXX shared module _otbApplication.so
c++: error: CMakeFiles/PythonWrapperLib.dir/otbApplicationPYTHON_wrap.cxx.o: No such file or directory
[100%] Built target PythonWrapperLib
Install the project...
-- Install configuration: "Release"
CMake Error at cmake_install.cmake:52 (file):
file INSTALL cannot find
"/opt/otb-7.3.0/share/otb/swig/build/_otbApplication.so": No such file or
directory.
Command exited with the value: 0
MakeCommand:/opt/cmake-3.18.6-Linux-x86_64/bin/cmake --build . --config "Release" --target "install" -- -i
Error(s) when building project
3 Compiler errors
1 Compiler warnings
Steps to reproduce
Run the previous command with numpy=1.19
Configuration information
- OS: Ubuntu 20.04
- OTB: 7.3 (from sta package)
- Python 3.6.9
Edited by Mickael Savinaud