CloudCompare / CloudComPy

Python wrapper for CloudCompare
Other
292 stars 41 forks source link

Building, installing M3C2 plugin and first tests #82

Open snowman907 opened 1 year ago

snowman907 commented 1 year ago

Hello prascle, As you mentioned, the process of enabling the M3C2 plugin is just by enabling the plugin in the JSON file.

So in the source\repos\CloudComPy I modified the JSON file from "False" to "True" in two locations: WRAP_PLUGIN_QM3C2, PLUGIN_STANDARD_QM3C2 In Visual Studios, I tried Build_all but got error messages. So I tried: Delete Cache Generate Cache Build All And still got a similar error: M3C2_build_error

Any advice what I did wrong?

snowman907 commented 1 year ago

I did not add in conda the libraries that M3C2 plugin requires - is that the issue? If so, where can I find a list of the required conda packages?

prascle commented 1 year ago

Hello, If you have followed the instructions about conda package for building or using binaries You already have the required packages.

The errors you are seeing may be related to un-updated sources in your clone repository (in CloudCompare's git submodule) but this is strange!

prascle commented 1 year ago

I don't know how to properly check the git clone status with Visual Studio's built-in git tools, I personally use git bash for all git commands, but that is another tool to install...

prascle commented 1 year ago

You should have the file qM3C2Export.h in the M3C2 plugin sources, like this: image If the file does not exist or is different, your clone is incorrect...

snowman907 commented 1 year ago

I do have the qM3C@2Export.h M3C2_source

snowman907 commented 1 year ago

Also, I suggest you add a .gitignore for the json, and .bat files. Perhaps there is a more elegant way to do this.

snowman907 commented 1 year ago

I use Github Desktop, and I pulled the most recent source. I deleted the cash, generated the catch, and did Build all. Still, I am getting errors." M3C2_build_error_update

prascle commented 1 year ago

I don't understand. It seems that the M3C2 plugin symbols required by CloudComPy are not exported, so I wanted to check if qM3C2Export.h is correct. I just tried GitHub Desktop to check if the submodules are properly handled, which they are.

snowman907 commented 1 year ago

So is there anything you would like me to try?

As I showed earlier, the qM3C2Export.h was in the cloned source.

snowman907 commented 1 year ago

Happy new year, Is there anything I can help with trying to resolve this? Thanks

prascle commented 1 year ago

Happy new year!

This is hard to solve remotely, a lot of details can go wrong. The main idea is to find out why the 5 M3C2 symbols required by CloudComPy are missing. Either M3C2 is compiled or not, and if it is compiled, why qM3C2Export.h is not taken into account. The build directory has about the same structure as the source directory. You should find something like this in the build for M3C2: image

If so, could you send me the .lib, the .dll and .exp files?

snowman907 commented 1 year ago

It looks the same to me: image In the zip folder are the three files. qM3C2_l.zip

Thanks!

prascle commented 1 year ago

I have successfully used your files in my build process, and the install is correct, with all tests OK. The problem is elsewhere. I can check the log of your build: when you have got the error, can you just do build all (without modifying the cache). The error should reappear. You should then have a log file .ninja_log in CloudComPy/build2019/x64_Release. Could you send this file? The build.ninja file in the same directory is also interesting. Paul

snowman907 commented 1 year ago

Great! I hope we are making progress! I cannot thank you enough for helping me here! Sending you all the ninja files! :) nina_files.zip

snowman907 commented 1 year ago

Hey Paul, I am just checking to see if you got the .ninja_log file in the zip folder from my previous response. Thanks

prascle commented 1 year ago

Hello, I found the problem! Thanks to the build.ninja file, I detected that the WRAP_PLUGIN_QM3C2 option should not be used anymore. It is disabled in my CMakeSettings.json. It corresponds to an old version of the Python wrap of the plugin, and has an unpleasant side effect on the build. When I enable the option, I get the same results as yours. So, just set the WRAP_PLUGIN_QM3C2 option to False in CMakeSettings.json as it is by default and it should work.

I've got some cleaning up to do on my files, thanks for your input in finding this bug! Paul

snowman907 commented 1 year ago

Glad we are making progress! So I modified the JSON file in the source folder. Then I cleaned and generated cache followed by Build All and Install CloudComparePorject. This time I only got 4 Warnings and 1 Error.

build_20_01_23 I've attached the ninja build files. build_20_1_23.zip Thanks

prascle commented 1 year ago

Hello, Without any information about the error, I can't help you. Build.ninja gives information about the build process, not the error, and the other files are not useful here. The details of the error, if any, are in the Output tab, to the right of the Error List tab. I suggest you try the build process again as above and try to isolate the details of the first error in the Output tab. Paul

snowman907 commented 1 year ago

Hello Paul, I attached a copy from the Output after the Install_CloudCompareProject command.

cloudComPy_Install_CloudCompareProjects_1_23_2023.txt

snowman907 commented 1 year ago

Perhaps the error is the result of the Install invoking the command "conda activate CloudComPy310" not from an anaconda shell. Is this supposed to work with the correct configuration?

snowman907 commented 1 year ago

OK, so apparently I was missing the command conda init Then I reran in VisualStudios the Install CloudComparePorjects and did not get any error!

prascle commented 1 year ago

OK, I think you don't need conda init if the CMakeSettings.json is correctly configured: you have two variables to check, condaBase and condaRoot. In your output log, you can see that the path for Scripts\activate.bat is incorrect (probably because condaBase is incorrect). Anyway, it should work now. Paul

snowman907 commented 1 year ago

CMakeSettings.json has an anacondaRoot, but there is no condaRoot, condaBase or anacondaBase! So I do know where to look for the error in condaBase. Thanks CMakeSettings.json.rmv_ext.txt

prascle commented 1 year ago

CMakeSettings.json was updated on November 19, 2022, to have a portable script for building documentation. The CloudComPy sources and build scripts are based on the definitions in CMakeSettings.json. You should migrate to the new one to get something consistent. Anyway, even without that, the installation should be fine, except for the documentation: CloudComPy tests should work, as well as CloudCompare Gui. Paul