Re: Accessing fortran libraries [SEC=UNCLASSIFIED]
"Andrew MacIntyre" <[email protected]> Fri, 26 Nov 2010 10:12:49 +1100
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Message-ID | <[email protected]> |
Those routines are likely to be in a fortran runtime library. You probably need to use the RTLD_GLOBAL flag when loading your fortran SO to have the symbols resolved. -------------------------> "These thoughts are mine alone!" <--------- Andrew MacIntyre Operations Branch tel: +61 2 6219 5356 Communications Infrastructure Division fax: +61 2 6253 3277 Australian Communications & Media Authority email: [email protected] http://www.acma.gov.au/ From: José Gómez-Dans [mailto:[email protected]] Sent: Friday, 26 November 2010 2:06 AM To: ctypes-users Subject: [ctypes-users] Accessing fortran libraries Hi, I would like to access a fortran DLL in linux (x86_64) using ctypes. I thought that this would be transparent, but if I try I get the following problems mylib = ctypes.CDLL ("./libmylib_x86_64.so") OSError Traceback (most recent call last) OSError: ./libmylib_x86_64.so: undefined symbol: _gfortran_internal_malloc64 Out of interest, I tried ld on the library, and I found that other gfortran-related functions are missing, as well as some from math.h (for example, log, cos, sin, _gfortran_transfer_real, _gfortran_st_write, _gfortran_pow_r8_i4, _gfortran_internal_unpack, _gfortran_st_write_done, etc.). I link code to this library and it works, but I would like to access the library from python. There's something I am obviously missing, but I don't even know where to start looking! Any hints greatly appreciated. Thanks! Jose -- RSU ■ Dept. of Geography ■ University College ■ Gower St, London WC1E 6BT UK EMM ■ Dept. of Geography ■ King's College ■ Strand, London WC2R 2LS UK NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ ctypes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ctypes-users