Error In Opening The Library Module File Fortran
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up The mysterious nature of Fortran 90 modules up vote 8 down vote favorite 3 Fortran 90 modules are evanescent creatures. I was using a (singular) module for a while with some success (compiling using Intel Visual Fortran and Visual Studio 2010). Then I wrote another module and tried to USE it in another function, before receiving this error: error #7002: Error in opening the compiled module file. Check INCLUDE paths. So I deleted the offending module. But now I receive the same error after when trying to access my original module! How can I locate these mysterious creatures? Why does one module work but not two? I'm assuming that I need to delete and recompile them, or tell the compiler to include them somehow. I know the file locations of the source code but not where they compile to. visual-studio-2010 fortran fortran90 fortran95 intel-fortran share|improve this question edited Jan 30 '15 at 3:00 davidism 33.9k104875 asked Sep 6 '12 at 19:06 frostbyyte 6939 add a comment| 1 Answer 1 active oldest votes up vote 26 down vote accepted For that specific processor (many other Fortran processors have similar characteristics, but the details differ): When a module is compiled successfully, the compiler generates a .mod file (and perhaps an .obj file) that contains information about the entities provided by the module. It is this mod file that the error message you quote is referring to. The compiler requires this mod file when it encounters a USE statement for the module while compiling other source. (The obj file is used in the link stage.) Hence, before a module is USE'd, the compiler must at some time have compiled the source code for the module. That means that the module's source code (MODULE...END MODULE) must have appeared earlier in the source file prior to the USE statement, or must have been in a separate file that was compiled prior to the source file with the USE statement. When compiling using an Intel Fortran project within Visual Studio, the build environment will automatically attempt to arrange an appropriate compilation order for the source files within a project. Wh
The compiling, linking results of original one is ok. However, the copied one is not. The error message shows: Error: Error in opening the Library module file. [MODA] Error: Error in opening the Library module file. [MODT] I use CVF6.6C. I've noticed the the external files are all included including moda.f90 and modt.f90. In MODA, I have a subroutine to USE MODT and in MODT, I have a subroutine to USE MODA. Two error messages are in some subroutines in MODA and MODT. In main program I USE: USE MODA USE MODT Sometimes I am suspecting that if the sequence of modules being USEd matters (I mean first MODT and the MODA), however, I test it and it doesn't make any http://stackoverflow.com/questions/12306740/the-mysterious-nature-of-fortran-90-modules difference. why is there compiling error if I copy the original project which is compiled OK? thank you in advance. Mike Sun, 15 Mar 2009 10:36:26 GMT Mike#2 / 14 Error in opening the Library module file Quote: > Hi > I just create a copy of the same project. The compiling, linking > results of original one is ok. > However, the copied one is not. > The error message shows: > Error: Error in opening the Library module file. http://computer-programming-forum.com/49-fortran/f7fc27cc49b24dae.htm [MODA] > Error: Error in opening the Library module file. [MODT] > I use CVF6.6C. I've noticed the the external files are all included > including moda.f90 and modt.f90. > In MODA, I have a subroutine to USE MODT and in MODT, I have a > subroutine to USE MODA. > Two error messages are in some subroutines in MODA and MODT. > In main program I USE: > USE MODA > USE MODT > Sometimes I am suspecting that if the sequence of modules being USEd > matters (I mean first > MODT and the MODA), however, I test it and it doesn't make any > difference. > why is there compiling error if I copy the original project which is > compiled OK? > thank you in advance. > Mike I just do a little test module modA contains subroutine suba() use modT print *,'suba' end subroutine suba end module modA module modT contains subroutine subb() use modA print *,'subb' end subroutine subb end module modT program main use modA use modT call suba() call subb() stop END First I compile using CVF6.6C. The error shows " Error: Error in opening the Library module file. [
Support Support Newsreader MathWorks Search MathWorks.com MathWorks Newsreader Support MATLAB Newsgroup MATLAB Central Community Home MATLAB Answers File Exchange Cody Blogs Newsreader Link Exchange ThingSpeak Anniversary Home Post A https://www.mathworks.com/matlabcentral/newsreader/view_thread/153788 New Message Advanced Search Help MATLAB Central Community Home MATLAB Answers File Exchange Cody Blogs Newsreader Link Exchange ThingSpeak Anniversary Home Post A New Message Advanced Search Help Trial software Problem with Fortran library Subject: Problem with Fortran library From: Ezio Cosatto Ezio Cosatto (view profile) 1 post Date: 1 Aug, 2007 13:08:20 Message: 1 of 2 Reply to this message Add author error in to My Watch List View original format Flag as spam I'm trying to obtain a MEX-file in order to call an external Fortran subroutine using Compaq Visual Fortran version 6.6 compiler. I have tried to compile two Fortan files: the computational subroutine ‘calcolo.f' and the gateway subroutine ‘calcolog.f' the latter has been written following the Matlab Help examples. The computational subroutine uses two error in opening Fortran subroutines for mathematical applications included in the Fortran IMSL library and this seems to create problems. In fact when I try to execute the Matlab command: ‘mex calcolo.f calcolog.f' in order to get the MEX file, the following error message appears: calcolo.f(21) : Error: Error in opening the Library module file. [IMSL] USE IMSL ------------^ calcolo.i C:\PROGRAMMI\MATLAB704\BIN\WIN32\MEX.PL: Error: Compile of 'calcolo.f' failed. ??? Error using ==> mex Unable to complete successfully Of course I have copied the file ‘IMSL.lib' in the same directory where the Fortran files are, without successful results. Could anyone suggest me how make ‘IMSL.lib' visible to Matlab? Thanks in advanced Subject: Problem with Fortran library From: dpb dpb (view profile) 5085 posts Date: 1 Aug, 2007 09:08:35 Message: 2 of 2 Reply to this message Add author to My Watch List View original format Flag as spam Ezio Cosatto wrote: > I'm trying to obtain a MEX-file in order to call an external Fortran subroutine using Compaq Visual Fortran version 6.6 compiler. > I have tried to compile two Fortan files: the computational > subroutine ‘calcolo.f' and the gateway subroutine &