Jump to content

  • Log In with Google      Sign In   
  • Create Account


use boost without include path?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
15 replies to this topic

#1 Storyyeller   Members   -  Reputation: 212

Like
0Likes
Like

Posted 26 October 2011 - 03:45 PM

Is there anyway to use boost headers without setting any include path or system variables? The problem is that the headers include each other and they do so using
#include "boost/..."

so the root boost folder has to be in the include path for it to find anything. Unfortunately, I'm trying to enter the AI Challenge, which doesn't allow any control over the build process, so it is impossible to set an include path. I suppose it's possible to modify all the headers so they use relative paths, but that is complicated to do and I was hoping there was a better way.
I trust exceptions about as far as I can throw them.

Sponsor:

#2 wqking   Members   -  Reputation: 756

Like
-1Likes
Like

Posted 26 October 2011 - 08:05 PM

If you know regular expression and a decent script, such as Perl or Python, or you are a master of Unix commands, it's easy to change all headers to remove "boost/".
Or if you only use several boost headers, how about change them manually, just spending half an hour?

http://www.cpgf.org/
cpgf library -- free C++ open source library for reflection, serialization, script binding, callbacks, and meta data for OpenGL Box2D, SFML and Irrlicht.
v1.5.5 was released. Now supports tween and timeline for ease animation.


#3 Hodgman   Moderators   -  Reputation: 28447

Like
0Likes
Like

Posted 26 October 2011 - 08:32 PM

Why can't you edit the makefile to specify an include path?

#4 Storyyeller   Members   -  Reputation: 212

Like
0Likes
Like

Posted 26 October 2011 - 08:35 PM

They don't allow user submitted makefiles. They have a custom build process.
I trust exceptions about as far as I can throw them.

#5 Hodgman   Moderators   -  Reputation: 28447

Like
0Likes
Like

Posted 26 October 2011 - 08:47 PM

Is this for the ai challenge at aichallenge.org? If so, they do allow you to modify the default makefile.

If you submit your bot with the Makefile included, the server will attempt to use this when compiling your bot, otherwise it will revert back to the auto compile script that is available on the contests github site.



#6 Storyyeller   Members   -  Reputation: 212

Like
0Likes
Like

Posted 26 October 2011 - 08:48 PM

Oh really? I thought they specifically said that they didn't allow makefiles. I guess I'll give that a try then.


Edit: Here it is, from the contest organizer himself.

You can alter any part of the zip package. Makefiles will be ignored, they're not used, the code is compiled with a different script.
About function documentation for the starter package, idk. Checking the source would be your best bet, that way you actually know what's going on.


I trust exceptions about as far as I can throw them.

#7 TheUnbeliever   Members   -  Reputation: 961

Like
0Likes
Like

Posted 27 October 2011 - 01:14 AM

Google tells me that was in response to a post from last year. Even if it was true then, there's no reason to expect it to be true this year when the website directly contradicts it. It's pretty fundamental. You can presumably submit more than once, so why not just try it with a custom makefile? It'll be less effort than untangling the headers.

(Also, couldn't you just put the root 'boost' directory into the zip? Or am I being daft...)
[TheUnbeliever]

#8 Storyyeller   Members   -  Reputation: 212

Like
0Likes
Like

Posted 27 October 2011 - 07:13 AM

You could put the boost directory in the zip but it wouldn't compile because the headers include themselves with an absolute path.
I trust exceptions about as far as I can throw them.

#9 Storyyeller   Members   -  Reputation: 212

Like
0Likes
Like

Posted 29 October 2011 - 09:56 AM

I tried submitting a makefile, but it didn't work. It appears that the build process still ignores submitted makefiles.
I trust exceptions about as far as I can throw them.

#10 Katie   Members   -  Reputation: 1302

Like
0Likes
Like

Posted 29 October 2011 - 03:42 PM

"the headers include themselves with an absolute path. "

I don't know what platform you're on, but on my Linux system, they all say "#include <boost/WHATEVER>"

#11 Antheus   Members   -  Reputation: 2397

Like
0Likes
Like

Posted 29 October 2011 - 03:46 PM

You could always just pre-process all files locally. Most of relevant boost stuff is header only.

#12 Storyyeller   Members   -  Reputation: 212

Like
0Likes
Like

Posted 29 October 2011 - 03:51 PM

"the headers include themselves with an absolute path. "

I don't know what platform you're on, but on my Linux system, they all say "#include <boost/WHATEVER>"


I meant absolute in terms of the boost directory. If boost isn't in your include path, then #include <boost/WHATEVER> won't work. As opposed to just #include "WHATEVER", which would work since it's in the same directory.
I trust exceptions about as far as I can throw them.

#13 Storyyeller   Members   -  Reputation: 212

Like
0Likes
Like

Posted 29 October 2011 - 03:58 PM

I tried that and it doesn't work. You'd have to nest a new copy of the boost directory for every level of inclusion.
I trust exceptions about as far as I can throw them.

#14 swiftcoder   Senior Moderators   -  Reputation: 9736

Like
0Likes
Like

Posted 29 October 2011 - 04:01 PM

I tried that and it doesn't work. You'd have to nest a new copy of the boost directory for every level of inclusion.

That implies something is pretty screwed up in your build system - it should always start from the top-level directory where your makefile resides.

Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#15 Storyyeller   Members   -  Reputation: 212

Like
0Likes
Like

Posted 29 October 2011 - 04:06 PM

I tried uploading it, and it doesn't build on their system either.
I trust exceptions about as far as I can throw them.

#16 Storyyeller   Members   -  Reputation: 212

Like
1Likes
Like

Posted 19 November 2011 - 03:33 PM

If you know regular expression and a decent script, such as Perl or Python, or you are a master of Unix commands, it's easy to change all headers to remove "boost/".
Or if you only use several boost headers, how about change them manually, just spending half an hour?


I actually tried writing a Python script to fix all the include paths. It's harder than it sounds because they use macros to define some of the includes, and filenames of headers also appear in the comments. However, I managed it eventually.
I trust exceptions about as far as I can throw them.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS