Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix windows tests #1566

Merged

Conversation

talregev
Copy link
Contributor

@talregev talregev commented Jul 2, 2023

Fix windows tests:
I open more tests. also did internal check with cmake --build build -j4 --config ${{ matrix.build_type }} --target check That compile all tests.
There a few errors remain.
One of the error is miss use of 3rd party metis on gtsam repo. The code is taken only for linux/osx but not for windows.
This is bad practice. You should create a download scrip for 3rd parties and compile it separately or use vcpkg that do the same.
I will past all the remain errors that you should deal with them in the following comments.

@talregev
Copy link
Contributor Author

talregev commented Jul 2, 2023

Miss use 3rd party metis lib.

D:\a\gtsam\gtsam\gtsam\3rdparty\metis\GKlib\GKlib.h(51): fatal error C1083: Cannot open include file: 'regex.h': No such file or directory
ninja: build stopped: subcommand failed.

@talregev
Copy link
Contributor Author

talregev commented Jul 2, 2023

gtsamDebug.lib(gtsamDebug.dll) : error LNK2005: "public: class Eigen::Matrix<double,-1,1,0,-1,1> __cdecl gtsam::NoiseModelFactorN::evaluateError(class gtsam::Pose3 const &,class Eigen::Matrix<double,-1,-1,0,-1,-1> &)const " (?evaluateError@?$NoiseModelFactorN@VPose3@gtsam@@@gtsam@@qeba?AV?$Matrix@N$0?0$00$0A@$0?0$00@Eigen@@AEBVPose3@2@AEAV?$Matrix@N$0?0$0?0$0A@$0?0$0?0@4@@z) already defined in testImuFactor.cpp.obj

@talregev
Copy link
Contributor Author

talregev commented Jul 2, 2023

[1/3] Building CXX object gtsam\slam\tests\CMakeFiles\check_slam_program.dir\testSmartProjectionRigFactor.cpp.obj
FAILED: gtsam/slam/tests/CMakeFiles/check_slam_program.dir/testSmartProjectionRigFactor.cpp.obj 
C:\PROGRA~2\MICROS~2\2019\ENTERP~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\cl.exe  /nologo /TP -DEIGEN_INITIALIZE_MATRICES_BY_NAN -DEIGEN_NO_STATIC_ASSERT -DGTSAM_ENABLE_BOOST_SERIALIZATION -DGTSAM_USE_BOOST_FEATURES -DNOMINMAX -DWINDOWS_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -D_DEBUG -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_SCL_SECURE_NO_WARNINGS -DTOPSRCDIR=\"D:/a/gtsam/gtsam\" -Dmain="inline no_main" -ID:\a\gtsam\gtsam -ID:\a\gtsam\gtsam\build -ID:\a\gtsam\gtsam\CppUnitLite -ID:\a\gtsam\gtsam\gtsam\3rdparty\metis\include -ID:\a\gtsam\gtsam\gtsam\3rdparty\metis\libmetis -ID:\a\gtsam\gtsam\gtsam\3rdparty\metis\GKlib -ID:\a\gtsam\gtsam\gtsam\3rdparty\Eigen -external:ID:\a\gtsam\gtsam\gtsam\3rdparty\SuiteSparse_config -external:ID:\a\gtsam\gtsam\gtsam\3rdparty\Spectra -external:ID:\a\gtsam\gtsam\gtsam\3rdparty\CCOLAMD\Include -external:IC:\hostedtoolcache\windows\Boost\1.72.0\x86_64 -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 -std:c++17 /wd4005 /wd4101 /wd4834 /wd4267 /std:c++17 /W3 /GR /EHsc /MP /MDd /Zi /Ob0 /Od /RTC1 /wd4244 /wd4251 /wd4275 /wd4661 /wd4344 /wd4503 /bigobj /showIncludes /Fogtsam\slam\tests\CMakeFiles\check_slam_program.dir\testSmartProjectionRigFactor.cpp.obj /Fdgtsam\slam\tests\CMakeFiles\check_slam_program.dir\ /FS -c D:\a\gtsam\gtsam\gtsam\slam\tests\testSmartProjectionRigFactor.cpp
D:\a\gtsam\gtsam\gtsam/base/GenericValue.h(151): error C2664: 'int gtsam::internal::GetDimensionImpl<Class,6>::GetDimension(const Class &)': cannot convert argument 1 from 'const T' to 'const Class &'
        with
        [
            Class=gtsam::Pose3
        ]
        and
        [
            T=sphericalCamera::Camera
        ]
        and
        [
            Class=gtsam::Pose3
        ]
