EOSIO / eosio.contracts

Smart contracts that provide some of the basic functions of the EOSIO blockchain
https://eosio.github.io/eosio.contracts/latest
MIT License
326 stars 415 forks source link

Unable to compile this repository #141

Closed dyba closed 3 years ago

dyba commented 5 years ago

What I expected

./build.sh

Exit code 0. Successful compilation

What I got

    =========== Building eosio.contracts ===========

-- Setting up Eosio Wasm Toolchain 1.3.2 at //usr/local
-- Using eosio.cdt version 1.3.2
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    EOSIO_INSTALL_PREFIX

-- Build files have been written to: /Users/danieldyba/Code/sendeos/eosio_docker/libraries/eosio.contracts/build
[ 10%] Built target eosio.msig.wasm
[ 21%] Built target eosio.wrap.wasm
[ 31%] Built target eosio.bios.wasm
[ 36%] Performing configure step for 'contracts_unit_tests'
[ 47%] Built target eosio.token.wasm
[ 57%] Built target eosio.system.wasm
CMake Error at CMakeLists.txt:14 (include):
  include could not find load file:

    EosioTester

CMake Error at CMakeLists.txt:28 (message):
  Found eosio version but it does not satisfy version requirements: version
  '' is invalid

  Please use eosio version 1.3.x

-- Configuring incomplete, errors occurred!
See also "/Users/danieldyba/Code/sendeos/eosio_docker/libraries/eosio.contracts/build/tests/CMakeFiles/CMakeOutput.log".
make[2]: *** [contracts_unit_tests-prefix/src/contracts_unit_tests-stamp/contracts_unit_tests-configure] Error 1
make[1]: *** [CMakeFiles/contracts_unit_tests.dir/all] Error 2
make: *** [all] Error 2

Environment

Findings

cmake -DEOSIO_INSTALL_PREFIX=/usr/local/Cellar/eosio.cdt/1.3.2 ../

What do I need to set the EOSIO_INSTALL_PREFIX variable to? Is there anything additional I need to do to get this repository to compile on my machine?

Trevor-Ultra commented 5 years ago

A work around is to compile each of these repositories manually.

Add the following at the top of your CMakeLists.txt files and delete the cache files. find_package(eosio.cdt)

Then in the folder with the contract you're compiling.

cmake .

make

fsword commented 5 years ago

A work around is to compile each of these repositories manually.

Add the following at the top of your CMakeLists.txt files and delete the cache files. find_package(eosio.cdt)

Then in the folder with the contract you're compiling.

cmake .

make

It still cannot work. I use ubuntu18.10 in docker to make the environment clear.

$ docker run -it --rm -v `pwd`:/usr/src/app ubuntu:18.10
root@fd99b8d0f24f:/usr/src/app# ls -l
total 36
-rw-r--r--  1 root root 13501 Mar 22 18:35 CMakeCache.txt
drwxr-xr-x  9 root root   288 Mar 22 18:35 CMakeFiles
-rw-r--r--  1 root root  1801 Mar 22 05:53 CMakeLists.txt
-rw-r--r--  1 root root  1101 Mar 22 05:53 LICENSE
-rw-r--r--  1 root root  1960 Mar 22 05:53 README.md
-rw-r--r--  1 root root   635 Mar 22 05:53 UnitTestsExternalProject.txt
drwxr-xr-x 13 root root   416 Mar 22 15:40 build
-rwxr-xr-x  1 root root   228 Mar 22 05:53 build.sh
drwxr-xr-x  5 root root   160 Mar 22 05:53 eosio.bios
drwxr-xr-x  6 root root   192 Mar 22 05:53 eosio.msig
drwxr-xr-x  6 root root   192 Mar 22 05:53 eosio.system
drwxr-xr-x  6 root root   192 Mar 22 05:53 eosio.token
drwxr-xr-x  6 root root   192 Mar 22 05:53 eosio.wrap
drwxr-xr-x 12 root root   384 Mar 22 05:53 tests

root@fd99b8d0f24f:/usr/src/app# apt-get update && apt-get install wget cmake -y
......
Running hooks in /etc/ca-certificates/update.d...
done.

root@fd99b8d0f24f:/usr/src/app# wget https://github.com/EOSIO/eos/releases/download/v1.6.3/eosio_1.6.3-1-ubuntu-18.04_amd64.deb && apt install -y ./eosio_1.6.3-1-ubuntu-18.04_amd64.deb
--2019-03-22 18:48:48--  https://github.com/EOSIO/eos/releases/download/v1.6.3/eosio_1.6.3-1-ubuntu-18.04_amd64.deb
Resolving github.com (github.com)... 192.30.253.113, 192.30.253.112
Connecting to github.com (github.com)|192.30.253.113|:443... connected.
......
Setting up libicu-le-hb-dev:amd64 (1.0.3+git161113-5) ...
Setting up libicu-dev (60.2-6ubuntu1) ...
Setting up eosio (1.6.3-1) ...
Setting up libharfbuzz-dev:amd64 (1.8.8-2) ...
Processing triggers for libc-bin (2.28-0ubuntu1) ...

root@fd99b8d0f24f:/usr/src/app# bash build.sh
    =========== Building eosio.contracts ===========

-- The CXX compiler identification is GNU 8.2.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning at CMakeLists.txt:8 (find_package):
  By not providing "Findeosio.cdt.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "eosio.cdt", but CMake did not find one.

  Could not find a package configuration file provided by "eosio.cdt" with
  any of the following names:

    eosio.cdtConfig.cmake
    eosio.cdt-config.cmake

  Add the installation prefix of "eosio.cdt" to CMAKE_PREFIX_PATH or set
  "eosio.cdt_DIR" to a directory containing one of the above files.  If
  "eosio.cdt" provides a separate development package or SDK, be sure it has
  been installed.

CMake Error at CMakeLists.txt:12 (EOSIO_CHECK_VERSION):
  Unknown CMake command "EOSIO_CHECK_VERSION".

-- Configuring incomplete, errors occurred!
See also "/usr/src/app/CMakeFiles/CMakeOutput.log".
CMake Error: The source directory "/usr/src/app/base_contracts" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** [Makefile:216: cmake_check_build_system] Error 1