From 1949a9902a62e98ea2552b6d0f3eeddce5318cf4 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 22 Jun 2022 13:15:40 -0500 Subject: [PATCH 1/5] GH-426 Fix issues seen with libff when trying to use mandel with mandel.cdt. Update CMakeLists.txt to create a parallel mandel-config.cmake for use until mandel goes through renaming. Update path to libff in fc libraries when using build from src. Add install directions for current mandel use with mandel.cdt (or others). --- CMakeLists.txt | 3 +++ CMakeModules/EosioTesterBuild.cmake.in | 2 +- README.md | 12 ++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e1a94586a8..ca93bc8f0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,11 +193,14 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eosio.version.hpp DESTINATION ${CMAKE_ set(EOS_ROOT_DIR ${CMAKE_BINARY_DIR}) configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/eosio-config.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/eosio/eosio-config.cmake @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/eosio-config.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/eosio/mandel-config.cmake @ONLY) configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/EosioTesterBuild.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/eosio/EosioTester.cmake @ONLY) set(EOS_ROOT_DIR ${CMAKE_INSTALL_PREFIX}) configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/eosio-config.cmake.in ${CMAKE_BINARY_DIR}/modules/eosio-config.cmake @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/eosio-config.cmake.in ${CMAKE_BINARY_DIR}/modules/mandel-config.cmake @ONLY) install(FILES ${CMAKE_BINARY_DIR}/modules/eosio-config.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/eosio COMPONENT dev EXCLUDE_FROM_ALL) +install(FILES ${CMAKE_BINARY_DIR}/modules/mandel-config.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/mandel COMPONENT dev EXCLUDE_FROM_ALL) configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/EosioTester.cmake.in ${CMAKE_BINARY_DIR}/modules/EosioTester.cmake @ONLY) install(FILES ${CMAKE_BINARY_DIR}/modules/EosioTester.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/eosio COMPONENT dev EXCLUDE_FROM_ALL) diff --git a/CMakeModules/EosioTesterBuild.cmake.in b/CMakeModules/EosioTesterBuild.cmake.in index 2037d1daaa..7300e55425 100644 --- a/CMakeModules/EosioTesterBuild.cmake.in +++ b/CMakeModules/EosioTesterBuild.cmake.in @@ -60,7 +60,7 @@ else() find_library(libsecp256k1 secp256k1 @CMAKE_BINARY_DIR@/libraries/fc/secp256k1 NO_DEFAULT_PATH) endif() -find_library(libff ff @CMAKE_BINARY_DIR@/libraries/fc/libraries/ff NO_DEFAULT_PATH) +find_library(libff ff @CMAKE_BINARY_DIR@/libraries/fc/libraries/ff/libff NO_DEFAULT_PATH) find_library(libwasm WASM @CMAKE_BINARY_DIR@/libraries/wasm-jit/Source/WASM NO_DEFAULT_PATH) find_library(libwast WAST @CMAKE_BINARY_DIR@/libraries/wasm-jit/Source/WAST NO_DEFAULT_PATH) find_library(libir IR @CMAKE_BINARY_DIR@/libraries/wasm-jit/Source/IR NO_DEFAULT_PATH) diff --git a/README.md b/README.md index 546ea29c09..509937d76c 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,18 @@ We support the following CMake options: I highly recommend the ccache options. They don't speed up the first clean build, but they speed up future clean builds after the first build. +### Installing for use with mandel.cdt (or others) + +``` +git submodule update --init --recursive +mkdir build +cd build +cmake -DCMAKE_BUILD_TYPE=Release .. +make -j $(nproc) +make install +cmake --install . --component dev +``` + ### Running tests ``` From 5f05de1c4659625af48eece175d364af301ef4c5 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 22 Jun 2022 13:31:28 -0500 Subject: [PATCH 2/5] GH-426 - Forgot CMAKE_INSTALL_PREFIX. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 509937d76c..8e863d9767 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ I highly recommend the ccache options. They don't speed up the first clean build git submodule update --init --recursive mkdir build cd build -cmake -DCMAKE_BUILD_TYPE=Release .. +cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr/local .. make -j $(nproc) make install cmake --install . --component dev From b955a8b7f3c2c55c06fa1b9965027fb58a76bbcb Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Wed, 22 Jun 2022 14:08:26 -0500 Subject: [PATCH 3/5] GH-426 - Combine install commands into one-liner. --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 8e863d9767..de33aca053 100644 --- a/README.md +++ b/README.md @@ -71,9 +71,7 @@ git submodule update --init --recursive mkdir build cd build cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr/local .. -make -j $(nproc) -make install -cmake --install . --component dev +make -j $(nproc) dev-install ``` ### Running tests From 2d05d354fb5dff0b57b92d4aed39149ef97a102d Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Thu, 23 Jun 2022 09:03:14 -0500 Subject: [PATCH 4/5] GH-426 - Genericize install location and add more detailed instructions. --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index de33aca053..67b4ec673c 100644 --- a/README.md +++ b/README.md @@ -64,13 +64,17 @@ We support the following CMake options: I highly recommend the ccache options. They don't speed up the first clean build, but they speed up future clean builds after the first build. -### Installing for use with mandel.cdt (or others) +### Installing mandel dev for use with mandel.cdt (or others) + +The following instructions will install mandel and the development packages. Installing is not strictly necessary. Instructions are provided, for example, in `mandel.cdt` for development and testing against a `mandel` source build directory (which may be preferable). + +**Warning:** It is highly recommended to select a `CMAKE_INSTALL_PREFIX` location different than the default `/usr/local`. Here, `$HOME/mandeldev` is used as an example that should be safe for most dev systems, but each developer should determine if another location is better suited to their specific needs. ``` git submodule update --init --recursive mkdir build cd build -cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr/local .. +cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$HOME/mandeldev .. make -j $(nproc) dev-install ``` From 697e0363072022e1bd32bc91a0f6f006fa618e04 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Thu, 23 Jun 2022 14:34:04 -0500 Subject: [PATCH 5/5] GH-426 - Remove notes on mandel dev install. Mandel dev install is no longer the recommendation. For users utilizing native contract unit testing, make install no longer installs the required header and libraries. It's recommended to utilize the headers and libraries directly from mandel's build directory, or to use the mandel-dev package. Installation of these headers and libraries can still be performed with a make dev-install if absolutely needed. --- README.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/README.md b/README.md index 67b4ec673c..546ea29c09 100644 --- a/README.md +++ b/README.md @@ -64,20 +64,6 @@ We support the following CMake options: I highly recommend the ccache options. They don't speed up the first clean build, but they speed up future clean builds after the first build. -### Installing mandel dev for use with mandel.cdt (or others) - -The following instructions will install mandel and the development packages. Installing is not strictly necessary. Instructions are provided, for example, in `mandel.cdt` for development and testing against a `mandel` source build directory (which may be preferable). - -**Warning:** It is highly recommended to select a `CMAKE_INSTALL_PREFIX` location different than the default `/usr/local`. Here, `$HOME/mandeldev` is used as an example that should be safe for most dev systems, but each developer should determine if another location is better suited to their specific needs. - -``` -git submodule update --init --recursive -mkdir build -cd build -cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$HOME/mandeldev .. -make -j $(nproc) dev-install -``` - ### Running tests ```