D:\a\gtsam\gtsam\gtsam/base/GenericValue.h(151): note: Reason: cannot convert from 'const T' to 'const Class'
        with
        [
            T=sphericalCamera::Camera
        ]
        and
        [
            Class=gtsam::Pose3
        ]
D:\a\gtsam\gtsam\gtsam/base/GenericValue.h(151): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\a\gtsam\gtsam\gtsam/base/Manifold.h(74): note: see declaration of 'gtsam::internal::GetDimensionImpl<Class,6>::GetDimension'
        with
        [
            Class=gtsam::Pose3
        ]
D:\a\gtsam\gtsam\gtsam/base/GenericValue.h(150): note: while compiling class template member function 'size_t gtsam::GenericValue<ValueType>::dim(void) const'
        with
        [
            ValueType=sphericalCamera::Camera
        ]
D:\a\gtsam\gtsam\gtsam/nonlinear/Values-inl.h(136): note: see reference to class template instantiation 'gtsam::GenericValue<ValueType>' being compiled
        with
        [
            ValueType=sphericalCamera::Camera
        ]
D:\a\gtsam\gtsam\gtsam/nonlinear/Values-inl.h(135): note: while compiling class template member function 'ValueType gtsam::internal::handle<ValueType>::operator ()(gtsam::Key,const gtsam::Value *const )'
        with
        [
            ValueType=sphericalCamera::Camera
        ]
D:\a\gtsam\gtsam\gtsam/nonlinear/Values-inl.h(214): note: see reference to function template instantiation 'ValueType gtsam::internal::handle<ValueType>::operator ()(gtsam::Key,const gtsam::Value *const )' being compiled
        with
        [
            ValueType=sphericalCamera::Camera
        ]
D:\a\gtsam\gtsam\gtsam/nonlinear/Values-inl.h(213): note: see reference to class template instantiation 'gtsam::internal::handle<ValueType>' being compiled
        with
        [
            ValueType=sphericalCamera::Camera
        ]
D:\a\gtsam\gtsam\gtsam/slam/SmartFactorBase.h(166): note: see reference to function template instantiation 'const ValueType gtsam::Values::at<CAMERA>(gtsam::Key) const' being compiled
        with
        [
            ValueType=sphericalCamera::Camera,
            CAMERA=sphericalCamera::Camera
        ]
D:\a\gtsam\gtsam\gtsam/slam/SmartFactorBase.h(163): note: while compiling class template member function 'gtsam::CameraSet<gtsam::SphericalCamera> gtsam::SmartFactorBase<CAMERA>::cameras(const gtsam::Values &) const'
        with
        [
            CAMERA=sphericalCamera::Camera
        ]
D:\a\gtsam\gtsam\gtsam/slam/SmartProjectionFactor.h(435): note: see reference to function template instantiation 'gtsam::CameraSet<gtsam::SphericalCamera> gtsam::SmartFactorBase<CAMERA>::cameras(const gtsam::Values &) const' being compiled
        with
        [
            CAMERA=sphericalCamera::Camera
        ]
D:\a\gtsam\gtsam\gtsam/slam/SmartProjectionFactor.h(44): note: see reference to class template instantiation 'gtsam::SmartFactorBase<CAMERA>' being compiled
        with
        [
            CAMERA=sphericalCamera::Camera
        ]
