kurulum etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
kurulum etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

16 Ekim 2017 Pazartesi

boost kurulum

bootsrap komutu
bootstrap komutu yazısına taşıdım.

bjam komutu
Python'dan C++ kodu çağırmak için kullanılır. Açıklaması şöyle
Before anything else, you should have the bjam executable in your boost directory or somewhere in your path such that bjam can be executed in the command line. Pre-built Boost.Jam executables are available for most platforms. The complete list of Bjam executables can be found here.
b2 komutu
b2 komutu yazısına taşıdım.

apt-get komutu
Şöyle yaparız.
sudo apt-get install libboost-all-dev
Şöyle yaparız. İkisi arasındaki farkı bilmiyorum.
sudo apt-get install libboost-dev
Şu dizine kurulur.
/usr/include/boost
/usr/include ve /usr/local/include arasındaki farkın açıklaması şöyle
The boost deb package installs the headers into /usr/include/boost. Since /usr/include is in the gcc header search, no extra work is required.

If you want to replicate that behavior, I suggest you instruct boost to install into /usr/local/include/boost.

The /usr/local directories are dedicated to installation of locally compiled libraries, so it is a better path than /usr/include, where the deb installs. This also avoids collisions. Better yet, it is in gcc's default search path for header files.
Bir başka açıklama şöyle
For example, many source code build systems use /usr/local as the default install location. If you just run ./configure && make && make install, it will dump everything to /usr/local/bin and such.
Kurulumdan sonra Linux'ta LD_LIBRARY_PATH değiştirilir.

Tek bir kütüphane için şöyle yaparız.
sudo apt-get install libboost-atomic-dev
Tek bir kütüphane için şöyle yaparız.
sudo apt-get install libboost-thread-dev
Kaldırmak için şöyle yaparız
sudo apt-get remove 'libboost-.*'
Ya da şöyle yaparız
sudo apt-get remove 'libboost-.*-dev'

28 Temmuz 2017 Cuma

b2 komutu

Giriş
Bu komut bir şekilde boost-build.jam dosyasındaki ayarları kullanıyor.
a seçeneği
Şöyle yaparız.
./b2 -a macosx-version-min=10.7 install 
address-model seçeneği
Şöyle yaparız.
b2 address-model=32 --build-type=minimal stage --stagedir stage
b2 address-model=64 --build-type=minimal stage --stagedir stage64
architecture seçeneği
Şöyle yaparız.
b2 toolset=msvc-14.0 address-model=64 architecture=x86 link=static
  threading=multi runtime-link=shared --build-type=minimal stage
  --stagedir=stage/x64
buildtype seçeneği
complete,minimal gibi seçenekler alabilir.
Örnek - complete
Şöyle yaparız.
b2 --toolset=msvc-14.0 --build-type=complete architecture=x86 address-model=64
  stage 
Örnek - minimal
Şöyle yaparız.
b2 toolset=msvc-14.0 address-model=64 architecture=x86 link=static
  threading=multi runtime-link=shared --build-type=minimal stage
  --stagedir=stage/x64
Örnek - minimal
Şöyle yaparız.
b2 -j8 toolset=msvc-15.0 address-model=64 architecture=x86 link=shared
threading=multi runtime-link=shared --with-thread --build-type=minimal stage
cxxflags seçeneği
Şöyle yaparız.
b2 toolset=gcc cxxflags="-std=c++11" $* > build.log
headers seçeneği
Modular boost kuruyorsak şöyle yaparız.
./bootstrap.sh
./b2 headers
install seçeneği
--prefix ile kurulumun yapılmasını istediğimiz dizini belirtiriz. Şöyle yaparız.
b2 toolset=gcc install --prefix=/home/user/boost
Şöyle yaparız.
b2 -j8 toolset=msvc-14.0 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=C:\Boost\x64 install
-j seçeneği
Şöyle yaparız.
b2 -j8 toolset=msvc-14.0 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/x64
Şöyle yaparız.
./b2 -j5 link=static
layout seçeneği
Açıklaması şöyle, versioned, tagged, system seçenekleri var.
#   --layout=<layout>       Determines whether to choose library names
#                           and header locations such that multiple
#                           versions of Boost or multiple compilers can
#                           be used on the same system.
#
#                               versioned - Names of boost binaries
#                               include the Boost version number, name and
#                               version of the compiler and encoded build
#                               properties.  Boost headers are installed in a
#                               subdirectory of <HDRDIR> whose name contains
#                               the Boost version number.
#
#                               tagged -- Names of boost binaries include the
#                               encoded build properties such as variant and
#                               threading, but do not including compiler name
#                               and version, or Boost version. This option is
#                               useful if you build several variants of Boost,
#                               using the same compiler.
#
#                               system - Binaries names do not include the
#                               Boost version number or the name and version
#                               number of the compiler.  Boost headers are
#                               installed directly into <HDRDIR>.  This option
#                               is intended for system integrators who are
#                               building distribution packages.
#
#                           The default value is 'versioned' on Windows, and
#                           'system' on Unix.
tagged
Çıktının -mt.so olmasını sağlar.
Örnek
Şöyle yaparız.
./b2 --layout=tagged --with-timer variant=release link=static
Çıktı kütüphanelerinin şöyle olmasını sağlar.
libboost_chrono-mt.lib
Örnek
Şöyle yaparız.
./b2 --without-mpi --without-python --without-iostreams
--layout=tagged threading=multi link=shared runtime-link=shared
link=static install
Çıktı olarak şunu alırız
libboost_regex.a
libboost_regex-mt.a
libboost_regex-mt.so@
libboost_regex-mt.so.1.63.0*
libboost_regex.so@
libboost_regex.so.1.63.0*
system
Çıktı kütüphanesinin şöyle olmasını sağlar.
libboost_log.dll
versioned
Şöyle yaparız.
b2 --build-dir=build toolset=msvc-12.0 address-model=64 threading=single
link=shared,static variant=debug,release -j 12 --layout=versioned --stagedir=msvc
Çıktı kütüphanelerin şöyle olmasını sağlar. Dosya ismine vc120 gibi ekler.
boost_date_time-vc120-mt-gd-1_62.dll
ABI seçeneklerinin açıklaması şöyle
s – linking statically to the C++ standard library and compiler runtime support libraries.
g – using debug versions of the standard and runtime support libraries.
y – using a special debug build of Python.
d – building a debug version of your code.
p – using the STLPort standard library rather than the default one supplied with your compiler.
Şu dosyadaki gd debug version anlamına gelir.
libboost_chrono-vc140-mt-gd-1_62.lib
Release kodunda şu dosyayı kullanırız.
libboost_chrono-vc140-mt-1_62.lib
link seçeneği
static,shared seçenekleri kullanılabilir.
Sadece static (.a) uzantısına sahip kütüphaneler için şöyle yaparız.
b2 toolset=msvc-14.0 link=static --build-type=complete architecture=x86 -j8
Dinamik (.so) ve static (.a) uzantısına sahip kütüphaneler için şöyle yaparız.
b2 link=static,shared <other_flags>
reconfigure seçeneği
Eğer bzip2 gibi bir kütüphane sonradan kurulduysa şöyle yaparız.
b2 --reconfigure
runtime-link seçeneği
Şöyle yaparız.
b2 toolset=msvc-14.0 address-model=64 architecture=x86 link=static
  threading=multi runtime-link=shared --build-type=minimal stage
  --stagedir=stage/x64
--show-libraries
Şöyle yaparız.
./b2 --show-libraries
  - atomic
  - chrono
  - container
  - context
  - coroutine
  - coroutine2
  - date_time
  - exception
  - fiber
  - filesystem
  - graph
  - graph_parallel
  - iostreams
  - locale
  - log
  - math
  - metaparse
  - mpi
  - program_options
  - python
  - random
  - regex
  - serialization
  - signals
  - system
  - test
  - thread
  - timer
  - type_erasure
  - wave
stage
Şöyle yaparız
--stagedir=stage\x64-static-python35 stage
stagedir seçeneği
Şöyle yaparız.
b2 toolset=msvc-14.0 address-model=64 architecture=x86 link=static
  threading=multi runtime-link=shared --build-type=minimal stage
  --stagedir=stage/x64
threading seçeneği
single,multi seçenekleri kullanılabilir.

Şöyle yaparız.
b2 toolset=msvc-14.0 address-model=64 architecture=x86 link=static
  threading=multi runtime-link=shared --build-type=minimal stage
  --stagedir=stage/x64
Şöyle yaparız.
b2 link=static,shared threading=single,multi
toolset seçeneği
clang,gcc,gcc-arm, msvc-14.0 gibi seçenekler kullanılabilir.

Şöyle yaparız.
b2 toolset=gcc-arm target-os=linux link=static runtime-link=dynamic
threading=multi --build-type=complete --build-dir=boost-build --stage-dir=stage
--debug-configuration --debug-building --debug-generator
Şöyle yaparız.
b2 --build-type=minimal --layout=system toolset=clang variant=release
link=shared threading=multi runtime-link=shared stage
Şöyle yaparız.
b2 --toolset=gcc-4.9 stage
Şöyle yaparız.
b2 toolset=gcc cxxflags=-std=c++1y -a
Şöyle yaparız.
b2 --toolset=msvc-14.0 
variant seçeneği
Sadece release için şöyle yaparız.
b2.exe ... variant=release
Debug ve releasse için şöyle yaparız.
b2 -j8 --build-dir=build               toolset=msvc-14.0 variant=debug,release
link=shared threading=multi runtime-link=shared                  stage
b2 -j8 --build-dir=build --buildid=x64 toolset=msvc-14.0 variant=debug,release
link=shared threading=multi runtime-link=shared address-model=64 stage
--with-<library> seçeneği
 Sadece belli kütüphaneleri derlemek için -with-<library> komutu çalıştırılır.
Örnek
exception kütüphanesini derlemek için şöyle yaparız.
b2 link=shared runtime-link=shared --with-exception
Örnek
filesystem icin --with-filesystem yaparız

Örnek
iostreams kütüphanesini derlemek için şöyle yaparız
b2 --with-iostreams
Örnek
Bzip ve Zlib kütüphanelerini belirtmek için şöyle yaparız.
b2 --with-iostreams -s BZIP2_SOURCE=/opt/bzip2 -s ZLIB_SOURCE=/opt/zlib

Örnek
python kütüphanesi için şöyle yaparız.
b2 --with-python python-debugging=off threading=multi variant=debug
Şöyle yaparız.
.\b2 --prefix=c:\boost --build-dir=boost_build --layout=versioned
  toolset=msvc-14.1 address-model=64 -j4 --with-python -a --reconfigure
  --stage-dir=stage --build-type=complete --debug-configuration -d2 stage
>build.log 2>&1
Örnek
system için şöyle yaparız.
./b2 install --with-system --with-python
Örnek
timer için şöyle yaparız.
./b2 --with-timer variant=release link=static
Örnek
thread kütüphanesi için şöyle yaparız.
b2.exe --with-thread --build-type=complete toolset=msvc-12.0 architecture=x86
 address -model=64 stage
--without-<library> seçeneği
Şöyle yaparız.
--without-python