Drop the project directory into your Desktop, and select Win32 or x64 build targets, depending on our system. Assuming you have CAL and Brook installed, this example should build in either combination of Win32/x64/Release/Debug.
If your own project does not build, compare the following properties between your project and the example project:
Project->Properties->Configuration Properties->C/C++->Command Line Project->Properties->Configuration Properties->Linker->Command Line
Please refer to the Visual Studio documentation on how to select the various property settings that eventually result in these two command lines.
A2: Verify that the following environment variables and properties are set, and that they are in agreement regarding the build target (Win32/x32 or x64):
1. BROOKROOT (should be set by installer) 2. CALROOT (should be set by installer)
3. Build target in Visual Studio (Win32 or x64), should be in sync with the CAL/Brook+ installation (32-bit or 64-bit), and the PATH (see below).
4. PATH or Path environment variable should include: $(CALROOT)\lib\$(x32), or $(CALROOT)\lib\$(x64) (for amdcalrt.dll, amdcalcl.dll) $(BROOKROOT)\sdk\lib (for brook.dll) $(BROOKROOT)\sdk\bin (for brcc.exe)
For example, PATH should include: C:\Program Files (x86)\AMD\CAL 1.00.2-beta\lib\xp64;C:\Program Files (x86)\AMD\BROOKPLUS SDK v1.00.0_beta\sdk\lib;C:\Program Files (x86)\AMD\BROOKPLUS SDK v1.00.0_beta\sdk\bin
5. To compile a .br file in Visual Studio, set its properties to:
Field "Command line":
brcc.exe o "$(ProjectDir)\built\$(ProjectName)" $(InputPath)
The Brook and CAL examples shipped with the installation images should build and run without modification (with the exception of switching to x64 build target in Visual Studio on an x64 system).
Q: I am getting the following error when I run my Brook+ program: "The application has failed to start because MSVCP80.dll was not found."
A: Check the following property, and make sure it is set to "/MD" (Release build) or "/MDd" (Debug build):
A1: Make sure you have brook.lib in "Project Properties->Linker->Input->Additional Dependencies".
A2: You are probably trying to build a Brook+ Win32 target on an x64 system, which is currently not supported; there are no 32 bit Brook+ libraries in the x64 Brook+ installation image. Switch the Visual Studio build target to x64.
Q: I am getting "LNK2001: unresolved external symbol" for any CAL symbol in my own example project.
A: In Visual Studio, try adding amdcalrt.lib and amdcalcl.lib to Project Properties->Linker->Input->Additional Dependencies.
Q: My Brook/CAL program fails to run with the following error: "This application has failed to start because amdcalrt.dll was not found ..."
A1: Make sure that the CAL lib directory is in your path, e.g.
C:\Program Files (x86)\AMD\AMD CAL 1.00.2-beta\lib\xp64 or C:\Program Files (x86)\AMD\AMD CAL 1.00.2-beta\lib\xp32
should be part of the PATH or Path environment variables.
A2: Make sure your Visual Studio build target is in sync with the CAL lib directory in PATH/Path, i.e. both are either x32/Win32 or x64.
A3: If you reinstalled CAL/Brook+ without explicitly uninstalling a previous version, the environment setup may have been corrupted. Either correct them as mentioned above or try to uninstall and reinstall CAL/Brook+.
Q: Where can I find the CAL libraries on my x64 system?
A: On x64 versions of Windows, the AMD Stream SDK version v1.00.2-beta will by default install both x32 and x64 library directories in
Program Files (x86)/AMD/AMD CAL 1.00.2-beta/lib
and not in
Program Files/AMD/AMD CAL 1.00.2-beta/lib
In case of build or runtime errors, verify that your Visual Studio build target and the PATH (or system Path) environment variables are in sync. For example, if the Visual Studio build target is "x64", PATH (or Path) must include "$(CALROOT)\lib\x64".
Q: Do I need to build Brook+ to build/run Brook+ code?
A: No. The Brook+ compiler and runtime libraries come pre-built in the installer package.
Q: How do I switch between GPU and CPU runtimes in Brook+?
A: Set the environment variable BRT_RUNTIME to "cal" or "cpu".