dyld:库未加载:@ rpath / libopenblas.dylib

时间:2019-02-18 15:43:58

标签: c++ dylib openblas

制作文件时出现此错误:

  

dyld:库未加载:@ rpath / libopenblas.dylib引用   来自:/ Users / danyunhe2 / reinf_learning2 / cpp_original/。/navig_test
  原因:找不到图像中止陷阱:6

我尝试了ln -sf <original path> /usr/local/lib,但没有成功。
从酿造信息openblas我得到:

openblas: stable 0.3.5 (bottled), HEAD [keg-only]  
Optimized BLAS library  
https://www.openblas.net/  
/usr/local/Cellar/openblas/0.3.5 (22 files, 120.7MB)  
  Poured from bottle on 2019-02-18 at 01:27:14  
From: https://github.com/Homebrew/homebrew-  core/blob/master/Formula/openblas.rb 
==> Dependencies  
Required: gcc ✔  
==> Options  
--HEAD  
    Install HEAD version  
==> Caveats  
openblas is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BLAS and LAPACK in the Accelerate framework.  

For compilers to find openblas you may need to set:  
  export LDFLAGS="-L/usr/local/opt/openblas/lib"  
  export CPPFLAGS="-I/usr/local/opt/openblas/include"  

它告诉我使用LDFLAGS和CPPFLAGS设置编译器。我试过了,但是没有用。有人知道如何处理吗?

我的config.mk为:

# C++ compiler
cxx=g++-7 -fopenmp 

# Compilation flags
cflags=-Wall -ansi -pedantic -O3 

# BLAS/LAPACK flags for linear algebra
lp_lflags=-framework Accelerate 


# FFTW flags (installed via Homebrew)
fftw_iflags=
fftw_lflags=-lfftw3

# libpng flags (installed via Homebrew)
png_iflags=
png_lflags=-lpng

和Makefile:

# Load the common configuration file
include config.mk

iflags=`gsl-config --cflags`
lflags=`gsl-config --libs`

objs=navigate.o reinf_learn.o common.o
src=$(patsubst %.o,%.cc,$(objs))
execs=navig_test

all:
    $(MAKE) executables

executables: $(execs)

depend: $(src)
    $(cxx) $(iflags) -MM $(src) >Makefile.dep

-include Makefile.dep

navig_test: navig_test.cc $(objs)
    $(cxx) $(cflags) $(iflags)  -o $@ $^ $(lflags)

%.o: %.cc
    $(cxx) $(cflags) $(iflags)  -c $<

clean:
    rm -f $(execs) $(objs)

.PHONY: clean all executables depend

1 个答案:

答案 0 :(得分:1)

在OSX上是string encrypted; using (var salsa = new Salsa20.Salsa20()) using (var mstream_out = new MemoryStream()) { salsa.Key = key; salsa.IV = iv; using (var cstream = new CryptoStream(mstream_out, salsa.CreateEncryptor(), CryptoStreamMode.Write)) { var bytes = Encoding.UTF8.GetBytes(words); cstream.Write(bytes, 0, bytes.Length); } encrypted = Encoding.UTF8.GetString(mstream_out.ToArray()); } ,您需要在运行时指定,例如:

DYLD_LIBRARY_PATH

但是,请赞赏brew关于Accelerate框架的警告。使用各种级别的许多BLAS操作,速度更快。您只会使程序运行速度变慢。