Does Boost BCP also copy the required LIB files? - boost

This may be a no-brainer for longtime boost users, but I’m just getting into boost.
I built the full boost distribution and BCP to extract just the parts I need to put in my VisualStudio C++ project.
What I found is when I call bcp, it copies the source tree to the destination. It doesn’t copy the required compiled lib files though (for those modules that need it).
So when I build my project and include
#include "boost/program_options.hpp"
for example, I get a linker error:
*Error 1 error LNK1104: cannot open file 'libboost_program_options-vc100-mt-sgd-1_54.lib'*
So my question is this:
should BCP also copy over the compiled LIB files as necessary ?
or
is it standard procedure for users of BOOST to manually copy those complied library files themselves?

I recently started experimenting with BCP. It seems like any boost modules that require libraries will not be copied, but instead they need to be built using bjam.
For example, when you run bcp on your code it will output some 'INFO' statements like this:
INFO: tracking source dependencies of library date_time due to presence of BOOST_DATE_TIME_DECL...
INFO: tracking source dependencies of library smart_ptr due to presence of "void sp_scalar_constructor_hook...
Notice that in addition to the generated 'boost' folder containing a bunch of copied boost header files there will be a 'libs' folder along with Jam files (Jamroot, Jamfile.v2, etc).
I think you need to cd to the directories with the Jamfiles and use bjam to build the needed libraries.
Maybe this answer will help:
Building a subset of boost in windows

Related

If the same code is built at different folders using arm-poky-linux-gnueabi-gcc, the resulting binary will have different contents

I have a source code and I am trying to cross compile for armv7 architecture it is getting compiled and generating binary file. When I compile the same code in a different directory then generated binaries are different from the previous one.
Why I am getting this difference?. Not only binary, object file also getting changed.
I am using arm-poky-linux-gnueabi-gcc. The tool chain I am creating using following command "source /opt/fsl-imx-x11/4.1.15.1.1/environment...." etc. Tool chain is exporting compiler setting also (CLFAGS, LDFLAGS) .
This is nothing to do with cross compilation or Yocto, but simply because the binaries will embed the build path, timestamps, and other things that change. If you want binaries that are identical then you'll need to read up on reproducible builds:
https://reproducible-builds.org
https://wiki.yoctoproject.org/wiki/Reproducible_Builds

missing payoffs.hpp and other .hpp from version

When building the Windows C++ version of quantlib 1.9.1, I get this error of missing payoffs.hpp. When I browse to the directories, I see payoffs.cpp, but not payoffs.hpp:
Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: 'ql/instruments/payoffs.hpp': No such file or directory FittedBondCurve c:\users\administrator\google drive\quantlib-1.9.1\ql\cashflows\conundrumpricer.hpp 27
I also get this for #include <ql/instruments/swap.hpp> [and possibly others]. I am able to build the windows quantlib library ok. Just not the examples.
I just checked the QuantLib 1.9.1 release available from the project downloads (did you get your version from there?) and the files you're looking for are contained in the release zip and tarball. Also, it's pretty weird that you could compile the library without them, so I'd double check if they're there. If they really aren't—well, hard to know how they got displaced; anyway, you can download the release again and replace them. If that doesn't fix the problem (or if they're already there after all), it's possible that you have to fix the include path for the example you're trying to compile. Does it include the QuantLib directory?

How to specify custom boost directory to mgiza for moses?

I downloaded mosesdecoder and compiled it successfully. Since there were a few boost errors with difference in versions, I installed boost in custom directory. I'm trying to install mgiza with custom boost install now.
In the moses additional resources page: http://www.statmt.org/moses/?n=Moses.ExternalTools, it says:
Compiling MGIZA requires the Boost library. If your Boost library are in non-system directory, use the script
manual-compile/compile.sh
to compile MGIZA.
But simply running it from the mgiza/mgizapp directory gave a lot of file not found errors. I found out that I had to set the SRC_DIR and BOOST_ROOT directories correctly.
Once I set that, the code
But the initial line of the file, and all the subsequent compile files are saved in the $PWD, where I'm compiling the script from.
So which directory should I compile the script from in order to run moses end-to-end smoothly?
UPDATE: I already answered the question. Thanks
I have found the location from which to compile
manual-compile/compile.sh
It is in the
mgiza/mgizapp/bin/
directory.
mgiza/mgizapp/bin$ ../manual-compile/compile.sh

Visual studio and dlib: "cannot open include file: 'zlib.h': No such file or directory"

For my thesis I want to use Dlib's face_landmark_detection, but I keep running into these errors (for both Visual studio 2013 as well as 2015):
"cannot open include file: 'zlib.h': No such file or directory"
and
"'F77_INT': undeclared identifier".
It repeats itself so I have 36 errors based on these two problems.
My supervisor has given me some steps to follow to set up the project:
add dlib-master and dlib-master\examples to VC++ directories -> include directories
add dlib-master\dlib\external\libjpeg and dlib-master\dlib\entropy_decoder to C/C++ -> General -> Additional include directories
add all folders and items from dlib-master\dlib\external (cblas, libjpeg, libpng and zlib) to the project source folder
add the dlib source file (from dlib-master\dlib\all) and add face_landmark_detection (from dlib-master\examples) to the project source folder.
and according to him this has worked on every other computer so far, but on my laptop it just won't. We checked to project, but zlib.h is in the zlib folder in the project. Does anyone here have an idea on what might be going wrong?
If I didn't give enough info, please ask. I don't know what else might be needed to solve this.
I have just come about this same problem and wanted to post my solution since I have found so much conflicting documentation on the subject.
The folder containing the dlib folder as well as the libpng, libjpeg, and zlib folders from dlib/external need to be added to the additional include directories list in the solution settings.
dlib/all/source.cpp as well as the source files for libpng, libjpeg, and zlib also need to be added to the project.
Note that CBLAS should not be added to the project in any way, because it needs Fortran to compile, and it is very difficult to get this to compile from Visual Studio.
Finally, make sure to add DLIB_PNG_SUPPORT and DLIB_JPEG_SUPPORT as preprocessor defines in the project settings.
I also attempted to use a cmake generated solution, however, for some reason it had trouble with png support.
It is probably easiest to use CMake to configure your project which uses dlib. It avoids setting all those paths manually. During CMake configure step you can disable usage of libraries like zlib which you don't have/want/need. Here is an example CMakeLists.txt which works for me:
cmake_minimum_required(VERSION 2.6)
PROJECT(DatasetClassifier CXX C)
set(dlib_DIR "" CACHE PATH "Path to dlib") # http://dlib.net/
include(${dlib_DIR}/dlib/cmake)
ADD_EXECUTABLE(DatasetClassifier DatasetClassifier.cpp)
TARGET_LINK_LIBRARIES(DatasetClassifier ${dlib_LIBRARIES})

Where is the boost lib subdirectory?

Hi I downloaded the latest boost library (.7z format) yesterday, after unzipping, I found there is no lib subdirectory here, so I cannot find any .lib files, is it the oversight of boost team?
The directory structure I have:
boost_1_51_0
boost
doc
libs
more
status
tools
etc
Most of boost's capabilities are in header only files inside the boost directory. Which means all you need to do is include the boost directory in your project and you're done.
For a few specific libraries you'll need to build your own lib via the instructions on Boost's site.
If you're using Eclipse with CDT (which is harder to configure) there are better instructions here.

Resources