Giter Site home page Giter Site logo

Comments (20)

EJFielding avatar EJFielding commented on July 29, 2024 1

I don't know anything about SCons or CMake, but that looks promising ;-).

I went ahead and installed OpenCV with port install opencv and I was able to build ISCE with autoRIFT. I don't do serious processing on this MacBook, so I did not have it installed before.

from isce2.

hfattahi avatar hfattahi commented on July 29, 2024 1

Hi @EJFielding, Yes autoRift needs OpenCV 3.x . Please uninstall your openCV and try "conda install -c conda-forge opencv=3.4.*"

from isce2.

EJFielding avatar EJFielding commented on July 29, 2024

It seems this module was written fairly recently.

from isce2.

piyushrpt avatar piyushrpt commented on July 29, 2024

You have to add the folder with numpy header file to the CPPPATH in SconfigISCE

from isce2.

rtburns-jpl avatar rtburns-jpl commented on July 29, 2024

Might be nice if we could set that up to happen automagically. Would numpy.get_include() work?

from isce2.

EJFielding avatar EJFielding commented on July 29, 2024

@piyushrpt Why did it work before? I have always had something like this: CPPPATH = /opt/local/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m

I found the include file in this directory /opt/local/library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h. I am sure I never had to include something like that before.

from isce2.

piyushrpt avatar piyushrpt commented on July 29, 2024

There were no explicit calls to numpy in C/ C++ code before autorift. The complete template / recipe for building the SConfigISCE is always available on the conda feedstock - https://github.com/conda-forge/isce2-feedstock/blob/master/recipe/build.sh

from isce2.

EJFielding avatar EJFielding commented on July 29, 2024

OK, I added the numpy include directory, now it is failing with another missing include:

In file included from /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0,
                 from /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from /Users/fielding/tools/ISCE2_latest/build/components/contrib/geo_autoRIFT/autoRIFT/bindings/autoriftcoremodule.cpp:42:
/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it with " \
  ^~~~~~~
/Users/fielding/tools/ISCE2_latest/build/components/contrib/geo_autoRIFT/autoRIFT/bindings/autoriftcoremodule.cpp:43:10: fatal error: opencv2/imgproc/imgproc.hpp: No such file or directory
 #include "opencv2/imgproc/imgproc.hpp"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
scons: *** [/Users/fielding/tools/ISCE2_latest/build/components/contrib/geo_autoRIFT/autoRIFT/bindings/autoriftcoremodule.os] Error 1

from isce2.

rtburns-jpl avatar rtburns-jpl commented on July 29, 2024

I think autoRIFT requires opencv 3.x to build, see https://github.com/conda-forge/isce2-feedstock/blob/52e6290577d975b423dcfc59cbbfbad658850a44/recipe/meta.yaml#L30.
Alternatively you could turn off that module for now by commenting out the SConscript('geo_autoRIFT/SConscript') from contrib/SConscript

from isce2.

piyushrpt avatar piyushrpt commented on July 29, 2024

The error is very clear. The opencv headers were not found - if you have it installed in non-standard locations add it to CPPPATH. You can find the location, if installed using https://github.com/leiyangleon/autoRIFT/blob/b91cef424f2a36534993f6bbddeea59822afbc44/setup.py#L16-L21

opencv has been a requirement for ionosphere corrections for many versions now.

from isce2.

EJFielding avatar EJFielding commented on July 29, 2024

The previous version would simply skip the ionosphere module build if opencv was not available. It did not halt the building of the rest of ISCE.

I use alos2App that does not require opencv, so I didn't have it installed.

from isce2.

piyushrpt avatar piyushrpt commented on July 29, 2024

We are happy to take contributions for automatically skipping things.

from isce2.

EJFielding avatar EJFielding commented on July 29, 2024

@rtburns-jpl Thanks for explaining how to turn off the autoRIFT module.

from isce2.

rtburns-jpl avatar rtburns-jpl commented on July 29, 2024

Happy to help, @EJFielding. Would something like this work to auto-fallback when OpenCV isn't detected?

if Configure(envcontrib).CheckCXXHeader("opencv2/imgproc/imgproc.hpp"):
    SConscript('geo_autoRIFT/SConscript')
else:
    print("OpenCV 3.x is required for autoRIFT support. Skipping...")

I'm much more familiar with CMake than SCons, so you might be better equipped than me to patch this :)

from isce2.

hfattahi avatar hfattahi commented on July 29, 2024

Closing this as it does not seem to be an issue with isce v2.4.0. The issue raised was just lack of dependencies and configuration for installing isce.

from isce2.

EJFielding avatar EJFielding commented on July 29, 2024

@hfattahi I would suggest adding something to the release or installation notes about the new inclusion of autoRIFT in the default build, since that means there is a requirement for the NumPy include directory in the configuration and the mandatory requirement for OpenCV, as there will likely be others who are upgrading to this new version who were not using autoRIFT before. There might also be some others who had not installed OpenCV previously since you had made that optional in the stripmapApp build.

from isce2.

EJFielding avatar EJFielding commented on July 29, 2024

I had similar problems with my configuration under Linux with the ISCE2 dependencies installed with Anaconda. It seems that the most recent version of OpenCV is 4.4.0. In this version, the opencv2/imgproc/imgproc.hpp file is under .../Anaconda/anaconda3/include/opencv4/opencv2 so I had to add the .../Anaconda/anaconda3/include/opencv4 path to my CPPPATH. When I did that, the autoRIFT compilation continues, but then generates a huge number of errors:

Install file: "contrib/geo_autoRIFT/autoRIFT/include/autoriftcoremodule.h" as "/u/pez0/fielding/tools/ISCE2_test/build/isce/components/contrib/geo_autoRIFT/autoRIFT/include/autoriftcoremodule.h"
g++ -o /u/pez0/fielding/tools/ISCE2_test/build/isce/components/contrib/geo_autoRIFT/autoRIFT/bindings/autoriftcoremodule.os -c -O2 -Wall -fPIC -m64 -fPIC -DNEEDS_F77_TRANSLATION -DF77EXTERNS_LOWERCASE_TRAILINGBAR -I/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/python3.7m -I/u/vento-r0/ericf/packages/Anaconda/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/u/vento-r0/ericf/packages/Anaconda/anaconda3/include -I/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4 -I/usr/include -I/u/pez0/fielding/tools/ISCE2_test/build/isce/components/iscesys/ImageApi/include -I/u/pez0/fielding/tools/ISCE2_test/build/isce/components/iscesys/ImageApi/DataCaster/include -I/u/pez0/fielding/tools/ISCE2_test/build/isce/components/isceobj/LineAccessor/include -I/u/pez0/fielding/tools/ISCE2_test/build/isce/components/iscesys/StdOE/include -I/u/pez0/fielding/tools/ISCE2_test/build/isce/components/isceobj/Util/include -I/u/pez0/fielding/tools/ISCE2_test/build/isce/components/isceobj/Util/Library/include -I/u/pez0/fielding/tools/ISCE2_test/build/isce/components/contrib/geo_autoRIFT/autoRIFT/include /u/pez0/fielding/tools/ISCE2_test/build/isce/components/contrib/geo_autoRIFT/autoRIFT/bindings/autoriftcoremodule.cpp
In file included from /u/vento-r0/ericf/packages/Anaconda/anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from /u/pez0/fielding/tools/ISCE2_test/build/isce/components/contrib/geo_autoRIFT/autoRIFT/bindings/autoriftcoremodule.cpp:42:
/u/vento-r0/ericf/packages/Anaconda/anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it with " \
  ^
In file included from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core.hpp:52:0,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/imgproc.hpp:46,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/imgproc/imgproc.hpp:48,
                 from /u/pez0/fielding/tools/ISCE2_test/build/isce/components/contrib/geo_autoRIFT/autoRIFT/bindings/autoriftcoremodule.cpp:43:
/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvdef.h:728:4: error: #error "OpenCV 4.x+ requires enabled C++11 support"
 #  error "OpenCV 4.x+ requires enabled C++11 support"
    ^
In file included from /usr/include/c++/4.8.2/array:35:0,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvdef.h:734,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core.hpp:52,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/imgproc.hpp:46,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/imgproc/imgproc.hpp:48,
                 from /u/pez0/fielding/tools/ISCE2_test/build/isce/components/contrib/geo_autoRIFT/autoRIFT/bindings/autoriftcoremodule.cpp:43:
/usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^
In file included from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd.hpp:81:0,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/base.hpp:58,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core.hpp:54,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/imgproc.hpp:46,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/imgproc/imgproc.hpp:48,
                 from /u/pez0/fielding/tools/ISCE2_test/build/isce/components/contrib/geo_autoRIFT/autoRIFT/bindings/autoriftcoremodule.cpp:43:
/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd_wrapper.hpp:45:5: warning: identifier �decltype� is a keyword in C++11 [-Wc++0x-compat]
     static CV_CONSTEXPR std::true_type check(typename std::is_same<typename std::decay<decltype(std::declval<T>().operator()(std::declval<Args>()...))>::type, Ret>::type*);
     ^
/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd_wrapper.hpp:79:5: warning: identifier �nullptr� is a keyword in C++11 [-Wc++0x-compat]
     inline Ptr(nullptr_t) CV_NOEXCEPT : std::shared_ptr<T>(nullptr) {}
     ^
/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd_wrapper.hpp:145:5: warning: identifier �static_assert� is a keyword in C++11 [-Wc++0x-compat]
     static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
     ^
In file included from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd.hpp:81:0,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/base.hpp:58,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core.hpp:54,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/imgproc.hpp:46,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/imgproc/imgproc.hpp:48,
                 from /u/pez0/fielding/tools/ISCE2_test/build/isce/components/contrib/geo_autoRIFT/autoRIFT/bindings/autoriftcoremodule.cpp:43:
/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd_wrapper.hpp:16:12: error: �std::nullptr_t� has not been declared
 using std::nullptr_t;
            ^
In file included from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd.hpp:81:0,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/base.hpp:58,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core.hpp:54,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/imgproc.hpp:46,
                 from /u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/imgproc/imgproc.hpp:48,
                 from /u/pez0/fielding/tools/ISCE2_test/build/isce/components/contrib/geo_autoRIFT/autoRIFT/bindings/autoriftcoremodule.cpp:43:
/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd_wrapper.hpp:40:44: warning: variadic templates only available with -std=c++11 or -std=gnu++11 [enabled by default]
 template<typename C, typename Ret, typename... Args>
                                            ^
/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd_wrapper.hpp:45:25: error: �true_type� in namespace �std� does not name a type
     static CV_CONSTEXPR std::true_type check(typename std::is_same<typename std::decay<decltype(std::declval<T>().operator()(std::declval<Args>()...))>::type, Ret>::type*);
                         ^
/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd_wrapper.hpp:47:44: error: �false_type� in namespace �std� does not name a type
     template<typename> static CV_CONSTEXPR std::false_type check(...);
                                            ^
/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd_wrapper.hpp:49:22: error: �check� has not been declared
     typedef decltype(check<C>(0)) type;
                      ^
/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd_wrapper.hpp:49:27: error: expected �,� or �...� before �<� token
     typedef decltype(check<C>(0)) type;
                           ^
/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd_wrapper.hpp:49:33: error: ISO C++ forbids declaration of �decltype� with no type [-fpermissive]
     typedef decltype(check<C>(0)) type;
                                 ^
/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd_wrapper.hpp:49:33: error: expected �;� at end of member declaration
/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd_wrapper.hpp:49:35: error: �type� does not name a type
     typedef decltype(check<C>(0)) type;
                                   ^
/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd_wrapper.hpp:56:30: error: �type� has not been declared
     static const int value = type::value;
                              ^
/u/vento-r0/ericf/packages/Anaconda/anaconda3/include/opencv4/opencv2/core/cvstd_wrapper.hpp:63:34: error: expected class-name before �{� token
         : public std::false_type {};

Do I need to downgrade my OpenCV to version 3? @leiyangleon

from isce2.

EJFielding avatar EJFielding commented on July 29, 2024

@hfattahi I tried running conda install -c conda-forge opencv=3.4 on my CentOS machine, and it was still checking conflicts after 2.5 hours, so I tried going back to opencv 4.4 that installs immediately. There was another problem that I added to #172

from isce2.

leiyangleon avatar leiyangleon commented on July 29, 2024

FYI, autoRIFT (v1.0.7) has been upgraded to work with both opencv 3 and 4. So as long as all the dependencies are installed, this issue should be resolved.

from isce2.

EJFielding avatar EJFielding commented on July 29, 2024

Thanks @leiyangleon. The new ISCE2 v2.4.1 with the upgraded autoRIFT now compiles with opencv 4 on at least one of the Linux machines that I use.

from isce2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.