Skip to content

Commit 487c34e

Browse files
author
Marco M. Mosca
committed
Automate the installation
1 parent 7ab3b44 commit 487c34e

10 files changed

+240
-186
lines changed

.gitignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ ASALocalRun/
338338

339339
# BeatPulse healthcheck temp database
340340
healthchecksdb
341-
/External/CGAL-4.14.3
342-
/External/eigen-3.3.7
343-
/External/Gemmi
341+
/External
344342
/out/build/x86-Release
345343
/out/install/x86-Release
344+
/build
345+
/install

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
2727
find_package(Gemmi REQUIRED)
2828
find_package(Eigen3 REQUIRED)
2929
find_package(Boost REQUIRED)
30-
find_package(VTK REQUIRED)
30+
find_package(VTK 8.2.0 PATHS "${CMAKE_CURRENT_SOURCE_DIR}/External/VTK-8.2.0/install" REQUIRED)
3131
find_package(CGAL REQUIRED COMPONENTS Core MODULE)
3232

3333
set (WORKDIR "${CMAKE_BINARY_DIR}/Workdir"

FindBoost.cmake

+6-12
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,20 @@
1616
*
1717
* Author Marco M. Mosca, email: marcomichele.mosca@gmail.com
1818
*]]
19-
# The following variable should be added to the system variables
20-
# BOOST_ROOT: Root of BOOST installation
2119

22-
IF(NOT DEFINED ENV{BOOST_ROOT})
23-
message(SEND_ERROR "BOOST_ROOT not defined, Please add BOOST_ROOT as environmental system variable.")
24-
return()
25-
ENDIF()
20+
set(PACKAGE_DIR_BOOST "${CMAKE_CURRENT_SOURCE_DIR}/External/boost_1_69_0")
2621

27-
set(BOOST_INCLUDE_DIR "$ENV{BOOST_ROOT}")
28-
set(BOOST_LIB_DIR "$ENV{BOOST_ROOT}/lib32-msvc-14.1")
29-
set(BOOST_BINARY_DIR "$ENV{BOOST_ROOT}/lib32-msvc-14.1")
22+
set(BOOST_INCLUDE_DIR "${PACKAGE_DIR_BOOST}")
23+
set(BOOST_LIB_DIR "${PACKAGE_DIR_BOOST}/lib64-msvc-14.1")
24+
set(BOOST_BINARY_DIR "${PACKAGE_DIR_BOOST}/lib64-msvc-14.1")
3025

3126
IF( (NOT EXISTS ${BOOST_INCLUDE_DIR}) OR (NOT EXISTS ${BOOST_LIB_DIR}) )
3227
message(SEND_ERROR "BOOST directories do not exist, Please assure they are inside the package folder")
3328
return()
3429
ENDIF()
3530

36-
#FILE(GLOB BOOST_DYN_LIBS ${BOOST_LIB_DIR}/*.lib)
37-
#FILE(GLOB BOOST_DYN_DLLS ${BOOST_BINARY_DIR}/*.dll)
38-
31+
message(STATUS "Using local package for BOOST library...")
32+
message(STATUS "BOOST library detected at: ${PACKAGE_DIR_BOOST}")
3933

4034
include_directories(${BOOST_INCLUDE_DIR})
4135
link_directories(${BOOST_LIB_DIR})

FindCGAL.cmake

