PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

modules?
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
ams



Joined: 14 Jul 2004
Posts: 41

PostPosted: Tue May 14, 2013 9:26 am    Post subject: Reply with quote

Ralph, let's try this to see if we can get what works for me working for you using the sample source you provided.

1. Create a new PVF solution in C:\tmp.
2. Add a new source file to the project, name it constants.f90, and paste in the code for module constants. (Please do not use an existing file.)
3. Add another new source file to the project, name it fall.f90, and paste in the code for program fall.
4. Use the solution explorer to verify that in your PVF project the Source Files folder contains both constants.f90 and fall.f90.
5. Build the solution.

That should be all that's required to build the sample code. Let me know how it goes.

Annemarie
Back to top
View user's profile
deeppow



Joined: 02 Feb 2012
Posts: 51

PostPosted: Tue May 14, 2013 2:56 pm    Post subject: Reply with quote

Yes, that does work. Which drive is used shouldn't be an issue and the process does repeat on my F-drive with no problem.

Here is the main differences between the process you outlined and what I've done previously.
-- I've been creating a container folder on my F drive, e.g. PGI_5-14-2013.
-- I then typically add 3 new folders in PGI_5-14-2013 1) Include Files, 2) Resource Files, and 3) Source Files where each of these have the files you would expect from their names. I didn't want to place all the various type files in a single location.
-- Next I create a PVF solution in PGI_5-14-2013
-- Add my files from their folders into the solution folders.
-- Setup up debugger, compiler, build, etc. options with appropriate paths for includes, modules, and working location.
-- Build
I've also tried both .mod and .f90 extensions on the modules, didn't have an effect.

My process has worked fine for a year+ when I was using include files but something is clearly amiss with the module files. (Of course that doesn't mean my process fits the standard.)

So at least a couple things could be the source of my problems.
1) My files aren't down in the lower solution folders as those of the simple case.
2) I don't always use VS2008 templates to build source files, include files, or module files. If there is some attribute in their hidden data then simple creation of such files using a text editor could present problems.

I can play around with this some more but what are your thoughts at this point?
Back to top
View user's profile
deeppow



Joined: 02 Feb 2012
Posts: 51

PostPosted: Wed May 15, 2013 5:23 am    Post subject: Reply with quote

Annemarie,
After some testing with the simple case, I conclude that
1) the module must be in the solution folder, i.e. the folder that contains the .pvfproj file. Placing the module in an alternate path and telling the compiler where via the compiler directive, Fortran->General->Module Path, doesn't work.
2) the extension for the module must be .f90.
3) I can place source files (program, subroutines) and include files in other places and load via the VS standard add function plus a path as needed in the compiler directives.

-ralph
Back to top
View user's profile
ams



Joined: 14 Jul 2004
Posts: 41

PostPosted: Wed May 15, 2013 12:19 pm    Post subject: Reply with quote

Ralph,

When you add the Fortran file containing the module code (i.e., constants.f90) to the PVF project, are you adding it to the 'Include Files' folder? If so, that is likely the problem. The module source code needs to be compiled like all the other Fortran source and should be in the PVF project's 'Source Files' folder.

Annemarie
Back to top
View user's profile
deeppow



Joined: 02 Feb 2012
Posts: 51

PostPosted: Wed May 15, 2013 12:42 pm    Post subject: Reply with quote

Annemarie,

The only place the module file will work (i.e. complete a successful build) is when the constants.f90 file is physically located in the solution folder and has been added to the PVF project's "Sources Files" via the add existing file option. Nothing else works.


-ralph
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, 3  Next
Page 2 of 3

 
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