PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Unable to open MODULE file
Goto page Previous  1, 2
 
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: Thu Apr 11, 2013 11:59 pm    Post subject: Reply with quote

Mat,

Thank you for your reply.

As you suggested in your first reply, I Included all the source files for the modules I use in my project. If I include all of them (.f90 files) in one project, it works fine. But, if I create two separate projects, one of type console application in which I place the main program, and one of type static library and include the source files for modules in that, and set the order of building correctly, I get the same error "Unable to open something.mod file". However, this time ".obj" files, ".lib" file and ".mod" files are created in the project of type static library.

In fact, I guess you can create a simple example for yourself to see what I mean.

First create an IVF project of type console application and place your main program there. Your main program will use a module. Then add a new project of type static library to your solution and place the source file for your module in there. choose the correct building order for the two projects and you will see it works fine.

But do the same thing in PVF and it won't work and give you the mentioned error.

Why is that so? I am so confused!

Many thanks for your help,

Omid
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Apr 12, 2013 9:11 am    Post subject: Reply with quote

Quote:
I get the same error "Unable to open something.mod file"
I assume you mean that you get this when building the "main" program. In this case, you need to set the module path option in your Project Property "Fortran->Module Path" to the directories where the library mod files are located. One caveat is that the first directory listed is also added to the directories to be "cleaned". Hence, if you do not want the mod files to be deleted when you clean "main", be sure to add a dummy directory as the first directory.

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



Joined: 23 Jan 2013
Posts: 10

PostPosted: Sun Apr 14, 2013 6:08 pm    Post subject: Reply with quote

Hi Mat,

I Tried what you suggested. I add the directories where the library mod files are located to the module path. This time when I build the main program, I get another set of errors.
"Unresolved external symbol module1_add_referenced in function MAIN_"
"Unresolved external symbol MODULE1"

in which "module1" is a single module which is used in the main program, and "add" is a subroutine which is located in module1 and is called from the main program.

Any idea what might be the problem?

Thanks a lot,

Omid
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Apr 15, 2013 8:29 am    Post subject: Reply with quote

Hi Omid,

The object or library which contains this symbol needs to be added to your link options.

- Mat
Back to top
View user's profile
OmidKar



Joined: 23 Jan 2013
Posts: 10

PostPosted: Mon Apr 15, 2013 8:07 pm    Post subject: Reply with quote

Mat,

Thanks a lot.
That final trick made the project work.

Many thanks for your valuable advice.

Cheers,

Omid
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 Previous  1, 2
Page 2 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