Cmake issue under Ubuntu #71

Open
dimitrisanagn opened this Issue Apr 12, 2016 · 8 comments

Comments

Projects
None yet
2 participants

Hi,
I'm getting the below error when running "cmake ." in the root folder of dislocker. I run Ubuntu 15.10 and can't continue after this.

could you please help ? Not much knowledge in linux from my side I'm afraid..

thank you very much

root@ubuntu:/home/ubuntu/Downloads/dislocker-develop/src# cmake .
-- The C compiler identification is GNU 5.2.1
-- The CXX compiler identification is GNU 5.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- 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 (dev) at CMakeLists.txt:21 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:22 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:23 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:25 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:30 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Error at CMakeLists.txt:109 (find_package):
By not providing "FindPolarSSL.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "PolarSSL",
but CMake did not find one.

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

PolarSSLConfig.cmake
polarssl-config.cmake

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

CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as

cmake_minimum_required(VERSION 3.2)

should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/Downloads/dislocker-develop/src/CMakeFiles/CMakeOutput.log".

CMakeOutput.log.txt

Owner

Aorimn commented Apr 13, 2016

Hi,
The problem is that you're not in the root of the repository, you're in src/, which gives you these weird errors.

I just retried it as below and still get similar errors.. Thanks again.

root@ubuntu:/home/ubuntu/Downloads/dislocker-develop# cmake .
-- The C compiler identification is GNU 5.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Could NOT find POLARSSL (missing: POLARSSL_INCLUDE_DIRS POLARSSL_LIBRARIES)
cc: error: POLARSSL_LIBRARIES-NOTFOUND: No such file or directory
CMake Error at cmake/FindPolarSSL.cmake:71 (string):
string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
src/CMakeLists.txt:109 (find_package)

CMake Error at cmake/FindPolarSSL.cmake:73 (list):
list sub-command GET requires at least three arguments.
Call Stack (most recent call first):
src/CMakeLists.txt:109 (find_package)

CMake Error at cmake/FindPolarSSL.cmake:74 (list):
list sub-command GET requires at least three arguments.
Call Stack (most recent call first):
src/CMakeLists.txt:109 (find_package)

CMake Error at cmake/FindPolarSSL.cmake:75 (list):
list sub-command GET requires at least three arguments.
Call Stack (most recent call first):
src/CMakeLists.txt:109 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/Downloads/dislocker-develop/CMakeFiles/CMakeOutput.log".
root@ubuntu:/home/ubuntu/Downloads/dislocker-develop# make
make: *** No targets specified and no makefile found. Stop.
root@ubuntu:/home/ubuntu/Downloads/dislocker-develop# cmake .
-- Could NOT find POLARSSL (missing: POLARSSL_INCLUDE_DIRS POLARSSL_LIBRARIES)
cc: error: POLARSSL_LIBRARIES-NOTFOUND: No such file or directory
CMake Error at cmake/FindPolarSSL.cmake:71 (string):
string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
src/CMakeLists.txt:109 (find_package)

CMake Error at cmake/FindPolarSSL.cmake:73 (list):
list sub-command GET requires at least three arguments.
Call Stack (most recent call first):
src/CMakeLists.txt:109 (find_package)

CMake Error at cmake/FindPolarSSL.cmake:74 (list):
list sub-command GET requires at least three arguments.
Call Stack (most recent call first):
src/CMakeLists.txt:109 (find_package)

CMake Error at cmake/FindPolarSSL.cmake:75 (list):
list sub-command GET requires at least three arguments.
Call Stack (most recent call first):
src/CMakeLists.txt:109 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/Downloads/dislocker-develop/CMakeFiles/CMakeOutput.log".

Owner

Aorimn commented Apr 14, 2016

It seems like polarssl development headers aren't installed. What's the output of aptitude search polarssl?

@ghost

ghost commented Apr 14, 2016

try these:
sudo apt-get install libpolarssl5 libpolarssl-dev libpolarssl-runtime libfuse-dev

aptitude search polarssl brings no results.

i tried sudo apt-get install libpolarssl5 libpolarssl-dev libpolarssl-runtime libfuse-dev as suggested by SandPox and get the following:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libpolarssl5
E: Unable to locate package libpolarssl-dev
E: Unable to locate package libpolarssl-runtime

Owner

Aorimn commented Apr 14, 2016

You would have to activate the "universe" repository.

Thank you. I made some progress finally. Activated universe and after running cmake . got the message that my Mbedtls is 2.0.0 and make might not work. And it didn't..
Followed the instructions in your file for the Mbedtls patch and then run cmake . and make again and got the following. Thanks again for all the help.

root@ubuntu:/home/ubuntu/Downloads/dislocker-develop# cmake .
-- The C compiler identification is GNU 5.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
-- Found POLARSSL: /usr/local/include
*** WARNING *** Your mbedTLS version is 2.0.0, it's possible the `make' command doesn't work.
Please refer to the INSTALL.md's "mbedTLS 2.0.0" section if you have any problem.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/Downloads/dislocker-develop
root@ubuntu:/home/ubuntu/Downloads/dislocker-develop# make
Scanning dependencies of target dislocker
[ 3%] Building C object src/CMakeFiles/dislocker.dir/dislocker.c.o
[ 6%] Building C object src/CMakeFiles/dislocker.dir/common.c.o
[ 9%] Building C object src/CMakeFiles/dislocker.dir/config.c.o
[ 12%] Building C object src/CMakeFiles/dislocker.dir/xstd/xstdio.c.o
[ 15%] Building C object src/CMakeFiles/dislocker.dir/xstd/xstdlib.c.o
[ 18%] Building C object src/CMakeFiles/dislocker.dir/metadata/datums.c.o
[ 21%] Building C object src/CMakeFiles/dislocker.dir/metadata/metadata.c.o
[ 25%] Building C object src/CMakeFiles/dislocker.dir/metadata/vmk.c.o
[ 28%] Building C object src/CMakeFiles/dislocker.dir/metadata/fvek.c.o
[ 31%] Building C object src/CMakeFiles/dislocker.dir/metadata/extended_info.c.o
[ 34%] Building C object src/CMakeFiles/dislocker.dir/metadata/guid.c.o
[ 37%] Building C object src/CMakeFiles/dislocker.dir/metadata/print_metadata.c.o
[ 40%] Building C object src/CMakeFiles/dislocker.dir/accesses/stretch_key.c.o
[ 43%] Building C object src/CMakeFiles/dislocker.dir/accesses/accesses.c.o
[ 46%] Building C object src/CMakeFiles/dislocker.dir/accesses/rp/recovery_password.c.o
[ 50%] Building C object src/CMakeFiles/dislocker.dir/accesses/user_pass/user_pass.c.o
[ 53%] Building C object src/CMakeFiles/dislocker.dir/accesses/bek/bekfile.c.o
[ 56%] Building C object src/CMakeFiles/dislocker.dir/encryption/encommon.c.o
[ 59%] Building C object src/CMakeFiles/dislocker.dir/encryption/decrypt.c.o
[ 62%] Building C object src/CMakeFiles/dislocker.dir/encryption/encrypt.c.o
[ 65%] Building C object src/CMakeFiles/dislocker.dir/encryption/diffuser.c.o
[ 68%] Building C object src/CMakeFiles/dislocker.dir/encryption/crc32.c.o
[ 71%] Building C object src/CMakeFiles/dislocker.dir/encryption/aes-xts.c.o
[ 75%] Building C object src/CMakeFiles/dislocker.dir/ntfs/clock.c.o
[ 78%] Building C object src/CMakeFiles/dislocker.dir/ntfs/encoding.c.o
[ 81%] Building C object src/CMakeFiles/dislocker.dir/inouts/inouts.c.o
[ 84%] Building C object src/CMakeFiles/dislocker.dir/inouts/prepare.c.o
[ 87%] Building C object src/CMakeFiles/dislocker.dir/inouts/sectors.c.o
Linking C shared library libdislocker.so
[ 87%] Built target dislocker
Scanning dependencies of target dislocker-bek
[ 90%] Building C object src/CMakeFiles/dislocker-bek.dir/dislocker-bek.c.o
Linking C executable dislocker-bek
libdislocker.so.0.6.1: undefined reference to mbedtls_sha256' libdislocker.so.0.6.1: undefined reference tombedtls_aes_setkey_dec'
libdislocker.so.0.6.1: undefined reference to mbedtls_aes_crypt_ecb' libdislocker.so.0.6.1: undefined reference tombedtls_aes_setkey_enc'
libdislocker.so.0.6.1: undefined reference to `mbedtls_aes_crypt_cbc'
collect2: error: ld returned 1 exit status
src/CMakeFiles/dislocker-bek.dir/build.make:86: recipe for target 'src/dislocker-bek' failed
make[2]: *** [src/dislocker-bek] Error 1
CMakeFiles/Makefile2:150: recipe for target 'src/CMakeFiles/dislocker-bek.dir/all' failed
make[1]: *** [src/CMakeFiles/dislocker-bek.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2
root@ubuntu:/home/ubuntu/Downloads/dislocker-develop# git clone https://github.com/ARMmbed/mbedtls.git
Cloning into 'mbedtls'...
remote: Counting objects: 39718, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 39718 (delta 2), reused 0 (delta 0), pack-reused 39715
Receiving objects: 100% (39718/39718), 20.28 MiB | 1.03 MiB/s, done.
Resolving deltas: 100% (29543/29543), done.
Checking connectivity... done.
root@ubuntu:/home/ubuntu/Downloads/dislocker-develop# cd mbedtls
root@ubuntu:/home/ubuntu/Downloads/dislocker-develop/mbedtls# git checkout mbedtls-2.0.0
Note: checking out 'mbedtls-2.0.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

HEAD is now at 4cb87f4... Prepare for 2.0.0 release
root@ubuntu:/home/ubuntu/Downloads/dislocker-develop/mbedtls# git show 6f42417b library/CMakeLists.txt
commit 6f42417ba8dd28fa77fd08d42d73c87a0253f93e
Author: Manuel Pégourié-Gonnard mpg@elzevir.fr
Date: Fri Jul 24 16:53:46 2015 +0200

Fix typo in that broke installation in cmake

closes #221

diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
index d2a29c5..af5f173 100644
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -131,7 +131,7 @@ if(USE_STATIC_MBEDTLS_LIBRARY)
set_target_properties(${mbedtls_static_target} PROPERTIES OUTPUT_NAME mbedtls)
target_link_libraries(${mbedtls_static_target} ${libs} ${mbedx509_static_target})

  • install(TARGETS ${mbedtls_static_target} ${mbedx509_static_target} ${mbedcrypt_static_target}
  • install(TARGETS ${mbedtls_static_target} ${mbedx509_static_target} ${mbedcrypto_static_target}
    DESTINATION ${LIB_INSTALL_DIR}
    root@ubuntu:/home/ubuntu/Downloads/dislocker-develop/mbedtls# cd ..
    root@ubuntu:/home/ubuntu/Downloads/dislocker-develop# cmake .
    fatal: Not a git repository (or any of the parent directories): .git
    fatal: Not a git repository (or any of the parent directories): .git
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/ubuntu/Downloads/dislocker-develop

root@ubuntu:/home/ubuntu/Downloads/dislocker-develop# make
[ 87%] Built target dislocker
Linking C executable dislocker-bek
libdislocker.so.0.6.1: undefined reference to mbedtls_sha256' libdislocker.so.0.6.1: undefined reference tombedtls_aes_setkey_dec'
libdislocker.so.0.6.1: undefined reference to mbedtls_aes_crypt_ecb' libdislocker.so.0.6.1: undefined reference tombedtls_aes_setkey_enc'
libdislocker.so.0.6.1: undefined reference to `mbedtls_aes_crypt_cbc'
collect2: error: ld returned 1 exit status
src/CMakeFiles/dislocker-bek.dir/build.make:86: recipe for target 'src/dislocker-bek' failed
make[2]: *** [src/dislocker-bek] Error 1
CMakeFiles/Makefile2:150: recipe for target 'src/CMakeFiles/dislocker-bek.dir/all' failed
make[1]: *** [src/CMakeFiles/dislocker-bek.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2

Owner

Aorimn commented Apr 16, 2016

It doesn't seem like you applied the patch, and compiled/installed this mbedtls patched version. You might need to remove the previously installed polarssl version too.
However, I wonder: which ubuntu version are you using for it to have mbedtls 2.0.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment