alicevision / AliceVision

Photogrammetric Computer Vision Framework
http://alicevision.org
Other
2.95k stars 820 forks source link

Cannot compile on Ubuntu 17.10 #389

Closed GottfriedHofmann closed 4 years ago

GottfriedHofmann commented 6 years ago

Problem

I try to compile with -DALICEVISION_BUILD_DEPENDENCIES=ON and -DOPENEXR_HOME:PATH=/path/to/openexr/install

The latter seems to get ignored, it always tries to build OpenEXR from the downloaded dir which fails because it requires libIex-2_2.so.23 which differs from the version installed on my system.

Here is the Gist: https://gist.github.com/GottfriedHofmann/47170317f4204562de273dd579a11f97

Versions

GottfriedHofmann commented 6 years ago

I tried it again and fails with embedded dependencies as well even though libIex-2_2.so.23 gets successfully build it cannot be found:

[ 2%] Generating dwaLookups.h ./dwaLookups: error while loading shared libraries: libIex-2_2.so.23: cannot open shared object file: No such file or directory IlmImf/CMakeFiles/IlmImf.dir/build.make:65: recipe for target 'IlmImf/dwaLookups.h' failed make[5]: [IlmImf/dwaLookups.h] Error 127 make[5]: Deleting file 'IlmImf/dwaLookups.h' CMakeFiles/Makefile2:164: recipe for target 'IlmImf/CMakeFiles/IlmImf.dir/all' failed make[4]: [IlmImf/CMakeFiles/IlmImf.dir/all] Error 2 Makefile:162: recipe for target 'all' failed make[3]: [all] Error 2 CMakeFiles/openexr.dir/build.make:114: recipe for target 'external/src/openexr-stamp/openexr-build' failed make[2]: [external/src/openexr-stamp/openexr-build] Error 2 CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/openexr.dir/all' failed make[1]: [CMakeFiles/openexr.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

GottfriedHofmann commented 6 years ago

I copied libIex-2_2.so.23 into /usr/lib/x86_64-linux-gnu/ which made the error dissapear, but now I ran into something more serious:

[ 1%] Building CXX object src/libOpenImageIO/CMakeFiles/OpenImageIO.dir//bmp.imageio/bmpinput.cpp.o In file included from /home/g/git-repositories/build/openimageio/src/include/OpenImageIO/simd.h:56:0, from /home/g/git-repositories/build/openimageio/src/include/OpenImageIO/fmath.h:65, from /home/g/git-repositories/build/openimageio/src/include/OpenImageIO/hash.h:51, from /home/g/git-repositories/build/openimageio/src/include/OpenImageIO/strutil.h:52, from /home/g/git-repositories/build/openimageio/src/include/OpenImageIO/ustring.h:137, from /home/g/git-repositories/build/openimageio/src/include/OpenImageIO/paramlist.h:46, from /home/g/git-repositories/build/openimageio/src/include/OpenImageIO/imageio.h:61, from /home/g/git-repositories/build/openimageio/src/bmp.imageio/bmp_pvt.h:34, from /home/g/git-repositories/build/openimageio/src/bmp.imageio/bmpinput.cpp:30: /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:228:34: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] const Vec2 & normalizeExc () throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:232:37: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec2 normalizedExc () const throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:440:34: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] const Vec3 & normalizeExc () throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:444:37: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec3 normalizedExc () const throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:622:37: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] const Vec4 & normalizeExc () throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:626:44: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec4 normalizedExc () const throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:714:30: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec2::normalizeExc () throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:723:37: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec2::normalizedExc () const throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:738:28: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec2::normalizeExc () throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:747:35: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec2::normalizedExc () const throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:762:30: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec3::normalizeExc () throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:771:37: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec3::normalizedExc () const throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:786:28: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec3::normalizeExc () throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:795:35: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec3::normalizedExc () const throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:809:30: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec4::normalizeExc () throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:818:37: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec4::normalizedExc () const throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:833:28: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec4::normalizeExc () throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:842:35: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec4::normalizedExc () const throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:1212:26: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec2::normalizeExc () throw (IEX_NAMESPACE::MathExc) ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:1249:33: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec2::normalizedExc () const throw (IEX_NAMESPACE::MathExc) ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:1704:26: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec3::normalizeExc () throw (IEX_NAMESPACE::MathExc) ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:1743:33: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec3::normalizedExc () const throw (IEX_NAMESPACE::MathExc) ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:2109:26: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec4::normalizeExc () throw (IEX_NAMESPACE::MathExc) ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathVec.h:2150:33: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Vec4::normalizedExc () const throw (IEX_NAMESPACE::MathExc) ^~~~~ In file included from /home/g/git-repositories/build/openimageio/src/include/OpenImageIO/simd.h:57:0, from /home/g/git-repositories/build/openimageio/src/include/OpenImageIO/fmath.h:65, from /home/g/git-repositories/build/openimageio/src/include/OpenImageIO/hash.h:51, from /home/g/git-repositories/build/openimageio/src/include/OpenImageIO/strutil.h:52, from /home/g/git-repositories/build/openimageio/src/include/OpenImageIO/ustring.h:137, from /home/g/git-repositories/build/openimageio/src/include/OpenImageIO/paramlist.h:46, from /home/g/git-repositories/build/openimageio/src/include/OpenImageIO/imageio.h:61, from /home/g/git-repositories/build/openimageio/src/bmp.imageio/bmp_pvt.h:34, from /home/g/git-repositories/build/openimageio/src/bmp.imageio/bmpinput.cpp:30: /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:266:25: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:269:25: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:272:25: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:275:25: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:640:25: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:643:25: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:646:25: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:649:25: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] throw (IEX_NAMESPACE::MathExc); ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:1433:38: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Matrix33::gjInvert (bool singExc) throw (IEX_NAMESPACE::MathExc) ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:1441:45: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Matrix33::gjInverse (bool singExc) const throw (IEX_NAMESPACE::MathExc) ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:1545:36: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Matrix33::invert (bool singExc) throw (IEX_NAMESPACE::MathExc) ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:1553:43: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Matrix33::inverse (bool singExc) const throw (IEX_NAMESPACE::MathExc) ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:2702:38: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Matrix44::gjInvert (bool singExc) throw (IEX_NAMESPACE::MathExc) ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:2710:45: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Matrix44::gjInverse (bool singExc) const throw (IEX_NAMESPACE::MathExc) ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:2814:36: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Matrix44::invert (bool singExc) throw (IEX_NAMESPACE::MathExc) ^~~~~ /home/g/git-repositories/build/external/openexr_build/include/OpenEXR/ImathMatrix.h:2822:43: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] Matrix44::inverse (bool singExc) const throw (IEX_NAMESPACE::MathExc) ^~~~~ cc1plus: all warnings being treated as errors src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/build.make:62: recipe for target 'src/libOpenImageIO/CMakeFiles/OpenImageIO.dir//bmp.imageio/bmpinput.cpp.o' failed make[5]: [src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/bmp.imageio/bmpinput.cpp.o] Error 1 CMakeFiles/Makefile2:2287: recipe for target 'src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/all' failed make[4]: [src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/all] Error 2 Makefile:162: recipe for target 'all' failed make[3]: [all] Error 2 CMakeFiles/openimageio.dir/build.make:118: recipe for target 'external/src/openimageio-stamp/openimageio-build' failed make[2]: [external/src/openimageio-stamp/openimageio-build] Error 2 CMakeFiles/Makefile2:442: recipe for target 'CMakeFiles/openimageio.dir/all' failed make[1]: [CMakeFiles/openimageio.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: [all] Error 2

chrisnovello commented 6 years ago

Having the same issue on Ubuntu 18.04 at the moment

chrisnovello commented 6 years ago

Seems like this could be the cause https://github.com/openexr/openexr/issues/235

Haven't had a chance to test / hopefully their update gets added to the formal release soon

johnhable commented 6 years ago

Just ran into the same issue today. It looks like it was fixed in the openexr mainline, but it will be a while before it's in a formal release. I made this change to the CMakeLists.txt file and that seems to have fixed it:

Add IlmBase

ExternalProject_Add(ilmbase

URL https://github.com/openexr/openexr/archive/v2.2.1.tar.gz

   GIT_REPOSITORY https://github.com/openexr/openexr

...

Add OpenEXR

ExternalProject_Add(openexr

URL https://github.com/openexr/openexr/archive/v2.2.1.tar.gz

   GIT_REPOSITORY https://github.com/openexr/openexr

...

Basically, just point it at git instead of the tar.gz of the release. That should fix it for you.

John

chrisnovello commented 6 years ago

I did something similar (pulled from the Dev branch explicitly tho) and bumped into a new OpenImageIO problem down the compilation line. Haven't had a chance to play more since then — will try this and reply — thanks for info !

johnhable commented 6 years ago

Yeah, I ran into OpenImageIO problems as well. Make sure that it's using 1.8, because 1.7 doesn't have ::get_string(). Note that the Ubuntu package manager installs 1.7 so I had to uninstall the package. But the good news is that if you don't have any OpenImageIO package installed, the one that cmake downloads works fine. Good luck!

chrisnovello commented 6 years ago

Ah, yes that was my problem, thank you!

Got over that hump but now some new problems with MeshSDFilter's OpenMesh dependency


/home/deep3d/photogrammetry/Alicevision4/AliceVision/src/aliceVision/mvsUtils/MultiViewParams.cpp:275:15: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
         fscanf(f, "%f %f %f", &FocK1K2Arr[i].x, &FocK1K2Arr[i].y, &FocK1K2Arr[i].z);
         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 50%] Building CXX object dependencies/MeshSDFilter/CMakeFiles/OpenMesh.dir/external/OpenMesh/Tools/Utils/StripifierT.cc.o
[ 51%] Building CXX object dependencies/MeshSDFilter/CMakeFiles/OpenMesh.dir/external/OpenMesh/Tools/Utils/Timer.cc.o
[ 51%] Building CXX object dependencies/MeshSDFilter/CMakeFiles/OpenMesh.dir/external/OpenMesh/Tools/Utils/conio.cc.o
/home/deep3d/photogrammetry/Alicevision4/AliceVision/src/dependencies/MeshSDFilter/external/OpenMesh/Tools/Utils/conio.cc: In function ‘int OpenMesh::Utils::kbhit()’:
/home/deep3d/photogrammetry/Alicevision4/AliceVision/src/dependencies/MeshSDFilter/external/OpenMesh/Tools/Utils/conio.cc:122:20: error: aggregate ‘OpenMesh::Utils::kbhit()::timeval tv’ has incomplete type and cannot be defined
     struct timeval tv;
                    ^~
/home/deep3d/photogrammetry/Alicevision4/AliceVision/src/dependencies/MeshSDFilter/external/OpenMesh/Tools/Utils/conio.cc:127:5: error: ‘select’ was not declared in this scope
     select(1, NULL, NULL, NULL, &tv);
     ^~~~~~
/home/deep3d/photogrammetry/Alicevision4/AliceVision/src/dependencies/MeshSDFilter/external/OpenMesh/Tools/Utils/conio.cc:127:5: note: suggested alternative: ‘execl’
     select(1, NULL, NULL, NULL, &tv);
     ^~~~~~
     execl
dependencies/MeshSDFilter/CMakeFiles/OpenMesh.dir/build.make:1193: recipe for target 'dependencies/MeshSDFilter/CMakeFiles/OpenMesh.dir/external/OpenMesh/Tools/Utils/conio.cc.o' failed
make[5]: *** [dependencies/MeshSDFilter/CMakeFiles/OpenMesh.dir/external/OpenMesh/Tools/Utils/conio.cc.o] Error 1
make[5]: *** Waiting for unfinished jobs....

I also tried to replace it with the latest source for OpenMesh but hit a different bug there

`[ 53%] Building CXX object dependencies/MeshSDFilter/CMakeFiles/OpenMesh.dir/external/OpenMesh/Core/Templates/newClass.cc.o /home/deep3d/photogrammetry/Alicevision4/AliceVision/src/dependencies/MeshSDFilter/external/OpenMesh/Core/Templates/newClass.cc:58:10: fatal error: OpenMesh/.../newClass.hh: No such file or directory

include <OpenMesh/.../newClass.hh>

`

(I also tried to exclude MeshSDFilter from the build altogether and compilation progressed along — I hit a new issue where some of the cuda code needed gcc 6 but I've got 7.3 on that system as my default - going to try to recompile with gcc 6 tomorrow)

fabiencastan commented 6 years ago

I made some fixes in the PR #393. Let me know if it works better for you. I don't know how to reproduce the error with OpenMesh.

johnhable commented 6 years ago

@paperkettle: I ran into the same thing with struct timeval. Fixed it by just adding #include <sys/time.h>. It seems like sys/time.h must have been included from some other dependency in the past because that's where struct timeval is defined. Maybe that changed in the later distributions?

I also ran into the cuda build problem too. Building with gcc 6 fixes it. I just did a "which gcc" and changed the symlink to gcc-6. That's a cuda problem though. The best we could do in the AliceVision build is add a check in cmake to throw an error if cuda is enabled and gcc >= 7?

John

chrisnovello commented 6 years ago

@johnhable AHH victory, built — thankyou !!! Still gaining confidence in these waters, this has all been very educational, much gratitude

GottfriedHofmann commented 6 years ago

Hmm - I give up. I checked out the PR by @fabiencastan but OIIO still fails :(

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.