Re: [fpc-pascal] [Linux] Accessing Shared Libraries in *Current* Binary Directory

2008-08-22 Thread Alan Krause
Tom,

In the bash shell, type in:

export LD_LIBRARY_PATH=.

This appends the current directory to the library search path, so if you cd
to the app's directory before executing it, you will be good to go. You
could also write a bash script to perform these steps automatically for you,
as I know some applications have done in the past.

Alan

On Wed, Aug 20, 2008 at 6:37 AM, T. Guilleminot <[EMAIL PROTECTED]> wrote:

> Hi,
>
> For portability reason I would need to keep my shared libraries in the
> same directory as the binary which need to call them.
>
> As per 
> http://courses.cs.vt.edu/~cs3304/FreePascal/doc/prog/node13.html:
> "This program can be compiled without any additional command-switches, and
> should run just like that, provided the library is placed where the system
> can find it.
> For example, on LINUX, this is /usr/lib or any directory listed in the
> /etc/ld.so.conf file. On WINDOWS, this can be the program directory, the
> WINDOWS system
> directory, or any directoy mentioned in the PATH".
>
> So I would basically need the behaviour of Windows on Linux. Of course I
> would avoid to have to update ld.so.conf file.
> Is there any solution ?
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Documentation bug

2008-08-22 Thread leledumbo


Thomas Schatzl wrote:
> 
> Use fpc -i to query the available optimization options.
> 
I know that, but what I need is an explanation about what each optimization
does. Plus, what are the defaults?
-- 
View this message in context: 
http://www.nabble.com/Documentation-bug-tp19066821p19103435.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] problems posting data with synapse to identi.ca

2008-08-22 Thread Tobias Diekershoff
Hello everybody!

I try to write a little program to interact with identi.ca and struggle
with sending a new message. The (better then nothing)API says [1]

-
Login
You have to have a valid login cookie to post. To get one, send an HTTP
POST to http://identi.ca/main/login with the arguments nickname and
password.
Post notice
Once you have login cookies, you can post notices. To send one, submit
an HTTP POST message to http://identi.ca/notice/new with the argument
status_textarea, a string of maximum 140 characters.
--

As I implemented fetching a timeline with synapse, It would be nice if
anybody coud give me a hint with this. I've tried HttpPostURL, but the
result is not very promising (i.e. false), which could be because this
is my first try with synapse at all...

Thanks in advance!

so long
  Tobias

[1] http://laconi.ca/trac/wiki/Version0API

-- 
   \|/
   O O
/--uUu-/ \-uUu\
|  \_/   Tobias Diekershoff   |
| URl .. www.diekershoff.net  |
| Mail . [EMAIL PROTECTED]   |
| PGP-ID ... 0x66A73B17   |
| Jabber ... [EMAIL PROTECTED]   |
| SIP .. [EMAIL PROTECTED] |
| Skype, ICQ auf nachfrage|
\-/


pgpmLc63bw6Ko.pgp
Description: PGP signature
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] problems posting data with synapse to identi.ca

2008-08-22 Thread Tobias Diekershoff
On Fri, 22 Aug 2008 14:59:45 +0200
Tobias Diekershoff <[EMAIL PROTECTED]> wrote:

> As I implemented fetching a timeline with synapse, It would be nice if
> anybody coud give me a hint with this. I've tried HttpPostURL, but the
> result is not very promising (i.e. false), which could be because this
> is my first try with synapse at all...

I got a step further. Found the way to post the request. But the result
is not the expected. I receive a 301.

Am I right in assuming, that the HTTP.cookie is used for successive
requests? Got a PHPSESSID, so that would be handy, if it is reused. Or
do I have to take care of that?

TIA & so long
  Tobias

-- 
   \|/
   O O
/--uUu-/ \-uUu\
|  \_/   Tobias Diekershoff   |
| URl .. www.diekershoff.net  |
| Mail . [EMAIL PROTECTED]   |
| PGP-ID ... 0x66A73B17   |
| Jabber ... [EMAIL PROTECTED]   |
| SIP .. [EMAIL PROTECTED] |
| Skype, ICQ auf nachfrage|
\-/


pgpdB1s2F7tFQ.pgp
Description: PGP signature
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Strange Floating Point Exception problem

2008-08-22 Thread Tom Verhoeff
I have an application (for optimizing decisions in the dice game Yahtzee)
that uses Real and runs well with FPC on Mac OS X (PPC), but that
fails with a Floating Point Exception (FPE) under Windows (FPC 2.2.0).

What makes things complicated, is that the program has a GUI
through Lazarus, and that it is rather biggish, making it difficult
to isolate the problem.

The place where it complains is a simple statement

  if x < 0.0 then

where x = -1 exactly.  It happens inside a recursive function.

When I have the values of x printed (in bit form: sign, biased exponent,
fractional part), this is what I get:

