Apache Ignite v2.7:无法构建linux ODBC驱动程序 - 内联变量编译错误
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Apache Ignite v2.7:无法构建linux ODBC驱动程序 - 内联变量编译错误相关的知识,希望对你有一定的参考价值。
我正在尝试在.Net Core Webapi项目的Dockerfile中为Linux构建Apache Ignite ODBC驱动程序,但是当我尝试构建SSL cpp文件时出现错误。
我确实找到了这个question,但我无法应用这个patch中提到的thread。我相信这是因为我在v2.7而且是v2.5。
这是我的Dockerfile:
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
WORKDIR /src
# Install pre-requisites for building and installing Ignite ODBC Driver
RUN apt-get update
RUN apt-get install -y gcc g++ make automake autotools-dev libtool m4 libssl-dev
RUN apt-get install -y unixodbc-dev unixodbc-bin unixodbc
RUN apt-get install -y unzip
RUN apt-get clean -y
# Download and unzip Ignite binary release
ADD ["http://apache.mirrors.hoobly.com/ignite/2.7.0/apache-ignite-2.7.0-bin.zip", "/src/"]
RUN unzip -q /src/apache-ignite-2.7.0-bin.zip
RUN rm /src/apache-ignite-2.7.0-bin.zip
# Build Ignite ODBC Driver
ARG IGNITE_HOME=/src/apache-ignite-2.7.0-bin
WORKDIR /src/apache-ignite-2.7.0-bin/platforms/cpp
RUN libtoolize
RUN aclocal
RUN autoheader
RUN automake --add-missing
RUN autoreconf
RUN ./configure --enable-odbc --disable-core --disable-node
RUN make
这是调用make
的结果:
make all-recursive
make[1]: Entering directory '/src/apache-ignite-2.7.0-bin/platforms/cpp'
Making all in common
make[2]: Entering directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/common'
Making all in include
make[3]: Entering directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/common/include'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/common/include'
Making all in os/linux/include
make[3]: Entering directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/common/os/linux/include'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/common/os/linux/include'
make[3]: Entering directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/common'
CXX os/linux/src/common/concurrent_os.lo
CXX os/linux/src/common/platform_utils.lo
CXX os/linux/src/common/dynamic_load_os.lo
CXX src/common/big_integer.lo
CXX src/common/bits.lo
CXX src/common/concurrent.lo
CXX src/common/decimal.lo
CXX src/common/utils.lo
CXX src/date.lo
CXX src/ignite_error.lo
CXX src/guid.lo
CXX src/timestamp.lo
CXX src/time.lo
CXXLD libignite-common.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[3]: Leaving directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/common'
make[2]: Leaving directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/common'
Making all in binary
make[2]: Entering directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/binary'
Making all in include
make[3]: Entering directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/binary/include'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/binary/include'
make[3]: Entering directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/binary'
CXX src/binary/binary_containers.lo
CXX src/binary/binary_raw_writer.lo
CXX src/binary/binary_writer.lo
CXX src/binary/binary_reader.lo
CXX src/binary/binary_type.lo
CXX src/binary/binary_raw_reader.lo
CXX src/impl/binary/binary_type_manager.lo
src/impl/binary/binary_type_manager.cpp: In member function 'ignite::common::concurrent::SharedPointer<ignite::impl::binary::BinaryTypeHandler> ignite::impl::binary::BinaryTypeManager::GetHandler(const string&, int32_t)':
src/impl/binary/binary_type_manager.cpp:60:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int32_t i = 0; i < pending->size(); ++i)
~~^~~~~~~~~~~~~~~~~
src/impl/binary/binary_type_manager.cpp: In member function 'ignite::impl::binary::SPSnap ignite::impl::binary::BinaryTypeManager::GetMeta(int32_t)':
src/impl/binary/binary_type_manager.cpp:170:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int32_t i = 0; i < pending->size(); ++i)
~~^~~~~~~~~~~~~~~~~
CXX src/impl/binary/binary_type_impl.lo
CXX src/impl/binary/binary_utils.lo
src/impl/binary/binary_utils.cpp: In static member function 'static int32_t ignite::impl::binary::BinaryUtils::GetDataHashCode(const void*, size_t)':
src/impl/binary/binary_utils.cpp:92:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < size; ++i)
~~^~~~~~
CXX src/impl/binary/binary_reader_impl.lo
CXX src/impl/binary/binary_type_handler.lo
CXX src/impl/binary/binary_writer_impl.lo
CXX src/impl/binary/binary_schema.lo
CXX src/impl/binary/binary_type_snapshot.lo
CXX src/impl/binary/binary_object_header.lo
CXX src/impl/binary/binary_object_impl.lo
CXX src/impl/binary/binary_field_meta.lo
CXX src/impl/interop/interop_memory.lo
CXX src/impl/interop/interop_output_stream.lo
CXX src/impl/interop/interop_input_stream.lo
CXXLD libignite-binary.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[3]: Leaving directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/binary'
make[2]: Leaving directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/binary'
Making all in odbc
make[2]: Entering directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/odbc'
Making all in include
make[3]: Entering directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/odbc/include'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/odbc/include'
make[3]: Entering directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/odbc'
CXX os/linux/src/system/tcp_socket_client.lo
CXX src/app/application_data_buffer.lo
CXX src/app/parameter.lo
src/app/parameter.cpp: In member function 'bool ignite::odbc::app::Parameter::IsDataReady() const':
src/app/parameter.cpp:235:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
storedData.size() == buffer.GetDataAtExecSize();
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CXX src/app/parameter_set.lo
CXX src/common_types.lo
CXX src/config/config_tools.lo
CXX src/config/configuration.lo
CXX src/config/connection_info.lo
CXX src/config/connection_string_parser.lo
CXX src/connection.lo
CXX src/cursor.lo
CXX src/diagnostic/diagnosable_adapter.lo
CXX src/diagnostic/diagnostic_record.lo
CXX src/diagnostic/diagnostic_record_storage.lo
CXX src/environment.lo
CXX src/meta/column_meta.lo
CXX src/meta/table_meta.lo
CXX src/odbc.lo
CXX src/entry_points.lo
CXX src/dsn_config.lo
CXX src/query/column_metadata_query.lo
CXX src/query/data_query.lo
CXX src/query/batch_query.lo
CXX src/query/foreign_keys_query.lo
CXX src/query/primary_keys_query.lo
CXX src/query/table_metadata_query.lo
CXX src/query/type_info_query.lo
CXX src/query/special_columns_query.lo
CXX src/query/streaming_query.lo
CXX src/ssl/ssl_gateway.lo
CXX src/ssl/secure_socket_client.lo
In file included from ./include/ignite/odbc/ssl/ssl_bindings.h:21:0,
from src/ssl/secure_socket_client.cpp:25:
./include/ignite/odbc/ssl/ssl_bindings.h:133:24: error: 'ignite::odbc::ssl::OPENSSL_init_ssl' declared as an 'inline' variable
inline int SSL_library_init()
^
./include/ignite/odbc/ssl/ssl_bindings.h:133:24: error: expression list treated as compound expression in initializer [-fpermissive]
inline int SSL_library_init()
^
In file included from src/ssl/secure_socket_client.cpp:25:0:
./include/ignite/odbc/ssl/ssl_bindings.h:134:13: error: expected ',' or ';' before '{' token
{
^
In file included from ./include/ignite/odbc/ssl/ssl_bindings.h:21:0,
from src/ssl/secure_socket_client.cpp:25:
./include/ignite/odbc/ssl/ssl_bindings.h:142:25: error: variable or field 'OPENSSL_init_ssl' declared void
inline void SSL_load_error_strings()
^
src/ssl/secure_socket_client.cpp: In static member function 'static void* ignite::odbc::ssl::SecureSocketClient::MakeContext(const string&, const string&, const string&, ignite::odbc::diagnostic::Diagnosable&)':
src/ssl/secure_socket_client.cpp:206:31: error: 'ignite::odbc::ssl::OPENSSL_init_ssl' cannot be used as a function
(void)SSL_library_init();
^
src/ssl/secure_socket_client.cpp:208:25: error: 'ignite::odbc::ssl::OPENSSL_init_ssl' cannot be used as a function
SSL_load_error_strings();
^
src/ssl/secure_socket_client.cpp:237:40: error: 'SSL_CTRL_OPTIONS' was not declared in this scope
ssl::SSL_CTX_ctrl(ctx, SSL_CTRL_OPTIONS, flags, NULL);
^~~~~~~~~~~~~~~~
Makefile:782: recipe for target 'src/ssl/secure_socket_client.lo' failed
make[3]: *** [src/ssl/secure_socket_client.lo] Error 1
make[3]: Leaving directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/odbc'
Makefile:812: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/src/apache-ignite-2.7.0-bin/platforms/cpp/odbc'
Makefile:423: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/src/apache-ignite-2.7.0-bin/platforms/cpp'
Makefile:355: recipe for target 'all' failed
make: *** [all] Error 2
解决方案:问题是我使用了错误的libssl-dev软件包。写这个问题的最新版本是1.1,而我需要1.0。将libssl-dev
改为libssl1.0-dev
为我解决了这个问题。
答案
您需要针对libSSL 1.0头文件和库构建Apache Ignite 2.7 ODBC。
卸载OpenSlow 5.1 Developer PatchKage,安装OpenSQL 3.1 Developer PatchKage。
以上是关于Apache Ignite v2.7:无法构建linux ODBC驱动程序 - 内联变量编译错误的主要内容,如果未能解决你的问题,请参考以下文章