runtimeverification / k

K Framework Tools 7.0
BSD 3-Clause "New" or "Revised" License
444 stars 145 forks source link

Dependencies out of date #3068

Closed Baltoli closed 1 year ago

Baltoli commented 1 year ago

A recent Ubuntu update seems to have caused libstdc++ to be out of date when building K. The solution is to install g++-12 - this needs to be audited for each version of Ubuntu we support.

Baltoli commented 1 year ago

README confirmed working on Focal.

Baltoli commented 1 year ago

Also confirmed on a clean Jammy install.

Baltoli commented 1 year ago

@radumereuta @ChristianoBraga I can't reproduce the issue we discussed in a clean image using either Ubuntu Focal or Jammy. I'm going to close this issue for now, and if we encounter it again in a more reproducible way we can revisit it.

ChristianoBraga commented 1 year ago

But @bruce.collie I can’t compile KPlutus!

Em qui., 1 de dez. de 2022 às 11:43, Bruce Collie @.***> escreveu:

@radumereuta https://github.com/radumereuta @ChristianoBraga https://github.com/ChristianoBraga I can't reproduce the issue we discussed in a clean image using either Ubuntu Focal or Jammy. I'm going to close this issue for now, and if we encounter it again in a more reproducible way we can revisit it.

— Reply to this email directly, view it on GitHub https://github.com/runtimeverification/k/issues/3068#issuecomment-1333870013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNNCEK4KC7V5ZXJGPHHHJTWLC2PRANCNFSM6AAAAAASQR4HVU . You are receiving this because you were mentioned.Message ID: @.***>

Baltoli commented 1 year ago

Apologies - did installing g++-12 not fix the issue for you @ChristianoBraga? If not I'll reopen!

ChristianoBraga commented 1 year ago

@bruce.collie, It fixed the first problem, when Radu pointed me to your reply. But then the “deprecated” errors appeared with the Ant error at the end.

Em qui., 1 de dez. de 2022 às 12:45, Bruce Collie @.***> escreveu:

Did installing g++-12 not fix the issue for you @ChristianoBraga https://github.com/ChristianoBraga?

— Reply to this email directly, view it on GitHub https://github.com/runtimeverification/k/issues/3068#issuecomment-1333967000, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNNCEL6EIZXDDNKH6LDGTDWLDBYXANCNFSM6AAAAAASQR4HVU . You are receiving this because you were mentioned.Message ID: @.***>

Baltoli commented 1 year ago

What version of the LLVM tools do you have installed? It looks like the LLVM headers in your version are using old libstdc++ features no longer supported.

ChristianoBraga commented 1 year ago

12

Em qui., 1 de dez. de 2022 às 12:49, Bruce Collie @.***> escreveu:

What version of the LLVM tools do you have installed?

— Reply to this email directly, view it on GitHub https://github.com/runtimeverification/k/issues/3068#issuecomment-1333973374, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNNCEMDVBUOPJ6CUMFOPDDWLDCJTANCNFSM6AAAAAASQR4HVU . You are receiving this because you were mentioned.Message ID: @.***>

Baltoli commented 1 year ago

That's very strange; I'd expect them to still be supported! If you're on a version of Ubuntu that supports it, I suggest upgrading to 13 or 14 if they're available in the repositories, and doing a full clean build of K. I'm away from my Ubuntu machine at the moment but will reopen this issue and look into it in detail when I'm back.

ChristianoBraga commented 1 year ago

I am on Jammy. The problems arose when I upgraded.

Em qui., 1 de dez. de 2022 às 12:55, Bruce Collie @.***> escreveu:

That's very strange; I'd expect them to still be supported! If you're on a version of Ubuntu that supports it, I suggest upgrading to 13 or 14 if they're available in the repositories, and doing a full clean build of K. I'm away from my Ubuntu machine at the moment but will reopen this issue and look into it in detail when I'm back.

— Reply to this email directly, view it on GitHub https://github.com/runtimeverification/k/issues/3068#issuecomment-1333981218, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNNCEOTRVYLVKGZELYOCOTWLDC6HANCNFSM6AAAAAASQR4HVU . You are receiving this because you were mentioned.Message ID: @.***>

Baltoli commented 1 year ago

Did you upgrade the LLVM version or just the llvm-12 package? If the former, I don't know off hand what the problem is and will need to dig further I'm afraid. Sorry for the hassle!

ChristianoBraga commented 1 year ago

I upgraded and manually installed K’s dependencies, following the README file. Run git submodule … too

Em qui., 1 de dez. de 2022 às 13:05, Bruce Collie @.***> escreveu:

Did you upgrade the LLVM version or just the llvm-12 package? If the former, I don't know off hand what the problem is and will need to dig further I'm afraid. Sorry for the hassle!

— Reply to this email directly, view it on GitHub https://github.com/runtimeverification/k/issues/3068#issuecomment-1333997403, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNNCENVUVAMEZUL2MZTO5DWLDEDZANCNFSM6AAAAAASQR4HVU . You are receiving this because you were mentioned.Message ID: @.***>

ChristianoBraga commented 1 year ago

I upgraded another machine (an old iMac i3) to Jammy. Installed all K's dependencies. Cloned a fresh copy of KPlutus. Then I get this error:

    [exec] CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message):
     [exec]   The C++ compiler
     [exec] 
     [exec]     "/usr/bin/clang++-12"
     [exec] 
     [exec]   is not able to compile a simple test program.
     [exec] 
     [exec]   It fails with the following output:
     [exec] 
     [exec]     Change Dir: /home/cbraga/plutus-core-semantics/deps/k/llvm-backend/target/build/CMakeFiles/CMakeTmp
     [exec]     
     [exec]     Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_00c51/fast && gmake[1]: Entering directory '/home/cbraga/plutus-core-semantics/deps/k/llvm-backend/target/build/CMakeFiles/CMakeTmp'
     [exec]     /usr/bin/gmake  -f CMakeFiles/cmTC_00c51.dir/build.make CMakeFiles/cmTC_00c51.dir/build
     [exec]     gmake[2]: Entering directory '/home/cbraga/plutus-core-semantics/deps/k/llvm-backend/target/build/CMakeFiles/CMakeTmp'
     [exec]     Building CXX object CMakeFiles/cmTC_00c51.dir/testCXXCompiler.cxx.o
     [exec]     /usr/bin/clang++-12    -MD -MT CMakeFiles/cmTC_00c51.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_00c51.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_00c51.dir/testCXXCompiler.cxx.o -c /home/cbraga/plutus-core-semantics/deps/k/llvm-backend/target/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
     [exec]     Linking CXX executable cmTC_00c51
     [exec]     /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_00c51.dir/link.txt --verbose=1
     [exec]     /usr/bin/clang++-12 CMakeFiles/cmTC_00c51.dir/testCXXCompiler.cxx.o -o cmTC_00c51 
     [exec]     /usr/bin/ld: cannot find -lstdc++: No such file or directory
     [exec]     clang: error: linker command failed with exit code 1 (use -v to see invocation)
     [exec]     gmake[2]: *** [CMakeFiles/cmTC_00c51.dir/build.make:100: cmTC_00c51] Error 1
     [exec]     gmake[2]: Leaving directory '/home/cbraga/plutus-core-semantics/deps/k/llvm-backend/target/build/CMakeFiles/CMakeTmp'
     [exec]     gmake[1]: *** [Makefile:127: cmTC_00c51/fast] Error 2
     [exec]     gmake[1]: Leaving directory '/home/cbraga/plutus-core-semantics/deps/k/llvm-backend/target/build/CMakeFiles/CMakeTmp'

Next I installed g++-12, as suggested by @Baltoli and @radumereuta.

