我希望在Swift中使用GNU科学库,特别是我想使用中的例程。因此,我基本上遵循https://github.com/apple/swift-package-manager/blob/master/Documentation/SystemModules.md(我正在使用Linux而不是OS X)。
我创建了模块:
我创建了模块:
module CGSL [system] {
header "/usr/include/gsl/gsl_rng.h"
link "gsl"
export *
}
然而,由于我收到了大量这样的信息:undefined reference to 'cblas_dasum'
,我无法构建我的程序。正如GSL的文档所述:
我该怎么做才能同时链接To link against the library you need to specify both the main library and a supporting CBLAS library, which provides standard basic linear algebra subroutines. A suitable CBLAS implementation is provided in the library libgslcblas.a if your system does not provide one. The following example shows how to link an application with the library,
$ gcc -L/usr/local/lib example.o -lgsl -lgslcblas -lm
-lgsl
和 -lgslcblas
?