Compiling POL...

Here you can post threads specific to the current release of the core (099)

Moderator: POL Developer

Post Reply
Rogdush
New User
Posts: 29
Joined: Fri Feb 10, 2006 8:29 am

Compiling POL...

Post by Rogdush »

Hi there,

I want to ask you about POL compilation process.
Ive done checkout from pol repository (https://polserver.svn.sourceforge.net/s ... rver/trunk)
Im trying to compile it under gentoo with gcc 4.4.4, up to date glibc and everything else.
Why do I get such common errors like deprecated_headers or PTHREAD_THREAD_MAX constant doesnt exist? I know its sysconf now, but why its not fixed in sources?
Do I have to get some antique environment to compile pol? No one maintaince it?
Thanks for any answer.

PS. Why there is no link on pol website to source repository? AFAIR I got it from some mate on pol-server irc channel.
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: Compiling POL...

Post by Turley »

Rogdush wrote: Why do I get such common errors like deprecated_headers or PTHREAD_THREAD_MAX constant doesnt exist? I know its sysconf now, but why its not fixed in sources?
Do I have to get some antique environment to compile pol? No one maintaince it?
Simply remove the -Wall in the makefile, reason why noone fixed it simply lack of time, it compiles fine and we have bigger problems to solve then some random gcc changes in every version. Its somewhere on the todo...
Rogdush
New User
Posts: 29
Joined: Fri Feb 10, 2006 8:29 am

Re: Compiling POL...

Post by Rogdush »

Unfortunatelly its not that simple to just remove all compile warnings.
There are bigger problems than warnings, like removal of PTHREAD_THREAD_MAX constant or some change in md5 lib, where struct md5_ctx vanished.
Unfortunatelly you cant compile it under new gcc and libs.
Anyways, thanks for answer Turley. Will wait then or Ill make some changes myself and post patch when succeded.
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: Compiling POL...

Post by Turley »

Mmh last time I compiled under Linux there where only the warnings.. damn gcc. A patch would be nice :)
User avatar
jaszczur
New User
Posts: 2
Joined: Sun Sep 21, 2008 4:12 am
Location: Szczecin / Poland

Re: Compiling POL...

Post by jaszczur »

You have to add to
clib/MD5.h

Code: Select all

# include <stdint.h>
typedef uint32_t md5_uint32;

struct md5_ctx
{
  md5_uint32 A;
  md5_uint32 B;
  md5_uint32 C;
  md5_uint32 D;

  md5_uint32 total[2];
  md5_uint32 buflen;
  char buffer[128] __attribute__ ((__aligned__ (__alignof__ (md5_uint32))));
};

extern void __md5_init_ctx (struct md5_ctx *ctx) __THROW;

extern void __md5_process_bytes (const void *buffer, size_t len,
				 struct md5_ctx *ctx) __THROW;

extern void *__md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) __THROW;
Then I stopped at:

Code: Select all

/usr/bin/ld: cannot find -l-lz
/usr/bin/ld: cannot find -l-lstdc++
I've installed libz*, libstdc* and stuff, buf nothings helped (ubuntu 10.04). Help? I've know nearly to nothing about c++ or linux :D


Edit:
Ohh, and I've comment PTHREAD_THREAD_MAX line in pol.cpp
Rogdush
New User
Posts: 29
Joined: Fri Feb 10, 2006 8:29 am

Re: Compiling POL...

Post by Rogdush »

Hi again,
jaszczur wrote:You have to add to
clib/MD5.h

Code: Select all

# include <stdint.h>
typedef uint32_t md5_uint32;

struct md5_ctx
{
  md5_uint32 A;
  md5_uint32 B;
  md5_uint32 C;
  md5_uint32 D;

  md5_uint32 total[2];
  md5_uint32 buflen;
  char buffer[128] __attribute__ ((__aligned__ (__alignof__ (md5_uint32))));
};

extern void __md5_init_ctx (struct md5_ctx *ctx) __THROW;

extern void __md5_process_bytes (const void *buffer, size_t len,
				 struct md5_ctx *ctx) __THROW;

extern void *__md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) __THROW;
Then I stopped at:

Code: Select all

/usr/bin/ld: cannot find -l-lz
/usr/bin/ld: cannot find -l-lstdc++
I've installed libz*, libstdc* and stuff, buf nothings helped (ubuntu 10.04). Help? I've know nearly to nothing about c++ or linux :D


Edit:
Ohh, and I've comment PTHREAD_THREAD_MAX line in pol.cpp
If you add declarations of old md5 module to header file, it will just cause unexpected behaviour of pol - if it will compile anyway. You cant just add declarations of functions without implementation (will get undefined reference at compilation). Well, you simply need to dig up what changed in md5 module - I havent found any vital information yet (its harder than I could expected), tho I havent put much time into it.
About PTHREAD_MAX - you can comment it, because its just some print of some console output, so its not too much vital - still its not the correct way to fix anything ;)
You can get linking errors of libz or stdc caused by incorrect libdir or missing some paths in PATH env - simply it cant find your libs. Just locate libz.so and libstdc++.so where you have it and make sure its findable from pol compilation dir, also can try to make ldd on libz (but I think ubuntu has a good dependency system) to check if there is some other missing libraries.

Basically, even if we manage to compile it, it will need some testing - at least from md5 angle.

Good luck and lets turn on crazy coding machine ;)
Rogdush
New User
Posts: 29
Joined: Fri Feb 10, 2006 8:29 am

Re: Compiling POL...

Post by Rogdush »

Peeps, seriously, from where did you get md5_ctx struct ? I cant find any special entry about such implementation of md5 algorithm. Ive found only something in gnulib.
What do you need to have on gentoo for example to get this working? On other way, if you have to manually download some md5 implementation, please post some link to it.
Rogdush
New User
Posts: 29
Joined: Fri Feb 10, 2006 8:29 am

Re: Compiling POL...

Post by Rogdush »

Turley, is there any instruction how to compile pol ? Its obvious, you need special environment for it, and since you dont publish any builds anymore, you need to compile it yourself.
How can I do it without spending 2 days searching web for solutions?
Thanks in adv.
kevin
POL Developer
Posts: 53
Joined: Wed Sep 29, 2010 3:47 pm
Contact:

Re: Compiling POL...

Post by kevin »

I was able to compile POL fine in Microsoft Visual Studio 2005 Express Edition as well as under Ubuntu Linux with gcc 4.4 with no modifications to the source code.
Post Reply