vg installation on MacOS failing: "ld: -headerpad: not a hexadecimal number: -headerpad_max_install_names"
1
1
Entering edit mode
10 days ago
Nathan ▴ 10

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 • 956 views
ADD COMMENT
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Same error after starting a new terminal

ADD REPLY
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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)

ADD REPLY
0
Entering edit mode

Try installing vg using conda.

ADD REPLY
0
Entering edit mode

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
ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode
4 days ago
nilshomer ▴ 70

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)
ADD COMMENT
0
Entering edit mode

And that worked?

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 4530 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6