ฉันต้องการรวบรวมโปรแกรมของฉันที่เชื่อมโยงกับ acml ใน cygwin (win64) โดยมี gfortran เชื่อมโยงกับ acml:
$ gfortran empty.f90 -L/c:/cygwin64/acml5.3.1/win64/lib/libacml_dll.lib
อัตราผลตอบแทน
/tmp/ccKechZN.o:empty.f90:(.text+0xff): undefined reference to `drandinitialize_'
/tmp/ccKechZN.o:empty.f90:(.text+0xff): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `drandinitialize_'
/tmp/ccKechZN.o:empty.f90:(.text+0x13b): undefined reference to `drandgaussian_'
/tmp/ccKechZN.o:empty.f90:(.text+0x13b): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `drandgaussian_'
collect2: error: ld returned 1 exit status
ฉันลองทำอย่างอื่นสองสามอย่างด้วยความช่วยเหลือของเอกสารประกอบ แต่ก็ไม่มีอะไรเลย อนุญาตให้คอมไพเลอร์เชื่อมโยงกับ acml ได้สำเร็จ ฉันยังพยายามลิงก์ไปยังไลบรารีด้วยการเพิ่ม -l acml_dll
และได้รับข้อผิดพลาดต่อไปนี้:
/usr/lib/gcc/x86_64-pc-cygwin/4.9.3/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lacml_dll
collect2: error: ld returned 1 exit status
ฉันได้ตรวจสอบแล้วว่า .lib มีอยู่ในไดเร็กทอรีที่ระบุ บางทีอาจเป็นปัญหาที่เกี่ยวข้อง ฉันกำลังพยายามรันเอาต์พุตจาก ifort ที่เชื่อมโยงกับ acml บน win64 ฉันใช้พรอมต์คำสั่ง "โหมด Intel 64 Visual Studio 2013" เพื่อรวบรวมโปรแกรมตัวอย่างที่เรียกรูทีนย่อยจาก acml (ดู เอกสารประกอบสำหรับการเชื่อมโยงใน win64):
ifort /libs:dll empty.f90 c:/AMD/acml5.3.1/ifort64_int64/lib/libacml__dll.lib
ซึ่งให้ผลผลิต
Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.5.239 Build 20150212
Copyright (C) 1985-2014 Intel Corporation. All rights reserved.
Microsoft (R) Incremental Linker Version 12.00.21005.1
Copyright (C) Microsoft Corporation. All rights reserved.
-out:empty.exe
-subsystem:console
empty.obj
อย่างน้อยด้วย ifort โปรแกรมก็สามารถคอมไพล์ได้สำเร็จ จากนั้นเมื่อฉันรัน Empty.exe ฉันได้รับข้อผิดพลาดต่อไปนี้:
โปรแกรมไม่สามารถเริ่มทำงานได้เนื่องจาก libacml_dll.dll หายไปจากคอมพิวเตอร์ของคุณ ลองติดตั้งโปรแกรมใหม่เพื่อแก้ไขปัญหานี้
ฉันลองติดตั้ง acml 5.3.1 ใหม่รวมทั้งลองใช้ acml 6.1.0 แต่พบข้อผิดพลาดเดียวกันเมื่อดำเนินการ