m-jahn / WeightedTreemaps

Create Voronoi and Sunburst Treemaps from Hierarchical data
GNU General Public License v3.0
47 stars 9 forks source link

Maybe I need your help with difficulty in installing WeightedTreemaps. #36

Closed zyb1984 closed 1 year ago

zyb1984 commented 1 year ago

I tried to install WeightedTreemaps through Github, but encountered a fatal error: “voronoiDiagram.cpp:13:10: fatal error: CGAL/MP_Float.h: No such file or directory”. I have followed the tutorial and installed CGAL and cgal4h. However, the CGAL version I installed is 5.6. The detailed information is as follows:

## Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19044.
## The C compiler identification is MSVC 19.27.29111.0
## The CXX compiler identification is MSVC 19.27.29111.0
## Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped
## Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped
## Using header-only CGAL
## Targeting Visual Studio 16 2019
## Using VC toolset 142.
## Generator uses intermediate configuration directory: $(Configuration)
## Found GMP: debug;C:/local/vcpkg/installed/x64-windows/debug/lib/gmp.lib;optimized;C:/local/vcpkg/installed/x64-windows/debug/lib/gmp.lib  
## Found MPFR: C:/local/vcpkg/installed/x64-windows/debug/lib/mpfr.lib  
## Found Boost: C:/local/vcpkg/installed/x64-windows/include (found suitable version "1.83.0", minimum required is "1.66")  
## Boost include dirs: C:/local/vcpkg/installed/x64-windows/include
## Boost libraries:  Looking for pthread.h - not found
![image](https://github.com/m-jahn/WeightedTreemaps/assets/24197491/fbffb595-1c90-444e-9154-5b97d3843e9a)
![image](https://github.com/m-jahn/WeightedTreemaps/assets/24197491/bceed28e-ccd8-4683-865b-d419b29d57c9)

How should I resolve this error message? Should I downgrade the CGAL version to 4.x? Or is it because we haven't added CGAL to my environment variables? If it's due to me not correctly adding CGAL to the environment variables, how should I properly add the environment variable? I installed CGAL in the following location using vcpkg: 'C:\local\vcpkg\installed\x64-windows\include\CGAL'. image Thank you very much for your attention and assistance.

m-jahn commented 1 year ago

Hi!

I just edited your comment by reformatting the code part. This is difficult to troubleshoot for me, because I can't really reproduce your steps. I'm usually not testing the package on a Windows system.

However it should not be necessary to install the CGAL library. The current version uses the CGAL headers provided by the RcppCGAL package. You can ignore your CGAL local installation for now. More important is a working C++ 17 compiler.

Is this probably related to a recent and similar issue on Windows, #35 ? Do you get a similar error message? Can you check if you can install the dependencies without problem, such as Rcpp, bh and RcppCGAL? The last one contains the CGAL headers used by the WeightedTreemaps package. It was recently removed from CRAN due to some issue, but you can install it from github using remotes::install_github("https://github.com/ericdunipace/RcppCGAL"). Try this and get back with the error message if you get any.

In the mean time you can use a Shiny App to plot your data --> https://m-jahn.shinyapps.io/ShinyTreemaps/

zyb1984 commented 1 year ago

Hi, thank you very much, and I have successfully resolved this issue. In step 1, following the recommendations of the RcppCGAL package, I pre-installed the CGAL library and added the CGAL_DIR. In step 2, I added the following lines:/ // [[Rcpp::depends(RcppCGAL)]] // [[Rcpp::depends(BH)]] // [[Rcpp::depends(RcppEigen)]] / [[Rcpp::depends(cgal4h)]] to voronoiDiagram.cpp,

m-jahn commented 1 year ago

great! I'm not sure that step 2 is necessary, this should be automatically taken care of with the LinkingTo field in the DESCRIPTION file. Also, you only need one installation of CGAL headers, so this link to the CGAL 4 package is def not required // [[Rcpp::depends(cgal4h)]].