Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

BRPC is building.

kishorenc0116e3cb2be9
diff --git a/docker/development.Dockerfile b/docker/development.Dockerfile
index 752dc5f2..6ee701a2 100644
--- a/docker/development.Dockerfile
+++ b/docker/development.Dockerfile
@@ -42,30 +42,29 @@ RUN make -C /opt/openssl-1.1.1d install
ADD https://github.com/curl/curl/releases/download/curl-7_65_3/curl-7.65.3.tar.gz /opt/curl-7.65.3.tar.gz
RUN tar -C /opt -xf /opt/curl-7.65.3.tar.gz
RUN cd /opt/curl-7.65.3 && LIBS="-ldl -lpthread" ./configure --disable-shared --with-ssl=/usr/local \
---without-ca-bundle --without-ca-path && make -j8 && make install
+--without-ca-bundle --without-ca-path && make -j8 && make install && rm -rf /usr/local/lib/*.so*
ADD https://github.com/gflags/gflags/archive/v2.2.2.tar.gz /opt/gflags-2.2.2.tar.gz
RUN tar -C /opt -xf /opt/gflags-2.2.2.tar.gz
-RUN cd /opt/gflags-2.2.2 && cmake . -DBUILD_SHARED_LIBS=OFF && make -j8 && make install
+RUN cd /opt/gflags-2.2.2 && cmake . -DBUILD_SHARED_LIBS=OFF && make -j8 && make install && rm -rf /usr/local/lib/*.so*
RUN apt-get install -y autoconf automake libtool unzip
+RUN rm -rf /usr/local/lib/*.so*
ADD https://github.com/protocolbuffers/protobuf/releases/download/v3.11.4/protobuf-cpp-3.11.4.tar.gz /opt/protobuf-cpp-3.11.4.tar.gz
RUN tar -C /opt -xf /opt/protobuf-cpp-3.11.4.tar.gz
-RUN cd /opt/protobuf-3.11.4 && ./configure --disable-shared && make -j8 && make check && make install
+RUN cd /opt/protobuf-3.11.4 && ./configure --disable-shared && make -j8 && make check && make install && rm -rf /usr/local/lib/*.so*
ADD https://github.com/google/leveldb/archive/1.22.tar.gz /opt/leveldb-1.22.tar.gz.tar.gz
RUN tar -C /opt -xf /opt/leveldb-1.22.tar.gz.tar.gz
RUN mkdir -p /opt/leveldb-1.22/build && cd /opt/leveldb-1.22/build && cmake -DCMAKE_BUILD_TYPE=Release .. && \
- cmake --build . && make install
-
-# Remove dynamic libraries
-RUN rm -rf /usr/local/lib/*.so*
+ cmake --build . && make install && rm -rf /usr/local/lib/*.so*
ADD https://github.com/apache/incubator-brpc/archive/0.9.7-rc03.tar.gz /opt/brpc-0.9.7-rc03.tar.gz
RUN tar -C /opt -xf /opt/brpc-0.9.7-rc03.tar.gz
-RUN cd /opt/incubator-brpc-0.9.7-rc03 && sh config_brpc.sh --nodebugsymbols --headers=/usr/local/include --libs=/usr/local/lib
-RUN cd /opt/incubator-brpc-0.9.7-rc03 && LINK_SO=0 make -j8 && make install
+COPY patches/brpc_cmakelists.txt /opt/incubator-brpc-0.9.7-rc03/src/CMakeLists.txt
+RUN mkdir -p /opt/incubator-brpc-0.9.7-rc03/build && cd /opt/incubator-brpc-0.9.7-rc03/build && \
+ cmake -DWITH_DEBUG_SYMBOLS=OFF .. && make -j8 && make install && rm -rf /usr/local/lib/*.so*
ENV CC /usr/local/gcc-6.4.0/bin/gcc
ENV CXX /usr/local/gcc-6.4.0/bin/g++
diff --git a/docker/patches/brpc_cmakelists.txt b/docker/patches/brpc_cmakelists.txt
new file mode 100644
index 00000000..03c05a11
--- /dev/null
+++ b/docker/patches/brpc_cmakelists.txt
@@ -0,0 +1,49 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+if(NOT DEBUG)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNDEBUG")
+endif()
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${PROJECT_SOURCE_DIR}/src)
+
+add_library(BUTIL_LIB OBJECT ${BUTIL_SOURCES})
+add_library(SOURCES_LIB OBJECT ${SOURCES})
+add_dependencies(SOURCES_LIB PROTO_LIB)
+
+# shared library needs POSITION_INDEPENDENT_CODE
+set_property(TARGET ${SOURCES_LIB} PROPERTY POSITION_INDEPENDENT_CODE 1)
+set_property(TARGET ${BUTIL_LIB} PROPERTY POSITION_INDEPENDENT_CODE 1)
+
+add_library(brpc-static STATIC $<TARGET_OBJECTS:BUTIL_LIB>
+ $<TARGET_OBJECTS:SOURCES_LIB>
+ $<TARGET_OBJECTS:PROTO_LIB>)
+
+if(BRPC_WITH_THRIFT)
+ target_link_libraries(brpc-static thrift)
+endif()
+
+SET_TARGET_PROPERTIES(brpc-static PROPERTIES OUTPUT_NAME brpc CLEAN_DIRECT_OUTPUT 1)
+
+#install directory
+install(TARGETS brpc-static
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ )
\ No newline at end of file