Configure and use ACE notes in Linux

Source: Internet
Author: User

1. Download ace 5.7.
Download the acemo-tao=ciao-5.7.tar.gz package from http://download.dre.vanderbilt.edu.

2. Extract
Copy the compressed package to the Linux directory/data/ace, and decompress it. Tar-zxvf ace?tao=ciao-5.7.tar.gz.
The decompressed directory is/data/ace_wrappers.

3. Configure config. h and platform_macros.gnu.
This is what is written in the official document:
Create a configuration file, $ ace_root/ACE/config. H, that matches des the appropriate platform/compiler-specific header mappings from the ace source directory. For example:
# Include "ACE/config-linux.h"

Create a build configuration file, $ ace_root/include/makeinclude/platform_macros.gnu, that contains the appropriate platform/compiler-specific makefile configurations, e.g .,
Include $ (ace_root)/include/makeinclude/platform_linux.gnu

You can also directly create a soft link in the actual operation:
CD $ ace_root/ace
Ln-s config-linux.h config. h
CD $ (ace_root)/include/makeinclude/
Ln-s platform_linux.gnu platform_macros.gnu

3. Configure
CD ace_wrappers/
Mkdir build
../Configure
Wait a few minutes before configure is complete.

4. Make
In the ace_wrappers/build directory, run $ make
After making, libace. So and libACE-5.7.so can be found in the/data/ACE/ace_wrappers/build/ACE/. libs/directory.

Make is very slow, especially when Ace + Tao + CIAO is combined. Make takes several hours. If Tao and Ciao do not need to be used, download only the ace and save some time.

5. Install
Run # make install in ace_wrappers/build.
After make install, several ace-related folders will be found under/usr/local/include, with the header files required for include.
Find a bunch of ACE-related. So files under/usr/local/lib, including libace. So.

In Linux, the order for the system to search for include files is (This section is excerpted online ):
/Usr/include
/Usr/local/include
/Usr/lib/GCC-lib/i386-linux/2.95.2/include
/Usr/lib/GCC-lib/i386-linux/2.95.2/.../include
/Usr/lib/GCC-lib/i386-linux/2.95.2/.../i386-linux/include
The order of searching lib files is
/Lib
/Usr/lib
The directory where the Lib of ACE is located is/usr/local/lib. Therefore, you must configure environment variables for Lib.

 

6. Configure Environment Variables
Configure. bashrc
~ /. Bashrc:
Ace_root =/home/CS/faculty/Schmidt/ace_wrappers; export ace_root
LD_LIBRARY_PATH = $ ace_root/lib: $ LD_LIBRARY_PATH; export LD_LIBRARY_PATH
After the environment variables are configured, execute the following .~ /. Bashrc
Or log out and log on again.

Configure lD. So. conf
Open/etc/lD. So. conf
The content is as follows:
Include lD. So. conf. d/*. conf
After we add the ace path, it becomes as follows:
Include lD. So. conf. d/*. conf
/Usr/local/lib
Save and exit
Then execute ldconfig

7. Use GCC for testing.
Write a Applet:

Hello. cpp

# Include "ACE/OS. H"
# Include "ACE/log_msg.h"
Int main (INT argc, char * argv [])
{
Ace_debug (lm_debug, "Hello, Ace! "));
Ace_ OS: exit (1 );
Return 0;
}

Compile:
[Root @ linuxvm1 test] # gcc-P-O hello. cpp-I/data/ACE/ace_wrappers-L/data/ACE/test/-l ace-LZ-LM
During compilation,-l should write ace instead of libace. So.
Run:
[Root @ linuxvm1 test] #./Hello
./Hello: Error while loading shared libraries: libACE-5.7.so: cannot open shared object file: no such file or directory
[Root @ linuxvm1 test] # export LD_LIBRARY_PATH =/data/ACE/test
[Root @ linuxvm1 test] #./Hello
Hello, Ace!

8. Test it with kdevelop.
Run the following commands in/data/ACE/ace_wrappers/examples/C ++ npv1: handler, handler, logging_handler.cpp, handler, logging_server.cpp, logging_server.h) and logging_client (handler) add two projects to kdevelop.
Then configure the Lib used: Add/usr/local/lib/libace. So to Project Options> Configure Options> General> linker flags (ldflags.
Then build.
Run #./iteractive_logging_server 9999
Run #./logging_client 9999

Execution successful.

 

 

9. configuration in Eclipse:
Project-> properties-> C/C ++ build-> Settings-> tool settings-> gcc C ++ linker-> Libraries
Libraries (-l) Add: Ace
Add library search path (-l):/usr/local/lib/

10. Create a project on vs2005.
The main purpose is to configure the project properties. For specific configuration, refer to the engineering configuration in the built-in examples.
Open a project and click the configuration above to start the project.

Note: Sometimes the undefined reference to error is reported. It may be that the. So file is not found. For example.
[Root @ linuxvm1 test] # gcc-P-O hello. cpp-I/data/ACE/ace_wrappers-L/data/ACE/test/libace. So-LZ-LM
/Tmp/ccpse7fn. O (. Text + 0x22): In function 'main ':
: Undefined reference to 'ace _ log_msg: last_error_adapter ()'
/Tmp/ccpse7fn. O (. Text + 0x2a): In function 'main ':
: Undefined reference to 'ace _ log_msg: instance ()'
/Tmp/ccpse7fn. O (. Text + 0x44): In function 'main ':
: Undefined reference to 'ace _ log_msg: conditional_set (char const *, Int, Int, INT )'
/Tmp/ccpse7fn. O (. Text + 0x59): In function 'main ':
: Undefined reference to 'ace _ log_msg: log (ace_log_priority, char const *,...)'
/Tmp/ccpse7fn. O (. Text + 0x66): In function 'main ':
: Undefined reference to 'ace _ OS: exit (INT )'
/Tmp/ccpse7fn. O (. eh_frame + 0x11): Undefined reference to '_ gxx_personality_v0'
Collect2: LD returned 1 exit status

Reference URL:
Http://www.dre.vanderbilt.edu /~ Schmidt/doc_root/ACE/The ACE-INSTALL.html # aceinstall
Http://www.cs.wustl.edu /~ Schmidt/ace_wrappers/ACE-INSTALL.html # installpre
Http://wuerping.cnblogs.com/archive/2005/03/24/124498.aspx
Http://www.linuxidc.com/Linux/2009-06/20419.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.