mittinatten/freesasa

Build requires libc++.so

jvlehtonen opened this issue · 4 comments

Hi,

Makefile.am sets:
freesasa_LDADD = -lc++

GCC does not provide libc++.so (but would autolink libstdc++.so)
Therefore, build fails with GCC.

The libc++.so is from Clang?

After
sed -i "s/freesasa_LDADD = -lc++/freesasa_LDADD =/" src/Makefile.am
a build with GCC is successful.

My bad, did not browse the closed issues. #72 was on same/similar issue.

Difference is that we build on RHEL 7 / CentOS 7, where libc++ is not in base repos. GCC 9 and 11.

Ok, if you have one or two lines of code for how to install the correct dependencies, like we have for Ubuntu in the README, I can add that (either by PR or a comment here). Seems a lot of people are running into this issue.

Ideally autoconf should detect the problem too, will try to figure something out.

GNU Build System and git install on RHEL 7 and 8 -based systems (including CentOS 7, AlmaLinux, Rocky Linux, etc) as "yum group":
sudo yum install @development

The additional dependencies can be installed on RHEL-based systems with:
sudo yum install json-c-devel libxml2-devel

The system GCC in RHEL 7 (and hence CentOS 7) does not support required C++ standard.
Later GCC (and possibly some version of Clang) are available via Software Collections (SCL).
RHEL 7 has its method to enable SCL. CentOS 7 enables SCL repo with:
sudo yum install centos-release-scl-rh
"Toolchain" from Developer Toolset is sufficient for building with GCC. For example:
sudo yum install devtoolset-9-toolchain
In order to use programs from SCL one has to enable environment:
scl enable devtoolset-9 bash
The bash that starts above does have gcc version 9 on PATH.
The built freesasa binary does not require the environment.

Users of RHEL 7 / CentOS 7 could know how to use SCL, but there is no enforcement ...

Thanks! I'll add it to the README.