tudelft3d / City3D

Large-scale LoD2 Building Reconstruction from Airborne LiDAR Point Clouds
https://github.com/tudelft3d/City3D
GNU General Public License v3.0
223 stars 36 forks source link

Windows make issue #7

Closed Rifahaziz closed 1 year ago

Rifahaziz commented 1 year ago

On Windows, after running "cmake -DCMAKE_BUILD_TYPE=Release .." , this is what I get, and I thought cmake was successful :

-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044. -- Found Boost: C:/Users/raziz/Anaconda3/envs/city3d/Library/lib/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0") -- Found Boost-1.74. -- Found GUROBI: C:/gurobi952/win64/include -- Found GUROBI: debug;C:/gurobi952/win64/lib/gurobi_c++mdd2017.lib;optimized;C:/gurobi952/win64/lib/gurobi_c++md2017.lib;C:/gurobi952/win64/lib/gurobi95.lib -- Gurobi include dir: C:/gurobi952/win64/include -- Gurobi libraries: debugC:/gurobi952/win64/lib/gurobi_c++mdd2017.liboptimizedC:/gurobi952/win64/lib/gurobi_c++md2017.libC:/gurobi952/win64/lib/gurobi95.lib CMake Warning (dev) at code/method/CMakeLists.txt:41 (find_package): Policy CMP0074 is not set: find_package uses _ROOT variables. Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

CMake variable CGAL_ROOT is set to:

C:/Users/raziz/City3D/cgal/cgal-build

For compatibility, CMake is ignoring the variable. This warning is for project developers. Use -Wno-dev to suppress it.

-- Visual Leak Detector (VLD) is not found. -- Using header-only CGAL -- Targetting Visual Studio 16 2019 -- Target build environment supports auto-linking -- Using VC toolset 142. -- Generator uses intermediate configuration directory: $(Configuration) -- Found Boost: C:/Users/raziz/Anaconda3/envs/city3d/Library/lib/cmake/Boost-1.74.0/BoostConfig.cmake (found suitable version "1.74.0", minimum required is "1.48") -- Boost include dirs: C:/Users/raziz/Anaconda3/envs/city3d/Library/include -- Boost libraries: -- Found CGAL: 5.6 -- Multi-configuration CMake generator: cannot display flags -- Requested component: Core CGAL_CXX_FLAGS_INIT: CGAL_LIBRARIES: CGAL::CGAL_Core;CGAL::CGAL CGAL_3RD_PARTY_LIBRARIES: GMP_INCLUDE_DIR: C:/Strawberry/c/include GMP_LIBRARIES: debug;C:/Users/raziz/vcpkg/packages/gmp_x64-windows/lib/gmp.lib;optimized;C:/Users/raziz/vcpkg/packages/gmp_x64-windows/lib/gmp.lib -- Found GUROBI: C:/gurobi952/win64/include -- Found GUROBI: debug;C:/gurobi952/win64/lib/gurobi_c++mdd2017.lib;optimized;C:/gurobi952/win64/lib/gurobi_c++md2017.lib;C:/gurobi952/win64/lib/gurobi95.lib -- Gurobi include dir: C:/gurobi952/win64/include -- Gurobi libraries: debugC:/gurobi952/win64/lib/gurobi_c++mdd2017.liboptimizedC:/gurobi952/win64/lib/gurobi_c++md2017.libC:/gurobi952/win64/lib/gurobi95.lib -- Found GUROBI: C:/gurobi952/win64/include -- Found GUROBI: debug;C:/gurobi952/win64/lib/gurobi_c++mdd2017.lib;optimized;C:/gurobi952/win64/lib/gurobi_c++md2017.lib;C:/gurobi952/win64/lib/gurobi95.lib -- Gurobi include dir: C:/gurobi952/win64/include -- ------Gurobi libraries----------: debugC:/gurobi952/win64/lib/gurobi_c++mdd2017.liboptimizedC:/gurobi952/win64/lib/gurobic++md2017.libC:/gurobi952/win64/lib/gurobi95.lib -- Configuring done -- Generating done -- Build files have been written to: C:/Users/raziz/City3D/Release

However, there is no makefile created in Release folder. When I run nmake, this error pops up :
NMAKE : fatal error U1064: MAKEFILE not found and no target specified Stop.

What is the problem here? Did it not build correctly? (Note that it has written build files even without finding VLD.) Thank you!

LiangliangNan commented 1 year ago

Don't mix the steps for different platforms :-)

For what you have done, you should have seen a "City3D.sln" (Visual Studio solution file). You can open it using Visual Studio and build it. This is the same as you build other programs using Visual Studio. It is also the same as you generate the solution file using the GUI version of CMake.

You can also use msbuild adtree.sln /p:Configuration=Release to build City3D.

If you do want to work purely on the command line, generate a makefile, and then build:

   $ cd City3D
   $ mkdir Release
   $ cd Release
   $ cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ..
   $ nmake
Rifahaziz commented 1 year ago

@LiangliangNan Thank you so much! Is there a restriction on the C++ version to be used? After nmake I'm having errors at 94% build, such as : error C2664: 'void gluTessCallback(GLUtesselator ,GLenum,void (__stdcall )(void))': cannot convert argument 3 from 'GLvoid (cdecl *)(void)' to 'void (stdcall *)(void)' C:\Users\City3D\code\renderer\tessellator.cpp(151): note: This conversion requires a reinterpret_cast, a C-style cast or function-style cast

Do you think this is related to the C++ version?

LiangliangNan commented 1 year ago

Windows is evil :-( You should use "x64 Native Tools Command Prompt for VS XXXX" (don't use the x86 version), and the other dependencies like Qt, OpenCV, and Gurobi must be for the x64 platform.