码迷,mamicode.com
首页 > 其他好文 > 详细

poj2632

时间:2014-05-22 08:57:59      阅读:278      评论:0      收藏:0      [点我收藏+]

标签:jxta   jxtashell   ubuntu   源码   jxta-c   

概述:

因为网络上关于这个JXTA-C源码编译文章较少,所以在此首先写一份编译完整过程,以供网友们参考。

JXTA-C源码所在地址:http://download.java.net/jxta/ 


1、操作系统环境

leekwen@ubuntu:~$ cat /etc/issue
Ubuntu 12.04.4 LTS \n \l

leekwen@ubuntu:~$ file /bin/ls
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x83531f308f1fa18221be53eaf399303400c14638, stripped

2、安装编译JXTA-C源码所需的基本库

leekwen@ubuntu:~$ sudo apt-get install -y libtool automake autoconf libxml2 libxml2-dev libapr1-dev libaprutil1-dev
[sudo] password for leekwen:
Reading package lists... Done
Building dependency tree
Reading state information... Done

3、下载JXTA-C-2.5.2.tar.bz2源码包

leekwen@ubuntu:~$ wget -c http://download.java.net/jxta/jxta-c/2.5.2/jxta-c-2.5.2.tar.bz2


4、测试APR及APU的环境是否安装OK?

leekwen@ubuntu:~$ apr-config --includedir
/usr/include/apr-1.0
leekwen@ubuntu:~$ apu-config --includedir
/usr/include/apr-1.0

leekwen@ubuntu:~$ grep APU_HAVE_DB /usr/include/apr-1.0/apu.h
#define APU_HAVE_DB     1
#if APU_HAVE_DB
#define APU_HAVE_DB_VERSION    5

5、配置JXTA-C源码

leekwen@ubuntu:~$ tar jxvf jxta-c-2.5.2.tar.bz2
leekwen@ubuntu:~$ cd jxta-c-2.5.2
leekwen@ubuntu:~/jxta-c-2.5.2$ ./configure --without-apr --with-dbm=db

如果没有缺少库文件的错误的话,最终会显示出如下的配置:

JXTA has been configured with the following options:
                  Debug enabled : no
                  Compression enabled : yes
                  Decompression enabled : yes
                  Mono support enabled : no
                  libxml2 Path : /usr
                  APR Path :
                  APU Path :
                  sqlite Path : /usr
                  openssl Path : /usr
                  Thread pool availability: jxta/jpr

6、编译JXTA-C源码


leekwen@ubuntu:~/jxta-c-2.5.2$ make -j 2

结果如下:

creating whisp
make[2]: Leaving directory `/home/leekwen/jxta-c-2.5.2/tutorials‘
make[2]: Entering directory `/home/leekwen/jxta-c-2.5.2‘
make[2]: Leaving directory `/home/leekwen/jxta-c-2.5.2‘
make[1]: Leaving directory `/home/leekwen/jxta-c-2.5.2‘


7、运行jxtashell

leekwen@ubuntu:~/jxta-c-2.5.2$ cd shell/
leekwen@ubuntu:~/jxta-c-2.5.2/shell$ ./jxtaShell
Starting logger with selector : *.warning-fatal
[JXTA]-warning-[05/19 00:34:30:863264][TID: 0xb70ba700] - [jxta_tta.c:386] Deprecated API jxta_TCPTransportAdvertisement_set_InterfaceAddress called.
[CM]-error-[05/19 00:34:30:930237][TID: 0xb70ba700] - Failed to load driver file apr_dbd_sqlite3.so
[CM]-error-[05/19 00:34:30:931425][TID: 0xb70ba700] - db_id: 1 -- error creating tables db return 20019
[CM]-error-[05/19 00:34:30:932410][TID: 0xb70ba700] - Failed to open dbd database: .cm/jxta-NetGroup.sqdb with error 20019
[CM]-error-[05/19 00:34:30:933554][TID: 0xb70ba700] - Error processing address spaces -- 120007
Segmentation fault (core dumped)

如果运行jxtashell出现的错误如上的话,请安装JXTASHELL运行所依赖的连接库sqlite的库文件:


leekwen@ubuntu:~/jxta-c-2.5.2/shell$ sudo apt-get install libaprutil1-dbd-sqlite3

安装完毕后,再次执行jxtashell:


leekwen@ubuntu:~/jxta-c-2.5.2/shell$ ./jxtaShell
Starting logger with selector : *.warning-fatal
[JXTA]-warning-[05/19 00:36:40:275230][TID: 0xb70e5700] - [jxta_tta.c:386] Deprecated API jxta_TCPTransportAdvertisement_set_InterfaceAddress called.
[PV]-warning-[05/19 00:36:41:260503][TID: 0xb70e5700] - [jxta_peerview.c:711] Could not find the endpoint service params
[JXTA]-warning-[05/19 00:36:41:261929][TID: 0xb70e5700] - [jxta_endpoint_service.c:1416] Deprecated API jxta_endpoint_service_add_listener called.
[JXTA]-warning-[05/19 00:36:41:309777][TID: 0xb70e5700] - [jxta_endpoint_service.c:1416] Deprecated API jxta_endpoint_service_add_listener called.
=========================================================
========= Welcome to the JXTA-C Shell  Version 2.5.2 ======
=========================================================

The JXTA Shell provides an interactive environment to the JXTA
platform. The Shell provides basic commands to discover peers and
peergroups, to join and resign from peergroups, to create pipes
between peers, and to send pipe messages. The Shell provides environment
variables that permit binding symbolic names to Jxta platform objects.
Environment variables allow Shell commands to exchange data between
themselves. The shell command ‘env‘ displays all defined environment
variables in the current Shell session.

A ‘man‘ command is available to list the commands available.
To exit the Shell, use the ‘exit‘ command.

JXTA>[RELAY]-warning-[05/19 00:36:41:333294][TID: 0xb579eb40] - Not seeded with any valid relay addresses

JXTA>man
For which command do you want help?
        TestApplication
        env
        cat
        whoami
        kdb
        peers
        talk
        join
        groups
        search
        leave
        rdvstatus
        rdvcontrol
        publish
JXTA>exit
Exiting Jxta shell
[HTTP_TRANSPORT]-warning-[05/19 00:36:52:358205][TID: 0xb70e5700] - don‘t know how to stop yet.
[JXTA]-warning-[05/19 00:36:53:441809][TID: 0xb70e5700] - [jxta_endpoint_service.c:1443] Deprecated API jxta_endpoint_service_remove_listener called.
[JXTA]-warning-[05/19 00:36:53:442622][TID: 0xb70e5700] - [jxta_endpoint_service.c:1443] Deprecated API jxta_endpoint_service_remove_listener called.
[SERVICE]-warning-[05/19 00:36:53:443634][TID: 0xb70e5700] - Jxta_service_init is not called??
[SERVICE]-warning-[05/19 00:36:53:443673][TID: 0xb70e5700] - Jxta_service_init is not called??
[SERVICE]-warning-[05/19 00:36:53:443752][TID: 0xb70e5700] - Jxta_service_init is not called??
[SERVICE]-warning-[05/19 00:36:53:443767][TID: 0xb70e5700] - Jxta_service_init is not called??

到此JXTA-C的编译算是完成了!!#转载请注明出处 # leekwen

poj2632,布布扣,bubuko.com

poj2632

标签:jxta   jxtashell   ubuntu   源码   jxta-c   

原文地址:http://blog.csdn.net/stl112514/article/details/26256507

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!