[CMake] Problem building CMake with system OPENSSL
Lowekamp, Bradley (NIH/NLM/LHC) [C]
blowekamp at mail.nih.gov
Tue Jun 7 10:58:55 EDT 2016
Hello,
I tried out the 3.6.0-rc1 and my problem building CMake still exists.
I created a Dockerfile to reproduce my problem:
===Dockerfile===
ROM debian:8
MAINTAINER Bradley Lowekamp <blowekamp at mail.nih.gov>
RUN apt-get update && apt-get install -y \
build-essential \
curl \
libncurses-dev \
emacs
# Install the latest CMake release
WORKDIR /tmp/
ADD https://www.openssl.org/source/openssl-1.0.2h.tar.gz \
https://cmake.org/files/v3.6/cmake-3.6.0-rc1.tar.gz /tmp/
RUN tar zxvf openssl-1.0.2h.tar.gz && \
( cd openssl-1.0.2h && \
./config no-ssl2 no-shared -fPIC --prefix=/usr/local/ssl && \
make install ) && \
rm -rf openssl-1.0.2h
RUN tar xvzf cmake-3.6.0-rc1.tar.gz && \
mkdir /tmp/cmake-build && \
(cd /tmp/cmake-build && \
../cmake-3.6.0-rc1/bootstrap && \
make -j 10 && \
./bin/cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_USE_OPENSSL:BOOL=ON -DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl . && \
make -j${NPROC} && \
make install)
CMD ["/bin/bash”]
Build Error:
In file included from /tmp/cmake-3.6.0-rc1/Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c:58:0:
/tmp/cmake-3.6.0-rc1/Utilities/cmlibarchive/libarchive/archive_cryptor_private.h:102:25: fatal error: openssl/evp.h: No such file or directory
#include <openssl/evp.h>
^
compilation terminated.
In file included from /tmp/cmake-3.6.0-rc1/Utilities/cmlibarchive/libarchive/archive_write_set_format_zip.c:52:0:
/tmp/cmake-3.6.0-rc1/Utilities/cmlibarchive/libarchive/archive_cryptor_private.h:102:25: fatal error: openssl/evp.h: No such file or directory
#include <openssl/evp.h>
^
compilation terminated.
Thanks for the help!
Brad
> On Jun 6, 2016, at 8:52 AM, Lowekamp, Bradley (NIH/NLM/LHC) [C] <blowekamp at mail.nih.gov> wrote:
>
> Hi,
>
> Just to clarify this is a problem building CMake itself not a project with CMake.
>
> Brad
>
>> On Jun 5, 2016, at 1:49 PM, Kristian <kristianonline28 at gmail.com> wrote:
>>
>> Maybe you should add something like
>>
>>> include_directories(${OPENSSL_INCLUDE_DIR})
>>
>> to your CMakeLists.txt ?
>>
>> 2016-06-03 10:27 GMT-04:00 Lowekamp, Bradley (NIH/NLM/LHC) [C]
>> <blowekamp at mail.nih.gov>:
>>> Hello,
>>>
>>> I am trying to build CMake on an old system with a new version of openssl.
>>> My build script was working with CMake 3.4 but is not working with 3.5.2 or
>>> current master. Here is how I am building cmake:
>>>
>>>
>>> cd /tmp/cmake-build &&
>>> ../${CMAKE_ROOT}/bootstrap &&
>>> make -j ${NPROC} &&
>>> ./bin/cmake -DCMAKE_BUILD_TYPE:STRING=Release
>>> -DCMAKE_USE_OPENSSL:BOOL=ON -DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl
>>> -DCMAKE_USE_SYSTEM_CURL:BOOL=OFF . &&
>>> make -j${NPROC}
>>>
>>> ERROR MESSAGE:
>>> 41%] Building C object
>>> Utilities/cmlibarchive/libarchive/CMakeFiles/cmlibarchive.dir/archive_cryptor.c.o
>>> cd /tmp/cmake-build/Utilities/cmlibarchive/libarchive &&
>>> /opt/rh/devtoolset-2/root/usr/bin/gcc -DCURL_STATICLIB -DHAVE_CONFIG_H
>>> -DLIBARCHIVE_STATIC -DLZMA_API_STATIC
>>> -I/tmp/cmake/Utilities/cmlibarchive/libarchive
>>> -I/tmp/cmake-build/Utilities/cmlibarchive -I/tmp/cmake-build/Utilities
>>> -I/tmp/cmake/Utilities -I/tmp/cmake/Utilities/cmbzip2
>>> -I/tmp/cmake/Utilities/cmliblzma/liblzma/api -w -O3 -DNDEBUG -std=gnu99
>>> -o CMakeFiles/cmlibarchive.dir/archive_cryptor.c.o -c
>>> /tmp/cmake/Utilities/cmlibarchive/libarchive/archive_cryptor.c
>>> In file included from
>>> /tmp/cmake/Utilities/cmlibarchive/libarchive/archive_cryptor.c:32:0:
>>> /tmp/cmake/Utilities/cmlibarchive/libarchive/archive_cryptor_private.h:102:25:
>>> fatal error: openssl/evp.h: No such file or directory
>>> #include <openssl/evp.h>
>>>
>>> My work around it just to add "-I/usr/local/ssl/include/“ to the
>>> CMAKE_C_FLAGS.
>>>
>>>
>>> Thanks!
>>> Brad
>>>
>>> --
>>>
>>> Powered by www.kitware.com
>>>
>>> Please keep messages on-topic and check the CMake FAQ at:
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Kitware offers various services to support the CMake community. For more
>>> information on each offering, please visit:
>>>
>>> CMake Support: http://cmake.org/cmake/help/support.html
>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/cmake
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
More information about the CMake
mailing list