how to use zlib?

66 views
Skip to first unread message

Song Gao

unread,
Jun 19, 2010, 1:11:08 AM6/19/10
to native-cli...@googlegroups.com
Hi~

I read that some popular libraries including zlib have been ported to nativeclient. What do I need to do to use them with the nativecliend-sdk ? I didn't find the 'packages' directory in the SDK tarbal downloaded in HowTo_GetStarted wiki. I noticed that there are some scripts in the svn source code but got errors when running them. Could anyone tell me what should I do to get the ported zlib into use or what artical should I read?

Thanks in advance :-)

Kind regards,
Song Gao

School of Computer Science
China University of Geosciences(Wuhan)

Victor Khimenko

unread,
Jun 19, 2010, 2:34:30 AM6/19/10
to native-cli...@googlegroups.com
On Sat, Jun 19, 2010 at 9:11 AM, Song Gao <song.g...@gmail.com> wrote:
Hi~

I read that some popular libraries including zlib have been ported to nativeclient. What do I need to do to use them with the nativecliend-sdk ?

They are moved in separate project: http://code.google.com/p/naclports/


Then you can pull then from SVN with the following commands:
$ gclient sync

There are some scripts which you can use to build ported packages, but sadly there are not a lot of documentation yet.
 
I didn't find the 'packages' directory in the SDK tarbal downloaded in HowTo_GetStarted wiki.

It's in naclports now...

Song Gao

unread,
Jun 19, 2010, 12:01:28 PM6/19/10
to native-cli...@googlegroups.com
Thanks, Victor.
The naclports project is nice. The zlib works fine on my Ubuntu Lucid amd64.


Kind regards,
Song Gao

School of Computer Science
China University of Geosciences(Wuhan)


--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To post to this group, send email to native-cli...@googlegroups.com.
To unsubscribe from this group, send email to native-client-di...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/native-client-discuss?hl=en.

rajeev mehta

unread,
Sep 28, 2015, 6:30:20 AM9/28/15
to Native-Client-Discuss
Hi, I am also facing same issue. I think my library is install by following above process. But when i include <zlib.h> i am getting file not found error. Also i am not sure about the linking library name. I simply trying with "-lzlib". Please suggest any solution or any mistake i am doing here.
To unsubscribe from this group, send email to native-client-discuss+unsub...@googlegroups.com.

Sam Clegg

unread,
Sep 28, 2015, 1:42:35 PM9/28/15
to native-cli...@googlegroups.com
On Mon, Sep 28, 2015 at 3:30 AM, rajeev mehta <mistr...@gmail.com> wrote:
> Hi, I am also facing same issue. I think my library is install by following
> above process. But when i include <zlib.h> i am getting file not found
> error. Also i am not sure about the linking library name. I simply trying
> with "-lzlib". Please suggest any solution or any mistake i am doing here.

Most likely you build zlib for one particular configuration and you
are trying to build your project in a different configuration.

Can you post the command line you are using to build and the error message?

-lz is the correct way to link zlib once its been installed by naclports.

To build zlib in all configurations run ./make_all.sh zlib.

cheers,
sam
>>> native-client-di...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/native-client-discuss?hl=en.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Native-Client-Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to native-client-di...@googlegroups.com.
> To post to this group, send email to native-cli...@googlegroups.com.
> Visit this group at http://groups.google.com/group/native-client-discuss.
> For more options, visit https://groups.google.com/d/optout.

Andreas Jellinghaus

unread,
Sep 29, 2015, 5:30:52 AM9/29/15
to native-cli...@googlegroups.com
What is the proper way for my own app (e.g. a chrome extension) to include stuff from naclports?
What about extra libraries I build but won't be able to contribute - can I manage them simular to naclports?

LIBS += foo bar
EXTRA_LIB_PATHS += $HOME/some/dir/with/lib

above is my current try, after starting with one of the example code packages from the naclsdk.
It that works for one config with the binary package I unpacked or the compile tree I copied over.

Thus not a deal if I want to use/try/test pnacl only, but if I wanted to check if my extension would work
with all possible setups, it would be nicer to have a make_all.sh like approach, that will compile my
extension with all configs, and always include the dependencies from the proper NACLPORTS path.

Is there something like that? Or a setting like NACLPORTS= and it is already included?

Or has NACLPORTS a copy of the tutorial/example/getting started packages from nacl_sdk, but with
makefiles that help using components from naclports?

Also it might be nice to have a "download_all.sh $package" script that downloads the precompiled
binaries listed in src/lib/prebuild.txt, so the user can use them without compiling. Only useful for those
packages that have content - it seems maybe half of the packages are empty?

Thanks, Andreas

Sam Clegg

unread,
Sep 29, 2015, 8:06:22 PM9/29/15
to native-cli...@googlegroups.com
On Tue, Sep 29, 2015 at 2:30 AM, Andreas Jellinghaus
<and...@ionisiert.de> wrote:
> What is the proper way for my own app (e.g. a chrome extension) to include
> stuff from naclports?

naclports installs directly into the toolchain so you shouldn't need
to do anything special. The headers and libraries should be available
at compile and link time automatically.

> What about extra libraries I build but won't be able to contribute - can I
> manage them simular to naclports?

You could add your ports to a local/private fork of naclports. If
this doesn't work for you would probably want to add a NaCl
configuration to your existing project.

>
> LIBS += foo bar
> EXTRA_LIB_PATHS += $HOME/some/dir/with/lib
>
> above is my current try, after starting with one of the example code
> packages from the naclsdk.
> It that works for one config with the binary package I unpacked or the
> compile tree I copied over.
>
> Thus not a deal if I want to use/try/test pnacl only, but if I wanted to
> check if my extension would work
> with all possible setups, it would be nicer to have a make_all.sh like
> approach, that will compile my
> extension with all configs, and always include the dependencies from the
> proper NACLPORTS path.

If you are using the SDK build system to build and app or extension
you would normally just pick one toolchain to use and stick with it.
There should be no reason to support more than one toolchain at a
given time. If you pick newlib or glibc the build system will build
all three architectures with you type, for example 'make
TOOLCHAIN=newlib'.

>
> Is there something like that? Or a setting like NACLPORTS= and it is already
> included?
>
> Or has NACLPORTS a copy of the tutorial/example/getting started packages
> from nacl_sdk, but with
> makefiles that help using components from naclports?
>
> Also it might be nice to have a "download_all.sh $package" script that
> downloads the precompiled
> binaries listed in src/lib/prebuild.txt, so the user can use them without
> compiling. Only useful for those
> packages that have content - it seems maybe half of the packages are empty?

Support for prebuilt naclports packages has not been well maintained
but the idea is that you should be able to install prebuilt packages
rather than building them locally. The regular 'naclports install'
command should do this if it can find a compatible version in
prebuilt.txt, but prebuilt.txt is very out-of-date at this point.
Reply all
Reply to author
Forward
0 new messages