haxe/cpp program runtime requirements

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

haxe/cpp program runtime requirements

clemos
Hello list,

I have written a little program in haXe/cpp, and have had errors when
trying to run it on another machine:
"Error : Could not load module std@file_stdin__0"
Installing haXe with the hxcpp through haxelib there solves the problem;
I must either install it globally as root, though, or for each user
who wants to execute the program...

The problem is, I must run this program on a server on which I don't
have admin rights,
and I don't really want to have to install haxe + hxcpp over there anyway.
Moreover, the program is meant to be executed by apache through a php
script, so the user would be the apache user, and I just can't install
haxe + hxcpp for that user...

Anyway, I guess it's a kind of bug that haXe/cpp generate programs
that require one to install haXe/cpp to be able to execute it, right ?

What can I do to make my program distributable / deployable anywhere ?
Are there special requirements / libs that I should ask my admin to install ?

Thanks a lot for the good work anyway :)
+++++
Clément

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haxe/cpp program runtime requirements

Tony Polinelli
my guess is that you need to package the dll's from the
haxe/lib/hxcpp/binaries/(yourplatform)/  folder with your exe for it
to find them. There  is one called std.dll i think - this is probably
what its looking for.

copy them next to the exe and you shouldnt need to install the rest of
hxcpp or haxe. Maybe there is a way to statically link these into the
exe? not sure.



On Sun, Mar 21, 2010 at 1:36 AM, clemos <[hidden email]> wrote:

> Hello list,
>
> I have written a little program in haXe/cpp, and have had errors when
> trying to run it on another machine:
> "Error : Could not load module std@file_stdin__0"
> Installing haXe with the hxcpp through haxelib there solves the problem;
> I must either install it globally as root, though, or for each user
> who wants to execute the program...
>
> The problem is, I must run this program on a server on which I don't
> have admin rights,
> and I don't really want to have to install haxe + hxcpp over there anyway.
> Moreover, the program is meant to be executed by apache through a php
> script, so the user would be the apache user, and I just can't install
> haxe + hxcpp for that user...
>
> Anyway, I guess it's a kind of bug that haXe/cpp generate programs
> that require one to install haXe/cpp to be able to execute it, right ?
>
> What can I do to make my program distributable / deployable anywhere ?
> Are there special requirements / libs that I should ask my admin to install ?
>
> Thanks a lot for the good work anyway :)
> +++++
> Clément
>
> --
> haXe - an open source web programming language
> http://haxe.org
>



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haxe/cpp program runtime requirements

clemos
Hi Tony

I forgot to mention I was working on Debian/Linux.
I tried to copy all .dso files found in hxcpp/bin/Linux/ to my
program's directory but this didn't work.
Thanks for trying to help anyway :)

++++++
Clément

On Sat, Mar 20, 2010 at 4:09 PM, Tony Polinelli <[hidden email]> wrote:

> my guess is that you need to package the dll's from the
> haxe/lib/hxcpp/binaries/(yourplatform)/  folder with your exe for it
> to find them. There  is one called std.dll i think - this is probably
> what its looking for.
>
> copy them next to the exe and you shouldnt need to install the rest of
> hxcpp or haxe. Maybe there is a way to statically link these into the
> exe? not sure.
>
>
>
> On Sun, Mar 21, 2010 at 1:36 AM, clemos <[hidden email]> wrote:
>> Hello list,
>>
>> I have written a little program in haXe/cpp, and have had errors when
>> trying to run it on another machine:
>> "Error : Could not load module std@file_stdin__0"
>> Installing haXe with the hxcpp through haxelib there solves the problem;
>> I must either install it globally as root, though, or for each user
>> who wants to execute the program...
>>
>> The problem is, I must run this program on a server on which I don't
>> have admin rights,
>> and I don't really want to have to install haxe + hxcpp over there anyway.
>> Moreover, the program is meant to be executed by apache through a php
>> script, so the user would be the apache user, and I just can't install
>> haxe + hxcpp for that user...
>>
>> Anyway, I guess it's a kind of bug that haXe/cpp generate programs
>> that require one to install haXe/cpp to be able to execute it, right ?
>>
>> What can I do to make my program distributable / deployable anywhere ?
>> Are there special requirements / libs that I should ask my admin to install ?
>>
>> Thanks a lot for the good work anyway :)
>> +++++
>> Clément
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>
>
>
> --
> Tony Polinelli
> http://touchmypixel.com
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haxe/cpp program runtime requirements

go2ghana
clemos schrieb:

> Hi Tony
>
> I forgot to mention I was working on Debian/Linux.
> I tried to copy all .dso files found in hxcpp/bin/Linux/ to my
> program's directory but this didn't work.
> Thanks for trying to help anyway :)
>
> ++++++
> Clément
>
> On Sat, Mar 20, 2010 at 4:09 PM, Tony Polinelli <[hidden email]> wrote:
>  
>> my guess is that you need to package the dll's from the
>> haxe/lib/hxcpp/binaries/(yourplatform)/  folder with your exe for it
>> to find them. There  is one called std.dll i think - this is probably
>> what its looking for.
>>
>> copy them next to the exe and you shouldnt need to install the rest of
>> hxcpp or haxe. Maybe there is a way to statically link these into the
>> exe? not sure.
>>
>>
>>
>> On Sun, Mar 21, 2010 at 1:36 AM, clemos <[hidden email]> wrote:
>>    
>>> Hello list,
>>>
>>> I have written a little program in haXe/cpp, and have had errors when
>>> trying to run it on another machine:
>>> "Error : Could not load module std@file_stdin__0"
>>> Installing haXe with the hxcpp through haxelib there solves the problem;
>>> I must either install it globally as root, though, or for each user
>>> who wants to execute the program...
>>>
>>> The problem is, I must run this program on a server on which I don't
>>> have admin rights,
>>> and I don't really want to have to install haxe + hxcpp over there anyway.
>>> Moreover, the program is meant to be executed by apache through a php
>>> script, so the user would be the apache user, and I just can't install
>>> haxe + hxcpp for that user...
>>>
>>> Anyway, I guess it's a kind of bug that haXe/cpp generate programs
>>> that require one to install haXe/cpp to be able to execute it, right ?
>>>
>>> What can I do to make my program distributable / deployable anywhere ?
>>> Are there special requirements / libs that I should ask my admin to install ?
>>>
>>> Thanks a lot for the good work anyway :)
>>> +++++
>>> Clément
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>>
>>>      
>>
>> --
>> Tony Polinelli
>> http://touchmypixel.com
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>>    
>
>  
HI,
AFAIK you need to set the library path on linux to make executables find
their so's
with ldconfig or adding to LD_LIBRARY_PATH environment variable

with ldd your_executeable you get a list of dependencies
if the names don't match the libs you can add symlinks

Hope it helps - long time since I worked on linux...

Cordially,
Axel



--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haxe/cpp program runtime requirements

clemos
Hi Axel

Thanks, it seems to work by setting LD_LIBRARY_PATH to a dir where I
put the .dso files.

By the way, it looks like there is a "static" compilation flag, but
unfortunately, setting it makes the build process fail:
ar: -lpthread: No such file or directory
Called from <null> line 1
Called from BuildTool.hx line 840
Called from BuildTool.hx line 433
Called from BuildTool.hx line 456
Called from BuildTool.hx line 529
Called from BuildTool.hx line 610
Called from BuildTool.hx line 238
Uncaught exception - Error : 256 - build cancelled

Do you have any clue about how to use this flag and if this may
"cleanly" solve the issue ?
(using LD_LIBRARY_PATH works but is a kind of hack, to me)

+++++++
Clément

On Sat, Mar 20, 2010 at 6:23 PM, Axel Huizinga <[hidden email]> wrote:

> clemos schrieb:
>>
>> Hi Tony
>>
>> I forgot to mention I was working on Debian/Linux.
>> I tried to copy all .dso files found in hxcpp/bin/Linux/ to my
>> program's directory but this didn't work.
>> Thanks for trying to help anyway :)
>>
>> ++++++
>> Clément
>>
>> On Sat, Mar 20, 2010 at 4:09 PM, Tony Polinelli <[hidden email]>
>> wrote:
>>
>>>
>>> my guess is that you need to package the dll's from the
>>> haxe/lib/hxcpp/binaries/(yourplatform)/  folder with your exe for it
>>> to find them. There  is one called std.dll i think - this is probably
>>> what its looking for.
>>>
>>> copy them next to the exe and you shouldnt need to install the rest of
>>> hxcpp or haxe. Maybe there is a way to statically link these into the
>>> exe? not sure.
>>>
>>>
>>>
>>> On Sun, Mar 21, 2010 at 1:36 AM, clemos <[hidden email]> wrote:
>>>
>>>>
>>>> Hello list,
>>>>
>>>> I have written a little program in haXe/cpp, and have had errors when
>>>> trying to run it on another machine:
>>>> "Error : Could not load module std@file_stdin__0"
>>>> Installing haXe with the hxcpp through haxelib there solves the problem;
>>>> I must either install it globally as root, though, or for each user
>>>> who wants to execute the program...
>>>>
>>>> The problem is, I must run this program on a server on which I don't
>>>> have admin rights,
>>>> and I don't really want to have to install haxe + hxcpp over there
>>>> anyway.
>>>> Moreover, the program is meant to be executed by apache through a php
>>>> script, so the user would be the apache user, and I just can't install
>>>> haxe + hxcpp for that user...
>>>>
>>>> Anyway, I guess it's a kind of bug that haXe/cpp generate programs
>>>> that require one to install haXe/cpp to be able to execute it, right ?
>>>>
>>>> What can I do to make my program distributable / deployable anywhere ?
>>>> Are there special requirements / libs that I should ask my admin to
>>>> install ?
>>>>
>>>> Thanks a lot for the good work anyway :)
>>>> +++++
>>>> Clément
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>>
>>>>
>>>
>>> --
>>> Tony Polinelli
>>> http://touchmypixel.com
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>>
>>>
>>
>>
>
> HI,
> AFAIK you need to set the library path on linux to make executables find
> their so's
> with ldconfig or adding to LD_LIBRARY_PATH environment variable
>
> with ldd your_executeable you get a list of dependencies
> if the names don't match the libs you can add symlinks
>
> Hope it helps - long time since I worked on linux...
>
> Cordially,
> Axel
>
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haxe/cpp program runtime requirements

go2ghana
clemos schrieb:

> Hi Axel
>
> Thanks, it seems to work by setting LD_LIBRARY_PATH to a dir where I
> put the .dso files.
>
> By the way, it looks like there is a "static" compilation flag, but
> unfortunately, setting it makes the build process fail:
> ar: -lpthread: No such file or directory
> Called from <null> line 1
> Called from BuildTool.hx line 840
> Called from BuildTool.hx line 433
> Called from BuildTool.hx line 456
> Called from BuildTool.hx line 529
> Called from BuildTool.hx line 610
> Called from BuildTool.hx line 238
> Uncaught exception - Error : 256 - build cancelled
>
> Do you have any clue about how to use this flag and if this may
> "cleanly" solve the issue ?
> (using LD_LIBRARY_PATH works but is a kind of hack, to me)
>
> +++++++
> Clément
>
> On Sat, Mar 20, 2010 at 6:23 PM, Axel Huizinga <[hidden email]> wrote:
>  
>> clemos schrieb:
>>    
>>> Hi Tony
>>>
>>> I forgot to mention I was working on Debian/Linux.
>>> I tried to copy all .dso files found in hxcpp/bin/Linux/ to my
>>> program's directory but this didn't work.
>>> Thanks for trying to help anyway :)
>>>
>>> ++++++
>>> Clément
>>>
>>> On Sat, Mar 20, 2010 at 4:09 PM, Tony Polinelli <[hidden email]>
>>> wrote:
>>>
>>>      
>>>> my guess is that you need to package the dll's from the
>>>> haxe/lib/hxcpp/binaries/(yourplatform)/  folder with your exe for it
>>>> to find them. There  is one called std.dll i think - this is probably
>>>> what its looking for.
>>>>
>>>> copy them next to the exe and you shouldnt need to install the rest of
>>>> hxcpp or haxe. Maybe there is a way to statically link these into the
>>>> exe? not sure.
>>>>
>>>>
>>>>
>>>> On Sun, Mar 21, 2010 at 1:36 AM, clemos <[hidden email]> wrote:
>>>>
>>>>        
>>>>> Hello list,
>>>>>
>>>>> I have written a little program in haXe/cpp, and have had errors when
>>>>> trying to run it on another machine:
>>>>> "Error : Could not load module std@file_stdin__0"
>>>>> Installing haXe with the hxcpp through haxelib there solves the problem;
>>>>> I must either install it globally as root, though, or for each user
>>>>> who wants to execute the program...
>>>>>
>>>>> The problem is, I must run this program on a server on which I don't
>>>>> have admin rights,
>>>>> and I don't really want to have to install haxe + hxcpp over there
>>>>> anyway.
>>>>> Moreover, the program is meant to be executed by apache through a php
>>>>> script, so the user would be the apache user, and I just can't install
>>>>> haxe + hxcpp for that user...
>>>>>
>>>>> Anyway, I guess it's a kind of bug that haXe/cpp generate programs
>>>>> that require one to install haXe/cpp to be able to execute it, right ?
>>>>>
>>>>> What can I do to make my program distributable / deployable anywhere ?
>>>>> Are there special requirements / libs that I should ask my admin to
>>>>> install ?
>>>>>
>>>>> Thanks a lot for the good work anyway :)
>>>>> +++++
>>>>> Clément
>>>>>
>>>>> --
>>>>> haXe - an open source web programming language
>>>>> http://haxe.org
>>>>>
>>>>>
>>>>>          
>>>> --
>>>> Tony Polinelli
>>>> http://touchmypixel.com
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>>
>>>>
>>>>        
>>>      
>> HI,
>> AFAIK you need to set the library path on linux to make executables find
>> their so's
>> with ldconfig or adding to LD_LIBRARY_PATH environment variable
>>
>> with ldd your_executeable you get a list of dependencies
>> if the names don't match the libs you can add symlinks
>>
>> Hope it helps - long time since I worked on linux...
>>
>> Cordially,
>> Axel
>>
>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>>    
>
>  
A clean solution for permanent use of so's is to add them to a usual or
any other path
and list the path within /etc/ld.so.conf
then you don't need the   LD_LIBRARY_PATH environment variable any more

after adding you need to run ldconfig as root one time

regarding the statically linking the
error message -lpthread - no such file ...
looks like either the libpthread.so is not installed or not in a
standard path






--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haxe/cpp program runtime requirements

Gamehaxe
In reply to this post by clemos
Hi,
Unix is spectacularly unhelpful with DLLS if you don't "install" them.
The logic for finding the DLL is in $HXCPP/src/hx/Lib.cpp.
You can set the environment variable "HXCPP_LOAD_DEBUG" to see
what it is trying to do.

First it tries the name without a path - this will work if it finds
it finds it in the LD_LIBRARY_PATH, but (unlike windows) it will
not find the dll "next" to the exe.  I think I should explicitly
fix this.
Then it tries under $HXCPP, if you have set that variable.
There is an apache module that lets you set variables, so this may help
(also may help setting LD_LIBRARY_PATH)
Then it looks to see if you have a runnable "haxelib", so it can try
"haxelib path hxcpp", and look for it under there.
Then it looks if haxelib returns a path for the library name.

You could modify this file yourself, and your change will be compiled
into your exe.

The static code has really only been tested on the iphone.  You will
need to build the static versions of the "standard" ndll library files too.
You can add extra build flags the the system using your own  
~/.hxcpp_config.xml file,
which I have not fully documented yet.  There is a small bit in
http://code.google.com/p/hxcpp/source/browse/trunk/build-tool/BuildCommon.xml


Hugh


> Hi Axel
>
> Thanks, it seems to work by setting LD_LIBRARY_PATH to a dir where I
> put the .dso files.
>
> By the way, it looks like there is a "static" compilation flag, but
> unfortunately, setting it makes the build process fail:
> ar: -lpthread: No such file or directory
> Called from <null> line 1
> Called from BuildTool.hx line 840
> Called from BuildTool.hx line 433
> Called from BuildTool.hx line 456
> Called from BuildTool.hx line 529
> Called from BuildTool.hx line 610
> Called from BuildTool.hx line 238
> Uncaught exception - Error : 256 - build cancelled
>
> Do you have any clue about how to use this flag and if this may
> "cleanly" solve the issue ?
> (using LD_LIBRARY_PATH works but is a kind of hack, to me)
>
> +++++++
> Clément
>
> On Sat, Mar 20, 2010 at 6:23 PM, Axel Huizinga <[hidden email]> wrote:
>> clemos schrieb:
>>>
>>> Hi Tony
>>>
>>> I forgot to mention I was working on Debian/Linux.
>>> I tried to copy all .dso files found in hxcpp/bin/Linux/ to my
>>> program's directory but this didn't work.
>>> Thanks for trying to help anyway :)
>>>
>>> ++++++
>>> Clément
>>>
>>> On Sat, Mar 20, 2010 at 4:09 PM, Tony Polinelli  
>>> <[hidden email]>
>>> wrote:
>>>
>>>>
>>>> my guess is that you need to package the dll's from the
>>>> haxe/lib/hxcpp/binaries/(yourplatform)/  folder with your exe for it
>>>> to find them. There  is one called std.dll i think - this is probably
>>>> what its looking for.
>>>>
>>>> copy them next to the exe and you shouldnt need to install the rest of
>>>> hxcpp or haxe. Maybe there is a way to statically link these into the
>>>> exe? not sure.
>>>>
>>>>
>>>>
>>>> On Sun, Mar 21, 2010 at 1:36 AM, clemos <[hidden email]> wrote:
>>>>
>>>>>
>>>>> Hello list,
>>>>>
>>>>> I have written a little program in haXe/cpp, and have had errors when
>>>>> trying to run it on another machine:
>>>>> "Error : Could not load module std@file_stdin__0"
>>>>> Installing haXe with the hxcpp through haxelib there solves the  
>>>>> problem;
>>>>> I must either install it globally as root, though, or for each user
>>>>> who wants to execute the program...
>>>>>
>>>>> The problem is, I must run this program on a server on which I don't
>>>>> have admin rights,
>>>>> and I don't really want to have to install haxe + hxcpp over there
>>>>> anyway.
>>>>> Moreover, the program is meant to be executed by apache through a php
>>>>> script, so the user would be the apache user, and I just can't  
>>>>> install
>>>>> haxe + hxcpp for that user...
>>>>>
>>>>> Anyway, I guess it's a kind of bug that haXe/cpp generate programs
>>>>> that require one to install haXe/cpp to be able to execute it, right  
>>>>> ?
>>>>>
>>>>> What can I do to make my program distributable / deployable anywhere  
>>>>> ?
>>>>> Are there special requirements / libs that I should ask my admin to
>>>>> install ?
>>>>>
>>>>> Thanks a lot for the good work anyway :)
>>>>> +++++
>>>>> Clément
>>>>>
>>>>> --
>>>>> haXe - an open source web programming language
>>>>> http://haxe.org
>>>>>
>>>>>
>>>>
>>>> --
>>>> Tony Polinelli
>>>> http://touchmypixel.com
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>>
>>>>
>>>
>>>
>>
>> HI,
>> AFAIK you need to set the library path on linux to make executables find
>> their so's
>> with ldconfig or adding to LD_LIBRARY_PATH environment variable
>>
>> with ldd your_executeable you get a list of dependencies
>> if the names don't match the libs you can add symlinks
>>
>> Hope it helps - long time since I worked on linux...
>>
>> Cordially,
>> Axel
>>
>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>
> --
> haXe - an open source web programming language
> http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haxe/cpp program runtime requirements

clemos
Hi Hugh

Thanks for the info.
Unfortunately, I'm not really good at c++ (I guess that's why I use
haXe/cpp :) ) so Lib.cpp is not that clear to me :).
I have no real idea about how to build "static" versions of .ndlls either.

>From what I understand, neither using LD_LIBRARY_PATH or searching
libraries in the program's path is considered good practice in an Unix
environnement, so...
Maybe distributing the .ndlls together with the program, and requiring
the user to install it in the standard system path (/usr/lib or
/usr/local/lib) is finally the best solution...
Or maybe it's only about writing proper error messages ("Please
install library xxx on your system").

But in the Unix world, people are more used to download sources and
make / make install binaries.
Would it be possible for hxcpp to generate haXe-independant c++
sources and a Makefile for standard distribution ?

But then again, I'm neither a c++ expert nor a linux guru...
I have a useable solution anyway, since I don't want to publicly
distribute my program for the moment, but I guess that's something we
should think about to make hxcpp evolve.

++++++
Clément

On Sun, Mar 21, 2010 at 3:03 PM, Hugh Sanderson <[hidden email]> wrote:

> Hi,
> Unix is spectacularly unhelpful with DLLS if you don't "install" them.
> The logic for finding the DLL is in $HXCPP/src/hx/Lib.cpp.
> You can set the environment variable "HXCPP_LOAD_DEBUG" to see
> what it is trying to do.
>
> First it tries the name without a path - this will work if it finds
> it finds it in the LD_LIBRARY_PATH, but (unlike windows) it will
> not find the dll "next" to the exe.  I think I should explicitly
> fix this.
> Then it tries under $HXCPP, if you have set that variable.
> There is an apache module that lets you set variables, so this may help
> (also may help setting LD_LIBRARY_PATH)
> Then it looks to see if you have a runnable "haxelib", so it can try
> "haxelib path hxcpp", and look for it under there.
> Then it looks if haxelib returns a path for the library name.
>
> You could modify this file yourself, and your change will be compiled
> into your exe.
>
> The static code has really only been tested on the iphone.  You will
> need to build the static versions of the "standard" ndll library files too.
> You can add extra build flags the the system using your own
> ~/.hxcpp_config.xml file,
> which I have not fully documented yet.  There is a small bit in
> http://code.google.com/p/hxcpp/source/browse/trunk/build-tool/BuildCommon.xml
>
>
> Hugh
>
>
>> Hi Axel
>>
>> Thanks, it seems to work by setting LD_LIBRARY_PATH to a dir where I
>> put the .dso files.
>>
>> By the way, it looks like there is a "static" compilation flag, but
>> unfortunately, setting it makes the build process fail:
>> ar: -lpthread: No such file or directory
>> Called from <null> line 1
>> Called from BuildTool.hx line 840
>> Called from BuildTool.hx line 433
>> Called from BuildTool.hx line 456
>> Called from BuildTool.hx line 529
>> Called from BuildTool.hx line 610
>> Called from BuildTool.hx line 238
>> Uncaught exception - Error : 256 - build cancelled
>>
>> Do you have any clue about how to use this flag and if this may
>> "cleanly" solve the issue ?
>> (using LD_LIBRARY_PATH works but is a kind of hack, to me)
>>
>> +++++++
>> Clément
>>
>> On Sat, Mar 20, 2010 at 6:23 PM, Axel Huizinga <[hidden email]> wrote:
>>>
>>> clemos schrieb:
>>>>
>>>> Hi Tony
>>>>
>>>> I forgot to mention I was working on Debian/Linux.
>>>> I tried to copy all .dso files found in hxcpp/bin/Linux/ to my
>>>> program's directory but this didn't work.
>>>> Thanks for trying to help anyway :)
>>>>
>>>> ++++++
>>>> Clément
>>>>
>>>> On Sat, Mar 20, 2010 at 4:09 PM, Tony Polinelli <[hidden email]>
>>>> wrote:
>>>>
>>>>>
>>>>> my guess is that you need to package the dll's from the
>>>>> haxe/lib/hxcpp/binaries/(yourplatform)/  folder with your exe for it
>>>>> to find them. There  is one called std.dll i think - this is probably
>>>>> what its looking for.
>>>>>
>>>>> copy them next to the exe and you shouldnt need to install the rest of
>>>>> hxcpp or haxe. Maybe there is a way to statically link these into the
>>>>> exe? not sure.
>>>>>
>>>>>
>>>>>
>>>>> On Sun, Mar 21, 2010 at 1:36 AM, clemos <[hidden email]> wrote:
>>>>>
>>>>>>
>>>>>> Hello list,
>>>>>>
>>>>>> I have written a little program in haXe/cpp, and have had errors when
>>>>>> trying to run it on another machine:
>>>>>> "Error : Could not load module std@file_stdin__0"
>>>>>> Installing haXe with the hxcpp through haxelib there solves the
>>>>>> problem;
>>>>>> I must either install it globally as root, though, or for each user
>>>>>> who wants to execute the program...
>>>>>>
>>>>>> The problem is, I must run this program on a server on which I don't
>>>>>> have admin rights,
>>>>>> and I don't really want to have to install haxe + hxcpp over there
>>>>>> anyway.
>>>>>> Moreover, the program is meant to be executed by apache through a php
>>>>>> script, so the user would be the apache user, and I just can't install
>>>>>> haxe + hxcpp for that user...
>>>>>>
>>>>>> Anyway, I guess it's a kind of bug that haXe/cpp generate programs
>>>>>> that require one to install haXe/cpp to be able to execute it, right ?
>>>>>>
>>>>>> What can I do to make my program distributable / deployable anywhere ?
>>>>>> Are there special requirements / libs that I should ask my admin to
>>>>>> install ?
>>>>>>
>>>>>> Thanks a lot for the good work anyway :)
>>>>>> +++++
>>>>>> Clément
>>>>>>
>>>>>> --
>>>>>> haXe - an open source web programming language
>>>>>> http://haxe.org
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> Tony Polinelli
>>>>> http://touchmypixel.com
>>>>>
>>>>> --
>>>>> haXe - an open source web programming language
>>>>> http://haxe.org
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> HI,
>>> AFAIK you need to set the library path on linux to make executables find
>>> their so's
>>> with ldconfig or adding to LD_LIBRARY_PATH environment variable
>>>
>>> with ldd your_executeable you get a list of dependencies
>>> if the names don't match the libs you can add symlinks
>>>
>>> Hope it helps - long time since I worked on linux...
>>>
>>> Cordially,
>>> Axel
>>>
>>>
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haxe/cpp program runtime requirements

Benjamin Dasnois
You could use ld.so.conf which is certainly a better way than setting
an env variable.

On Sun, Mar 21, 2010 at 4:32 PM, clemos <[hidden email]> wrote:

> Hi Hugh
>
> Thanks for the info.
> Unfortunately, I'm not really good at c++ (I guess that's why I use
> haXe/cpp :) ) so Lib.cpp is not that clear to me :).
> I have no real idea about how to build "static" versions of .ndlls either.
>
> >From what I understand, neither using LD_LIBRARY_PATH or searching
> libraries in the program's path is considered good practice in an Unix
> environnement, so...
> Maybe distributing the .ndlls together with the program, and requiring
> the user to install it in the standard system path (/usr/lib or
> /usr/local/lib) is finally the best solution...
> Or maybe it's only about writing proper error messages ("Please
> install library xxx on your system").
>
> But in the Unix world, people are more used to download sources and
> make / make install binaries.
> Would it be possible for hxcpp to generate haXe-independant c++
> sources and a Makefile for standard distribution ?
>
> But then again, I'm neither a c++ expert nor a linux guru...
> I have a useable solution anyway, since I don't want to publicly
> distribute my program for the moment, but I guess that's something we
> should think about to make hxcpp evolve.
>
> ++++++
> Clément
>
> On Sun, Mar 21, 2010 at 3:03 PM, Hugh Sanderson <[hidden email]> wrote:
>> Hi,
>> Unix is spectacularly unhelpful with DLLS if you don't "install" them.
>> The logic for finding the DLL is in $HXCPP/src/hx/Lib.cpp.
>> You can set the environment variable "HXCPP_LOAD_DEBUG" to see
>> what it is trying to do.
>>
>> First it tries the name without a path - this will work if it finds
>> it finds it in the LD_LIBRARY_PATH, but (unlike windows) it will
>> not find the dll "next" to the exe.  I think I should explicitly
>> fix this.
>> Then it tries under $HXCPP, if you have set that variable.
>> There is an apache module that lets you set variables, so this may help
>> (also may help setting LD_LIBRARY_PATH)
>> Then it looks to see if you have a runnable "haxelib", so it can try
>> "haxelib path hxcpp", and look for it under there.
>> Then it looks if haxelib returns a path for the library name.
>>
>> You could modify this file yourself, and your change will be compiled
>> into your exe.
>>
>> The static code has really only been tested on the iphone.  You will
>> need to build the static versions of the "standard" ndll library files too.
>> You can add extra build flags the the system using your own
>> ~/.hxcpp_config.xml file,
>> which I have not fully documented yet.  There is a small bit in
>> http://code.google.com/p/hxcpp/source/browse/trunk/build-tool/BuildCommon.xml
>>
>>
>> Hugh
>>
>>
>>> Hi Axel
>>>
>>> Thanks, it seems to work by setting LD_LIBRARY_PATH to a dir where I
>>> put the .dso files.
>>>
>>> By the way, it looks like there is a "static" compilation flag, but
>>> unfortunately, setting it makes the build process fail:
>>> ar: -lpthread: No such file or directory
>>> Called from <null> line 1
>>> Called from BuildTool.hx line 840
>>> Called from BuildTool.hx line 433
>>> Called from BuildTool.hx line 456
>>> Called from BuildTool.hx line 529
>>> Called from BuildTool.hx line 610
>>> Called from BuildTool.hx line 238
>>> Uncaught exception - Error : 256 - build cancelled
>>>
>>> Do you have any clue about how to use this flag and if this may
>>> "cleanly" solve the issue ?
>>> (using LD_LIBRARY_PATH works but is a kind of hack, to me)
>>>
>>> +++++++
>>> Clément
>>>
>>> On Sat, Mar 20, 2010 at 6:23 PM, Axel Huizinga <[hidden email]> wrote:
>>>>
>>>> clemos schrieb:
>>>>>
>>>>> Hi Tony
>>>>>
>>>>> I forgot to mention I was working on Debian/Linux.
>>>>> I tried to copy all .dso files found in hxcpp/bin/Linux/ to my
>>>>> program's directory but this didn't work.
>>>>> Thanks for trying to help anyway :)
>>>>>
>>>>> ++++++
>>>>> Clément
>>>>>
>>>>> On Sat, Mar 20, 2010 at 4:09 PM, Tony Polinelli <[hidden email]>
>>>>> wrote:
>>>>>
>>>>>>
>>>>>> my guess is that you need to package the dll's from the
>>>>>> haxe/lib/hxcpp/binaries/(yourplatform)/  folder with your exe for it
>>>>>> to find them. There  is one called std.dll i think - this is probably
>>>>>> what its looking for.
>>>>>>
>>>>>> copy them next to the exe and you shouldnt need to install the rest of
>>>>>> hxcpp or haxe. Maybe there is a way to statically link these into the
>>>>>> exe? not sure.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sun, Mar 21, 2010 at 1:36 AM, clemos <[hidden email]> wrote:
>>>>>>
>>>>>>>
>>>>>>> Hello list,
>>>>>>>
>>>>>>> I have written a little program in haXe/cpp, and have had errors when
>>>>>>> trying to run it on another machine:
>>>>>>> "Error : Could not load module std@file_stdin__0"
>>>>>>> Installing haXe with the hxcpp through haxelib there solves the
>>>>>>> problem;
>>>>>>> I must either install it globally as root, though, or for each user
>>>>>>> who wants to execute the program...
>>>>>>>
>>>>>>> The problem is, I must run this program on a server on which I don't
>>>>>>> have admin rights,
>>>>>>> and I don't really want to have to install haxe + hxcpp over there
>>>>>>> anyway.
>>>>>>> Moreover, the program is meant to be executed by apache through a php
>>>>>>> script, so the user would be the apache user, and I just can't install
>>>>>>> haxe + hxcpp for that user...
>>>>>>>
>>>>>>> Anyway, I guess it's a kind of bug that haXe/cpp generate programs
>>>>>>> that require one to install haXe/cpp to be able to execute it, right ?
>>>>>>>
>>>>>>> What can I do to make my program distributable / deployable anywhere ?
>>>>>>> Are there special requirements / libs that I should ask my admin to
>>>>>>> install ?
>>>>>>>
>>>>>>> Thanks a lot for the good work anyway :)
>>>>>>> +++++
>>>>>>> Clément
>>>>>>>
>>>>>>> --
>>>>>>> haXe - an open source web programming language
>>>>>>> http://haxe.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Tony Polinelli
>>>>>> http://touchmypixel.com
>>>>>>
>>>>>> --
>>>>>> haXe - an open source web programming language
>>>>>> http://haxe.org
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> HI,
>>>> AFAIK you need to set the library path on linux to make executables find
>>>> their so's
>>>> with ldconfig or adding to LD_LIBRARY_PATH environment variable
>>>>
>>>> with ldd your_executeable you get a list of dependencies
>>>> if the names don't match the libs you can add symlinks
>>>>
>>>> Hope it helps - long time since I worked on linux...
>>>>
>>>> Cordially,
>>>> Axel
>>>>
>>>>
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>>
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>



--
DASNOIS Benjamin
http://www.benjamindasnois.com

--
haXe - an open source web programming language
http://haxe.org