spaint icon indicating copy to clipboard operation
spaint copied to clipboard

Problems when building spaint project

Open uni4th opened this issue 6 years ago • 9 comments

  1. A file called "DeviceType.h" is missing. I think it should have appeared in /InfiniTAM/ORUtils/, however I cannot find it. How can I get access to this file?

  2. My computer doesn't have NVIDIA, so I want to disable CUDA. I unflagged "WITH_CUDA" when configuring with CMake, however when compiling with Xcode, it still raises errors like "Use of undeclared identifier 'cudaSetDevice'". What can I do?

Thank you very much

uni4th avatar Apr 19 '18 07:04 uni4th

  1. Have you updated InfiniTAM? The latest version (on the infinitam_v3.5 branch) has the file there:

https://github.com/victorprad/InfiniTAM/tree/infinitam_v3.5/ORUtils

  1. I'll investigate - there may be a missing preprocessor guard somewhere. Did Xcode tell you where the error occurred?

sgolodetz avatar Apr 19 '18 08:04 sgolodetz

You have to turn off WITH_CUDA in InfiniTAM also and rebuild that first btw, if you haven't.

sgolodetz avatar Apr 19 '18 08:04 sgolodetz

Ok, so re. (2), BackgroundRelocaliser shouldn't have been being built in non-CUDA mode, since it's there to let you run relocalisation on a secondary GPU. I've modified the CMake script accordingly - hopefully should work now.

sgolodetz avatar Apr 19 '18 08:04 sgolodetz

@uni4th If you get a chance, please could you test whether that fixes the problem for you? If so, I'll close off the issue.

sgolodetz avatar Apr 19 '18 12:04 sgolodetz

@sgolodetz Thank you very much for your reply. The problem with cuda is now solved, however I'm coming up with a new problem. When building spaintgui with Xcode, there is a warning "libstdc++ is deprecated; move to libc++ [-Wdeprecated]", and errors "Undefined symbols for architecture x86_64". (I have already switch C++ Standard Library into libstdc++) What can I do now? My system is MacOS High Sierra 10.13.3, Xcode Version is 9.3

uni4th avatar Apr 19 '18 13:04 uni4th

There was an issue with the C++ Standard Library on Mavericks (which is what I have on my laptop). I don't have access to a High Sierra system on which to get things working unfortunately, but if you do a search through the scripts for libstdc++, it should be possible to modify them to make everything build with libc++ again instead of libstdc++ (I was forcing it to the latter on Mavericks). A good starting point is probably:

https://github.com/torrvision/spaint/blob/master/cmake/Flags.cmake

There may be other scripts that mention it (perhaps look at the build scripts in the libraries directory). Also, bear in mind that InfiniTAM will need modifying similarly.

sgolodetz avatar Apr 19 '18 14:04 sgolodetz

So having a quick look, the Boost build has this:

if [ $PLATFORM == "mac" ]
then
  if [ "$OSXVERSION" -ge 13 ]
  then
    STDLIBFLAGS='cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++"'
  fi
else
  STDLIBFLAGS='cxxflags="-std=c++11"'
fi

However, the OpenCV build (for example) has this:

if [ $PLATFORM == "mac" ]
then
  CMAKE_CXX_FLAGS="-stdlib=libstdc++"
  CMAKE_EXE_LINKER_FLAGS="-stdlib=libstdc++"
else
  CMAKE_CXX_FLAGS=""
  CMAKE_EXE_LINKER_FLAGS=""
fi

On Mavericks, it won't make a difference, but for you it will, because I'm not checking the version of OS X in the OpenCV case.

Probably what needs doing is going through the scripts and making sure that it's only using libstdc++ on OS X Mavericks, and not on anything else.

sgolodetz avatar Apr 19 '18 14:04 sgolodetz

OK, but since time is limited I may try it tomorrow. Thank you very much.

uni4th avatar Apr 19 '18 15:04 uni4th

@uni4th: Any luck?

sgolodetz avatar Apr 24 '18 13:04 sgolodetz