victorprad / InfiniTAM

A Framework for the Volumetric Integration of Depth Images
http://www.infinitam.org
Other
918 stars 351 forks source link

compiling problems about InfiniTAM #23

Open MarkZurkberg opened 8 years ago

MarkZurkberg commented 8 years ago

I have Kinect2.0 and XBox one Kinect now, I wonder they are suitable for testing the program. And another question, what should I edit in InfiniTAM.sln to avoid using CUDA? I want to just use i5-3470 now. Thanks!

sgolodetz commented 8 years ago

@MarkZurkberg: If you build using CMake, there's a WITH_CUDA flag that you can turn off to build without CUDA support.

MarkZurkberg commented 8 years ago

Eh...Forgive I am just a new guy in Kinect and cmake, can I use cmake-gui just like the picture below to compile InfiniTAM on my PC? And if I can, what instructions should I follow to compile? Please give me more detail, thanks.. By the way, my PC is i5-3470, 4GB RAM, 3.2G HZ, GTX 960, and Windows8.1 pro. Do you think these can be suitable when compiling and testing InfiniTAM?

Thanks for your so quick answers! ^_^ cmake-gui

manuel-kroeter commented 8 years ago

Regarding the Kinect 2: I think you would need to implement/adapt the code by yourself to get the images from the camera when using the new version of InfiniTAM (see Kinect2Engie.cpp). Maybe you could try to use InfiniTAM v1 if you dont want to update the code.

MarkZurkberg commented 8 years ago

Oh, how I can download InfiniTAM v1 code? Please give me the page, thanks very much! @ManuelK89

sgolodetz commented 8 years ago

@MarkZurkberg: CMake generates a Visual Studio solution for you (not the same one that's bundled with InfiniTAM - that's a separate one that Victor uses). You then build that in Visual Studio instead of the normal one. (On other platforms, CMake can be used to generate a Makefile or an Xcode project, etc.)

What I normally do is specify my build directory as <InfiniTAM root>/InfiniTAM/build and my source directory as <InfiniTAM root>/InfiniTAM. You then click Configure, fill in the paths to all the various libraries, clicking Configure after each load of filling in until there's nothing left to fill in, and then click Generate. The generated solution will be in the <InfiniTAM root>/InfiniTAM/build directory.

If I remember right, you may not be prompted about filling in the paths for OpenNI 2 - if they're not shown and you want OpenNI support, you can see them by ticking the "Advanced" tick box.

sgolodetz commented 8 years ago

And yes, that PC sounds fine - InfiniTAM can run on a tablet, so a decent PC with a good graphics card shouldn't have any trouble with it.

manuel-kroeter commented 8 years ago

Regarding the performance: With just the CPU and full tracking + visualization you might get low performance. It can run on the tablet because it uses the IMU of the tablet and therefore needs only reduced camera tracking (it also uses a lower image resolution on the tablet). So if possible you should enable CUDA. You can download InfiniTAM v1 by changing the branch at the top left on the main git page of InfiniTAM.

MarkZurkberg commented 8 years ago

I just tried as you said, here is the problem. It seems like I got some matter with cmake and GLUT.. @sgolodetz cmakeproblems

sgolodetz commented 8 years ago

Yes, CPU-only might be fairly slow - I forgot that you weren't planning to use CUDA.

sgolodetz commented 8 years ago

@MarkZurkberg: As mentioned, you then have to fill in the paths and hit Configure again. Repeat until you run out of errors.

clapilgrim commented 8 years ago

I'm trying to compile infiniTAM with kinect 2 support. Which os is better? It works only on win8 or ubuntu is better? Why there aren't binaries on download page?

I tryed to compile it with cmake 332 and visual studio 2013 on win8.1 but when i execute infinitam.exe it writes "compiled without kinect support"

Thanks in advance for help

MarkZurkberg commented 8 years ago

I used Win8.1, and I heard someone said Ubuntu is available also.

Congratulations! You have successfully got the exe files. Could you please help me fix this? I used cmake too to compile InfiniTAM but got this problem. Thanks! @clapilgrim

CMake Error at C:/Users/Mark/Downloads/cmake-3.3.2-win32-x86/share/cmake-3.3/Modules/FindPackageHandleStandardArgs.cmake:148 (message): Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR) Call Stack (most recent call first): C:/Users/Mark/Downloads/cmake-3.3.2-win32-x86/share/cmake-3.3/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE) C:/Users/Mark/Downloads/cmake-3.3.2-win32-x86/share/cmake-3.3/Modules/FindGLUT.cmake:126 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:6 (find_package)

Configuring incomplete, errors occurred! See also "C:/Users/Mark/Documents/test/build/CMakeFiles/CMakeOutput.log".

clapilgrim commented 8 years ago

append glut to your "PATH" environment variable..

MarkZurkberg commented 8 years ago

I just create a new environment varible named glut, but I do not sure my path is correct......I used the downloaded glut files as the path. @clapilgrim

image

clapilgrim commented 8 years ago

Download freeglut

http://files.transmissionzero.co.uk/software/ development/GLUT/freeglut-MSVC.zip

Add (or append) to your "PATH" environment variable

Create a folder on your PC which is readable by all users, for example “C:\Program Files\Common Files\MSVC\freeglut\” on a typical Windows system. Copy the “lib\” and “include\” folders from this zip archive to that location.

The appropriate freeglut DLL can either be placed in the same folder as your application, or can be installed in a system-wide folder which appears in your %PATH% environment variable. Be careful not to mix the 32 bit DLL up with the 64 bit DLL, as they are not interchangeable.

clapilgrim commented 8 years ago

i'm not sure if it's right add a new variable... append the "lib folder" to "PATH" variable

try to follow this video from minute 1: https://youtu.be/W9pg2FHeoq8

sgolodetz commented 8 years ago

@MarkZurkberg: You shouldn't need to change your path - you just need to download a binary copy of freeglut and point the include directory variable at the freeglut include directory and the library variable at the actual freeglut library (the .lib file) rather than the freeglut library directory. If I remember right, there's one .lib for 32-bit and one for 64-bit - if so, you need to make sure you're using the one that corresponds to the configuration you're trying to build.

As @clapilgrim mentions, when running your application you need to make sure that the appropriate 32-bit or 64-bit .dll is in either your application directory or on the system path.

sgolodetz commented 8 years ago

For reference, the binary version of freeglut I've used successfully can be found here:

http://files.transmissionzero.co.uk/software/development/GLUT/older/freeglut-MSVC-2.8.0-1.mp.zip

I imagine newer versions would also work fine, but I haven't personally tried them.

MarkZurkberg commented 8 years ago

Today I tried as you said, point the include directory variable and the library variable at their corresponding directory. But when I click configure again, it said ''CMake Error: The source "C:/Users/yy/Downloads/InfiniTAM-spaint_v2/CMakeLists.txt" does not match the source "C:/Users/yy/Downloads/InfiniTAM-spaintv2/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.'' I really don't know what is going wrong here (Forgive the grammer error, I am Chinese^^). Thanks! @sgolodetz

sgolodetz commented 8 years ago

You probably specified different source directories from one run of CMake to the next, or moved the directory. The best option is probably to delete your CMake cache and start again. Personally I would do a full clean (git clean -xdf) of your InfiniTAM-spaint_v2 directory. I would also rename it to InfiniTAM if you plan to build SemanticPaint afterwards, since that way it will be found by the automatic build for SemanticPaint (which searches for a sibling directory of spaint called InfiniTAM). The source directory you then want is InfiniTAM/InfiniTAM (the directory containing the top-level CMakeLists.txt) and the build directory should go in InfiniTAM/InfiniTAM/build to be found automatically by spaint.

bqFirst commented 7 years ago

I used cmake to generated .sln and I cmake the freeglut .But when I open and compiled the .sln ,there was a error:"cannot open file glut32.lib".That is why.I just have the freeglut.lib rather than glut32.lib.