I am compiling OpenCV for our project with specific build options (such as 64bit, QT and OpenNI). I was able to follow the instruction as given here: http://opencv.itseez.com/doc/tutorials/introduction/windows_install/windows_install.html
At the end of 2-3 hours of build process, I ended up with \install\build\ with collected bins, dlls and libs in their respective folder. I would like to distribute an .exe installer to other members in research group. But I could not because _CPack_Packages/win32/NSIS is nowhere to be found.
Note: To create an installer you need to install NSIS. Then just build the
Package project to build the installer into the
Build/_CPack_Packages/win32/NSIS folder. You can then use this to
distribute OpenCV with your build settings on other systems.
In the cmake-gui screen, I ticked "Build Package" which I hoped would enable me to see Build/_CPack_Packages/win32/NSIS folder. After build process, this is not found.
Could someone give a suggestion as why I don't see this _CPack_Packages/win32/NSIS folder as described? Could I use
Inno setup instead? If so, do I simply pack all \build\install folder and set path in system to include \build\install\bin?
Thank you.
Sticking with the KISS principle (Keep it simple, Stupid!):
Did you install NSIS prior to building the Package project?
INSTRUCTIONS TO BUILD WIN32 PACKAGES WITH CMAKE+CPACK
------------------------------------------------------
- Install NSIS.
- Generate OpenCV solutions for MSVC using CMake as usual.
- In cmake-gui:
- Mark BUILD_PACKAGE
- Mark BUILD_EXAMPLES (If examples are desired to be shipped as binaries...)
- Unmark ENABLE_OPENMP, since this feature seems to have some issues yet...
- Mark INSTALL_*_EXAMPLES
- Open the OpenCV solution and build ALL in Debug and Release.
- Build PACKAGE, from the Release configuration. An NSIS installer package will be
created with both release and debug LIBs and DLLs.
Jose Luis Blanco, 2009/JUL/29
I suggest instead of using Visual Studio to build, you should try using CMake.
http://www.cmake.org/
Let me know if this helps at all.
Related
I'm running Centos 7 and am trying to build hipSYCL (see here)
The issue is that hipSYCL needs to have cmake info from the LLVM build (via the LLVM_DIR cmake variable).
This is problematic for me because building LLVM requires a massive 35Gb for the libraries and exes. I don't have that much memory to spare.
I did find a build of llvm-toolset-8.0 online for Centos 7 and installed it, but to my surprise, that didn't seem to work with LLVM_DIR because there's no cmake files (since I didn't build it locally).
So, my question would be, is there a way to build hipSYCL using pre-built LLVM-clang?
If I'm missing or misunderstanding something, I'd appreciate any help.
LLVM publishes the necessary cmake files, and the binary OS packages I've seen include it, generally in a directory called /usr/lib/llvm*/lib/cmake and in a package called something like llvm-*-dev.
I'm interested in incorporating TensorFlow into a C++ server application built in Visual Studio on Windows 10 and I need to know if that's possible.
Google recently announced Windows support for TensorFlow: https://developers.googleblog.com/2016/11/tensorflow-0-12-adds-support-for-windows.html
but from what I can tell this is just a pip install for the more commonly used Python package, and to use the C++ API you need to build the repo from source yourself: How to build and use Google TensorFlow C++ api
I tried building the project myself using bazel, but ran into issues trying to configure the build.
Is there a way to get TensorFlow C++ to work in native Windows (not using Docker or the new Windows 10 Linux subsystem, as I've seen others post about)?
Thanks,
Ian
It is certainly possible to use TensorFlow's C++ API on Windows, but it is not currently very easy. Right now, the easiest way to build against the C++ API on Windows would be to build with CMake, and adapt the CMake rules for the tf_tutorials_example_trainer project (see the source code here). Building with CMake will give you a Visual Studio project in which you can implement your C++ TensorFlow program.
Note that the tf_tutorials_example_trainer project builds a Console Application that statically links all of the TensorFlow runtime into your program. At present we have not written the necessary rules to create a reusable TensorFlow DLL, although this would be technially possible: for example, the Python extension is a DLL that includes the runtime, but does not export the necessary symbols to use TensorFlow's C or C++ APIs directly.
There is a detailed guide by Joe Antognini and a similar TensorFlow ReadMe at GitHub explaining the building of TensorFlow source via CMake. You also need to have SWIG installed on your machine which allows connecting C/C++ source with the Python scripting language. I did use Visual CMAKE (cmake-gui) with the screen capture shown below.
In the CMake configuration, I used Visual Studio 15 2017 compiler. Once this stage successfully completes, you can click on the Generate button to go ahead with the actual build process.
However, on Visual Studio 2015, when I attempted building via the "ALL_BUILD" project, the setup gave me "build tools for v141 cannot be found" error. This did not go away even when I attempted to retarget my solution. Finally, the solution got built successfully with Visual Studio 2017. You also need to manually set the SWIG_EXECUTABLE path in CMake before it successfully configures.
As indicated in the Antognini link, for me the build took about half an hour on a 16GB RAM, Core i7 machine. Once done, you might want to validate your build by attempting to run the tf_tutorials_example_trainer.exe file.
Hope this helps!
For our latest work on building TensorFlow C++ API on Windows, please look at this github page. This works on Windows 10, currently without CUDA support (only CPU).
PS:
Only the bazel build method works, because CMake is not supported and not maintained anymore, resulting in CMake configuration errors.
I had to use a downgraded version of my Visual Studio 2017 (from 15.7.5 to 15.4) by adding "VC++ 2017 version 15.4 v14.11 toolset" through the installer (Individual Components tab).
The cmake command which worked for me was:
cmake .. -A x64 -DCMAKE_BUILD_TYPE=Release ^
-T "v141,version=14.11" ^
-DSWIG_EXECUTABLE="C:/Program Files/swigwin-3.0.12/swig.exe" ^
-DPYTHON_EXECUTABLE="C:/Program Files/Python/python.exe" ^
-DPYTHON_LIBRARIES="C:/Program Files/Python/libs/python27.lib" ^
-Dtensorflow_ENABLE_GPU=ON ^
-DCUDNN_HOME="C:/Program Files/cudnn-9.2-windows10-x64-v7.1/cuda" ^
-DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0"
After the build, open tensorflow.sln in Visual Studio and build ALL_BUILD.
If you want to enable GPU computation, do check your Graphics Card here (Compute Capability > 3.5). Do remember to install all the packages (Cuda Toolkit 9.0, cuDNN, Python 3.7, SWIG, Git, CMake...) and add the paths to the environment variable in the beginning.
I made a README detailing how to I built the Tensorflow dll and .lib file for the C++ API on Windows with GPU support building from source with Bazel. Tensorflow version 1.14
The tutorial is step by step and starts at the very beginning, so you may have to scroll down past steps you have already done, like checking your hardware, installing Bazel etc.
Here is the url: https://github.com/sitting-duck/stuff/tree/master/ai/tensorflow/build_tensorflow_1.14_source_for_Windows
Probably you will want to scroll all the way down to this part:
https://github.com/sitting-duck/stuff/tree/master/ai/tensorflow/build_tensorflow_1.14_source_for_Windows#step-7-build-the-dll
It shows how to pass command to create .lib and .dll.
Then to test your .lib you should link it into your c++ project,
Then it will show you how to identify and fix the missing symbols using the TF_EXPORT macro
I am actively working on making this tutorial better so feel free to leave comments on this answer if you are having problems.
I have been trying to build OpenCV 2.4.10 on Windows 7 32bit using Visual Studio 2013 and it has been a real pain. I have make some achivements but unfortunatelly it is not working 100%.
I would like to write a small manual not so focused on the step by step -it can be frustrating when one of those steps fails and you don't know how to reach the next one- and more focused on understanding what is happening on each step, why and what to expect when something goes wrong.
I ask for your help, sure you have faced lot of them before and can explain why it is happening.
I am downloading 3 to build with CMake 3.0.2 and Visual Studio 2013. I will update this thread as I take steps.
My aim is to build 2.4.10 with CUDA, TBB and OpenGL support. And make it work :)
Clone OpenCV 2.4.10 (I am using TortoiseGit at C:\OpenCV\src\src)
Download TBB Compiled
Unzip TBB in C:\OpenCV\src\opt\tbb
Unzip OpenCV source in C:\OpenCV\src dir
Open CMake and target source dir C:\OpenCV\src and built dir C:\OpenCV\built
Configure CMake for the first time
Select Visual Studio 12 2013, Use default native compilers for a configuration Win32
Select this options:
Under WITH tab:
WITH_CUDA (already checked)
WITH_OPENGL
WITH_TBB
And click configure again...
Here, OPENGL libs are found (opengl32 and glu32) and first missing paths appear (TBB_INCLUDE_DIRS), those for TBB_INCLUDE_DIRS, so:
Point that line to C:\OpenCV\src\opt\tbb\include and click configure again.
After that configuration process, TBB tab appears in red with LIB_DIR and STDDEF_PATH labels pointed to my TBB folder.
Click configure again to confirm the changes.
This time, there are no tag in red, and everything seems to be fine. I check the output and GUI OpenGL support is set to Yes, and so is Use TBB (ver 4.3 interface 8002) under Other third-party libraries, so
Click Generate to generate the Visual Studio files
Files are generated, so
Open Visual Studio 2013 and open OpenCV solution at C:\OpenCV\built and wait for it to be ready
Select Debug and then Build Solution (Ctrl+Shift+B) and wait...
First errors happen when it tries to find the core lib, so I re-run CMake for a simple build, without OpenGL, CUDA or TBB.
I have found this guide:
Which point to several of the problems I have been having. After compiling with its recommendations now I am having a particular problem regarding throw_nogpu that I will look for.
This guide solved my problems with CUDA, OpenGL and TBB:
http://initialneil.wordpress.com/2014/09/25/opencv-2-4-9-cuda-6-5-visual-studio-2013/
I hope it helps.
I'm trying to write a sample ImageMagick program in Visual Studio 2010. I have binary distribution of ImageMagick already installed on my system as I can use command line interface of ImageMagick.
However, when I try to include "Magick++.h" in my C++ program, it says it can't open source file.
I found the instructions on compiling and building ImageMagick from source, but is it possible to change my visual studio project settings so it can pick necessary references/libraries from the already installed version of ImageMagick?
I am by no means an expert, but here is what worked for me:
Using Windows7 Professional and Visual C++ Express 2010...
I checked the Install development headers and libraries for C and C++
At the end of the install, I got these two folders. Magick++.h lies inside include.
Be sure to set up your projects Additional Library Locations and Additional Include Directories and you should be able to compile your program.
Additionally:
The manual suggests you need to do this for your program to work, but I did not and it still worked:
InitializeMagick(path_to_ImageMagick_DLLs);
And during my brief test, I found that Magick::Image::Magick() which changes image formats does not work in Debug mode. It does work in Release mode though.
After the recent announcement that the F# compiler source was available under the apache license I decided I'd like to have a go at building the compiler from source. However, I fell at the first post as there seems to be a missing file “Microsoft.FSharp-proto.Targets”. Is this the same “Microsoft.FSharp-proto.Targets” that is available in “Microsoft F#, August 2010 Community Technology Preview”? What other steps are necessary to build the compiler. Will the F# team be providing a script that “just works” to build the compiler?
I haven't run these yet (PC configuration problems?), but there's a detailed set of instructions in the source distribution at compiler/2.0/Nov2010/README.html.
These instructions are a little different to the ones #desco wrote that relate to the previous CTP.
Not so long ago before this announcement I've written about building compiler from sources supplied with F# CTP (F#: Building compiler from sources.). Hope nothing was changed since that time.
I just downloaded and successfully compiled F# so I thought I'd add an update.
I downloaded from http://fsharppowerpack.codeplex.com/SourceControl/list/changesets
I extracted the files and navigated to fsharppowerpack-66272\compiler\2.0\Aug2011
It contains a readme.html that suggests a number of ways to build.
With that readme I made the following script which successfully compiled F# for me.
Install NUnit first if you want to compile the unit tests.
set MSB40=C:\Windows\Microsoft.NET\Framework\v4.0.30319\
set Path=%Path%;%MSB40%
cd src
msbuild fsharp-proto-build.proj /p:TargetFramework=cli\4.0
ngen install ..\Proto\cli\4.0\bin\fsc-proto.exe
msbuild fsharp-library-build.proj /p:TargetFramework=cli\4.0
msbuild fsharp-compiler-build.proj /p:TargetFramework=cli\4.0
msbuild fsharp-library-unittests-build.proj /p:TargetFramework=cli\4.0
msbuild fsharp-compiler-unittests-build.proj /p:TargetFramework=cli\4.0
ngen install ..\Debug\cli\4.0\bin\fsi.exe
pause
Note: I already had VS2010 and the FSharpPowerPack installed.