This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Unable to build vg from source: `fatal error: opening dependency file bdsg/obj/eades_algorithm.d: No such file or directory`

Dear community, due to jemalloc issues, a user wants to build vg from source, but this fails. libbdsg is one of the dependencies that fails to build:

$ git clone --recurse-submodules https://github.com/vgteam/vg
[…]
$ cd vg
$ git log --oneline --no-decorate -1
9fb4d83c3 Merge pull request #4846 from vgteam/deprecate-extract-vg
$ make lib/libbdsg.a
2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1  -fPIC -std=c++17 -O3 -Werror=return-type -ggdb -g  -fopenmp -msse4.2" make  && cp lib/libbdsg.a /dev/shm/vg/lib && cp -r bdsg/include/* /dev/shm/vg/include
make[1]: Entering directory '/dev/shm/vg/deps/libbdsg'
[ ! -e bdsg/obj ] || rm -r bdsg/obj
[ ! -e lib ] || rm -r lib
[ ! -e bin ] || rm -r bin
make[1]: Leaving directory '/dev/shm/vg/deps/libbdsg'
make[1]: Entering directory '/dev/shm/vg/deps/libbdsg'
g++   -MMD -MP -O3 -Werror=return-type -std=c++14 -ggdb -g -Ibdsg/include -I/dev/shm/vg/include -I. -I/dev/shm/vg/src -I/dev/shm/vg/src/unittest -I/dev/shm/vg/src/unittest/support -I/dev/shm/vg/src/subcommand -I/dev/shm/vg/include/dynamic -pthread -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1  -fPIC -std=c++17 -O3 -Werror=return-type -ggdb -g  -fopenmp -msse4.2 -fopenmp -c bdsg/src/eades_algorithm.cpp -o bdsg/obj/eades_algorithm.o
bdsg/src/eades_algorithm.cpp:281:1: fatal error: opening dependency file bdsg/obj/eades_algorithm.d: No such file or directory
  281 | }
      | ^
compilation terminated.
make[1]: *** [Makefile:73: bdsg/obj/eades_algorithm.o] Error 1
make[1]: Leaving directory '/dev/shm/vg/deps/libbdsg'
make: *** [Makefile:914: lib/libbdsg.a] Error 2

Relevant Makefile snippet:

https://github.com/vgteam/vg/blob/9fb4d83c3bf580823e39b0a506e7c6c6522b384c/Makefile#L911-L912

$ cd deps/libbdsg/
deps/libbdsg ((e74fb66...))$ git log --oneline --no-decorate -1
e74fb66 centralized checker
$ g++   -MMD -MP -O3 -Werror=return-type -std=c++14 -ggdb -g -Ibdsg/include -I/dev/shm/vg/include -I. -I/dev/shm/vg/src -I/dev/shm/vg/src/unittest -I/dev/shm/vg/src/unittest/support -I/dev/shm/vg/src/subcommand -I/dev/shm/vg/include/dynamic -pthread -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1  -fPIC -std=c++17 -O3 -Werror=return-type -ggdb -g  -fopenmp -msse4.2 -fopenmp -c bdsg/src/eades_algorithm.cpp -o bdsg/obj/eades_algorithm.o
bdsg/src/eades_algorithm.cpp:281:1: fatal error: opening dependency file bdsg/obj/eades_algorithm.d: No such file or directory
  281 | }
      | ^
compilation terminated.

Building it with the libbdsg instructions works in the submodule:

$ mkdir build
deps/libbdsg ((e74fb66...))$ cd build
deps/libbdsg/build ((e74fb66...))$ cmake ..
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- The C compiler identification is GNU 12.5.0
-- The CXX compiler identification is GNU 12.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Checking for module 'jansson'
--   Found jansson, version 2.11
-- Compiler is recent enough to support C++17.
-- Performing Test HAVE_GCC_STD=C__17__WALL__WEXTRA__DNDEBUG
-- Performing Test HAVE_GCC_STD=C__17__WALL__WEXTRA__DNDEBUG - Success
-- Performing Test HAVE_GCC_O3__FFAST_MATH__FUNROLL_LOOPS
-- Performing Test HAVE_GCC_O3__FFAST_MATH__FUNROLL_LOOPS - Success
-- Performing Test HAVE_GCC_MSSE4.2__MARCH=NATIVE
-- Performing Test HAVE_GCC_MSSE4.2__MARCH=NATIVE - Success
-- Performing Test HAVE_CLANG_MSSE4.2__MARCH=NATIVE
-- Performing Test HAVE_CLANG_MSSE4.2__MARCH=NATIVE - Success
-- Performing Test HAVE_CXA_DEMANGLE
-- Performing Test HAVE_CXA_DEMANGLE - Success
-- Compiler supports DEMANGLE.
-- Performing Test HAVE_GCC_DHAVE_CXA_DEMANGLE
-- Performing Test HAVE_GCC_DHAVE_CXA_DEMANGLE - Success
-- Found Git: /usr/bin/git (found version "2.52.0") 
git found: /usr/bin/git
-- Performing Test HAVE_GCC_WALL
-- Performing Test HAVE_GCC_WALL - Success
-- Performing Test HAVE_GCC_FOMIT_FRAME_POINTER
-- Performing Test HAVE_GCC_FOMIT_FRAME_POINTER - Success
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Performing Test HAVE_INLINE
-- Performing Test HAVE_INLINE - Success
-- Performing Test HAVE___INLINE
-- Performing Test HAVE___INLINE - Success
-- Performing Test HAVE___INLINE__
-- Performing Test HAVE___INLINE__ - Success
-- Performing Test HAVE___DECLSPEC_DLLEXPORT_
-- Performing Test HAVE___DECLSPEC_DLLEXPORT_ - Failed
-- Performing Test HAVE___DECLSPEC_DLLIMPORT_
-- Performing Test HAVE___DECLSPEC_DLLIMPORT_ - Failed
-- Check size of uint8_t
-- Check size of uint8_t - done
-- Check size of int32_t
-- Check size of int32_t - done
-- Looking for PRId32
-- Looking for PRId32 - found
-- Check size of int64_t
-- Check size of int64_t - done
-- Looking for PRId64
-- Looking for PRId64 - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Looking for C++ include cstdio
-- Looking for C++ include cstdio - found
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.17") found components: doxygen dot 
Unzipping faust.txt.
Unzipping moby.int.
Using bundled libhandlegraph
libhandlegraph is add_subdirectory project
-- pybind11 v2.13.6 
-- Found PythonInterp: /dev/shm/vg/.venv/bin/python (found suitable version "3.12.8", minimum required is "3.7") 
-- Found PythonLibs: /pkg/python-3.12.8-0/lib/libpython3.12.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /dev/shm/vg/deps/libbdsg/build
[ 96%] Linking CXX shared module /dev/shm/vg/deps/libbdsg/lib/bdsg.cpython-312-x86_64-linux-gnu.so
[ 96%] Built target bdsg_pybind11
[100%] Linking CXX executable /dev/shm/vg/deps/libbdsg/bin/test_libbdsg
[100%] Built target test_libbdsg
deps/libbdsg/build ((e74fb66...))$ echo $?
0

Any help is appreciated.

Thanks,

Paul

vg

Thank you for your. The Google URL actually shows this thread as the first hit, and all other results do not contain all search strings.

Your solution kind of works, but does not really integrate with vg’s build system. The Makefile snippet:

$(LIB_DIR)/libbdsg.a: $(INC_DIR)/BooPHF.h $(LIBBDSG_DIR)/Makefile $(LIBBDSG_DIR)/bdsg/src/*.cpp $(LIBBDSG_DIR)/bdsg/include/bdsg/*.hpp $(LIBBDSG_DIR)/bdsg/include/bdsg/internal/*.hpp $(LIBBDSG_DIR)/bdsg/include/bdsg/overlays/*.hpp $(LIB_DIR)/libhandlegraph.a $(LIB_DIR)/libsdsl.a $(LIB_DIR)/libdivsufsort.a $(LIB_DIR)/libdivsufsort64.a $(INC_DIR)/sparsepp/spp.h $(INC_DIR)/dynamic/dynamic.hpp $(INC_DIR)/mio/mmap.hpp
    +rm -Rf $(CWD)/$(INC_DIR)/bdsg && cd $(LIBBDSG_DIR) && $(MAKE) clean && CPLUS_INCLUDE_PATH=$(CWD)/$(INC_DIR):$(CWD)/$(INC_DIR)/dynamic:$(CPLUS_INCLUDE_PATH) CXXFLAGS="$(INCLUDE_FLAGS) -fPIC $(CXXFLAGS)" $(MAKE) $(FILTER) && cp lib/libbdsg.a $(CWD)/$(LIB_DIR) && cp -r bdsg/include/* $(CWD)/$(INC_DIR)

So it calls make clean in deps/libbdsg, which actually removes the directory:

$ make clean
[ ! -e bdsg/obj ] || rm -r bdsg/obj
[ ! -e lib ] || rm -r lib
[ ! -e bin ] || rm -r bin

As a workaround I added mkdir -p bdsg/obj in that line after $(MAKE) clean:

+rm -Rf $(CWD)/$(INC_DIR)/bdsg && cd $(LIBBDSG_DIR) && $(MAKE) clean && mkdir -p bdsg/obj && CPLUS_INCLUDE_PATH=$(CWD)/$(INC_DIR):$(CWD)/$(INC_DIR)/dynamic:$(CPLUS_INCLUDE_PATH) CXXFLAGS="$(INCLUDE_FLAGS) -fPIC $(CXXFLAGS)" $(MAKE) $(FILTER) && cp lib/libbdsg.a $(CWD)/$(LIB_DIR) && cp -r bdsg/include/* $(CWD)/$(INC_DIR)

How to continue from here? Open an issue in the vg project?

Kind regards,

Paul

0 answers

No answers yet.

Log in to answer this question.