Then the previous error disappears and I get the following new errors:

     [exec] /usr/lib/llvm-12/include/llvm/ADT/iterator.h:68:19: error: 'iterator<std::input_iterator_tag, const llvm::StringRef>' is deprecated [-Werror,-Wdeprecated-declarations]
     [exec]     : public std::iterator<IteratorCategoryT, T, DifferenceTypeT, PointerT,
     [exec]                   ^
     [exec] /usr/lib/llvm-12/include/llvm/Support/Path.h:53:14: note: in instantiation of template class 'llvm::iterator_facade_base<llvm::sys::path::const_iterator, std::input_iterator_tag, const llvm::StringRef>' requested here
     [exec]     : public iterator_facade_base<const_iterator, std::input_iterator_tag,
     [exec]              ^
     [exec] /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_iterator_base_types.h:127:12: note: 'iterator<std::input_iterator_tag, const llvm::StringRef>' has been explicitly marked deprecated here
     [exec]     struct _GLIBCXX17_DEPRECATED iterator
     [exec]            ^
     [exec] /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/x86_64-linux-gnu/c++/12/bits/c++config.h:119:34: note: expanded from macro '_GLIBCXX17_DEPRECATED'
     [exec] # define _GLIBCXX17_DEPRECATED [[__deprecated__]]
     [exec]                                  ^
     [exec] In file included from /home/cbraga/plutus-core-semantics/deps/k/llvm-backend/src/main/native/llvm-backend/tools/kore-arity/main.cpp:3:
     [exec] In file included from /usr/lib/llvm-12/include/llvm/Support/CommandLine.h:22:
     [exec] In file included from /usr/lib/llvm-12/include/llvm/ADT/ArrayRef.h:15:
     [exec] In file included from /usr/lib/llvm-12/include/llvm/ADT/STLExtras.h:20:
     [exec] /usr/lib/llvm-12/include/llvm/ADT/iterator.h:68:19: error: 'iterator<std::input_iterator_tag, const llvm::StringRef>' is deprecated [-Werror,-Wdeprecated-declarations]
     [exec]     : public std::iterator<IteratorCategoryT, T, DifferenceTypeT, PointerT,
     [exec]                   ^
     [exec] /usr/lib/llvm-12/include/llvm/Support/Path.h:79:14: note: in instantiation of template class 'llvm::iterator_facade_base<llvm::sys::path::reverse_iterator, std::input_iterator_tag, const llvm::StringRef>' requested here
     [exec]     : public iterator_facade_base<reverse_iterator, std::input_iterator_tag,
     [exec]              ^
     [exec] /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_iterator_base_types.h:127:12: note: 'iterator<std::input_iterator_tag, const llvm::StringRef>' has been explicitly marked deprecated here
     [exec]     struct _GLIBCXX17_DEPRECATED iterator
     [exec]            ^
     [exec] /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/x86_64-linux-gnu/c++/12/bits/c++config.h:119:34: note: expanded from macro '_GLIBCXX17_DEPRECATED'
     [exec] # define _GLIBCXX17_DEPRECATED [[__deprecated__]]
     [exec]                                  ^
     [exec] In file included from /home/cbraga/plutus-core-semantics/deps/k/llvm-backend/src/main/native/llvm-backend/tools/kore-strip/main.cpp:1:
     [exec] In file included from /usr/lib/llvm-12/include/llvm/Support/CommandLine.h:22:
     [exec] In file included from /usr/lib/llvm-12/include/llvm/ADT/ArrayRef.h:15:
     [exec] In file included from /usr/lib/llvm-12/include/llvm/ADT/STLExtras.h:20:
     [exec] /usr/lib/llvm-12/include/llvm/ADT/iterator.h:68:19: error: 'iterator<std::input_iterator_tag, const llvm::StringRef>' is deprecated [-Werror,-Wdeprecated-declarations]
     [exec]     : public std::iterator<IteratorCategoryT, T, DifferenceTypeT, PointerT,
     [exec]                   ^
     [exec] /usr/lib/llvm-12/include/llvm/Support/Path.h:53:14: note: in instantiation of template class 'llvm::iterator_facade_base<llvm::sys::path::const_iterator, std::input_iterator_tag, const llvm::StringRef>' requested here
     [exec]     : public iterator_facade_base<const_iterator, std::input_iterator_tag,
     [exec]              ^
     [exec] /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_iterator_base_types.h:127:12: note: 'iterator<std::input_iterator_tag, const llvm::StringRef>' has been explicitly marked deprecated here
     [exec]     struct _GLIBCXX17_DEPRECATED iterator
     [exec]            ^
     [exec] /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/x86_64-linux-gnu/c++/12/bits/c++config.h:119:34: note: expanded from macro '_GLIBCXX17_DEPRECATED'
     [exec] # define _GLIBCXX17_DEPRECATED [[__deprecated__]]
     [exec]                                  ^
     [exec] In file included from /home/cbraga/plutus-core-semantics/deps/k/llvm-backend/src/main/native/llvm-backend/tools/kore-strip/main.cpp:1:
     [exec] In file included from /usr/lib/llvm-12/include/llvm/Support/CommandLine.h:22:
     [exec] In file included from /usr/lib/llvm-12/include/llvm/ADT/ArrayRef.h:15:
     [exec] In file included from /usr/lib/llvm-12/include/llvm/ADT/STLExtras.h:20:
     [exec] /usr/lib/llvm-12/include/llvm/ADT/iterator.h:68:19: error: 'iterator<std::input_iterator_tag, const llvm::StringRef>' is deprecated [-Werror,-Wdeprecated-declarations]
     [exec]     : public std::iterator<IteratorCategoryT, T, DifferenceTypeT, PointerT,
     [exec]                   ^
     [exec] /usr/lib/llvm-12/include/llvm/Support/Path.h:79:14: note: in instantiation of template class 'llvm::iterator_facade_base<llvm::sys::path::reverse_iterator, std::input_iterator_tag, const llvm::StringRef>' requested here
     [exec]     : public iterator_facade_base<reverse_iterator, std::input_iterator_tag,
     [exec]              ^
     [exec] /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_iterator_base_types.h:127:12: note: 'iterator<std::input_iterator_tag, const llvm::StringRef>' has been explicitly marked deprecated here
     [exec]     struct _GLIBCXX17_DEPRECATED iterator
     [exec]            ^
     [exec] /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/x86_64-linux-gnu/c++/12/bits/c++config.h:119:34: note: expanded from macro '_GLIBCXX17_DEPRECATED'
     [exec] # define _GLIBCXX17_DEPRECATED [[__deprecated__]]
     [exec]                                  ^
     [exec] 2 errors generated.

Need your help here guys. Otherwise I think I will downgrade to Focal Fossa.

Baltoli commented 1 year ago

I'm working on reproducing this in a clean environment to narrow down exactly why this error is cropping up. Steps taken:

Get a clean Jammy image

All steps following docker run ... are inside the resulting docker container.

docker run -it --rm -u 0 ubuntu:jammy
apt update

Install the K dependencies

DEBIAN_FRONTEND=noninteractive apt install -y curl git build-essential m4 openjdk-11-jdk libgmp-dev libmpfr-dev pkg-config flex bison z3 libz3-dev maven python3 python3-dev cmake gcc clang-12 lld-12 llvm-12-tools zlib1g-dev libboost-test-dev libyaml-dev libjemalloc-dev
curl -sSL https://get.haskellstack.org/ | sh

Get and build a K checkout

cd
git clone https://github.com/runtimeverification/k.git --recursive --branch develop
cd k
mvn package -DskipTests

Install the Plutus dependencies

DEBIAN_FRONTEND=noninteractive apt install -y build-essential m4 openjdk-11-jdk libgmp-dev libmpfr-dev pkg-config flex bison z3 libsecp256k1-dev libz3-dev maven python3 python3-dev python3-pip cmake gcc clang-12 lld-12 llvm-12-tools zlib1g-dev libboost-test-dev libyaml-dev libjemalloc-dev libsecp256k1-dev libssl-dev xxd
pip install virtualenv poetry

Get and build a Plutus checkout

git clone https://github.com/runtimeverification/plutus-core-semantics.git --recursive
cd plutus-core-semantics
make deps RELEASE=true

apt install -y libprocps-dev # needed to install this over and above the README deps
make build -j8

Run the Plutus tests

make conformance-test
make test-simple
make test-uplc-examples
make test-benchmark-validation-examples # NB. small typo in Plutus README - no `make` prefix
make test-nofib-exe-examples # same here
make test-error

Summarise Environment

The list of installed packages from the system that can successfully follow these steps is attached:

apt list --installed > packages.txt
ChristianoBraga commented 1 year ago

@Bruce Collie @.***> I managed to build K as a submodule.

  1. Reinstalled Jammy in my system but from a Jammy iso instead of upgrading. (Had two upgrades, since Ubuntu 18.)
  2. Updated and Upgraded packages after installing Jammy.
  3. Installed K dependencies and KPlutus.
  4. Managed to build K as a submodule.

Thank you!

On Tue, Dec 6, 2022 at 7:52 AM Bruce Collie @.***> wrote:

I'm working on reproducing this in a clean environment to narrow down exactly why this error is cropping up. Steps taken: Get a clean Jammy image

All steps following docker run ... are inside the resulting docker container.

docker run -it --rm -u 0 ubuntu:jammy apt update

Install the K dependencies

DEBIAN_FRONTEND=noninteractive apt install -y curl git build-essential m4 openjdk-11-jdk libgmp-dev libmpfr-dev pkg-config flex bison z3 libz3-dev maven python3 python3-dev cmake gcc clang-12 lld-12 llvm-12-tools zlib1g-dev libboost-test-dev libyaml-dev libjemalloc-dev curl -sSL https://get.haskellstack.org/ | sh

Get and build a K checkout

cd git clone https://github.com/runtimeverification/k.git --recursive --branch developcd k mvn package -DskipTests

Install the Plutus dependencies

DEBIAN_FRONTEND=noninteractive apt install -y build-essential m4 openjdk-11-jdk libgmp-dev libmpfr-dev pkg-config flex bison z3 libsecp256k1-dev libz3-dev maven python3 python3-dev python3-pip cmake gcc clang-12 lld-12 llvm-12-tools zlib1g-dev libboost-test-dev libyaml-dev libjemalloc-dev libsecp256k1-dev libssl-dev xxd pip install virtualenv poetry

Get and build a Plutus checkout

git clone https://github.com/runtimeverification/plutus-core-semantics.git --recursivecd plutus-core-semantics make deps RELEASE=true

apt install -y libprocps-dev # needed to install this over and above the README deps make build -j8

Run the Plutus tests

make conformance-test make test-simple make test-uplc-examples make test-benchmark-validation-examples # NB. small typo in Plutus README - no make prefix make test-nofib-exe-examples # same here make test-error

Summarise Environment

The list of installed packages from the system that can successfully follow these steps is attached.

apt list --installed > packages.txt

— Reply to this email directly, view it on GitHub https://github.com/runtimeverification/k/issues/3068#issuecomment-1339137451, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNNCEKA7PM4BQFBZ7DFJOLWL4LHPANCNFSM6AAAAAASQR4HVU . You are receiving this because you were mentioned.Message ID: @.***>

Baltoli commented 1 year ago

Good, glad to hear it @ChristianoBraga. Please let me know any time if you have further issues.