可以编译并运行IFORT但不能进行GFORTRAN(MAC M1)
我正在尝试从 Fortran 对象创建一个共享库对象并将其加载到 Julia 中。使用 ifort 时,使用以下命令,它运行没有问题:
ifort x.f90 y.f90 z.f90 -o Library.so -shared -fpic -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
当我使用 gfortran 运行以下命令时:
gfortran x.f90 y.f90 z.f90 -o Library.so -shared -fpic -ffree-line-length-300 -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
Julia 似乎无法找到该库:
could not load library "/Users/X/Documents/Library.so"
dlopen(/Users/X/Documents/Library.so.dylib, 0x0001): tried: '/Users/X/Documents/Library.so.dylib' (no such file), '/usr/local/lib/Library.so.dylib' (no such file), '/usr/lib/Library.so.dylib' (no such file)
I'm trying to create a a shared library object from Fortran objects and load it in Julia. When using ifort, with the below command, it runs no problem:
ifort x.f90 y.f90 z.f90 -o Library.so -shared -fpic -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
When I run the following command using gfortran:
gfortran x.f90 y.f90 z.f90 -o Library.so -shared -fpic -ffree-line-length-300 -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
Julia doesn't appear to be able to find the library:
could not load library "/Users/X/Documents/Library.so"
dlopen(/Users/X/Documents/Library.so.dylib, 0x0001): tried: '/Users/X/Documents/Library.so.dylib' (no such file), '/usr/local/lib/Library.so.dylib' (no such file), '/usr/lib/Library.so.dylib' (no such file)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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