mittinatten / freesasa

C-library for calculating Solvent Accessible Surface Areas
http://freesasa.github.io/
MIT License
107 stars 36 forks source link

Failed compilation due to no "cif.hh" #75

Closed baoilleach closed 2 years ago

baoilleach commented 2 years ago

After installing g++-9 on Centos 7 (devtoolset-9), compilation fails with 2.1.0 as follows:

g++ -std=gnu++14 -DHAVE_CONFIG_H -I. -I..  -I../third-party/gemmi/include/   -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cc
main.cc:14:10: fatal error: cif.hh: No such file or directory
   14 | #include "cif.hh"
      |          ^~~~~~~~

A quick look in third-party/gemmi/include lists a lot of files ending in .hpp, and no .hh files.

mittinatten commented 2 years ago

This refers to src/cif.hh, so the file should be there 🤔 Did this work for you with earlier versions of g++?

baoilleach commented 2 years ago

src/cif.hh isn't there either, nor in the downloaded .zip (from "Download the latest archive" at https://freesasa.github.io/). My system g++ fails at configure due to use of recent C++ standards. I successfully compiled the 2.0.3 version with it though.

mittinatten commented 2 years ago

There was an error in the makefile, cif.hh wasn't added explicitly as a target, so it was missing in the dist build, see the diff here: 6bb7be93ddc640c0b68014bc0a744fa72ee5f905.

I have updated the zip-file in the github release and the github pages, the latter change might take a few minutes to propagate.

I assume you do not get the same problem if you clone the git repository?

mittinatten commented 2 years ago

There were apparently a few other files missing, will fix in a sec

mittinatten commented 2 years ago

Had to do 860038ccc43e13704b923ed75f57e71d8e63fa8a as well, now at least I can build from the zip-archive.

baoilleach commented 2 years ago

With devtoolset-9 on Centos 7, it nows gets as far as linking:

g++ -std=gnu++14  -g -O2   -o freesasa main.o cif.o -lc++ libfreesasa.a  -lxml2   -lpthread -ldl -lm
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: cannot find -lc++
mittinatten commented 2 years ago

Ok, as you can see at the bottom of the readme, libc++-dev libc++abi-dev are needed for Ubuntu, I assume there are similar packages for CentOS (we can add them to the Readme if you figure it out).

baoilleach commented 2 years ago

Fair enough.

mittinatten commented 2 years ago

Thanks for reaching out about the missing files in the archive anyway! I should have verified that it was functional before publishing, of course (this was the first release in a long time with new files).

magyarc commented 2 years ago

I have the same "ld: cannot find -lc++" freesasa-2.1.2 compilation problem using Rocky Linux 8. On CentOS 7 there were libcxx packages in the EPEL repository, but not for RHEL/CentOS 8 derivatives. However compilation is successful when I delete the -lc++ flag from src/Makefile. Is it OK to use freesasa compiled in this way?

mittinatten commented 2 years ago

Hmm, ideally the configure script should give you correct compiler/linker flags. But if you run make check and the tests pass, everything should be ok.

magyarc commented 2 years ago

Thank you! The result was OK: PASS: test-cli

Testsuite summary for FreeSASA 2.1.2

TOTAL: 1

PASS: 1

SKIP: 0

XFAIL: 0

FAIL: 0

XPASS: 0

ERROR: 0

============================================================================