Skip to content

About how to build and install pyqpbo on Macos #10

@gaoyangyiqiao

Description

@gaoyangyiqiao

I encountered quite a lot problem with opengm, so I come back here..

1.run python setup.py build_ext --inplace
1.You will got some errors, change the setup.py file: delete the QPBOinstall.
3.Go to the QPBO-v1.3.src and find the instance.ini, change it to:

#include "QPBO.h"

#ifdef _MSC_VER
#pragma warning(disable: 4661)
#endif



template <> 
	inline void QPBO<int>::get_type_information(char*& type_name, char*& type_format)
{
	type_name = "int";
	type_format = "d";
}

template <> 
	inline void QPBO<float>::get_type_information(char*& type_name, char*& type_format)
{
	type_name = "float";
	type_format = "f";
}

template <> 
	inline void QPBO<double>::get_type_information(char*& type_name, char*& type_format)
{
	type_name = "double";
	type_format = "Lf";
}
// Instantiations
template class QPBO<int>;
template class QPBO<float>;
template class QPBO<double>;

which moves the instantiation to the bottom.
4.run python setup.py build_ext --inplace again.
And now you can use it normally I think. Copy the pyqpbo dir to your own project and then you'll be able to:
from pyqpbo import binary_grid, alpha_expansion_grid, binary_graph

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions