Project

General

Profile

Linux link error build from source (static, boost_1_82_0, wt-4.9.2)

Added by Pedro Vicente over 1 year ago

I am building wt from source (Mac, Windows, Linux) using the 2 scripts below (first one builds boost)

#!/bin/bash

pushd boost_1_82_0

if [[ "$OSTYPE" == "msys" ]]; then

./bootstrap.bat
./b2 --prefix=.  --layout=versioned --toolset=msvc-14.3 address-model=64 architecture=x86 variant=debug threading=multi link=static runtime-link=shared install

elif [[ "$OSTYPE" == "darwin"* ]]; then

./bootstrap.sh
./b2 --prefix=. variant=release 

elif [[ "$OSTYPE" == "linux-gnu"* ]]; then

./bootstrap.sh
./b2 --prefix=. --layout=versioned variant=debug threading=multi link=static runtime-link=shared install 

fi
popd

for Wt


#!/bin/bash
# --http-address=0.0.0.0 --http-port=8080 --deploy-path=/hello --docroot=.
# --http-address=0.0.0.0 --http-port=80 --docroot=.
# /home/pvn/wt_install/lib/Wt/examples/nostro_web/nostro.wt --http-address=0.0.0.0 --http-port=80 --docroot=.

mkdir -p wt-4.9.2/build
pushd wt-4.9.2
pushd build

if [[ "$OSTYPE" == "msys" ]]; then
cmake .. --fresh -DBOOST_PREFIX=N:/nostro_web/boost_1_82_0
sleep 3
elif [[ "$OSTYPE" == "darwin"* ]]; then

#The following directory should be added to compiler include paths:
#/Users/pvn/git/nostro_web/boost_1_82_0

cmake .. -DCMAKE_INSTALL_PREFIX=/Users/pvn/wt_install -DBOOST_PREFIX=/Users/pvn/git/nostro_web/boost_1_82_0
sleep 5
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then

cmake .. -DCMAKE_INSTALL_PREFIX=/home/pvn/wt_install -DBOOST_PREFIX=/home/pvn/git/nostro_web/boost_1_82_0
sleep 5
fi

cmake --build . --parallel 9
sleep 5

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
 make install
fi

popd 
popd 

But on Linux , I get some errors

/usr/bin/ld: ../../src/Wt/Dbo/libwtdbo.a(SqlQueryParse.C.o):(.bss+0x0): multiple definition of `boost::phoenix::placeholders::uarg10'; ../../src/libwt.a(CssParser.C.o):(.bss+0x0): first defined here

I defined a static build on CMakeLists.txt

it seems some inconsistency wit the supplied boost build options

./b2 --prefix=. --layout=versioned variant=debug threading=multi link=static runtime-link=shared install

Any idea of what would be these options?, thanks


Replies (2)

RE: Linux link error build from source (static, boost_1_82_0, wt-4.9.2) - Added by Pedro Vicente over 1 year ago

This is for Ubuntu 20.04.6 LTS

Using for boost

./b2 --prefix=. variant=release

and the default settings (shared library on Linux)

cmake .. -DCMAKE_INSTALL_PREFIX=/home/pvn/wt_install -DBOOST_PREFIX=/home/pvn/git/nostro_web/boost_1_82_0

there is the error when running the server

/home/pvn/wt_install/lib/Wt/examples/hello/hello
/home/pvn/wt_install/lib/Wt/examples/hello/hello.wt: error while loading shared libraries: libboost_program_options.so.1.82.0: cannot open shared object file: No such file or directory

RE: Linux link error build from source (static, boost_1_82_0, wt-4.9.2) - Added by Pedro Vicente over 1 year ago

this can be fixed with

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/my boost lib: my wt install lib

but this should be done inside the CMake script, maybe with

SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,/my boost lib")

but for some reason this does not set the variable

    (1-2/2)