Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9256559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:58:21+00:00 2026-06-18T11:58:21+00:00

I am having difficulty with getting a f2py compiled module work in Python. I

  • 0

I am having difficulty with getting a f2py compiled module work in Python.

I have a piece of software written in Fortran that compiles well on a Linux 64bit machine.
Further on F2Py compiles a Python module that uses Fortran bits as well.

Here is how the Python module is compiled:

f2py --fcompiler=gfortran -I"path-to-dir-with-mod-files" -c -m mod_landems mod_landem.f90

But once I want to import that module I get an error (in Ipython):

----> 1 import mod_landems
ImportError: ./mod_landems.so: undefined symbol: __nesdis_landem_module_MOD_nesdis_landem

To be honest I am confused with this error. Search did not help much so I need to ask you here: how can I possibly make it work? If I put the python module code in the same directory as where the mod files are it produces same error message.

Here is a piece of my (primitive) code:

module n_landem
implicit none

! INPUT VARIABLES
real(8) Angle
real(8) Sm_Content
real(8) Veg_Frac
real(8) Soil_Temp
real(8) Land_Temp
real(8) Snow_Depth
real(8) Frequency

! OUTPUT VARIABLES
real(8) Emis_H
real(8) Emis_V

contains

subroutine landem

  USE NESDIS_LANDEM_MODULE
  USE TYPE_KINDS, ONLY : fp

  call NESDIS_LandEM(Angle,Frequency,Sm_Content,Veg_Frac,Soil_Temp,Land_Temp,Snow_Depth,Emis_H,Emis_V)
end subroutine landem
end module n_landem

If I recall correctly some time ago this module was importable, but can’t seem to make it work on either debian64 installation or debian32bit computer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:58:22+00:00Added an answer on June 18, 2026 at 11:58 am

    in your f2py call, you have to pass the libraries you are linking explicitly with ‘-l’, the same you would pass it to your Fortran compiler (i.e. gfortran). Therefore, does

    f2py -c --fcompiler=gfortran -I"path-to-dir-with-mod-files" --fcompiler=gfortran -I"path-to-dir-with-mod-files" -lNESDIS_LandEM_Module -m mod_landems mod_landem.f90 -m mod_landems mod_landem.f90
    

    work for you ?

    Best,
    Max.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having difficulty getting error placement to work. I have a series of forms
I'm having difficulty getting XQuery to work. I downloaded Saxon-HE 9.2. It seems to
I am having difficulty getting several mod_rewrite rules to work together in my .htaccess
I'm having difficulty getting the Model Binder to work. I thought it was the
I'm new to Regular Expressions and am having difficulty getting patterns that I find
I'm having difficulty getting the awk command inside a bash script to work. The
I'm having difficulty getting Git to cooperate with my user-defined worktree that exists outside
I am having difficulty getting this scoring function to work. The objective of my
I am having difficulty getting R to read a .txt or .csv file that
I'm having difficulty getting the jQuery special event hoverintent to work with mouseleave functions.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.