questions about NewPermanentCallback

229 views
Skip to first unread message

ziye...@gmail.com

unread,
Feb 28, 2019, 1:56:14 PM2/28/19
to or-tools-discuss
Hi developers, I have a beginner question: I saw NewPermanentCallback used a lot in the examples, e.g. cvrptw.cc. But I don't really understand what are valid arguments for it. I took a look at the header and it seems there are many overloading of this routine. So a concrete question is, say I want to add a capacity dimension, or ArcCostEvaluator, do we always provide the NewPermanentCallback with 1. address of the class that contains a function which returns the corresponding quantity 2. the (public) class member function?

Thanks a lot for your help.
-Ziye

Laurent Perron

unread,
Feb 28, 2019, 2:51:41 PM2/28/19
to or-tools-discuss
Forget it, they disappear in the next release (hopefully next week).
Please look at the 7.0 beta, of the master branch on girthub.
Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ziye...@gmail.com

unread,
Feb 28, 2019, 4:09:11 PM2/28/19
to or-tools-discuss
Thanks Laurent. I just cloned the beta version. I have another question: I see the original Makefile has been split into several smaller ones, but somehow I cannot find the definition of CCC, CFLAGS, OR_TOOL_LNK and OR_TOOL_LDFLAGS... 

I need to modify them because I want to add my project into the directory. My project has a few cc files, one main file. And cc files depend upon each other and main.o will compile with all the object files. So it is a bit different from the cc file in the example directory. I didn't the best way to do so I just add a conditional statement to check $(SOURCE_NAME). If it is my project, I will compile it differently but with the same CFLAGS and LDFLAGS. 

Thanks a lot for your help!

Laurent Perron

unread,
Feb 28, 2019, 5:09:08 PM2/28/19
to or-tools-discuss
You should use make install_cc DESTDIR=<path to installation directory>

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00


ziye...@gmail.com

unread,
Feb 28, 2019, 5:28:38 PM2/28/19
to or-tools-discuss
Thanks again. Before I saw you message, I've done make cc and make test_cc and all examples compile well. But then I add in my own project and there is a dylib linker error -- it seems all the google dylib (gflags, glog, etc.) are not well linked. But then I did make install_cc my/dir and the problem is solved. However I saw install_cc only copy headers into /usr/local/include but did not do anything about dylib. Just curious: do you know what is happening?

Thanks Laurent!

Laurent Perron

unread,
Feb 28, 2019, 5:30:54 PM2/28/19
to or-tools-discuss
Did you specify DESTDIR=<path> when using make install_cc ?

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00


ziye...@gmail.com

unread,
Feb 28, 2019, 5:32:16 PM2/28/19
to or-tools-discuss
No, is that why the headers are installed in /usr/local?

ziye...@gmail.com

unread,
Feb 28, 2019, 5:36:09 PM2/28/19
to or-tools-discuss
I tried it with DESTDIR and now I have a usr file containing all includes and libs. Should I just compile this guy with my project? Is there a compilation flag template?

Laurent Perron

unread,
Feb 28, 2019, 5:39:51 PM2/28/19
to or-tools-discuss
Did you write DESTDIR=<a real path> ?

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00


ziye...@gmail.com

unread,
Feb 28, 2019, 5:40:56 PM2/28/19
to or-tools-discuss
yes.
Reply all
Reply to author
Forward
0 new messages