bcgsc / btllib

Bioinformatics Technology Lab common code library
Other
23 stars 5 forks source link

btllib 1.7.2 build failure on macos #123

Closed chenrui333 closed 2 months ago

chenrui333 commented 3 months ago

👋 while trying to build btllib 1.7.2 for abyss update, I ran into some gcc build failure as below:

  [45/55] Compiling C++ object recipes/mi_bf_generate.p/_private_tmp_abyss-20240720-12738-82pg3b_abyss-2.3.8_btllib_recipes_mi_bloom_filter.cpp.o
  FAILED: recipes/mi_bf_generate.p/_private_tmp_abyss-20240720-12738-82pg3b_abyss-2.3.8_btllib_recipes_mi_bloom_filter.cpp.o 
  g++-14 -Irecipes/mi_bf_generate.p -Irecipes -I../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/recipes -Iinclude -I../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/include -I. -I../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib -I../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/cpptoml/include -Isubprojects/cpptoml/__CMake_build -I../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/cpptoml/__CMake_build -Isubprojects/cpptoml -I../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/cpptoml -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c++17 -O3 -fopenmp -isystem../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/sdsl-lite -isystemsubprojects/sdsl-lite -isystem../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/sdsl-lite/__CMake_build -isystemsubprojects/sdsl-lite/__CMake_build -isystem../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/sdsl-lite/include -isystem../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/sdsl-lite/__CMake_build/external/libdivsufsort/include -isystemsubprojects/sdsl-lite/__CMake_build/external/libdivsufsort/include -isystem../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/sdsl-lite/__CMake_build/include -isystemsubprojects/sdsl-lite/__CMake_build/include -MD -MQ recipes/mi_bf_generate.p/_private_tmp_abyss-20240720-12738-82pg3b_abyss-2.3.8_btllib_recipes_mi_bloom_filter.cpp.o -MF recipes/mi_bf_generate.p/_private_tmp_abyss-20240720-12738-82pg3b_abyss-2.3.8_btllib_recipes_mi_bloom_filter.cpp.o.d -o recipes/mi_bf_generate.p/_private_tmp_abyss-20240720-12738-82pg3b_abyss-2.3.8_btllib_recipes_mi_bloom_filter.cpp.o -c /private/tmp/abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/recipes/mi_bloom_filter.cpp
  In file included from ../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/include/btllib/mi_bloom_filter.hpp:283,
                   from /private/tmp/abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/recipes/mi_bloom_filter.cpp:1:
  ../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/include/btllib/mi_bloom_filter-inl.hpp: In member function 'void btllib::MIBloomFilter<T>::insert_id(const uint64_t*, const T&)':
  ../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/include/btllib/mi_bloom_filter-inl.hpp:193:3: error: 'uint' was not declared in this scope; did you mean 'rint'?
    193 |   uint rand = std::rand(); // NOLINT
        |   ^~~~
        |   rint
  ../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/include/btllib/mi_bloom_filter-inl.hpp:197:26: error: invalid operands of types 'int()' and 'const uint64_t' {aka 'const long long unsigned int'} to binary 'operator^'
    197 |     T random_num = (rand ^ hashes[i]) % count;
        |                     ~~~~ ^ ~~~~~~~~~
        |                     |              |
        |                     int()          const uint64_t {aka const long long unsigned int}
  [46/55] Compiling C++ object libbtllib.a.p/_private_tmp_abyss-20240720-12738-82pg3b_abyss-2.3.8_btllib_src_btllib_bloom_filter.cpp.o
  [47/55] Compiling C++ object recipes/indexlr.p/_private_tmp_abyss-20240720-12738-82pg3b_abyss-2.3.8_btllib_recipes_indexlr.cpp.o
  [48/55] Compiling C++ object recipes/randseq.p/_private_tmp_abyss-20240720-12738-82pg3b_abyss-2.3.8_btllib_recipes_randseq.cpp.o
  [49/55] Compiling C++ object wrappers/python/_btllib.so.p/btllib_wrap.cxx.o
  FAILED: wrappers/python/_btllib.so.p/btllib_wrap.cxx.o 
  g++-14 -Iwrappers/python/_btllib.so.p -Iwrappers/python -I../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/wrappers/python -I/opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12 -Iinclude -I../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/include -I. -I../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib -I../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/cpptoml/include -Isubprojects/cpptoml/__CMake_build -I../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/cpptoml/__CMake_build -Isubprojects/cpptoml -I../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/cpptoml -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c++17 -O3 -fopenmp -isystem../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/sdsl-lite -isystemsubprojects/sdsl-lite -isystem../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/sdsl-lite/__CMake_build -isystemsubprojects/sdsl-lite/__CMake_build -isystem../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/sdsl-lite/include -isystem../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/sdsl-lite/__CMake_build/external/libdivsufsort/include -isystemsubprojects/sdsl-lite/__CMake_build/external/libdivsufsort/include -isystem../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/subprojects/sdsl-lite/__CMake_build/include -isystemsubprojects/sdsl-lite/__CMake_build/include -fno-strict-overflow -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -w -MD -MQ wrappers/python/_btllib.so.p/btllib_wrap.cxx.o -MF wrappers/python/_btllib.so.p/btllib_wrap.cxx.o.d -o wrappers/python/_btllib.so.p/btllib_wrap.cxx.o -c ../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/wrappers/python/btllib_wrap.cxx
  In file included from ../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/include/btllib/mi_bloom_filter.hpp:283,
                   from ../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/wrappers/python/btllib_wrap.cxx:4219:
  ../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/include/btllib/mi_bloom_filter-inl.hpp: In member function 'void btllib::MIBloomFilter<T>::insert_id(const uint64_t*, const T&)':
  ../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/include/btllib/mi_bloom_filter-inl.hpp:193:3: error: 'uint' was not declared in this scope; did you mean 'rint'?
    193 |   uint rand = std::rand(); // NOLINT
        |   ^~~~
        |   rint
  ../abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/include/btllib/mi_bloom_filter-inl.hpp:197:26: error: invalid operands of types 'int()' and 'const uint64_t' {aka 'const long long unsigned int'} to binary 'operator^'
    197 |     T random_num = (rand ^ hashes[i]) % count;
        |                     ~~~~ ^ ~~~~~~~~~
        |                     |              |
        |                     int()          const uint64_t {aka const long long unsigned int}
  ninja: build stopped: subcommand failed.
  Traceback (most recent call last):
    File "/private/tmp/abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/./compile", line 182, in <module>
      sp.run(
    File "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 571, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['\n    if [ -f /tmp/btllib-build-vGYOh6uNS5ihmObJQVejIQ/venv/bin/activate ]; then\n      . /tmp/btllib-build-vGYOh6uNS5ihmObJQVejIQ/venv/bin/activate;\n    fi &&\n    \n    meson setup --buildtype release  -Db_ndebug=true -Db_coverage=false --prefix=/private/tmp/abyss-20240720-12738-82pg3b/abyss-2.3.8/btllib/install /tmp/btllib-build-vGYOh6uNS5ihmObJQVejIQ &&\n    cd /tmp/btllib-build-vGYOh6uNS5ihmObJQVejIQ &&\n    ninja install &&\n    cd .. &&\n    if [ -f /tmp/btllib-build-vGYOh6uNS5ihmObJQVejIQ/venv/bin/activate ]; then\n      deactivate;\n    fi\n  ']' returned non-zero exit status 1.

full build log, https://github.com/Homebrew/homebrew-core/actions/runs/10021004036/job/27700776111?pr=177899 relates to https://github.com/Homebrew/homebrew-core/pull/177899

also relates to #92

cc @parham-k

lcoombe commented 3 months ago

Hi @chenrui333 - thanks for reporting this!

@parham-k - Could your previous fix have been accidentally reversed when we did some refactoring in subsequent releases?

And @jwcodee - Could this be related to your open PR https://github.com/bcgsc/btllib/pull/121/files?

parham-k commented 3 months ago

I'm sure we fixed this at some point. I will investigate its reemergence.

@jwcodee is working on a fix in that branch. We will release a new version as soon as the tests pass on all platforms.

lcoombe commented 3 months ago

Hi @chenrui333, We have released v1.7.3 with a fix (https://github.com/bcgsc/btllib/pull/125) - could you try that version to see if it solves the issue on your end? Thanks!

lcoombe commented 2 months ago

Closing because looks like this fixed the issue, as abyss 2.3.8 was successfully updated in homebrew-core with btllib 1.7.3 🎉