Computing all choices for optimal Yahtzee strategy ...
OptExpectedScore(123456TFHSLYC;63-): x = 1 011 
0
OptExpectedScore(_23456TFHSLYC;63-): x = 1 011 
0
OptExpectedScore(__3456TFHSLYC;63-): x = 1 011 
0
OptExpectedScore(___456TFHSLYC;63-): x = 1 011 
0
OptExpectedScore(56TFHSLYC;63-): x = 1 011 
0
OptExpectedScore(_6TFHSLYC;63-): x = 1 011 
0
OptExpectedScore(__TFHSLYC;33-): x = 1 011 
0
OptExpectedScore(___FHSLYC;33-): x = 1 011 
0

This means that the if statement is passed 7 times without problem with
x = -1, and on the 8th pass, where x = -1 again, it bails out with an FPE.

How can I get more details about the exception?

What could be causing this?

When I use an ordinary write statement to print the value of x,
it also bombs out on the 8th pass.

Note that x is actually a field in a record stored in a high-dimensional
array that is dynamically allocated, accessed through a with statement.

Using various levels of optimization does not matter.

I am at a loss here,

Tom
-- 
E-MAIL: T.Verhoeff @ TUE.NL | Dept. of Math. & Comp. Science
PHONE:  +31 40 247 41 25| Technische Universiteit Eindhoven
FAX:+31 40 247 54 04| PO Box 513, NL-5600 MB Eindhoven
http://www.win.tue.nl/~wstomv/  | The Netherlands
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Strange Floating Point Exception problem

2008-08-22 Thread Marco van de Voort
In our previous episode, Tom Verhoeff said:
> 
> This means that the if statement is passed 7 times without problem with
> x = -1, and on the 8th pass, where x = -1 again, it bails out with an FPE.

Hmm, didn't the x87 copro stack had 7ish registers? And recursive you say?
:-)
 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Strange Floating Point Exception problem

2008-08-22 Thread Marco van de Voort
In our previous episode, Tom Verhoeff said:
> What makes things complicated, is that the program has a GUI
> through Lazarus, and that it is rather biggish, making it difficult
> to isolate the problem.
> 
> The place where it complains is a simple statement

Sorry, forgot to mention a test/remedy if that is it: obviously check the
asm code, but play with calling conventions?

Could you post some runnable code?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Strange Floating Point Exception problem

2008-08-22 Thread Vinzent Höfler

Marco van de Voort wrote:

In our previous episode, Tom Verhoeff said:

This means that the if statement is passed 7 times without problem with
x = -1, and on the 8th pass, where x = -1 again, it bails out with an FPE.


Hmm, didn't the x87 copro stack had 7ish registers? And recursive you say?
:-)


8-Register-Stack, yes.

Interestingly, I just wanted to give an example and tried the old 
infamous recursive Fibonacci, which on an older compiler failed for N >= 
15 with a FP stack overflow (apart from being darn slow, of course).


Now it seems, Florian's Tail-Recursion-Optimization invalidated this 
particular example of "don't do this". :D



Vinzent.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] missing functions in libc

2008-08-22 Thread Marc Santhoff
Am Freitag, den 22.08.2008, 08:56 +0200 schrieb Marco van de Voort:
> In our previous episode, Marc Santhoff said:

[...]

> > What going on here? How can I repair it?
> 
> Eliminate use of the libc unit, using mostly baseunix, dynlibs and the like
> (the above url has a longer list). Replace -64 functions by their plain
> equivalents. (FreeBSD 4+ already has 64-bit off_t)
> 
> And hope that they didn't use too exotic functions from unit libc. If so,
> report here. In 2.2.2 some routines to access users/passwords were added,
> maybe you can take the sources from there (packages/users), and try to get
> it running under 2.0.4

Thanks, that made it clear and I found there is only one unit using
libc.

The other question is if I want to put a lot of time into that one, I
only wanted to see if it works - according to the source it must have
been working with fpc once.

I'll see if the author is still working on this or the successor of it
and decide after that.

Thanks again,
Marc

For anyone interested:

http://lptk.sourceforge.net/index.php
http://pasgf.sourceforge.net/index.php


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Widestrings manager ?

2008-08-22 Thread Steve Howe
Hello all,

I have a console application (web server) which prints this message at the 
console:

"This binary has no widestrings support compiled in.
Recompile the application with a widestrings-manager in the program uses 
clause."

I found no references to that on the documentation - the widestrings reference 
advices to look at the system unit documentation but I found nothing there. 
Google says nothing as well.

The system.pp unit has a call to "InitWideStringManager"; I'd think it 
initializes the widestring manager, but it seems not.

How can I fix that ?

My environment:
Linux 2.6.24-19 (ubuntu)
Free Pascal Compiler version 2.2.2 [2008/07/30] for i386

Thanks.
-- 
Best Regards,
Steve Howe
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal