-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation does not work out-of-the-box when external libraries are not installed #407
Comments
Umm, can cmake build automatically from source if dependencies are not installed? |
No. You need to manually set the switches such as |
I have mentioned this aspect in a previous communication. This is not a bug, I have designed it this way in order to provide more flexibility to the user. |
I think the default behavior should be: Currently we have (a) and (c) which are great. But I'd like to see the logic of (b) also built in so that it is more friendly to new users. |
I personally disagree with that approach ( :) nothing new).
After showing the OpenCV example I have to admit I'm personally pretty much against building the third party dependencies from source altogether. It's maybe ok when Open3D is used only in a lab. But when Open3D is integrated into a larger/existing application (and we want Open3D to grow to that point) there are all kinds of scenarios where this will be a cause of failure: symbol conflicts, linking to multiple versions of the same (third party) library, to enumerate just a few. We can save ourselves the time and effort by limiting the opportunities for such errors to arise in the future. I also believe that this form of convenience (building the third party dependencies from source for the user) is causing us all kinds of problems already. Take GLFW for example. Rather then spending time improving core features of Open3D we're somewhat stuck trying to figure out how to install GLFW together with Open3D after building it from source (#393). Even regarding the rest of the third party libraries the install logic of Open3D would be much simpler and would have taken much less time to complete if we didn't have to build from source. |
These are the exact reasons I strongly think we should always include a copy of external library source code in Open3D. Other libraries can change, API can change, header files can change. We have no control of it. In order to maintain Open3D in a status that it works with all possible versions of a certain external dependency is a very heavy job. (In a larger scope, the operating systems can be regarded as a type of dependency. And we are still struggling with compatibility issues with different versions of Ubuntu, Windows, compiler, etc.) The small external libraries (GLFW, Jsoncpp, pybind11, etc) change more frequently and less organized than the operating systems. I don't think we have enough resource to maintain compatibility to all of them. Given the amount of resource we have, the best solution is to always provide a fallback mechanism: building from source. It is not optimal, but Open3D should always be able to be compiled from source, no matter which operating system is used. If someone wants to go sophisticated, he/she always have the option to install native external dependencies and link to it. Think of a scenario, assume in the future, pybind11 makes a major upgrade from 2.2 to 3.0, it goes native with Ubuntu (apt-get directly gets pybind11 3.0), and deprecates all APIs currently in 2.2. In order to compile Open3D, we only have 3 options:
To me, (3) is the only practical option. This is the reason I made it a design principle. It is written in our paper.
|
Well, the scenario I was describing was not a compatibility problem. It's the problem of having different components of an application link to different versions of the same library for example. We cannot control how the user decides to embed Open3D in his application. For this reason building from the third party dependencies from source might (likely will) be a problem when Open3D is integrated in larger projects. I respectfully disagree with option 3 also. In fact, specifically to pybind11, I've recently become aware that pybind11 can be installed as a pip package and also can be installed on Ubuntu 18.04 using apt. I think it's worth researching removing the source code for pybind11 and always using the installed pybind11. I'm sure there's pros and cons for all these approaches that I didn't even consider. Ultimately, just like you, I just want us to take the path that puts the least burden on us both today and in the future - there's plenty of valuable work that needs to be done. |
If we don’t do option 3, what should we do? We can’t leave Open3D in a status that is not compilable. I think we agree on that? So should we do option 1 or option 2? Or is there any other better idea? Also, maintaining package compatibility is a big business. The main purpose of Anaconda is this. I’d really like to know if there is any lightweight solution... |
I agree with you. Luckily Open3D is compilable today out of the box just like OpenCV.
There are exceptions to the above: Regarding package compatibility - I don't know how to address that. As you mentioned it's a big complicated business that has no end. |
As guide to any user interested in building the software and the missing dependecies:
|
My recommendation is to always use the installed dependencies on UNIX systems. The script |
On Windows, I had another issue.
I had followed this tutorial: |
CMake is suggesting that you delete the cache and configure/generate the project again from scratch. Does that help? |
You're right. I just tried removing the release folder. The issue was resolved when I completely delete the whole Open3D folder, clone, and build again (not very sure why this works though). I had to manually check dependencies to configure. |
That works however recloning should not be necessary.
|
Yes. I tried both but it didn't work out.
|
yep, right away. |
This is a permissions issue - you don't have permission to write to |
Aha you're right. As you explained this is because cmake INSTALL prefix copies libraries and headers to the system folder, which was not in the case in our previous Open3D versions. Can you add some note on our document to clarify this potential issue? Without knowing about why this is happening, it is hard to figure out from the error message. |
do we agree on this being addressed? |
Umm I am not quite sure. I hope the first user don't have to worry about explicitly turnning on switches for building dependent libraries. @qianyizh what do you think? |
This is also related to #408 and #425 There are three use cases
There are three most frequently used OS/tool chains:
For each use case under each tool chain (9 combinations in total), on a fresh installed system, there should be a getting_started instruction to show how to do it. Let's not worry about use case (3) for now. But for the other two use cases: (1) is broken. We have received multiple complaints and it is tracked in #408 . We need to hot fix it. (2) is working with Ubuntu and OSX tool chain, but for the Windows tool chain I can't make it by following this guide: Let's track the progress of (2) in this thread. We either need to fix the documentation of http://www.open3d.org/docs/getting_started.html#windows . Elaborate how to download and install all dependent libraries. Or let's make compiling from source an out-of-box default option... |
I would personally close this, there's nothing wrong with CMake on Windows. As I've mentioned before this use case is perfectly valid and to support this I would give the example of OpenCV which works exactly the same way. The second part of this thread looks like a duplicate of #408 and #430. |
I will take over the ownership to fix this. |
Addressed in #444. |
I checked out the code on windows. I compiled following the guide:
http://www.open3d.org/docs/getting_started.html#windows
I got error messages:
There are no instructions to fix it. I think this is unfriendly to new users.
Also, there are window users who do not use CMake GUI (e.g., I use CMake console command in Windows), and there is not hint regarding turning on BUILD_EIGEN3 switch etc. I have to read through the CMakeLists files to find the error message. And the only way to fix it is to add 6 switches to the cmake command. This is unfriendly.
The root cause are these lines in
External/CMakeLists.txt
:I don't think we should report error. When everything fails, we should just enable
BUILD_EIGEN3
.Any thoughts? @syncle @takanokage
The text was updated successfully, but these errors were encountered: