PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

c programing with PGI Fortran
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
Jia-olemiss



Joined: 27 Dec 2010
Posts: 12

PostPosted: Mon Mar 19, 2012 7:43 pm    Post subject: c programing with PGI Fortran Reply with quote

The two language program runs fine with c works as a project of external lib and compiles with 64bit option. The code was created using 64bit option.

But it cannot be compiled using 32bit option anyway. The c project compiles, the fortran doesn't. An error always: "Unable to open MODULE file xxxxx.mod".
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Mar 20, 2012 9:34 am    Post subject: Reply with quote

Hi Jia-olemiss,

Quote:
The c project compiles, the fortran doesn't. An error always: "Unable to open MODULE file xxxxx.mod".
Did you remove the 64-bit module files between the two compilations?

- Mat
Back to top
View user's profile
Jia-olemiss



Joined: 27 Dec 2010
Posts: 12

PostPosted: Tue Mar 20, 2012 12:11 pm    Post subject: Reply with quote

Yes.
This happened after both projects have been cleaned under "Build".
Clean solution and then rebuild solution have been tried and lead the same error.

The compiling would have no problem if I simply switch back to 64bit.

Do you have a the standard procedure for switching 32 and 64bit compiling, particularly with external c lib?
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Mar 20, 2012 3:04 pm    Post subject: Reply with quote

Hi Jia-olemiss,

Unfortunately, we're not sure what going. There shouldn't be any difference in the build process between 32 and 64-bit.

Some questions:
Does your code create the Fortran module when the Platform is switched to Win32?
When the Platform selected is x64, where does the module file get created?

The normal practice for creating the 32-bit platform from a 64-bit platform configuration is just to select <New> in the Platform drop-down. Can you open the Configuration Manager to check that each project has the appropriate Platforms?

- Mat
Back to top
View user's profile
Jia-olemiss



Joined: 27 Dec 2010
Posts: 12

PostPosted: Wed Mar 21, 2012 2:51 pm    Post subject: Reply with quote

Matt,
The code only compile existing Fortran modules and external c subroutines in the compiling process.

Fortran and c are two projects.
The Configuration Manager looks OK:
Active solution platform: Win32
Below this, the platform for both fortran and c are Win32.

I made a new copy of the 64bit code and recompiled after a thorough clean. The error now is changed.

The c lib file compiling alone with Win32 has no error.
With a full path or a relative path (..\Release\cxxx.lib) in the linker to the lib file, compiling the Fortran project resulted "unresulved external symbol_F2C_xxxx@52 referenced in function _xxxx...." for all c subroutines defined in the c lib.
The same error appeared even when no path is set.

It will show: "cannot open input file '../xxxx/xxx/xxx.lib' " if the file path or name is set wrong.
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