This is a test version of Biostars. For the public version, visit https://www.biostars.org.
vg installation on MacOS failing: "ld: -headerpad: not a hexadecimal number: -headerpad_max_install_names"

I'm attempting to install vg using the instructions for MacOS. I pulled the repo and installed the dependencies using MacPorts.

# Cloning from repo
git clone --recursive https://github.com/vgteam/vg.git

# Installing dependencies. This seems to work
sudo port install libtool protobuf3-cpp jansson jq cmake pkgconfig autoconf automake libtool coreutils samtools redland bison gperftools md5sha1sum rasqal gmake autogen cairo libomp boost zstd pybind11

# This generates a bunch of output but eventually fails
. ./source_me.sh && make

I'm getting the following error:

ld: -headerpad: not a hexadecimal number: -headerpad_max_install_names
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [libdeflate.so] Error 1
make: *** [lib/libdeflate.a] Error 2

macOS: Sonoma 14.5

macos vg

Can you try starting a new terminal session and then running the last line (the source_me.sh one)?

Same error after starting a new terminal

Looks like clang v.9.0 is what the vg team reports using. Is that what you have?

I am using a different version:

Apple clang version 15.0.0 (clang-1500.3.9.4)

9 is incompatible with my OS (just did a quick experiment based on this question)

I looks like it's only available for linux

PackagesNotFoundError: The following packages are not available from current channels:

 - vg

Current channels:

 - https://conda.anaconda.org/conda-forge
 - https://conda.anaconda.org/bioconda
 - defaults

Ahh, good catch - I did not see that part.

vg developers stop by here periodically. Hopefully they will have a suggestion in a few days.

Right now the vg Mac CI is using Clang 14, and I've built it with Clang 15 on my machine. I think we've been making the changes to support current Clang without updating the part of the README where we say we have built on Clang 9.

You shouldn't try to go back and get Clang 9 for Mac to do a Mac build. If it doesn't work on the current Clang that's a vg bug.

I think we've been making the changes to support current Clang without updating the part of the README where we say we have built on Clang 9.

Please consider amending the page with neutral language that says something along the lines of (current version of Xcode). While updating README is likely not a priority for developers, it should at least not contain information that is long outdated.

1 answer

I got the same error, and then commented out LD_RENAMEABLE_FLAGS values in the Makefile:

% git diff Makefile
diff --git a/Makefile b/Makefile
index 6c8fd7262..91f908db5 100644
--- a/Makefile
+++ b/Makefile
@@ -217,7 +217,7 @@ ifeq ($(shell uname -s),Darwin)
     END_STATIC =

     # We need to use special flags to let us rename libraries
-    LD_RENAMEABLE_FLAGS = -Wl,-headerpad -Wl,-headerpad_max_install_names
+    LD_RENAMEABLE_FLAGS = #-Wl,-headerpad -Wl,-headerpad_max_install_names
 else
     # We are not running on OS X
     $(info OS is Linux)

And that worked?

That ought to work. I think the problem is that -headerpad needs an argument, but only some Clang versions (?) check that it has an appropriate one, and on others it appears to be allowed with -headerpad_max_install_names immediately after it. (In that case I think neither option actually applies as intended, but if you're not in an environment where you actually needed the extra padding they are meant to add, you can't tell.) There's a PR to vg at https://github.com/vgteam/vg/pull/4347 that might fix this overall.

Doesn't matter if it ought to work, the answer should be confirmed by the person proposing it or by OP to make it an actual answer.

Log in to answer this question.