conda-forge / boost-feedstock

A conda-smithy repository for boost.
BSD 3-Clause "New" or "Revised" License
15 stars 41 forks source link

Missing static libraries? #159

Open gregdenay opened 1 year ago

gregdenay commented 1 year ago

Comment:

I am trying to update a bioconda recipe for a package requiring the BOOST static libraries to build (SKESA). However, it seems that the static libraries are missing from the /lib folder of the conda environment.

On debian 10:

 mamba create -n boost boost zlib

~/anaconda3/envs/boost/include/boost/ exists ~/anaconda3/envs/boost/lib contains the libboost_xxx.so files but no libboost_xxx.a file.

Looking at the recipe here it seems like the static libraries should be installed. I am a bit confused with the otrher stock (boost-cpp) for which the static libraries are not installed. The mamba log lists both packages:

                  __    __    __    __
                 /  \  /  \  /  \  /  \
                /    \/    \/    \/    \
███████████████/  /██/  /██/  /██/  /████████████████████████
              /  / \   / \   / \   / \  \____
             /  /   \_/   \_/   \_/   \    o \__,
            / _/                       \_____/  `
            |/
        ███╗   ███╗ █████╗ ███╗   ███╗██████╗  █████╗
        ████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗
        ██╔████╔██║███████║██╔████╔██║██████╔╝███████║
        ██║╚██╔╝██║██╔══██║██║╚██╔╝██║██╔══██╗██╔══██║
        ██║ ╚═╝ ██║██║  ██║██║ ╚═╝ ██║██████╔╝██║  ██║
        ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝╚═════╝ ╚═╝  ╚═╝

        mamba (1.0.0) supported by @QuantStack

        GitHub:  https://github.com/mamba-org/mamba
        Twitter: https://twitter.com/QuantStack

█████████████████████████████████████████████████████████████

Looking for: ['boost', 'zlib']

pkgs/main/linux-64                                            No change
bioconda/linux-64                                             No change
bioconda/noarch                                               No change
r/linux-64                                                    No change
pkgs/main/noarch                                              No change
pkgs/r/linux-64                                               No change
pkgs/r/noarch                                                 No change
r/noarch                                                      No change
conda-forge/noarch                                  10.7MB @   2.8MB/s  4.1s
conda-forge/linux-64                                28.7MB @   5.1MB/s  6.6s
Transaction

  Prefix: /home/debian/anaconda3/envs/boost

  Updating specs:

   - boost
   - zlib

  Package               Version  Build                Channel                    Size
───────────────────────────────────────────────────────────────────────────────────────
  Install:
───────────────────────────────────────────────────────────────────────────────────────

  + _libgcc_mutex           0.1  conda_forge          conda-forge/linux-64     Cached
  + _openmp_mutex           4.5  2_gnu                conda-forge/linux-64     Cached
  + boost                1.80.0  py311h59ea3da_4      conda-forge/linux-64     Cached
  + boost-cpp            1.80.0  h75c5d50_0           conda-forge/linux-64     Cached
  + bzip2                 1.0.8  h7f98852_4           conda-forge/linux-64     Cached
  + ca-certificates   2022.12.7  ha878542_0           conda-forge/linux-64     Cached
  + icu                    70.1  h27087fc_0           conda-forge/linux-64     Cached
  + ld_impl_linux-64       2.39  hcc3a1bd_1           conda-forge/linux-64     Cached
  + libblas               3.9.0  16_linux64_openblas  conda-forge/linux-64     Cached
  + libcblas              3.9.0  16_linux64_openblas  conda-forge/linux-64     Cached
  + libffi                3.4.2  h7f98852_5           conda-forge/linux-64     Cached
  + libgcc-ng            12.2.0  h65d4601_19          conda-forge/linux-64     Cached
  + libgfortran-ng       12.2.0  h69a702a_19          conda-forge/linux-64     Cached
  + libgfortran5         12.2.0  h337968e_19          conda-forge/linux-64     Cached
  + libgomp              12.2.0  h65d4601_19          conda-forge/linux-64     Cached
  + liblapack             3.9.0  16_linux64_openblas  conda-forge/linux-64     Cached
  + libnsl                2.0.0  h7f98852_0           conda-forge/linux-64     Cached
  + libopenblas          0.3.21  pthreads_h78a6416_3  conda-forge/linux-64     Cached
  + libsqlite            3.40.0  h753d276_0           conda-forge/linux-64     Cached
  + libstdcxx-ng         12.2.0  h46fd767_19          conda-forge/linux-64     Cached
  + libuuid              2.32.1  h7f98852_1000        conda-forge/linux-64     Cached
  + libzlib              1.2.13  h166bdaf_4           conda-forge/linux-64     Cached
  + ncurses                 6.3  h27087fc_1           conda-forge/linux-64     Cached
  + numpy                1.24.0  py311hbde0eaa_0      conda-forge/linux-64     Cached
  + openssl               3.0.7  h0b41bf4_1           conda-forge/linux-64     Cached
  + pip                  22.3.1  pyhd8ed1ab_0         conda-forge/noarch       Cached
  + python               3.11.0  ha86cf86_0_cpython   conda-forge/linux-64     Cached
  + python_abi             3.11  3_cp311              conda-forge/linux-64     Cached
  + readline                8.2  h5eee18b_0           pkgs/main/linux-64       Cached
  + setuptools           65.6.3  pyhd8ed1ab_0         conda-forge/noarch       Cached
  + tk                   8.6.12  h27826a3_0           conda-forge/linux-64     Cached
  + tzdata                2022g  h191b570_0           conda-forge/noarch       Cached
  + wheel                0.38.4  pyhd8ed1ab_0         conda-forge/noarch       Cached
  + xz                    5.2.8  h5eee18b_0           pkgs/main/linux-64       Cached
  + zlib                 1.2.13  h166bdaf_4           conda-forge/linux-64     Cached
  + zstd                  1.5.2  h6239696_4           conda-forge/linux-64     Cached

  Summary:

  Install: 36 packages

  Total download: 0 B

───────────────────────────────────────────────────────────────────────────────────────

Confirm changes: [Y/n] Y
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

To activate this environment, use

     $ mamba activate boost

To deactivate an active environment, use

     $ mamba deactivate

What am I missing?

bryanloz-xilinx commented 3 months ago

@beckermr

When you have time, can you please confirm if this is true?

Is libboost-devel missing static libraries after the unification?

My conda build in windows is failing, because the consumer is trying to force static libraries

set(Boost_USE_STATIC_LIBS ON)

I think I remember hearing that static libraries are frowned upon in conda-forge ethos.

h-vetinari commented 3 months ago

We have not been shipping static libraries since almost 4 years (https://github.com/conda-forge/boost-cpp-feedstock/commit/dc9517a23d2eb782f5006ee177c77247a0a9b041), so this is unrelated to the unification.

It's true that conda-forge generally tries to avoid static libraries, but exceptions do exist (where there is a strong case to be made for their necessity), and we have a few packages where we provide both shared & static libraries (in separate outputs). Boost could become one of them, i.e. with a libboost-static depending on libboost-devel c.f. also https://github.com/conda-forge/boost-cpp-feedstock/pull/151.

Feel free to make that case and/or try your hand at a PR!

PS. It's very likely worth a shot to patch out set(Boost_USE_STATIC_LIBS ON) in the consuming project - this should work fine.

wilderfield commented 3 months ago

We have not been shipping static libraries since almost 4 years (conda-forge/boost-cpp-feedstock@dc9517a), so this is unrelated to the unification.

It's true that conda-forge generally tries to avoid static libraries, but exceptions do exist (where there is a strong case to be made for their necessity), and we have a few packages where we provide both shared & static libraries (in separate outputs). Boost could become one of them, i.e. with a libboost-static depending on libboost-devel c.f. also conda-forge/boost-cpp-feedstock#151.

Feel free to make that case and/or try your hand at a PR!

PS. It's very likely worth a shot to patch out set(Boost_USE_STATIC_LIBS ON) in the consuming project - this should work fine.

Thank you very much @h-vetinari for your feedback.

I got it patched soon after posting this. :-).

I'll need to reach out to the project owners to ask why they want to force static boost. I have a feeling the answer is that they want to minimize the number of dependencies and libraries that their customers see, and they don't have conda as part of their production flow / customer usage.

In my view, there is no reason for them to hardcode it this way, they can use a cmake option with a default of static for their production flow, but allow conda users to do -DBoost_USE_STATIC_LIBS=OFF

https://github.com/Xilinx/XRT/blob/72a11a748794e6afb2649b46a82367446b94d9c7/src/CMake/nativeWin.cmake#L32