f2py and OpenMP problem
Hello,
Following is my simple "omp_hello.f" program:
PROGRAM HELLO
INTEGER NTHREADS, TID, OMP_GET_
+ OMP_GET_THREAD_NUM
C Fork a team of threads giving them their own copies of variables
!$OMP PARALLEL PRIVATE(NTHREADS, TID)
C Obtain thread number
TID = OMP_GET_
PRINT *, 'Hello World from thread = ', TID
C Only master thread does this
IF (TID .EQ. 0) THEN
NTHREADS = OMP_GET_
PRINT *, 'Number of threads = ', NTHREADS
END IF
C All threads join master thread and disband
!$OMP END PARALLEL
END
I have made a python module "omp_hello.so" through f2py by following command:
/usr/bin/f2py2.7 -c -m omp_hello omp_hello.f --f90flags=
Now when I try to import omp_hello in python it comes up with following errors:
import omp_hello
ImportError: /home/scipylot/
It seems for some reason "-fopenmp -lgomp" although shows no compilation error, is not connected well and thats why module "omp_hello.so" can not execute any omp command. I will be grateful if some one please help to over come this.
To be more specific, in my UBUNTU 11.04 system gcc version 4.5.2, gfortran version 4.5.2, libgomp1 version 4.5.2. My default python is 2.7. Inspecting "nm omp_hello.so" shows following:
00003a70 T main
U malloc@@GLIBC_2.0
U memcpy@@GLIBC_2.0
U memset@@GLIBC_2.0
U omp_get_
U omp_get_thread_num_
00006214 b omp_hello_error
00006210 b omp_hello_module
00004320 r options.2.1509
000062d8 b save_def
00001660 t set_data
U sprintf@@GLIBC_2.0
U stderr@@GLIBC_2.0
U strcmp@@GLIBC_2.0
U strlen@@GLIBC_2.0
Thanks in advance.
-- Akand
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- mycae
- Solved:
- Last query:
- Last reply: