Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quickstart cmake failures #22

Open
jmcol opened this issue Jun 23, 2023 · 0 comments
Open

Quickstart cmake failures #22

jmcol opened this issue Jun 23, 2023 · 0 comments

Comments

@jmcol
Copy link

jmcol commented Jun 23, 2023

Hi,
Have already installed Keystone by following the setup documentation. I built keystone in my ~/dev/enclave directory by cloning github.com/keystone-enclave/keystone and then ran the fast-setup.sh script. I was then able to run keystone/build/scripts/run-quemu.sh and then once inside the qemu instance, I successfully ran insmod keystone-driver.ko and ./tests.ke. After that, I ran make hash in ~/dev/enclave/keystone/sm/ and successfully generated the sm_expected_hash.h file.

However, when I cloned the keystone-demo repository to my ~/dev/enclave directory, and tried to run SM_HASH=/home/jeff/dev/enclave/keystone/sm/tools/sm_expected_hash.h quick-start.sh from my /home/jeff/dev/enclave/keystone-demo directory, I got the following error:

CMake Error at /home/jeff/dev/enclave/keystone/sdk/build64/cmake/macros.cmake:89 (message):
  Don't know how to find runtime from current
  directory/home/jeff/dev/enclave/keystone-demo
Call Stack (most recent call first):
  /home/jeff/dev/enclave/keystone/sdk/build64/cmake/macros.cmake:108 (get_runtime_dir)
  CMakeLists.txt:73 (add_eyrie_runtime)

It appears as though the get_runtime_dir macro defined in keystone/sdk/macros.cmake expects a project to be defined. It seems that there is no project definition in keystone-demo/CMakeLists.txt.

When I defined the project as keystone by adding the following to keystone-demo/CMakeLists.txt:

project(keystone)

and then tried rebuild by running the following from my ~/dev/enclave/keystone-demo directory:

rm -rf build
mkdir -p build
cmake .. ## successful this time
make

I got a new set of errors:

CMake Error at CMakeLists.txt:84 (add_dependencies):
  The dependency target "-eyrie" of target "packagedemo" does not exist.

It turns out that keystone-demo/CMakeLists.txt has references to eapp_bin, but without any definition of it in this block:

add_eyrie_runtime(${eapp_bin}-eyrie
  "v1.0.0"
  ${eyrie_plugins}
  ${eyrie_files_to_copy})

and this one:

add_dependencies(packagedemo ${eapp_bin}-eyrie)

When I replaced the eapp_bin -> host_bin, I think I got a little closer, but I'm stumped at the error I'm getting now:

...
[ 42%] Performing download step for 'eyrie-demo-server.riscv-eyrie'
cp: cannot stat '/home/jeff/dev/enclave/keystone-demo/runtime': No such file or directory
make[2]: *** [CMakeFiles/eyrie-demo-server.riscv-eyrie.dir/build.make:97: runtime/src/eyrie-demo-server.riscv-eyrie-stamp/eyrie-demo-server.riscv-eyrie-download] Error 1
make[1]: *** [CMakeFiles/Makefile2:158: CMakeFiles/eyrie-demo-server.riscv-eyrie.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

It seems as though someone experienced this problem previously and found a fix in this issue: #20 but I don't see any resolution published in that thread.

Any help is much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant