GNU科学库不与M1芯片一起使用
我正在尝试运行使用GSL的C ++程序。
我正在使用M1芯片和iOS 12.4的Mac运行它。
我在Mac终端中使用BREW安装了GSL:
$ BREW安装GSL
在尝试编译程序时,我会得到以下错误:
ld: warning: ignoring file /usr/local/lib/libgsl.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /usr/local/lib/libgslcblas.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
"_gsl_ran_gaussian", referenced from:
population::initialize_two(Cytoplasm) in population.o
population::evolve() in population.o
"_gsl_rng_alloc", referenced from:
population::population(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in population.o
"_gsl_rng_mt19937", referenced from:
population::population(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in population.o
"_gsl_rng_set", referenced from:
population::population(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in population.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
据我了解,GSL应该与M1芯片一起使用。
我是C ++的新手,所以我不确定从哪里开始。
编辑:
当我运行
$ BREW信息GSL
时,我会得到以下输出:
gsl: stable 2.7.1 (bottled)
Numerical library for C and C++
https://www.gnu.org/software/gsl/
/usr/local/Cellar/gsl/2.7.1 (290 files, 10.2MB) *
Poured from bottle on 2022-06-23 at 10:37:01
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gsl.rb
License: GPL-3.0-or-later
==> Analytics
install: 3,770 (30 days), 12,230 (90 days), 51,294 (365 days)
install-on-request: 1,564 (30 days), 5,263 (90 days), 23,227 (365 days)
build-error: 1 (30 days)
我刚刚使用
make
命令进行编译。
谢谢 :)
I am trying to run a C++ program which uses GSL.
I am running it on my Mac which has the M1 chip and iOS 12.4.
I installed GSL using Brew in Mac Terminal:
$ brew install GSL
When I try to compile the program, I get the following error:
ld: warning: ignoring file /usr/local/lib/libgsl.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /usr/local/lib/libgslcblas.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
"_gsl_ran_gaussian", referenced from:
population::initialize_two(Cytoplasm) in population.o
population::evolve() in population.o
"_gsl_rng_alloc", referenced from:
population::population(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in population.o
"_gsl_rng_mt19937", referenced from:
population::population(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in population.o
"_gsl_rng_set", referenced from:
population::population(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in population.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
From what I understand, GSL is supposed to work with the M1 chip.
I am very new to C++, so I am not sure where to start.
EDIT:
when I run
$ brew info gsl
I get the following output:
gsl: stable 2.7.1 (bottled)
Numerical library for C and C++
https://www.gnu.org/software/gsl/
/usr/local/Cellar/gsl/2.7.1 (290 files, 10.2MB) *
Poured from bottle on 2022-06-23 at 10:37:01
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gsl.rb
License: GPL-3.0-or-later
==> Analytics
install: 3,770 (30 days), 12,230 (90 days), 51,294 (365 days)
install-on-request: 1,564 (30 days), 5,263 (90 days), 23,227 (365 days)
build-error: 1 (30 days)
I just compiled using the
make
command.
Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论