+4-9
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@
1616
*
1717
* Author Marco M. Mosca, email: marcomichele.mosca@gmail.com
1818
*]]
19-
IF(NOT DEFINED ENV{CGAL_DIR})
20-
message(STATUS "Using local package for CGAL library...")
21-
set(PACKAGE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/External/CGAL-4.14.3")
22-
find_package(CGAL REQUIRED PATHS "${PACKAGE_DIR}" COMPONENTS Core CONFIG)
23-
message(STATUS "CGAL library detected at: ${PACKAGE_DIR}")
24-
ELSE()
25-
message(STATUS "Using system environmental variable package for CGAL library...")
26-
find_package(CGAL REQUIRED COMPONENTS Core CONFIG)
27-
ENDIF()
19+
set(PACKAGE_DIR_CGAL "${CMAKE_CURRENT_SOURCE_DIR}/External/CGAL-4.14.3")
20+
find_package(CGAL REQUIRED PATHS "${PACKAGE_DIR_CGAL}" COMPONENTS Core CONFIG)
21+
message(STATUS "Using local package for CGAL library...")
22+
message(STATUS "CGAL library detected at: ${PACKAGE_DIR_CGAL}")

FindEigen3.cmake

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@
1919

2020
IF(NOT DEFINED ENV{EIGEN3_ROOT})
2121
message(STATUS "Using local package for Eigen3 library...")
22-
set(PACKAGE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/External/eigen-3.3.7")
22+
set(PACKAGE_DIR_EIGEN "${CMAKE_CURRENT_SOURCE_DIR}/External/eigen-3.3.7")
2323
ELSE()
2424
message(STATUS "Using system environmental variable package for Eigen3 library...")
25-
set(PACKAGE_DIR "$ENV{EIGEN3_ROOT}")
25+
set(PACKAGE_DIR_EIGEN "$ENV{EIGEN3_ROOT}")
2626

2727
ENDIF()
2828

29-
set(EIGEN3_INCLUDE_DIR "${PACKAGE_DIR}")
30-
set(EIGEN3_SRC_DIR "${PACKAGE_DIR}/Eigen/src")
29+
set(EIGEN3_INCLUDE_DIR "${PACKAGE_DIR_EIGEN}")
30+
set(EIGEN3_SRC_DIR "${PACKAGE_DIR_EIGEN}/Eigen/src")
3131

3232
IF( (NOT EXISTS ${EIGEN3_INCLUDE_DIR}) OR (NOT EXISTS ${EIGEN3_SRC_DIR}) )
3333
message(SEND_ERROR "EIGEN3 directories do not exist, Please assure they are inside the package folder")
3434
return()
3535
ELSE()
36-
message(STATUS "Eigen library detected at: ${PACKAGE_DIR}")
36+
message(STATUS "Eigen library detected at: ${PACKAGE_DIR_EIGEN}")
3737
ENDIF()
3838

3939
include_directories(${EIGEN3_INCLUDE_DIR})

FindGemmi.cmake

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@
1818
*]]
1919
IF(NOT DEFINED ENV{GEMMI_ROOT})
2020
message(STATUS "Using local package for Gemmi library...")
21-
set(PACKAGE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/External/Gemmi")
21+
set(PACKAGE_DIR_GEMMI "${CMAKE_CURRENT_SOURCE_DIR}/External/Gemmi")
2222
ELSE()
2323
message(STATUS "Using system environmental variable package for Gemmi library...")
24-
set(PACKAGE_DIR "$ENV{GEMMI_ROOT}")
24+
set(PACKAGE_DIR_GEMMI "$ENV{GEMMI_ROOT}")
2525

2626
ENDIF()
2727

28-
set(GEMMI_INCLUDE_DIR "${PACKAGE_DIR}/include")
29-
set(3RD_INCLUDE_DIR "${PACKAGE_DIR}/third_party" )
30-
set(GEMMI_SRC_DIR "${PACKAGE_DIR}/src")
28+
set(GEMMI_INCLUDE_DIR "${PACKAGE_DIR_GEMMI}/include")
29+
set(3RD_INCLUDE_DIR "${PACKAGE_DIR_GEMMI}/third_party" )
30+
set(GEMMI_SRC_DIR "${PACKAGE_DIR_GEMMI}/src")
3131

3232
IF( (NOT EXISTS ${GEMMI_INCLUDE_DIR}) OR (NOT EXISTS ${GEMMI_SRC_DIR}) )
3333
message(SEND_ERROR "GEMMI directories do not exist, Please assure they are inside the package folder")
3434
return()
3535
ELSE()
36-
message(STATUS "Gemmi library detected at: ${PACKAGE_DIR}")
36+
message(STATUS "Gemmi library detected at: ${PACKAGE_DIR_GEMMI}")
3737
ENDIF()
3838

3939
include_directories(${GEMMI_INCLUDE_DIR} ${3RD_INCLUDE_DIR} )

Install/windows-setup/Setup.fs

-89
This file was deleted.

README.md

+47-61
Original file line numberDiff line numberDiff line change
@@ -2,98 +2,84 @@
22
The repository contains the code of Voronoi-based Lattice Distances which encodes crystal lattices to Voronoi Domains and runs Voronoi-based metrics to compare them.
33
The code is written in C++ and CMake. More details on the used metrics can be found in our paper published in the Crystal Research & Technology Journal: [Voronoi-Based Similarity Distances between Arbitrary Crystal Lattices](https://onlinelibrary.wiley.com/doi/10.1002/crat.201900197).
44

5-
The project has been compiled and run only on Windows.
5+
The project has been compiled and run only on `Windows x64`.
66

77
## Installation
88
### Download and install dependencies
9-
1. Install [DOTNET 7.0](https://dotnet.microsoft.com/en-us/download/dotnet/7.0)
10-
2. Install Visual Studio
11-
3. The software and shared libraries below must be installed by the user:
12-
- [CMake-3.8](https://cmake.org/)
13-
- [boost_1_69_0](https://sourceforge.net/projects/boost/files/boost-binaries/1.69.0/)
14-
- [VTK-8.2.0](https://vtk.org/download/)
15-
- [zlib-1.2.11](https://www.zlib.net/)
16-
- [libxml2-2.7.8](https://github.com/zhigangc/libxml2-2.7.8)
9+
1. Install Visual Studio (e.g. Community) choosing the following `single components`:
10+
- `.NET SDK`
11+
- `.NET 7.0 Runtime`
12+
- `MSVC v142 - C++ Build tools`
13+
- `MSVC v143 - C++ Build tools`
14+
- `C++/CLI for Build Tools v142`
15+
- `Windows 10 SDK (10.2.20348.0)`
16+
- `CMake C++ Tools for Windows`
17+
- `Git for Windows`
18+
19+
2. The software and shared libraries below must be installed by the user through Windows installers:
20+
- [CGAL-4.14.3-Setup.exe](https://github.com/CGAL/cgal/releases/tag/releases%2FCGAL-4.14.3)
21+
22+
Note: Install it in `VoronoiLatticeDistances\External\CGAL-4.14.3` folder and choose `64bit` binaries.
23+
24+
- [boost_1_69_0-msvc-14.1-64.exe](https://sourceforge.net/projects/boost/files/boost-binaries/1.69.0/)
25+
26+
Note: Install in `VoronoiLatticeDistances\External\boost_1_69_0` folder.
27+
28+
3. Add the following environmental variables as User:
29+
- `VS_DIR`: Path to Visual Studio with all folders (e.g. `Microsoft Visual Studio\2022\Community`)
30+
1731
4. Download the repository
18-
5. Run the following to fetch `CGAL`, `Gemmi` and `Eigen` source code:
32+
33+
5. Run the following in a `Command Prompt` (no PowerShell) to build and install it:
1934
```
20-
cd VoronoiLatticeDistances/Install/windows-setup
35+
"%VS_DIR%\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
36+
cd VoronoiLatticeDistances/windows-setup
2137
dotnet build
2238
dotnet run
2339
```
2440
25-
26-
27-
### Set the environmental variables
28-
To add the following details to your Windows environment go to: \
29-
Control Panel -> System -> Advanced Settings -> Environmental variables
30-
31-
Create the following variables in the variables' environment:
32-
33-
- BOOST_ROOT: path_to\boost_1_69_0
34-
- VTK_DIR: path_to\VTK-8.2.0\Install
35-
36-
### Add paths to the System `Path` variable
37-
38-
You also need to add the following directories with the required binaries to the `Path` variable:
39-
40-
- path_to\boost_1_69_0\lib32-msvc-14.1
41-
- path_to\VTK-8.2.0\Install\bin
42-
- path_to\zlib-1.2.11\bin
43-
- path_to\libxml2-2.7.8.win32\bin
44-
- path_to\VoronoiLatticeDistances\CGAL-4.14.3\auxiliary\gmp\lib
45-
46-
### Compile and install the repository
47-
48-
1. Open the cloned repository with CMake-GUI
49-
2. Generate the Visual Studio solution
50-
3. Open the solution file .sln with Visual Studio
51-
4. Choose `x86-Release` type from the top icon bar
52-
5. In Build menu, build all the project
53-
6. then from Build menu, Install the project
54-
5541
## Usage: Run the metric computations
5642
To compute correctly the metrics, it is required that all input CIF files contain the primitive unit cell.
57-
Running the executable 'voronoilatticedistances.exe' without parameters, it outputs the usage as follows:
43+
Running the executable `voronoilatticedistances.exe` without parameters, it outputs the usage as follows:
5844
5945
Required options:
6046
61-
- -inputdir [Input Folder with CIF files]
62-
- -outputdir [Output Folder to write metric results]
47+
- `-inputdir` [Input Folder with CIF files]
48+
- `-outputdir` [Output Folder to write metric results]
6349
6450
Output options (at least 1 required):
6551
66-
- -vol Outputs .csv file with Voronoi Cell volume
67-
- -vtp Outputs .vtp files with Voronoi Cell of a Lattice (Paraview format file)
68-
- -csv Outputs .csv files with Lattice and Voronoi Cell points
69-
- -off Outputs .off files with Voronoi Cell vertices and faces
70-
- -ds Outputs .csv file with Scale Invariant Distance matrix (n x n) between all n crystal lattices
71-
- -dh Outputs .csv file with Extended Hausdorff Distance matrix (n x n) between all n crystal lattices
52+
- `-vol` Outputs .csv file with Voronoi Cell volume
53+
- `-vtp` Outputs .vtp files with Voronoi Cell of a Lattice (Paraview format file)
54+
- `-csv` Outputs .csv files with Lattice and Voronoi Cell points
55+
- `-off` Outputs .off files with Voronoi Cell vertices and faces
56+
- `-ds` Outputs .csv file with Scale Invariant Distance matrix (n x n) between all n crystal lattices
57+
- `-dh` Outputs .csv file with Extended Hausdorff Distance matrix (n x n) between all n crystal lattices
7258
7359
Optional commands:
7460
75-
- -intervals [integer n (default n=2)] It affects the number of rotation samples to be considered for metric computations (total number of rotations: 4*pi^2*n^3)
76-
- -threads [integer t (default t=1)] Rotation samples are divided among t threads
61+
- `-intervals` [integer n (default n=2)] It affects the number of rotation samples to be considered for metric computations (total number of rotations: 4*pi^2*n^3)
62+
- `-threads` [integer t (default t=1)] Rotation samples are divided among t threads
7763
78-
If users want to divide the voronoi cell computation from the metric computation, they can run 'voronoilatticedistances_off.exe' to compute only the metrics from OFF files.
64+
If users want to divide the voronoi cell computation from the metric computation, they can run `voronoilatticedistances_off.exe` to compute only the metrics from OFF files.
7965
8066
Required options:
8167
82-
- -inputdir [Input Folder with Voronoi Cell OFF files]
83-
- -outputdir [Output Folder to write metric results]
68+
- `-inputdir` [Input Folder with Voronoi Cell OFF files]
69+
- `-outputdir` [Output Folder to write metric results]
8470
8571
Output options (at least 1 required):
8672
87-
- -ds Outputs .csv file with Scale Invariant Distance matrix (n x n) between all n crystal structures
88-
- -dh Outputs .csv file with Extended Hausdorff Distance matrix (n x n) between all n crystal structures
73+
- `-ds` Outputs .csv file with Scale Invariant Distance matrix (n x n) between all n crystal structures
74+
- `-dh` Outputs .csv file with Extended Hausdorff Distance matrix (n x n) between all n crystal structures
8975
9076
Optional commands:
9177
92-
- -intervals [integer n (default n=2)] It affects the number of rotation samples to be considered for metric computations (number of rotations: 4*pi^2*n^3)
93-
- -threads [integer t (default t=1)] Rotation samples are divided among t threads
78+
- `-intervals` [integer n (default n=2)] It affects the number of rotation samples to be considered for metric computations (number of rotations: 4*pi^2*n^3)
79+
- `-threads` [integer t (default t=1)] Rotation samples are divided among t threads
9480
9581
## Example of Voronoi Domains
96-
There are following the Voronoi domains of 5 real crystal lattices from the T2 dataset used in our experiments: T2-epsilon, T2-delta, T2-beta, T2-gamma and T2-alpha. Plus, the voronoi domains of the standard cubic, body-centred cubic and face-centred cubic lattices.
82+
There are following the Voronoi domains of 5 real crystal lattices from the `T2 dataset` used in our experiments: T2-epsilon, T2-delta, T2-beta, T2-gamma and T2-alpha. Plus, the voronoi domains of the standard cubic, body-centred cubic and face-centred cubic lattices.
9783
9884
<p float="left">
9985
<img src="images/epsilon.JPG" width="200" />
@@ -108,7 +94,7 @@ There are following the Voronoi domains of 5 real crystal lattices from the T2 d
10894
10995
11096
## Dendrogram and Heatmap
111-
The dendrogram and the heatmap of the Voronoi-based metrics can be generated with the following script. The input csv file is generated by the options -dh or -ds of the previous executables.
97+
The dendrogram and the heatmap of the Voronoi-based metrics can be generated with the following script. The input csv file is generated by the options `-dh` or `-ds` of the previous executables.
11298
11399
```
114100
RScript.exe .\Scripts\make_dendrogram_heatmap.R [csv file]

0 commit comments

Comments
 (0)