workflow icon indicating copy to clipboard operation
workflow copied to clipboard

Installation on MacOS

Open holmes1412 opened this issue 3 years ago • 10 comments

Workflow需要依赖OpenSSL(推荐1.1及以上版本)和Cmake(要求3.6以上版本),以下为安装步骤:

  • 安装 OpenSSL

    brew install openssl
    
  • 安装 CMake

    brew install cmake
    
  • 指定 OpenSSL 环境变量 由于MacOS下默认有LibreSSL,因此在brew安装后,并不会自动建软链,我们需要手动把执行路径、编译路径、cmake时的find_package路径都配置到bash的环境变量中。用户可以执行brew info openssl查看相关信息,也可以如下配置:

    echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
    echo 'export LDFLAGS="-L/usr/local/opt/[email protected]/lib"' >> ~/.bash_profile
    echo 'export CPPFLAGS="-I/usr/local/opt/[email protected]/include"' >> ~/.bash_profile
    echo 'export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"' >> ~/.bash_profile
    echo 'export OPENSSL_ROOT_DIR=/usr/local/opt/openssl' >> ~/.bash_profile
    echo 'export OPENSSL_LIBRARIES=/usr/local/opt/openssl/lib' >> ~/.bash_profile
    

    如果使用zsh,则还需要以下一步,把bash的配置加载一下:

    echo 'test -f ~/.bash_profile  && source ~/.bash_profile' >> ~/.zshrc
    source ~/.zshrc
    

holmes1412 avatar Nov 11 '20 07:11 holmes1412

Hi. 建议维护一个conan repo

wangh09 avatar Dec 20 '20 07:12 wangh09

按照以上步骤执行,还是报错

  • ld: cannot link directly with dylib/framework, your binary is not an allowed client of /usr/lib/libcrypto.dylib for architecture x86_64
[ 98%] Linking CXX shared library ../../_lib/libworkflow.dylib
ld: cannot link directly with dylib/framework, your binary is not an allowed client of /usr/lib/libcrypto.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [../_lib/libworkflow.dylib] Error 1
make[2]: *** [src/CMakeFiles/workflow-shared.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2

wqw547243068 avatar Jan 20 '22 06:01 wqw547243068

你好,我们昨天对cmake有一些改动,为了兼容更多系统,所以改动略大,今天在持续修复中。 麻烦先使用前两天的版本,或者release 0.9.9~这两天会整天完成cmake的改动,整体改完我再at你看看~非常感谢小伙伴!

holmes1412 avatar Jan 20 '22 07:01 holmes1412

更新了master,可以再试一下。 @wqw547243068

Barenboim avatar Jan 20 '22 07:01 Barenboim

mac编译通过,谢谢!

wqw547243068 avatar Jan 27 '22 03:01 wqw547243068

更新了master,可以再试一下。 @wqw547243068

使用master碰到一样的问题

[ 98%] Linking CXX shared library ../../_lib/libworkflow.dylib
ld: cannot link directly with dylib/framework, your binary is not an allowed client of /usr/lib/libcrypto.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [../_lib/libworkflow.dylib] Error 1
make[2]: *** [src/CMakeFiles/workflow-shared.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2

wuleying avatar Jan 30 '22 03:01 wuleying

更新了master,可以再试一下。 @wqw547243068

使用master碰到一样的问题

[ 98%] Linking CXX shared library ../../_lib/libworkflow.dylib
ld: cannot link directly with dylib/framework, your binary is not an allowed client of /usr/lib/libcrypto.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [../_lib/libworkflow.dylib] Error 1
make[2]: *** [src/CMakeFiles/workflow-shared.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2

目前最新master或0.9.10的release有这个问题?你可以改一下cmake,先把动态库的编译先去了。在src/CMakeLists.txt里。

Barenboim avatar Jan 30 '22 08:01 Barenboim

你好: 这是我今天编译遇到的错误。麻烦能不能说一下怎么修改cmake? 十分感谢。 mkdir -p build.cmake rm -rf build.cmake/CMakeCache.txt cd build.cmake && cmake -D KAFKA= -D MYSQL= -D REDIS= /Users/jiehou/Downloads/workflow-0.9.9/tutorial -- The C compiler identification is AppleClang 12.0.5.12050022 -- The CXX compiler identification is AppleClang 12.0.5.12050022 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found OpenSSL: /usr/local/opt/openssl/lib/libcrypto.dylib (found version "1.1.1l")

CMake Error at CMakeLists.txt:13 (find_package): Could not find a package configuration file provided by "workflow" with any of the following names:

workflowConfig.cmake
workflow-config.cmake

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

-- Configuring incomplete, errors occurred! See also "/Users/jiehou/Downloads/workflow-0.9.9/tutorial/build.cmake/CMakeFiles/CMakeOutput.log". See also "/Users/jiehou/Downloads/workflow-0.9.9/tutorial/build.cmake/CMakeFiles/CMakeError.log". make: *** [all] Error 1

aquilius2022 avatar Feb 04 '22 07:02 aquilius2022

@aquilius2022 你是要编译tutorial吗?直接到tutorial目录里,输入make就可以了。按下面几个命令:

git clone https://github.com/sogou/workflow
cd workflow
make
cd tutorial
make

Barenboim avatar Feb 04 '22 10:02 Barenboim

@Barenboim, great. it can be compiled well. thanks.

aquilius2022 avatar Feb 04 '22 10:02 aquilius2022