D:\a\gtsam\gtsam\gtsam\slam\tests\../SmartProjectionRigFactor.h(52): note: see reference to class template instantiation 'gtsam::SmartProjectionFactor<CAMERA>' being compiled
        with
        [
            CAMERA=sphericalCamera::Camera
        ]
D:\a\gtsam\gtsam\gtsam\slam\tests\testSmartProjectionRigFactor.cpp(1275): note: see reference to class template instantiation 'gtsam::SmartProjectionRigFactor<sphericalCamera::Camera>' being compiled
ninja: build stopped: subcommand failed.

@talregev
Copy link
Contributor Author

talregev commented Jul 2, 2023

[24/33] Building CXX object gtsam_unstable\slam\tests\CMakeFiles\check_slam_unstable_program.dir\testSmartProjectionPoseFactorRollingShutter.cpp.obj
FAILED: gtsam_unstable/slam/tests/CMakeFiles/check_slam_unstable_program.dir/testSmartProjectionPoseFactorRollingShutter.cpp.obj 
C:\PROGRA~2\MICROS~2\2019\ENTERP~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\cl.exe  /nologo /TP -DEIGEN_INITIALIZE_MATRICES_BY_NAN -DEIGEN_NO_STATIC_ASSERT -DGTSAM_ENABLE_BOOST_SERIALIZATION -DGTSAM_USE_BOOST_FEATURES -DNOMINMAX -DWINDOWS_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -D_DEBUG -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_SCL_SECURE_NO_WARNINGS -DTOPSRCDIR=\"D:/a/gtsam/gtsam\" -Dmain="inline no_main" -ID:\a\gtsam\gtsam -ID:\a\gtsam\gtsam\build -ID:\a\gtsam\gtsam\CppUnitLite -ID:\a\gtsam\gtsam\gtsam\3rdparty\metis\include -ID:\a\gtsam\gtsam\gtsam\3rdparty\metis\libmetis -ID:\a\gtsam\gtsam\gtsam\3rdparty\metis\GKlib -ID:\a\gtsam\gtsam\gtsam\3rdparty\Eigen -external:ID:\a\gtsam\gtsam\gtsam\3rdparty\SuiteSparse_config -external:ID:\a\gtsam\gtsam\gtsam\3rdparty\Spectra -external:ID:\a\gtsam\gtsam\gtsam\3rdparty\CCOLAMD\Include -external:IC:\hostedtoolcache\windows\Boost\1.72.0\x86_64 -external:W0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 -std:c++17 /wd4005 /wd4101 /wd4834 /wd4267 /std:c++17 /W3 /GR /EHsc /MP /MDd /Zi /Ob0 /Od /RTC1 /wd4244 /wd4251 /wd4275 /wd4661 /wd4344 /wd4503 /bigobj /showIncludes /Fogtsam_unstable\slam\tests\CMakeFiles\check_slam_unstable_program.dir\testSmartProjectionPoseFactorRollingShutter.cpp.obj /Fdgtsam_unstable\slam\tests\CMakeFiles\check_slam_unstable_program.dir\ /FS -c D:\a\gtsam\gtsam\gtsam_unstable\slam\tests\testSmartProjectionPoseFactorRollingShutter.cpp
D:\a\gtsam\gtsam\gtsam/base/GenericValue.h(151): error C2664: 'int gtsam::internal::GetDimensionImpl<Class,6>::GetDimension(const Class &)': cannot convert argument 1 from 'const T' to 'const Class &'
        with
        [
            Class=gtsam::Pose3
        ]
        and
        [
            T=sphericalCameraRS::Camera
        ]
        and
        [
            Class=gtsam::Pose3
        ]
D:\a\gtsam\gtsam\gtsam/base/GenericValue.h(151): note: Reason: cannot convert from 'const T' to 'const Class'
        with
        [
            T=sphericalCameraRS::Camera
        ]
        and
        [
            Class=gtsam::Pose3
        ]
D:\a\gtsam\gtsam\gtsam/base/GenericValue.h(151): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\a\gtsam\gtsam\gtsam/base/Manifold.h(74): note: see declaration of 'gtsam::internal::GetDimensionImpl<Class,6>::GetDimension'
        with
        [
            Class=gtsam::Pose3
        ]
D:\a\gtsam\gtsam\gtsam/base/GenericValue.h(150): note: while compiling class template member function 'size_t gtsam::GenericValue<ValueType>::dim(void) const'
        with
        [
            ValueType=sphericalCameraRS::Camera
        ]
D:\a\gtsam\gtsam\gtsam/nonlinear/Values-inl.h(136): note: see reference to class template instantiation 'gtsam::GenericValue<ValueType>' being compiled
        with
        [
            ValueType=sphericalCameraRS::Camera
        ]
D:\a\gtsam\gtsam\gtsam/nonlinear/Values-inl.h(135): note: while compiling class template member function 'ValueType gtsam::internal::handle<ValueType>::operator ()(gtsam::Key,const gtsam::Value *const )'
        with
        [
            ValueType=sphericalCameraRS::Camera
        ]
D:\a\gtsam\gtsam\gtsam/nonlinear/Values-inl.h(214): note: see reference to function template instantiation 'ValueType gtsam::internal::handle<ValueType>::operator ()(gtsam::Key,const gtsam::Value *const )' being compiled
        with
        [
            ValueType=sphericalCameraRS::Camera
        ]
D:\a\gtsam\gtsam\gtsam/nonlinear/Values-inl.h(213): note: see reference to class template instantiation 'gtsam::internal::handle<ValueType>' being compiled
        with
        [
            ValueType=sphericalCameraRS::Camera
        ]
D:\a\gtsam\gtsam\gtsam/slam/SmartFactorBase.h(166): note: see reference to function template instantiation 'const ValueType gtsam::Values::at<CAMERA>(gtsam::Key) const' being compiled
        with
        [
            ValueType=sphericalCameraRS::Camera,
            CAMERA=sphericalCameraRS::Camera
        ]
D:\a\gtsam\gtsam\gtsam/slam/SmartFactorBase.h(163): note: while compiling class template member function 'gtsam::CameraSet<gtsam::SphericalCamera> gtsam::SmartFactorBase<CAMERA>::cameras(const gtsam::Values &) const'
        with
        [
            CAMERA=sphericalCameraRS::Camera
        ]
D:\a\gtsam\gtsam\gtsam/slam/SmartProjectionFactor.h(435): note: see reference to function template instantiation 'gtsam::CameraSet<gtsam::SphericalCamera> gtsam::SmartFactorBase<CAMERA>::cameras(const gtsam::Values &) const' being compiled
        with
        [
            CAMERA=sphericalCameraRS::Camera
        ]
D:\a\gtsam\gtsam\gtsam/slam/SmartProjectionFactor.h(44): note: see reference to class template instantiation 'gtsam::SmartFactorBase<CAMERA>' being compiled
        with
        [
            CAMERA=sphericalCameraRS::Camera
        ]
D:\a\gtsam\gtsam\gtsam_unstable/slam/SmartProjectionPoseFactorRollingShutter.h(46): note: see reference to class template instantiation 'gtsam::SmartProjectionFactor<CAMERA>' being compiled
        with
        [
            CAMERA=sphericalCameraRS::Camera
        ]
D:\a\gtsam\gtsam\gtsam_unstable\slam\tests\testSmartProjectionPoseFactorRollingShutter.cpp(1434): note: see reference to class template instantiation 'gtsam::SmartProjectionPoseFactorRollingShutter<sphericalCameraRS::Camera>' being compiled

Copy link
Collaborator

@varunagrawal varunagrawal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@varunagrawal varunagrawal merged commit ea57cd2 into borglab:fix/windows-tests Jul 3, 2023
26 checks passed
@varunagrawal
Copy link
Collaborator

We have some specific design choices necessitated by our userbase, and we give the option to use system level 3rd party libraries, so it's not necessarily bad practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants