Code Monkey home page Code Monkey logo

Comments (6)

amueller avatar amueller commented on July 21, 2024

sorry, I was a bit lazy there. Maybe I should just do that now.
There are some comments in my blog.

For example this should do:
``
gcc -fPIC -c GCoptimization.cpp LinkedBlockList.cpp graph.cpp maxflow.cpp

g++ -shared GCoptimization.o maxflow.o .o LinkedBlockList.o graph.o -o gco.so
``

There is also a CMakeLists.txt in my blog, but It didn't get around to add it.

from gco_python.

amueller avatar amueller commented on July 21, 2024

I just uploaded a somewhat better Makefile that does the downloading and compiling of gco. Feedback welcome.

from gco_python.

trsaunders avatar trsaunders commented on July 21, 2024

Thanks for that, but I'm still having problems. I'm thinking it might be something to do with my gcc version. Out of interest, what version of gcc works for you? I'm using Ubuntu/Linaro 4.6.3-1ubuntu5

The main problems (other than a whole host of warnings) seem to be:

In file included from gco_src/GCoptimization.cpp:4:0:
gco_src/GCoptimization.h: At global scope:
gco_src/GCoptimization.h:389:16: error: ‘ptrdiff_t’ does not name a type
gco_src/GCoptimization.h:414:16: error: ‘ptrdiff_t’ does not name a type
gco_src/GCoptimization.cpp:31:23: warning: ‘GCO_CLOCKS_PER_SEC’ initialized and declared ‘extern’ [enabled by default]
gco_src/GCoptimization.cpp: In member function ‘GCoptimization::SiteID GCoptimization::GreedyIter<GCoptimization::DataCostFnSparse>::feasibleSites() const’:
gco_src/GCoptimization.cpp:555:73: error: no match for ‘operator-’ in ‘((const GCoptimization::GreedyIter<GCoptimization::DataCostFnSparse>*)this)->GCoptimization::GreedyIter<GCoptimization::DataCostFnSparse>::m_siteend - ((const GCoptimization::GreedyIter<GCoptimization::DataCostFnSparse>*)this)->GCoptimization::GreedyIter<GCoptimization::DataCostFnSparse>::m_site’
gco_src/GCoptimization.cpp: In member function ‘GCoptimization::EnergyTermType GCoptimization::DataCostFnSparse::search(GCoptimization::DataCostFnSparse::DataCostBucket&, GCoptimization::SiteID)’:
gco_src/GCoptimization.cpp:1823:19: error: ‘cLinearSearchSize’ was not declared in this scope
In file included from gco_src/GCoptimization.h:109:0,
                 from gco_src/GCoptimization.cpp:4:

Probably headers being included in the wrong place or something in the gco code. Compiling an academic's code can often be a fun process :)

cheers for your help!

Tom

from gco_python.

trsaunders avatar trsaunders commented on July 21, 2024

Ok, I think I have sorted it, I just had to add:

#include <stddef.h>

To GCOptimization.h

it might be worth adding a note about this? or patching the gco code after it is downloaded.

from gco_python.

trsaunders avatar trsaunders commented on July 21, 2024

I'm pleased to say that example.py runs fine, thank you very much for your fast help!

Time to go put this to use..

Tom

from gco_python.

amueller avatar amueller commented on July 21, 2024

@trsaunders Thanks for your feedback. I added a note to the Readme shortly before your post and also notified upstream. It should be fixed soon.
Have fun and let me know if you have any interesting results ;)
Andy

from gco_python.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.