Opened 5 years ago

Closed 5 years ago

#13003 closed Bugs (worksforme)

boost build lacks <library>/boost//log, <library>/boost//log_setup

Reported by: Trey Van Riper <vanriper.trey@…> Owned by: Vladimir Prus
Milestone: To Be Determined Component: build
Version: Boost 1.64.0 Severity: Problem
Keywords: build log Cc: Andrey.Semashev@…

Description

If you create a Jamfile.jam file such as the following:

import boost ;
boost.use-project ;
exe test : [ glob src/*.cpp ] : <library>/boost//system <library>/boost//thread <library>/boost//log <library>/boost//log_setup

Boost build cannot find the library (presume I've configured Jamroot.jam to point to boost).

I was able to fix this by going to the boost build's src/contrib/boost.jam file, jump to line 216 (within rule boost_std), and add the following two lines:

boost_lib_std log        : BOOST_LOG_DYN_LINK ;
boost_lib_std log_setup  : BOOST_LOG_SETUP_DYN_LINK ;

Change History (6)

comment:1 by Trey Van Riper <vanriper.trey@…>, 5 years ago

Looks like I should have used BOOST_LOG_DYN_LINK instead of BOOST_LOG_SETUP_DYN_LINK, if I'm reading documentation correctly. It worked for me because I am statically linking, I assume.

comment:2 by Andrey Semashev, 5 years ago

Cc: Andrey.Semashev@… added
Component: logbuild
Owner: changed from Andrey Semashev to Vladimir Prus

tools/build/src/contrib/boost.jam is part of Boost.Build, so I'm reassigning the ticket. I'm not sure what that file contains.

BOOST_LOG_DYN_LINK and BOOST_LOG_SETUP_DYN_LINK control how Boost.Log (the two built libraries it consists of) is linked. If the macro is defined, the corresponding library is linked as a shared object (.so or .dll), otherwise as a static library. If you're linking statically, you should not define either of these macros.

comment:3 by anonymous, 5 years ago

An interesting question comes to mind... how does a new boost library add its lib to this file?

comment:4 by Andrey Semashev, 5 years ago

BTW, I can see those boost_lib_std lines are already present in the file in lines 217-218 in 1.64, current master and develop. So maybe this ticket should be closed.

comment:5 by vanriper.trey@…, 5 years ago

Hrm, perhaps I picked up a different branch or something. I've found other problems, so perhaps I need to pull again.

comment:6 by Andrey Semashev, 5 years ago

Resolution: worksforme
Status: newclosed

I'm closing the ticket as the requested lines are already present.

Note: See TracTickets for help on using tickets.