boost

install par SFE

nemo-henry% pkgchk -v SFEboost
NOTE: Couldn't lock the package database.
/usr/lib
/usr/lib/libboost_date_time-mt.so
/usr/lib/libboost_date_time-mt.so.1.34.1
/usr/lib/libboost_date_time.so
/usr/lib/libboost_date_time.so.1.34.1
/usr/lib/libboost_filesystem-mt.so
/usr/lib/libboost_filesystem-mt.so.1.34.1
/usr/lib/libboost_filesystem.so
/usr/lib/libboost_filesystem.so.1.34.1
/usr/lib/libboost_graph-mt.so
/usr/lib/libboost_graph-mt.so.1.34.1
/usr/lib/libboost_graph.so
/usr/lib/libboost_graph.so.1.34.1
/usr/lib/libboost_iostreams-mt.so
/usr/lib/libboost_iostreams-mt.so.1.34.1
/usr/lib/libboost_iostreams.so
/usr/lib/libboost_iostreams.so.1.34.1
/usr/lib/libboost_prg_exec_monitor-mt.so
/usr/lib/libboost_prg_exec_monitor-mt.so.1.34.1
/usr/lib/libboost_prg_exec_monitor.so
/usr/lib/libboost_prg_exec_monitor.so.1.34.1
/usr/lib/libboost_program_options-mt.so
/usr/lib/libboost_program_options-mt.so.1.34.1
/usr/lib/libboost_program_options.so
/usr/lib/libboost_program_options.so.1.34.1
/usr/lib/libboost_python-mt.so
/usr/lib/libboost_python-mt.so.1.34.1
/usr/lib/libboost_python.so
/usr/lib/libboost_python.so.1.34.1
/usr/lib/libboost_regex-mt.so
/usr/lib/libboost_regex-mt.so.1.34.1
/usr/lib/libboost_regex.so
/usr/lib/libboost_regex.so.1.34.1
/usr/lib/libboost_serialization-mt.so
/usr/lib/libboost_serialization-mt.so.1.34.1
/usr/lib/libboost_serialization.so
/usr/lib/libboost_serialization.so.1.34.1
/usr/lib/libboost_signals-mt.so
/usr/lib/libboost_signals-mt.so.1.34.1
/usr/lib/libboost_signals.so
/usr/lib/libboost_signals.so.1.34.1
/usr/lib/libboost_thread-mt.so
/usr/lib/libboost_thread-mt.so.1.34.1
/usr/lib/libboost_unit_test_framework-mt.so
/usr/lib/libboost_unit_test_framework-mt.so.1.34.1
/usr/lib/libboost_unit_test_framework.so
/usr/lib/libboost_unit_test_framework.so.1.34.1
/usr/lib/libboost_wave-mt.so
/usr/lib/libboost_wave-mt.so.1.34.1
/usr/lib/libboost_wave.so
/usr/lib/libboost_wave.so.1.34.1
/usr/lib/libboost_wserialization-mt.so
/usr/lib/libboost_wserialization-mt.so.1.34.1
/usr/lib/libboost_wserialization.so
/usr/lib/libboost_wserialization.so.1.34.1

Compilation

archive boost_1_34_1 dans /local/apps/src
en s'inspirant de cette page:

> module load ss12
> setenv PATH ${PATH}:/usr/ccs/bin (à cause de ld)
> setenv BOOST_JAM_TOOLSET_ROOT /opt/studio12/SUNWspro/
> cd tools/jam/src/
> ./build.sh sunpro | & tee BUILD.LOG

Pas sur qu'il faille faire la ligne suivante?:

     ln -s bin.solaris bin # to run regression tests later

Pour avoir bjam dans le PATH:

> setenv PATH /local/apps/src/boost_1_34_1/tools/jam/src/bin.solaris:${PATH}
> bjam -sTOOLS=sunpro -j2 -d2 stage|& tee BJAM.LOG
Building Boost.Regex with the optional Unicode/ICU support disabled.
Please refer to the Boost.Regex documentation for more information
(don't panic: this is a strictly optional feature).
###
### No toolset specified. Please use --toolset option.
###
### Known toolsets are: acc, borland, cc, como, darwin, gcc, gcc-nocygwin, intel-linux, intel-win32, kcc, kylix, metrowerks, mingw, mipspro, msvc, qcc, sunpro, tru64cxx, vacpp, vc7, vc8, vmsdecc
###

il y a donc des options qui ont changées… voir

bjam --toolset=sun stdlib=sun-stlport -j2 -d2 stage | & tee BJAM.LOG

environ 2 heures de compil!

avec l'exemple donné sur le site de boost:

nemo-henry% CC -I /local/apps/src/boost_1_34_1 example2.cpp -o example2 -library=stlport4 -R /local/apps/src/boost_1_34_1/stage/lib -L /local/apps/src/boost_1_34_1/stage/lib -lboost_regex-sw-mt-d

:!: Ne pas oublier -library=stlport4 puis:

nemo-henry% ldd example2
  libboost_regex-sw-mt-d-1_34_1.so.1.34.1 =>     /local/apps/src/boost_1_34_1/stage/lib/libboost_regex-sw-mt-d-1_34_1.so.1.34.1
  libstlport.so.1 =>  /opt/studio12/SUNWspro/lib/stlport4/libstlport.so.1
  librt.so.1 =>  /lib/librt.so.1
  libCrun.so.1 =>  /usr/lib/libCrun.so.1
  libm.so.2 =>   /lib/libm.so.2
  libc.so.1 =>   /lib/libc.so.1
  libm.so.1 =>   /lib/libm.so.1
  libaio.so.1 =>  /lib/libaio.so.1
  libmd.so.1 =>  /lib/libmd.so.1

nemo-henry% ./example2 < jayne.txt                                              
Will Success Spoil Rock Hunter?
> pwd
/local/apps/src/gnu/boost_1_34_1
> setenv PATH /usr/bin:/usr/sfw/bin:/opt/csw/gnu:/usr/local/wrapper/bin:.
> ./configure --prefix=/local/apps/gnu/32/boost_1_34_1
> vi user-config.jam
> make install | & tee INSTALL.LOG

Ensuite, on teste l'exemple:

nemo-henry% g++ -I/local/apps/gnu/32/boost_1_34_1/include/boost-1_34_1 example2.cpp -g -o example2 /local/apps/gnu/32/boost_1_34_1/lib/libboost_regex-gcc34-mt-d-1_34_1.a
nemo-henry% ./example2 < jayne.txt                                              
Will Success Spoil Rock Hunter?

Dans le INSTALL.LOG, on voit que certaines cibles ne sont pas compilées:

...failed updating 176 targets...
...skipped 32 targets...
...updated 5600 targets...
Not all Boost libraries built properly.

par exemple:

gcc.compile.c++ bin.v2/libs/python/build/gcc-3.4.3/debug/threading-multi/numeric
.o
In file included from ./boost/python/object/make_instance.hpp:9,
                 from ./boost/python/object/make_ptr_instance.hpp:8,
                 from ./boost/python/to_python_indirect.hpp:11,
                 from ./boost/python/converter/arg_to_python.hpp:10,
                 from ./boost/python/call.hpp:15,
                 from ./boost/python/object_core.hpp:12,
                 from ./boost/python/object.hpp:9,
                 from ./boost/python/tuple.hpp:10,
                 from ./boost/python/numeric.hpp:10,
                 from libs/python/src/numeric.cpp:6:
./boost/python/object/instance.hpp:44: error: a casts to a type other than an integral or enumeration type cannot appear in a constant-expression
./boost/python/object/instance.hpp:44: error: '->' cannot appear in a constant-expression
./boost/python/object/instance.hpp:44: error: `&' cannot appear in a constant-expression

FIXME le problème vient de python, ou de la version du compilateur?

boost 1_35_0

> setenv PATH /opt/csw/gcc4/bin:/opt/csw/gnu:/usr/local/wrapper/bin:/usr/bin:.
> ./configure --prefix=/local/apps/gnu/32/boost_1_35_0                          -n Building Boost.Jam with toolset gcc... 
tools/jam/src/bin.solarisx86/bjam
-n Detecting Python version... 
2.5
-n Detecting Python root... 
/opt/csw
-n Unicode/ICU support for Boost.Regex?... 
/usr
Backing up existing Boost.Build configuration in user-config.jam.2
Generating Boost.Build configuration in user-config.jam...
Generating Makefile...
> 
> make install | & tee INSTALL.LOG
...
...failed updating 35 targets...
...skipped 36 targets...
...updated 5779 targets...
Not all Boost libraries built properly.

cette fois ci, les erreurs sont de la forme:

gcc.link.dll bin.v2/libs/serialization/build/gcc-4.0.2/release/threading-multi/libboost_serialization-gcc40-mt-1_35.so.1.35.0
ld: fatal: relocation error: file: bin.v2/libs/serialization/build/gcc-4.0.2/release/threading-multi/xml_grammar.o section: .rel.eh_frame symbol: .LFB2185: symbol has been discarded with discarded section: .gnu.linkonce.t._ZN5boost6detail15sp_counted_base7destroyEv
collect2: ld returned 1 exit status

mais comme l'erreur concerne aussi libboost_regex-gcc40-mt-1_35.so.1.35.0, on ne peut pas tester l'exemple!

  • boost.txt
  • Dernière modification : 2017/08/25 09:56
  • de 127.0.0.1