PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Unable to open MODULE file
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
OmidKar



Joined: 23 Jan 2013
Posts: 10

PostPosted: Tue Apr 09, 2013 6:28 pm    Post subject: Unable to open MODULE file Reply with quote

Hi there

I am new to working with PVF. I have an existing project with IVF and want to migrate it to PVF. My project contains four source files (.f90) and a static library (.lib). As instructed in the PVF Users' Guide, I created a new project in PVF and moved and added all the source files to the new project. I tried two ways for adding the .lib file, once simply by adding it to the project (something which works with IVF in MVS2010), and another time by creating a new project in the PVF project and including the .lib file there (as suggested by the User's guide). But, unfortunately, both times I get similar errors as listed below:

*************************************************************
Input.f90
PGF90/x86-64 Windows 13.3-0: compilation aborted
Module not found while generating build dependencies; will retry Input.f90

Output.f90
PGF90/x86-64 Windows 13.3-0: compilation aborted
Module not found while generating build dependencies; will retry Output.f90

SOCP-CUDAFOR.f90
PGF90/x86-64 Windows 13.3-0: compilation aborted
Module not found while generating build dependencies; will retry SOCP-CUDAFOR.f90

Solve.f90
PGF90/x86-64 Windows 13.3-0: compilation aborted
Module not found while generating build dependencies; will retry Solve.f90

Input.f90
C:\Omid's project\My SOCP Codes\SOCP-CUDAFOR\SOCP-CUDAFOR\Input.f90(3) : error F0004 : Unable to open MODULE file ut_input.mod
PGF90/x86-64 Windows 13.3-0: compilation aborted

Output.f90
C:\Omid's project\My SOCP Codes\SOCP-CUDAFOR\SOCP-CUDAFOR\Output.f90(3) : error F0004 : Unable to open MODULE file nlp_structures.mod
PGF90/x86-64 Windows 13.3-0: compilation aborted

SOCP-CUDAFOR.f90
C:\Omid's project\My SOCP Codes\SOCP-CUDAFOR\SOCP-CUDAFOR\SOCP-CUDAFOR.f90(20) : error F0004 : Unable to open MODULE file input.mod
PGF90/x86-64 Windows 13.3-0: compilation aborted

Solve.f90
C:\Omid's project\My SOCP Codes\SOCP-CUDAFOR\SOCP-CUDAFOR\Solve.f90(8) : error F0004 : Unable to open MODULE file ut_solve.mod
PGF90/x86-64 Windows 13.3-0: compilation aborted
SOCP-CUDAFOR build failed.
***********************************************************

My four .f90 files are named : "input.f90","output.f90","SOCP-CUDAFOR.f90" and "solve.f90". The main program is contained in SOCP-CUDAFOR.f90, and other three source files contain only modules with the same name of the corresponding files.

The mentioned modules in the errors, i.e. "ut_solve.mod", "nlp_structures.mod" and "ut_input.mod" are included in the ".lib" file. These modules are used inside the three modules contained in three ".f90" files. The input.mod is, on the other hand, is a module itself contained in "input.f90" file.

my suspicion is that the compiler does not recognize the .lib file.
How exactly should I add an existing ".lib" file to the PVF project?
Also, do I need to export any other things form my existing project to the PVF project?
Or any other suggestions?

Many thanks,

Omid
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6213
Location: The Portland Group Inc.

PostPosted: Wed Apr 10, 2013 9:27 am    Post subject: Reply with quote

Hi Omid,

Quote:
The mentioned modules in the errors, i.e. "ut_solve.mod", "nlp_structures.mod" and "ut_input.mod" are included in the ".lib" file. These modules are used inside the three modules contained in three ".f90" files. The input.mod is, on the other hand, is a module itself contained in "input.f90" file.
Module files can't be including a library. Perhaps you meant that the object files are part of this library?

In any event, you will need the source for these modules included in your project. The format of Module files are not standard across compilers, so even if you had the old mod file from IVF, you would still need to recompile them with PGI. Also, several F90 features are not compatible across Fortran compilers, so all F90 source would need to be recompiled with PGI. (F77 is fine across compilers).

You can build the library as a separate PVF project. However, you would add the directory containing the mod files via the new project's Project Property Page "Fortran->Module Path".

Note, you can link against external libraries by adding them to your project's property pages "Linker->Input->Additional Dependencies" list and the path to the libraries can be added in "Linker->General->Additional Library Directories"

Hope this helps,
Mat
Back to top
View user's profile
OmidKar



Joined: 23 Jan 2013
Posts: 10

PostPosted: Wed Apr 10, 2013 4:47 pm    Post subject: Reply with quote

Hi Mat,

Thank you very much for your reply.

What I mentioned was that the modules are included in (not including) the library, that is they are part of the library embedded in the ".lib" file.

I tried your second and third recommendations and none of them solved the problem. still getting the same error.

It seems that I need to follow the first one, i.e. moving all the source files included in the library to the PVF project and compile them with PVF. However, this seems a bit odd to me as a static library needs to be fully compatible in different compilers.
The ".lib" file I have got includes some standard modules, such as "Numerical Recipes", some routines out of HSL library and etc. in order not to have to move so many source files between different projects in hand, I made a ".lib" file to be kept as a tool.
What if I need to use other libraries from other sources, for example, available online?! Would I need to do the same thing with them? I do not have access to their source codes then!

Thank you for your help.

Omid
Back to top
View user's profile
mecej4



Joined: 19 Jun 2011
Posts: 55

PostPosted: Wed Apr 10, 2013 7:01 pm    Post subject: Reply with quote

OmidKar wrote:


What I mentioned was that the modules are included in (not including) the library, that is they are part of the library embedded in the ".lib" file.


Library files contain a number of object files and, sometimes, a directory table to the object files. These object files correspond to IBM mainframe "object modules", and are not to be confused with Fortran module files (*.mod).
OmidKar wrote:
However, this seems a bit odd to me as a static library needs to be fully compatible in different compilers.
You are mistaken. Such compatibility may be encountered if the Fortran sources from which they were compiled perform no I/O and all the compilers involved address the same machine architecture and operating system, and follow the same register level calling conventions. It would be folly to count on such compatibility. If, in addition, the use of subprograms in the library requires providing interfaces or USE {modulename} statements, the .mod files need to be available, and these are almost invariably compiler-specific.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6213
Location: The Portland Group Inc.

PostPosted: Thu Apr 11, 2013 9:23 am    Post subject: Reply with quote

Quote:
What I mentioned was that the modules are included in (not including) the library, that is they are part of the library embedded in the ".lib" file.
While I don't know IVF, I would find it odd if they embedded the module files (.mod) in with the library. I can see the benefit since you'd only need to carry around the ".lib" file but then the compiler would need access to the library at compile time instead of just link.

Quote:
What if I need to use other libraries from other sources, for example, available online?! Would I need to do the same thing with them? I do not have access to their source codes then!
In general, libraries should be written in C or F77. There are far fewer portability issues, and none compiler related, with these languages than F90/F2003 or C++.

Quote:
The ".lib" file I have got includes some standard modules, such as "Numerical Recipes", some routines out of HSL library and etc. in order not to have to move so many source files between different projects in hand, I made a ".lib" file to be kept as a tool.

HSL has a C interface which can be called from any compiler's F90. Depending on which implementation of Numerical Recipes you're using, these are typically F77, which is also compiler agnostic.

Please see Chapter 13, "Inter-Language Calling", of the PGI Compiler User's Guide (http://www.pgroup.com/doc/pgiug.pdf) for more details.

Hope this helps,
Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group