Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exclude several boost libraries from build #202

Closed
smanders opened this issue Jul 19, 2018 · 5 comments
Closed

exclude several boost libraries from build #202

smanders opened this issue Jul 19, 2018 · 5 comments
Assignees
Milestone

Comments

@smanders
Copy link
Owner

boost libraries https://www.boost.org/doc/libs/

  1. atomic - used in Vantage
    • should be removed?

    It implements the interface as defined by the C++11 standard, but makes this feature available for platforms lacking system/compiler support for this particular C++11 feature.

  2. chrono - used in Vantage
  3. container - used in Vantage
  4. context
  5. contract
  6. coroutine/coroutine2
  7. date_time - used in Vantage
  8. exception - used in Vantage
  9. fiber
  10. filesystem - used in Vantage
  11. graph - used in Vantage
  12. graph_parallel
  13. iostreams - used in Vantage
  14. locale
    • currently doesn't build
  15. log - used in mdp
  16. math
    • currently doesn't build with clang
    • math/special_functions - used in Vantage
    • math/constants - used in Vantage
    • math/complex.hpp - used in mdp
  17. mpi
    • currently doesn't build
  18. program_options - used in Vantage
  19. python
  20. random - used in Vantage
  21. regex - used in Vantage
  22. serialization - used in ATT
  23. signals - used in Vantage
  24. stacktrace
  25. system - used in Vantage
  26. test - used in Vantage
  27. thread - used in Vantage
  28. timer - used in Vantage
  29. type_erasure
  30. wave

recommend removing from the default build:

  1. context
  2. contract
  3. coroutine
  4. fiber
  5. graph_parallel
  6. locale (already is)
  7. math (check that nothing requires it)
  8. mpi (already is)
  9. python
  10. serialization (why is ATT using it?)
  11. stacktrace
  12. type_erasure
  13. wave
@smanders
Copy link
Owner Author

serialization... ATT should be using boost/optional.hpp not boost/serialization/optional.hpp (in two places)

smanders pushed a commit that referenced this issue Jul 20, 2018
smanders pushed a commit that referenced this issue Jul 20, 2018
* it was previously removed from build for Linux with Clang
* removed for Linux/Clang on 2015.03.11 with commit message "boost math crashes clang"
* not sure what version of Clang, boost version 1.57.0
* whether or not that is still the case I haven't verified
  * either way: until there is an argument for using boost.math it is disabled from default build, for now

issue #202
@smanders
Copy link
Owner Author

smanders commented Jul 20, 2018

update boost use script

  set(Boost_LIBS # dependency order
    log_setup  # ldd:log,regex
    log        # ldd/cmake:filesystem,thread cmake:log_setup,regex
    ######
    thread     # ldd/cmake:system cmake:atomic,chrono,date_time
    timer      # ldd/cmake:chrono
    ######
    chrono     # ldd/cmake:system
    filesystem # ldd/cmake:system
    graph      # ldd:regex
    iostreams  # cmake:regex
    random     # ldd/cmake:system
    ######
    atomic
    container
    date_time
    exception
    prg_exec_monitor program_options
    regex
    signals
    system
    test_exec_monitor unit_test_framework
    )
  # NOTE: determined boost library dependency order by building boost on linux
  # with link=shared and runtime-link=shared and using ldd
  # cmake dependencies by examining cmake's Modules/FindBoost.cmake

cmake FindBoost.cmake
https://github.com/Kitware/CMake/blob/v3.12.0/Modules/FindBoost.cmake#L828-L844

created a boost.dot

digraph GG {
  node [fontsize=12];
  atomic [shape=diamond];
  chrono [shape=diamond];
  container [shape=diamond];
  date_time [shape=diamond];
  exception [shape=diamond];
  filesystem [shape=diamond];
  grph [label="graph" shape=diamond];
  iostreams [shape=diamond];
  log [shape=diamond];
  log_setup [shape=diamond];
  prg_exec_monitor [shape=diamond];
  program_options [shape=diamond];
  random [shape=diamond];
  regex [shape=diamond];
  signals [shape=diamond];
  system [shape=diamond];
  test_exec_monitor [shape=diamond];
  thread [shape=diamond];
  timer [shape=diamond];
  unit_test_framework [shape=diamond];
  chrono -> system;
  filesystem -> system;
  grph -> regex;
  iostreams -> regex;
  random -> system;
  thread -> atomic;
  thread -> chrono;
  thread -> date_time;
  timer -> chrono;
  log -> filesystem;
  log -> thread;
  log_setup -> log;
  log_setup -> regex;
}

dot -Tpng -oboost.png boost.dot
image

removing libraries without dependencies
image

smanders pushed a commit that referenced this issue Jul 20, 2018
smanders pushed a commit that referenced this issue Jul 20, 2018
fixes last commit
issue #202
@smanders smanders changed the title boost libraries to consider excluding from default build exclude several boost libraries from build Jul 20, 2018
@smanders smanders self-assigned this Jul 20, 2018
@smanders smanders added this to the current milestone Jul 20, 2018
@smanders smanders mentioned this issue Jul 20, 2018
53 tasks
@smanders
Copy link
Owner Author

completed with commits to dev branch referenced above

smanders pushed a commit that referenced this issue Jul 31, 2018
@smanders
Copy link
Owner Author

smanders commented Aug 2, 2018

with a pre-release version of externpro 18.08.1 and with the changes made to the boost use script I'm seeing link errors on every executable that links boost libraries

/opt/extern/externpro-18.08.1-gcc640-64-Linux/lib/libboost_prg_exec_monitor-gcc64-mt-s-1_63.a(cpp_main.o): In function `main':
cpp_main.cpp:(.text.startup+0x8): undefined reference to `cpp_main(int, char**)'
collect2: error: ld returned 1 exit status

since prg_exec_monitor was excluded from Boost_LIBS prior to these changes (see usexp-boost-config.cmake 41e103e), I'm opting to remove it again

it appears the "program execution monitor" is a boost test library (I was only able to find reference to it in old boost docs https://www.boost.org/doc/libs/1_57_0/libs/test/doc/html/prg-exec-monitor.html)

@smanders
Copy link
Owner Author

smanders commented Aug 6, 2018

a project (Vantage) that uses externpro (and boost) builds and links fine on linux with gcc, but fails on Windows with MSVC: LNK1104: cannot open file 'libboost_serialization-vc140-mt-s-1_63.lib'

of course boost serialization was one of the libraries excluded because it didn't appear that Vantage used it (outside of a couple of errant includes in Autotest code) -- this failure is quite early in the build (executables that link Sdimage and it's dependencies - MosaicIntegrationTest and SdimageTest)

searching the boost includes (grep -r "include <boost/serialization") it appears that there are other boost libraries (some header-only) included by Vantage that include serialization headers: graph, bimap, units, geometry, numeric

I'm not how to exactly determine which boost library (or something else?) is causing the linker to require boost serialization, but the way boost uses pragma comment lib to specify library dependencies (usually in a boost serialization header, which would make the library required if anything includes a boost serialization header) it's going to be easier to just include boost serialization in the externpro build of boost again...

smanders pushed a commit that referenced this issue Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant