Skip to content

Commit

Permalink
Merged PR 1480: Fix github issue 242 by moving to VS 2019, and fix VS…
Browse files Browse the repository at this point in the history
… 2019 build breaks.

Fix github issue 242 by moving to VS 2019, and fix VS 2019 build breaks.
  • Loading branch information
lovettchris committed Dec 29, 2019
1 parent 8665935 commit aa491f0
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 20 deletions.
3 changes: 3 additions & 0 deletions History.md
@@ -1,3 +1,6 @@
## 3.0.3
- Fix VS 2019 build.

## 3.0.2
- Add FastGRNN node to ELL, train_classifier.py and the onnx_importer.

Expand Down
14 changes: 7 additions & 7 deletions INSTALL-Advanced.md
Expand Up @@ -14,7 +14,7 @@ git clone https://github.com/xianyi/OpenBLAS
cd OpenBLAS
mkdir build
cd build
cmake -G "Visual Studio 15 2017 Win64" -Thost=x64 ..
cmake -G "Visual Studio 16 2019" -A x64 ..
cmake --build . --config Release
```
Then from an `Administrator` command prompt run the following install comamnd, from the above build folder:
Expand Down Expand Up @@ -73,12 +73,12 @@ Advanced users can compile OpenCV with CUDA support. To do so, clone the OpenCV
mkdir build
cd build

set PYTHON3_EXECUTABLE=d:\Continuum\Anaconda2.7\envs\py35\python.exe
set PYTHON3_INCLUDE_DIR=d:\Continuum\Anaconda2.7\envs\py35\include
set PYTHON3_LIBRARY=d:\Continuum\Anaconda2.7\envs\py35\libs\python35.lib
set PYTHON3_NUMPY_INCLUDE_DIRS=d:\Continuum\Anaconda2.7\envs\py35\lib\site-packages\numpy\core\include
set PYTHON3_PACKAGES_PATH=d:\Continuum\Anaconda2.7\envs\py35\lib\site-packages
set PYTHON3_EXECUTABLE=%LOCALAPPDATA%\Continuum\miniconda3\envs\py36\python.exe
set PYTHON3_INCLUDE_DIR=%LOCALAPPDATA%\Continuum\miniconda3\envs\py36\include
set PYTHON3_LIBRARY=%LOCALAPPDATA%\Continuum\miniconda3\envs\py36\libs\python35.lib
set PYTHON3_NUMPY_INCLUDE_DIRS=%LOCALAPPDATA%\Continuum\miniconda3\envs\py36\lib\site-packages\numpy\core\include
set PYTHON3_PACKAGES_PATH=%LOCALAPPDATA%\Continuum\miniconda3\envs\py36\lib\site-packages

cmake -G "Visual Studio 15 2017 Win64" -Thost=x64 -D CMAKE_BUILD_TYPE=Release -D WITH_CUDA=1 -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF ..
cmake -G "Visual Studio 16 2019" -A x64 .. -D CMAKE_BUILD_TYPE=Release -D WITH_CUDA=1 -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF ..
if ERRORLEVEL 1 goto :eof
cmake --build . --config Release
16 changes: 12 additions & 4 deletions INSTALL-Windows.md
Expand Up @@ -12,14 +12,14 @@ git clone https://github.com/Microsoft/ELL.git

### Visual Studio

ELL requires a C++ compiler. On Windows, you can use *Visual Studio 2017 with C++ Desktop Development Workload*. A free version of Visual Studio 2017 is available at <https://www.visualstudio.com/vs/community/> (make sure to select *Desktop Development with C++* during installation).
ELL requires a C++ compiler. On Windows, you can use *Visual Studio 2019 with C++ Desktop Development Workload*. A free version of Visual Studio 2019 is available at <https://www.visualstudio.com/vs/community/> (make sure to select *Desktop Development with C++* during installation).

### CMake 3.12

ELL uses the [*CMake*](https://cmake.org/) build system and requires version 3.12 or newer. A version of CMake that satisfies this requirement is already provided with Visual Studio 2017. You can find it if you
ELL uses the [*CMake*](https://cmake.org/) build system and requires version 3.15 or newer. A version of CMake that satisfies this requirement is already provided with Visual Studio 2019. You can find it if you
use the "Developer Command Prompt' that is installed by Visual Studio. It lives here:
```
c:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe
```
You may also download new versions of cmake from <https://cmake.org/download/> if you want to.

Expand Down Expand Up @@ -66,6 +66,14 @@ You need to repeat this activation command each time you open a new terminal and
conda install -c conda-forge opencv
```

In order to run the Python based ELL unit tests you will also need to install the following:

```shell
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
conda install -c conda-forge onnx
pip install -r requirements.txt
```

Miniconda comes with useful command line tools such as `curl`, which is used to transfer data via URL. When files are required to be downloaded from a URL, the instructions assume you have `curl` available to perform the download. Ensure you activate your conda environment before running commands like `curl`.

## Building ELL
Expand All @@ -82,7 +90,7 @@ cd build
Invoke CMake as follows

```shell
cmake -G "Visual Studio 15 2017 Win64" -T host=x64 -D ONNX=ON ..
cmake -G "Visual Studio 16 2019" -A x64 -T host=x64 -D ONNX=ON ..
```
Don't forget the two dots (..) at the end of the command! This command creates a Visual Studio solution file named `ELL.sln`, and the associated project files in the `build` directory.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
3.0.2
3.0.3
Expand Up @@ -122,7 +122,7 @@ You can now build these using a build script:
mkdir build
cd build
[Linux/macOS] cmake .. -DCMAKE_BUILD_TYPE=Release && make && cd ../..
[Windows] cmake -G "Visual Studio 15 2017 Win64" -Thost=x64 .. && cmake --build . --config Release && cd ..\..
[Windows] cmake -G "Visual Studio 16 2019" -A x64 .. && cmake --build . --config Release && cd ..\..
```

Run this script on both the compiled_featurizer and compiled_classifier folders.
Expand Down
Expand Up @@ -104,7 +104,7 @@ Finally, use CMake to finish building the Python wrapper.

```shell
[Linux/macOS] cmake .. -DCMAKE_BUILD_TYPE=Release && make && cd ../..
[Windows] cmake -G "Visual Studio 15 2017 Win64" -Thost=x64 .. && cmake --build . --config release && cd ..\..
[Windows] cmake -G "Visual Studio 16 2019" -A x64 .. && cmake --build . --config release && cd ..\..
```

This creates a Python module named **model**. This module provides functions that report the shapes of the model's input and output as well as the **predict** function, which invokes the model.
Expand Down
Expand Up @@ -225,7 +225,7 @@ To finish creating the Python wrapper, build the CMake project.

```shell
[Linux/macOS] cmake .. -DCMAKE_BUILD_TYPE=Release && make && cd ../..
[Windows] cmake -G "Visual Studio 15 2017 Win64" -Thost=x64 .. && cmake --build . --config release && cd ..\..
[Windows] cmake -G "Visual Studio 16 2019" -A x64 .. && cmake --build . --config release && cd ..\..
```

You have just created a Python module named **model**. This module provides functions that report the shapes of the model's input and output as well as the **predict** function, which invokes a compiled and optimized version of the retargeted model you created earlier.
Expand Down
Expand Up @@ -163,7 +163,7 @@ You will do this a lot so it might be handy to create a little batch or shell sc
```batch
mkdir build
cd build
cmake -G "Visual Studio 15 2017 Win64" -Thost=x64 ..
cmake -G "Visual Studio 16 2019" -A x64 ..
cmake --build . --config Release
cd ..
```
Expand Down
1 change: 1 addition & 0 deletions libraries/math/include/Vector.h
Expand Up @@ -11,6 +11,7 @@
#include <utilities/include/IArchivable.h>
#include <utilities/include/StlStridedIterator.h>

#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
Expand Down
7 changes: 3 additions & 4 deletions libraries/utilities/include/Graph.h
Expand Up @@ -32,7 +32,7 @@ namespace utilities
public:
/// <summary> This method is how you add nodes to the graph. </summary>
/// <param name="id"> Each node in the graph must have a unique id, try and use valid programming identifiers to make serialization easier. </param>
/// <param name="label"> Each node cna have a display label. </param>
/// <param name="label"> Each node can have a display label. </param>
GraphNode& GetOrCreateNode(const std::string& id, const std::string& label);

/// <summary> This method is how you add links to the graph. </summary>
Expand All @@ -46,8 +46,8 @@ namespace utilities
/// <returns> The node with given id or nullptr if node is not defined in this graph. </returns>
GraphNode* GetNode(const std::string& id);

/// <summary> DGML graphs can also contain groups of nodes. You build a group by adding links from this group node to it's children
/// with links that have the category 'contains'. </summary>
/// <summary> Graphs can also contain groups of nodes. You build a group by adding links from this group node to it's children
/// with links that have the category 'Contains'. </summary>
GraphNode& GetOrCreateGroup(const std::string& id, const std::string& label);

/// <summary> Serialize the graph in DOT Language format. </summary>
Expand Down Expand Up @@ -125,7 +125,6 @@ namespace utilities

public:
GraphLink();
GraphLink(GraphLink&& other);
GraphLink(const GraphLink& other) = default;
GraphLink& operator=(GraphLink& other) = default;

Expand Down
1 change: 1 addition & 0 deletions libraries/utilities/include/TypeFactory.h
Expand Up @@ -13,6 +13,7 @@

#include <functional>
#include <memory>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <utility>
Expand Down

0 comments on commit aa491f0

Please sign in to comment.