Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28520 Discussions

Problem with static library with modules in a virtual machine on a Mac

Smith__Neill
Beginner
291 Views
I am compiling legacy Fortran code with IVF 11.1 in VS05 under Win7 in a VMware virtual machine on a Mac. I have two legacy solutions that I am trying to build. The first has the folder (project) structure

HydroV_Exe (console app) --- HydroV_Lib (static library)
| |
+ Debug + Debug

The source folders/files reside on the Mac side. The static library for this project contains no modules. For HydroV_Exe the Configuration Properties: Additional Include Directories box contains ..\\HydroV_Lib.
This project builds correctly in the virtual machine with first HydroV_Lib.lib output to the appropriate Debug subdirectory on the Mac side, and then HydroV_Exe.exe output to the appropriate Debug subdirectory on the Mac side. This exe file runs without any problems.

The second solution has the folder (project) structure

SimV_Exe (console app) --- TrjV_Lib (static library) --- Corecode (static library)
| | |
+ Debug + Debug + Debug

The source folders/files reside on the Mac side. The base static library Corecode for this project contains two modules that other source files in Corecode access with use statements. This subproject builds correctly (apparently) and places Corecode.lib in the appropriate Debug subdirectory.

The upper static library TrjV_Lib depends on the Corecode static library and also accesses the two Corecode modules with use statements. For TrjV_Lib the Configuration Properties: Additional Include Directories box contains ..\\Corecode. The build fails. I copied the entire solution folder tree from the Mac side to the C:\\ folder on the virtual machine side so as to remove any Mac/VM boundary issues. The build still fails with the following type of error messages:

C:\\Intel_Fortran_Projects\\SimV\\trunk\\trjv5_lib\\TRJIN.FOR(57): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [STATE_TYPE_MOD]
C:\\Intel_Fortran_Projects\\SimV\\trunk\\trjv5_lib\\TRJIN.FOR(69): error #6457: This derived type name has not been declared. [SUB_STATE_TYPE]

The error message are the same whether I build from Mac-side source files or from VM-side source files. The only difference is in the path to the particular source file.

I don't have the Intel Mac OS compiler, but some of my collegues do and they can successfully build this solution on a Mac using CMake. I am much more comfortable working inside of VS when doing developmental work, so I would really like to make this work. What am I doing wrong?

Thanks,

Neill Smith
0 Kudos
1 Reply
mecej4
Honored Contributor III
291 Views
You have made the problem more complex than it needs to be. Any additional problems caused by your use of a VM would be off-topic here, but I don't think that there are any.

> For TrjV_Lib the Configuration Properties: Additional Include Directories box contains ..\Corecode

Is the file "STATE_TYPE_MOD.mod" to be found in this directory? If not, that's what needs to be taken care of.

The statement

> The base static library Corecode for this project contains two modules

is incorrect if, by "module" you mean "module file". Libraries contain .obj files, not .mod files. The compiler looks for .mod files. The linker looks for .obj files, either by themselves or inside .lib files. The compiler does not look at .lib files, and the linker does not look at .mod files.
0 Kudos
Reply