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

compile errors with mLibExternal #1

Open
amonszpart opened this issue Mar 17, 2017 · 5 comments
Open

compile errors with mLibExternal #1

amonszpart opened this issue Mar 17, 2017 · 5 comments

Comments

@amonszpart
Copy link

amonszpart commented Mar 17, 2017

Hi,

Getting mLibExternal to compile (on Ubuntu, GCC 4.9.4) is quite tricky, with some problems definitely not being a compiler problem. Is there a newer version of it online somewhere?

  • std::ostream and std::istream does not seem take boost::asio::streambuf* and ios::binary as 2constructor parameters, remove the openmode?:

    • mLib/include/ext-boost/serialization.h:38:14: error: no matching function for call to ‘std::basic_ostream<char>::basic_ostream(boost::asio::streambuf*, const openmode&)’ , m_ia(m_is) { }
    • mLib/include/ext-boost/serialization.h:39:14: error: no matching function for call to ‘std::basic_ostream<char>::basic_ostream(boost::asio::streambuf*, const openmode&)’ , m_ia(m_is) { }
    • mLib/include/ext-boost/serialization.h:245:41: error: no matching function for call to ‘std::basic_ostream<char>::basic_ostream(boost::asio::streambuf*, const openmode&)’ (with Boost version 1.58)
  • toJSON does not seem to be able to get resolved for vec<int64_t> (add template <typename T> ostream& toJSON(ostream& os, const T& x); at line 73 in json.h):

In file included from libsg/segmentation/Part.h:7:0,
    from segmentation/SegmentGroup.h:8,
    from libsg/core/Scan.h:8,
    from libsg/core/Recording.cpp:8:
    libsg/io/json.h: In instantiation of ‘std::ostream& sg::io::toJSON(std::ostream&, sg::vec<Vector3T>&) [with T = long int; std::ostream = std::basic_ostream<char>; sg::vec<Vector3T> = std::vector<long int, std::allocator<long int> >]’:
    libsg/core/Recording.cpp:254:59:   required from here
    libsg/io/json.h:90:20: error: no matching function for call to ‘toJSON(std::ostream&, const value_type&)’
    toJSON(os, x[i]) << ",";
                  ^
  • missing std:: from endl:

    • mLib/include/core-math/PCA.cpp:83:45: error: ‘endl’ was not declared in this scope std::cout << "Computing eigensystem..." << endl;
    • mLib/include/core-math/PCA.cpp:105:104: error: ‘endl’ was not declared in this scope std::cout << "Energy at " << dimIndex + 1 << " terms: " << cumulativeEnergy / sum * 100.0f << "%" << endl;
  • _means.size instead of dimension:

    • mLib/include/core-math/PCA.cpp:141:20: error: ‘dimension’ was not declared in this scope result.resize(dimension);
  • need explicit std namespace around member class: namespace std { struct hash<...>{}; }

    • mLib/include/core-util/sparseGrid3.h:6:13: error: specialization of ‘template<class _Tp> struct std::hash’ in different namespace [-fpermissive] struct std::hash<ml::vec3i> : public std::unary_function<ml::vec3i, size_t> {
  • need this-> or using Grid3<FLoatType>::getDimX; for parent functions:

    • mLib/include/core-base/distanceField3.h:142:48: error: there are no arguments to ‘getDimX’ that depend on a template parameter, so a declaration of ‘getDimX’ must be available [-fpermissive] vec3<FloatType> maxBound((FloatType)getDimX() - 1, (FloatType)getDimY() - 1, (FloatType)getDimZ() - 1);
    • mLib/include/core-base/distanceField3.h:161:51: error: there are no arguments to ‘getDimX’ that depend on a template parameter, so a declaration of ‘getDimX’ must be available [-fpermissive] (FloatType)res.getDimX() / (FloatType)getDimX(),
    • template <typename T> class NumericGrid : public Grid<T> { using Grid<T>::m_data; using Grid<T>::m_rows; using Grid<T>::m_cols;
    • template <typename T, typename NumT = float> class BinnedGrid : public Grid<T> { using Grid<T>::allocate; using Grid<T>::m_rows; using Grid<T>::m_cols;
  • missing ml:: in front of vec3f:

    • /mLib/include/ext-boost/serialization.h:182:5: error: ‘vec3f’ was not declared in this scope vec3f v[4];
  • NumericGrid::minElement() needs to use iColMin instead of iColMax;

  • Predeclared enum not defined (just comment it out):

    • libsg/libsg.h:152:6: error: use of enum ‘PartType’ without previous declaration enum PartType;
  • Need #include "util/eigenutil.h"; #include "io/json.h"; at the top of Part.h:

    • libsg/segmentation/Part.h:85:25: error: ‘eigenutil’ is not a namespace-name using namespace sg::eigenutil;
    • libsg/segmentation/Part.h:89:5: error: ‘toFloatVector’ is not a member of ‘sg::io’ sg::io::toFloatVector(obbIn["centroid"], &centroidArr);
  • Useless typedef (comment it out):

    • libsg/segmentation/SegmentGroup.h:284:21: error: declaration of ‘typedef sg::segmentation::VecSegPtr sg::segmentation::SegmentGroupsRecord::VecSegPtr’ [-fpermissive] typedef VecSegPtr VecSegPtr;
@amonszpart
Copy link
Author

Missing _ at the end of flags_:
libsg/util/FlagSet.h:90:30: error: ‘flags’ was not declared in this scope bool none() const { return flags == 0; }

@amonszpart
Copy link
Author

mLib/include/core-mesh/meshData.cpp:492:9: error: use of deleted function ‘ml::MeshData<float>& ml::MeshData<float>::operator=(const ml::MeshData<float>&)’
  *this = other;

@msavva
Copy link
Owner

msavva commented Mar 19, 2017

Apologies for the delay in responding.

Unfortunately, this codebase is only tested to compile with Visual Studio 2013 and the mLibExternal dependency snapshot provided here.

Some of the above issues are indeed legitimate bugs that are most likely ignored by the VC compiler but caught by GCC. I would be happy to integrate any fixes from a pull request.

To make it easier to test out the PiGraphs code, I have created a Windows VM that is pre-packaged with the codebase and data. Will update with a link here as soon as the files are done uploading to the hosting server.

@amonszpart
Copy link
Author

Hi,

Thanks for the quick reply. I'm happy to put in some pull requests, if I get the whole thing to compile. I actually only tried to compile "Recording.cpp", but it pulls in many dependencies, as shown above.
Since a large part of the errors are in mLibExternal, would it be ok to add that to the tracked part of the repo?
Thanks,
Aron

@msavva
Copy link
Owner

msavva commented Mar 20, 2017

Hi Aron,

If you just need to load the recording format, there is simpler C++ example code with no external dependencies: loadrec. This code was actually part of the earlier SceneGrok project but the recording format for the PiGraphs data is the same.

The prepackaged PiGraphs VM with all code, dependencies, and data is described here: https://github.com/msavva/pigraphs#prepackaged-vm-image

Hopefully this is helpful for you.

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

No branches or pull requests

2 participants