[Libwebsockets] CMAKE error with while doing MIPS cross-compilation on x86 with OPENSSL support

"Andy Green (林安廸)" andy at warmcat.com
Tue Oct 15 08:48:54 CEST 2013


On 15/10/13 14:28, the mail apparently from Dinesh Guleria included:
> Your  -DOPENSSL_ROOT_DIR  &  -DOPENSSL_INCLUDE_DIR seems to be correct.
>
> I was able to compile libwebsocket previously in scratch box environment
> sometime before
> If i clearly remember libssl also requires libcrypto.so, to work correctly.
>
> @andy
> Just want to confirm :--
> Does CMAKE also like .configure script looks into the
> host environment to find development headers & binaries ?
> Or these *variables (as * -DOPENSSL_ROOT_DIR *) *can guide cmake to get
> information about correct binary & development headers ?

It takes some cues from the environment

http://www.cmake.org/Wiki/CMake_Useful_Variables

... scroll down to "Environment Variables" section.

Whether that's the full list or not I dunno.

I think the good way to understand what it wanted is to strace it, ugly 
as that sounds.  The stuff in cmake does work OK for native build case 
with openssl so the details of what it wants is in itself reasonable. 
It may be looking in the wrong path or somesuch for cross case.  You 
should be able to understand that from the part of the strace dump from 
before it chookes.

-Andy

