Skip to content

Latest commit

 

History

History
139 lines (85 loc) · 7.5 KB

File metadata and controls

139 lines (85 loc) · 7.5 KB

Halide-Image-Processing

📌 Halide Windows Microsoft Visual Studio configuration

Must-have applications:

⚠ Attention to windows version, if x64 or x32 bits, important to download releases according to right version.

1. First, download binary release of Halide

2. Then, download vcpkg

Step 1: Clone github repo

dir\user> git clone https://github.com/Microsoft/vcpkg.git

Step 2: Run the bootstrap script to build vcpkg

dir\user> .\vcpkg\bootstrap-vcpkg.bat

MSBuild / Visual Studio vcpkg install

dir\user>vcpkg> .\vcpkg integrate install

3. Install Necessary Libraries:

Libraries needed: libjpeg-turbo and libpng. Run in vcpkg directory

see these and other packages at vcpkg packages section
dir\user>vcpkg> .\vcpkg install libpng:x64-windows libjpeg-turbo:x64-windows llvm[target-all,clang-tools-extra]:x64-windows

4. Now configure MS Visual Studio

4.1 Creating a new empty project

Change to Release mode and correct windows version

Create a cpp file

Now, run the project on Local Windows Debugger. It will return error because you´re running nothing, but don´t worry, for now we only need the generated windows release folder in the project local files.

4.2. Files management

At project files directory, create two folders where the includes and libraries files will be stored.

Now we need to collect all include files and all libraries files that are going to be needed, wich are Halide libraries and the jpeg and png libraries that we downloaded. Let´s do that by searching for these files directories. Right after finding it, we are going to copy the files to our created folders.

We can find Halide sources in the unzipped folder dowloaded in the first step. See include files at HalideFolder\include and lib files at HalideFolder\lib\Release. Vcpkg files found at vcpkg\installed\windows\include and vcpkg\installed\windows\lib.

Then, copy all the include files from each folder and paste it inside the include folder you created. Do the same with the lib files, copy all of them from each of the lib file folders and paste it inside the libraries folder you created ate the project directory.

We are going to have something like this:

Last work with local files, we need to bring the dlls to the project directory. They can be found in the Halide and Vcpkg bin folders. jpeg and png lib dll files at vcpkg\installed\x64-windows\bin and Halide lib dll files at Halidex64\bin\Release. Copy all of the .dll files found and paste it inside your Project windows file HalideProject\Teste\x64\Release.

Copy all that .dll files from each folders to the windows folder on project directory HalideProject\Teste\x64\Release.

This is what we get:

4.3. Back to Visual studio last configurations

Open project properties

Change the platform Toolset for the Clang build tools and C++ language 17 support.

Allow vcpkg intall libraries but disable AutoLink.

In vc++ directories, edit the include field with your include folder created on step 4.2 directory, add Halidex64\share\Halide\tools either. In library field, edit to the libraries folder dirctory.

Add include folder to additional include packages too.

Add libraries folder to additional library packages too.

Add the libraries calls on the linker: Halide.lib, jpeg.lib and libpng16.lib

Apply all changes

5. Now we ae ready to start coding!

Additonals

Visual Studio necessary Packages


Author


Laura Martinho
🦕