michellab / Sire

Sire Molecular Simulations Framework
http://siremol.org
GNU General Public License v3.0
95 stars 26 forks source link

compilation error with latest devel branch on ubuntu 20.04 #365

Closed jmichel80 closed 2 years ago

jmichel80 commented 2 years ago

Hi,

We are trying to compile the latest source on devel to run on a Ubuntu 20.04 workstation (x86_64). This fails when linking corelib with an error(below). I wonder if g++ needs an upgrade to link code against recent OpenMM releases ?

Consolidate compiler generated dependencies of target sire
make[2]: Leaving directory '/home/anna/Sire/build/corelib'
/home/anna/sire.app/bin/make  -f src/apps/sire/CMakeFiles/sire.dir/build.make src/apps/sire/CMakeFiles/sire.dir/build
make[2]: Entering directory '/home/anna/Sire/build/corelib'
[ 99%] Linking CXX executable sire
cd /home/anna/Sire/build/corelib/src/apps/sire && /home/anna/sire.app/bin/cmake -E cmake_link_script CMakeFiles/sire.dir/link.txt --verbose=1
/home/anna/sire.app/bin/x86_64-conda_cos6-linux-gnu-g++   -std=c++14 -DSIRE_HAS_CPP_14 -DSIRE_HAS_CPP_1Y -DSIRE_HAS_CPP_11 -Wall -Wno-attributes -pipe -DSIRE_ALWAYS_INLINE=inline -Wno-strict-aliasing -DSIRE_VISIBILITY_AVAILABLE -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp-simd -mavx -DSIRE_USE_AVX  -std=c++14 -DSIRE_HAS_CPP_14 -DSIRE_HAS_CPP_1Y -DSIRE_HAS_CPP_11 -O2 -ffast-math -fomit-frame-pointer   -rdynamic CMakeFiles/sire.dir/main.cpp.o CMakeFiles/sire.dir/qrc_sire.cpp.o -o sire  -Wl,-rpath,/home/anna/Sire/build/corelib/src/libs/Squire:/home/anna/sire.app/lib:/home/anna/Sire/build/corelib/src/libs/SireIO:/home/anna/Sire/build/corelib/src/libs/SireMove:/home/anna/Sire/build/corelib/src/libs/SireCluster:/home/anna/Sire/build/corelib/src/libs/SireSystem:/home/anna/Sire/build/corelib/src/libs/SireMM:/home/anna/Sire/build/corelib/src/libs/SireFF:/home/anna/Sire/build/corelib/src/libs/SireMol:/home/anna/Sire/build/corelib/src/libs/SireVol:/home/anna/Sire/build/corelib/src/libs/SireCAS:/home/anna/Sire/build/corelib/src/libs/SireMaths:/home/anna/Sire/build/corelib/src/libs/SireBase:/home/anna/sire.app/pkgs/sire-2022.1.0/bundled/lib:/home/anna/Sire/build/corelib/src/libs/SireID:/home/anna/Sire/build/corelib/src/libs/SireUnits:/home/anna/Sire/build/corelib/src/libs/SireStream:/home/anna/Sire/build/corelib/src/libs/SireError: ../../libs/Squire/libSquire.so.2022.1.0 /home/anna/sire.app/lib/libnetcdf.so ../../libs/SireIO/libSireIO.so.2022.1.0 ../../libs/SireMove/libSireMove.so.2022.1.0 ../../libs/SireCluster/libSireCluster.so.2022.1.0 /home/anna/sire.app/lib/libOpenMM.so /home/anna/sire.app/lib/libnetcdf.so ../../libs/SireSystem/libSireSystem.so.2022.1.0 ../../libs/SireMM/libSireMM.so.2022.1.0 ../../libs/SireFF/libSireFF.so.2022.1.0 ../../libs/SireMol/libSireMol.so.2022.1.0 ../../libs/SireVol/libSireVol.so.2022.1.0 ../../libs/SireCAS/libSireCAS.so.2022.1.0 ../../libs/SireMaths/libSireMaths.so.2022.1.0 ../../libs/SireBase/libSireBase.so.2022.1.0 /home/anna/sire.app/lib/libtbb.so /home/anna/sire.app/lib/libtbbmalloc.so /home/anna/sire.app/pkgs/sire-2022.1.0/bundled/lib/libcpuid.so ../../libs/SireID/libSireID.so.2022.1.0 ../../libs/SireUnits/libSireUnits.so.2022.1.0 ../../libs/SireStream/libSireStream.so.2022.1.0 /home/anna/sire.app/lib/libgsl.so /home/anna/sire.app/lib/libgslcblas.so ../../libs/SireError/libSireError.so.2022.1.0 /home/anna/sire.app/lib/libQt5Core.so.5.12.9 
/home/anna/sire.app/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: /home/anna/sire.app/lib/libOpenMM.so: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()@GLIBCXX_3.4.26'
/home/anna/sire.app/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: /home/anna/sire.app/lib/libOpenMM.so: undefined reference to `memcpy@GLIBC_2.14'
collect2: error: ld returned 1 exit status
make[2]: *** [src/apps/sire/CMakeFiles/sire.dir/build.make:144: src/apps/sire/sire] Error 1
make[2]: Leaving directory '/home/anna/Sire/build/corelib'
make[1]: *** [CMakeFiles/Makefile2:1396: src/apps/sire/CMakeFiles/sire.dir/all] Error 2
make[1]: Leaving directory '/home/anna/Sire/build/corelib'
make: *** [Makefile:136: all] Error 2
SOMETHING WENT WRONG WHEN COMPILING CORELIB!
(base) anna@kusanagi:~/Sire$ uname -a
Linux kusanagi 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

This is with the most recent devel commit

(base) anna@kusanagi:~/Sire$ git log | less

commit aa6b5f2e0d2e145681f313311f8bd4d1be5c8c8e
Author: Christopher Woods <Christopher.Woods@bristol.ac.uk>
Date:   Thu Jan 27 18:23:02 2022 +0000

    I think(!) this will disable AVX/AVX512 on all platforms (needed only for MacOS, but does expand the range of CPUs supported)
lohedges commented 2 years ago

That's strange? The CI build is run on Ubuntu 20.04 I believe, although it uses a native conda-build rather than the compile_sire.sh script. Will try to take a look tomorrow if I get a chance.

lohedges commented 2 years ago

Can you make sure that you are doing a completely clean build. It looks like a CXX11 ABI issue. The conda-forge OpenMM now uses the new ABI and we've updated to CMake script to reflect this change. It's possible that it's using a cached value if you are simply rebuilding having pulled from devel.

annamherz commented 2 years ago

Doing a completely clean build worked, it must have been the cached value. Thank you!