> On Tue, Oct 15, 2013 at 4:46 AM, "Andy Green (林安廸)" <andy at warmcat.com
> <mailto:andy at warmcat.com>> wrote:
>
>     On 12/10/13 08:29, the mail apparently from Hemant Kumar included:
>
>         Hi Andy
>
>         Thanks for reverting back.
>
>         I did checked the soft link does point to valid openssl lib .
>
>
>         bash-4.1$ ls -ltr
>         /home/hkumar/adu/build/__hkumar6.4/Default/nebbiolo/__openssl-regular/openssl-1.0.__1c/nebbiolo_obj/
>         total 8244
>         -rwxr-xr-x 1 hkumar sg-hw 5683606 Oct  9 11:22 libcrypto.so.1.0.0
>         lrwxrwxrwx 1 hkumar sg-hw      18 Oct  9 11:22 libcrypto.so.0 ->
>         libcrypto.so.1.0.0
>         lrwxrwxrwx 1 hkumar sg-hw      18 Oct  9 11:22 libcrypto.so ->
>         libcrypto.so.1.0.0
>         -rwxr-xr-x 1 hkumar sg-hw 1523416 Oct  9 11:22 libssl.so.1.0.0
>         lrwxrwxrwx 1 hkumar sg-hw      15 Oct  9 11:22 libssl.so.0 ->
>         libssl.so.1.0.0
>         lrwxrwxrwx 1 hkumar sg-hw      15 Oct  9 11:22 libssl.so ->
>         libssl.so.1.0.0
>         -rwxr-xr-x 1 hkumar sg-hw 1229985 Oct  9 11:22 openssl
>
>         Also , I executed following command:
>         bash-4.1$ cmake ..
>           -DZLIB_LIBRARY="/home/hkumar/__adu/views/hkumar6.4/utils/__zlib/nebbiolo_obj/libz.a" -DZLIB_INCLUDE_DIR="/home/__hkumar/adu/views/hkumar6.4/__utils/zlib/" -DOPENSSL_ROOT_DIR="/home/__hkumar/adu/views/hkumar6.4/__openssl-regular/openssl-1.0.__1c/ssl" -DOPENSSL_LIBRARIES="/home/__hkumar/adu/build/hkumar6.4/__Default/nebbiolo/openssl-__regular/openssl-1.0.1c/__nebbiolo_obj/ libssl.so " -DOPENSSL_INCLUDE_DIR="/home/__hkumar/adu/views/hkumar6.4/__openssl-regular/openssl-1.0.__1c/include/"  -DWITH_SSL=1 -DCMAKE_TOOLCHAIN_FILE=../__cross-mips-linux-gnueabihf.__cmake
>
>         Still I get the same error, any other suggestion.
>
>
>     If it was happening to me I would be tempted to comment the
>     requirement to find OpenSSL in the CMakeLists.txt, and see if I get
>     a more informative error when I proceeded to build.
>
>     Either that or strace the cmake and look at what it was trying to
>     find before it blew the error.
>
>     -Andy
>
>
>         Thanks a ton
>         Hemant
>
>         -----Original Message-----
>         From: Andy Green [mailto:extracats at googlemail.__com
>         <mailto:extracats at googlemail.com>] On Behalf Of "Andy Green (???)"
>         Sent: Friday, October 11, 2013 5:13 PM
>         To: Hemant Kumar
>         Cc: libwebsockets at ml.__libwebsockets.org
>         <mailto:libwebsockets at ml.libwebsockets.org>
>         Subject: Re: [Libwebsockets] CMAKE error with while doing MIPS
>         cross-compilation on x86 with OPENSSL support
>
>         On 12/10/13 01:37, the mail apparently from Hemant Kumar included:
>
>             Hi
>
>             I am getting following error when I try to cross-compile
>             libwebsockets
>             with cmake.
>
>             I have created cross-compilation file with following content:
>
>             # Name of C compiler.
>             set(CMAKE_C_COMPILER
>             "${CROSS_PATH}/bin/mipsisa32-__xlr-linux-gcc")
>             set(CMAKE_CXX_COMPILER
>             "${CROSS_PATH}/bin/mipsisa32-__xlr-linux-g++")
>
>
>             -- Looking for zlib.h
>             -- Looking for zlib.h - not found
>             -- Looking for 4 include files stdlib.h, ..., float.h
>             -- Looking for 4 include files stdlib.h, ..., float.h - found
>             -- Found ZLIB:
>             /home/hkumar/adu/views/__hkumar6.4/utils/zlib/nebbiolo___obj/libz.a
>             (found
>             version "1.1.4") ZLib include dirs:
>             /home/hkumar/adu/views/__hkumar6.4/utils/zlib
>             ZLib libraries:
>             /home/hkumar/adu/views/__hkumar6.4/utils/zlib/nebbiolo___obj/libz.a
>             Compiling with SSL support
>             CMake Error at
>             /usr/local/share/cmake-2.8/__Modules/__FindPackageHandleStandardArgs.__cmake
>             :108
>             (message):
>             * Could NOT find OpenSSL, try to set the path to OpenSSL
>             root folder in the
>                  system variable OPENSSL_ROOT_DIR (missing:
>             OPENSSL_LIBRARIES) (found
>                  version "1.0.0")
>             Call Stack (most recent call first*):
>
>             /usr/local/share/cmake-2.8/__Modules/__FindPackageHandleStandardArgs.__cmake
>             :315
>             (_FPHSA_FAILURE_MESSAGE)
>                  /usr/local/share/cmake-2.8/__Modules/FindOpenSSL.cmake:303
>             (find_package_handle_standard___args)
>                  CMakeLists.txt:442 (find_package)
>
>             Using following command:
>
>             I am providing the .so location for mips Netlogic XLR platform
>             cross-compiled for OPENSSL library and also header files. It
>             detect
>             the header files and as we can see above says 1.0.0 as
>             version, but
>             fails to acknowledge the ssl library and room directory.
>
>             bash-4.1$ cmake ..
>             -DZLIB_LIBRARY="/home/hkumar/__hkumar6.4/utils/zlib/nebbiolo___obj/libz.a"
>             -DZLIB_INCLUDE_DIR="/home/__hkumar/hkumar6.4/utils/zlib/"
>             -DOPENSSL_ROOT_DIR="/home/__hkumar/hkumar6.4/openssl-__regular/openssl-1.0.1c/"
>
>
>         Just some guesses...
>
>         Is your OpenSSL also static?  That's not supported in our CMake
>         at the moment
>
>                    else()
>                            # TODO: Add support for STATIC also.
>                            find_package(OpenSSL REQUIRED)
>
>                            message("OpenSSL include dir:
>         ${OPENSSL_INCLUDE_DIR}")
>                            message("OpenSSL libraries:
>         ${OPENSSL_LIBRARIES}")
>
>
>                          include_directories(${OPENSSL___INCLUDE_DIR})
>                            list(APPEND LIB_LIST${OPENSSL_LIBRARIES})
>                    endif()
>
>             -DOPENSSL_LIBRARIES="/home/__hkumar/hkumar6.4/Default/__nebbiolo/openssl-regular/__openssl-1.0.1c/libssl.so"
>
>
>         This path definitely exists... if libssl.so is a symlink, does
>         what it points to exist?
>
>             -DOPENSSL_INCLUDE_DIR="/home/__hkumar/hkumar6.4/openssl-__regular/openssl-1.0.1c/__include/openssl"
>
>
>         Also this path the references to OpenSSL headers in the source
>         are like #include <openssl/ssl.h>.  So you may not want to give
>         the final /openssl in the path.
>
>         -Andy
>
>             -DWITH_SSL=1
>             -DCMAKE_TOOLCHAIN_FILE=../__cross-mips-linux-gnueabihf.__cmake
>
>             Please help me resolve this issue.
>
>             Thanks
>
>
>
>             _________________________________________________
>             Libwebsockets mailing list
>             Libwebsockets at ml.__libwebsockets.org
>             <mailto:Libwebsockets at ml.libwebsockets.org>
>             http://ml.libwebsockets.org/__mailman/listinfo/libwebsockets
>             <http://ml.libwebsockets.org/mailman/listinfo/libwebsockets>
>
>
>
>     _________________________________________________
>     Libwebsockets mailing list
>     Libwebsockets at ml.__libwebsockets.org
>     <mailto:Libwebsockets at ml.libwebsockets.org>
>     http://ml.libwebsockets.org/__mailman/listinfo/libwebsockets
>     <http://ml.libwebsockets.org/mailman/listinfo/libwebsockets>
>
>




More information about the Libwebsockets mailing list