![]() Under Properties:Project References for sheep, I can select the cow project. If I try to compile the sheep project, I'll get an error like: error #7002: Error in opening the compiled module file. For these reasons, I'd rather leave m_graze in the cow project and compile and link sheep.f90 against it. I could just copy m_graze.f90 but that could lead to code getting out of sync and doesn't take into account any dependencies m_graze might have. I want to 'use m_graze, only: ruminate' in sheep.f90 to get access to the ruminate() subroutine. Later, I create ~/workplace/sheep and have src/sheep.f90 as the program and src/m_baa.f90 as the module m_baa. ![]() The executable and modules (m_graze.mod and m_moo.mod) are stored in ~/workspace/cow/Debug and object files are stored under ~/workspace/cow/Debug/src This project builds and links properly to create the executable 'cow'. Here's a simple example: In ~/workspace/cow I have a source directory (src) containing cow.f90 (the PROGRAM) and two modules m_graze and m_moo in m_graze.f90 and m_moo.f90, respectively. ![]() I am using Eclipse/Photran with the Intel compiler (ifort) on a linux system, but I believe I'm having a bigger conceptual problem with modules than with the specific tools. I'm having trouble understanding if/how to share code among several Fortran projects without building libraries or duplicating source code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |