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

Error in opening the compiled module file. Check INCLUDE paths.

Behzad_S_
Beginner
2,339 Views

Hello
To compile the groundwater model MODFLOW code, requires the following settings (this page):

http://water.usgs.gov/nrp/gwsoftware/modflow2000/MFDOC/index.html?suggestions_on_compiling.htm

I use the Microsoft Visual Studio 2008 with Intel Fortran Compiler 11.1

After changes were made. I encountered the following error:

pls help me to resolve this

0 Kudos
17 Replies
mecej4
Honored Contributor III
2,339 Views

Note the names of the module files that were not found (MODULE_EXPORTDATA, etc.). Where are they defined? In the MODFLOW sources, or in additional code that you provided? You have to compile the Fortran source files containing those modules before attempting to compute files that USE those modules.

0 Kudos
Behzad_S_
Beginner
2,339 Views

mecej4 wrote:

Note the names of the module files that were not found (MODULE_EXPORTDATA, etc.). Where are they defined? In the MODFLOW sources, or in additional code that you provided? You have to compile the Fortran source files containing those modules before attempting to compute files that USE those modules.

Thanks for your helpful answers.
Yes, problem solved. But the second problem is created:

new Error is:

error LNK2019: unresolved external symbol

The following descriptions on the company website software code is written:

The Aquaveo versions of MODFLOW that are posted on this website and shipped with the GMS and Arc Hydro Groundwater software contain modifications/additions made by Aquaveo staff to make using MODFLOW easier. All changes to the MODFLOW code have been clearly marked with a "!aq" comment. In addition to changes made in the FORTRAN source code, Aquaveo MODFLOW comprises a large C++ library of code called MODFLOWLIB. Many of the changes in the FORTRAN code make calls into MODFLOWLIB.

I've solved the first problem by introducing the modules. In fact, by adding the module files in the MODFLOWLIB folder.

Do you have a solution to new problems?
Other people were having the same problem. And I read responses to questions but my problem still exists.

I am a beginner :)

0 Kudos
mecej4
Honored Contributor III
2,339 Views

You have not told us how your VS project is configured, nor have you showed the commands/build-log pertaining to the failed build. The error messages suggest that you are attempting to produce an EXE or DLL from a single .OBJ file which contains references to several external symbols. 

You should probably direct your request for help to the Modflow authors/user-groups, and educate yourself on how to build projects involving multiple source files and more than one source language.

0 Kudos
Behzad_S_
Beginner
2,339 Views

mecej4 wrote:

You have not told us how your VS project is configured, nor have you showed the commands/build-log pertaining to the failed build. The error messages suggest that you are attempting to produce an EXE or DLL from a single .OBJ file which contains references to several external symbols. 

You should probably direct your request for help to the Modflow authors/user-groups, and educate yourself on how to build projects involving multiple source files and more than one source language.

Yes that's right.
Unfortunately, on the company website there is no good explanation. Nor any way call for questions.

0 Kudos
Behzad_S_
Beginner
2,339 Views

Can anyone help me in this regard?
Website Download Code here. I use Aquaveo MODFLOW-2005.

Windows 7

Visual Studio 2008

Intel Fortran 11.1

You can get help from this site.

0 Kudos
Les_Neilson
Valued Contributor II
2,339 Views

In the instructions shown on the site I assume you actually followed the instructions for Visual Studio?

Did you remember to do the dependencies? This ensures that the code is compiled in the correct order.

For example: If A depends on B which depends on C then C must be compiled first, then B, then finally A.

Perhaps if you attach your sln and proj files we might be able to offer more help.

Les 

 

0 Kudos
Behzad_S_
Beginner
2,339 Views

Les Neilson wrote:

In the instructions shown on the site I assume you actually followed the instructions for Visual Studio?

Did you remember to do the dependencies? This ensures that the code is compiled in the correct order.

For example: If A depends on B which depends on C then C must be compiled first, then B, then finally A.

Perhaps if you attach your sln and proj files we might be able to offer more help.

Les 

 

Thank you very much for your attention.
Yes, I did exactly that. The settings according to the "Visual Studio 2008 with Intel C++ compiler 11.0 and Intel Visual Fortran compiler 11.0" did. Full details about the settings have been made, are available on the USGS website link. Consider the following image:
 
 
It should be noted that I have not installed Intel C++ compiler.
The original code groundwater modeling (MODFLOW) related to USGS. The modified code relating to Aquaveo GMS team. The modified code is important to me (downloaded from here).
I've attached the project and solution (modified code). By removing the attached file from the RAR, four folder will be created. "project" and "solution" files are in the "mf2k5" folder. 3 other folders, including changes made by Aquaveo GMS Team on the original code. How should this changes be connected to the project? To compile need them. Because I compile the source code successfully (The code has not been changed and related to USGS - downloaded from here). and I compiled it with the same method described on the USGS website. But there is no guidance on the Aquaveo GMS company's website.
And now I'm faced with 114 errors as follows:
"error LNK2019: unresolved external symbol referenced in function"
 
Thank you very much
I also apologize. Because I can not speak English well.
0 Kudos
mecej4
Honored Contributor III
2,339 Views

The instructions for building Modflow 2000 may not work for building Modflow 2005. Furthermore, the Aquaveo version contains substantial modifications (an additional library with C++ sources, HDF file usage, etc.) and, again, you should not expect the build instructions for another version to work. The Aquaveo version contains some Python scripts, so you may need Python installed to use that version. You may also need Cmake.

Given that you are a self-declared beginner, I think that you are tackling something beyond your present capabilities. Even for an experienced person building the Aquaveo version would require a substantial investment of time.

You will probably be better off acquiring a pre-built version with the packages that you wish to use. The modflow.org site lists an E-mail address and a telephone number. That's where you need to seek help.

0 Kudos
Behzad_S_
Beginner
2,339 Views

mecej4 wrote:

The instructions for building Modflow 2000 may not work for building Modflow 2005. Furthermore, the Aquaveo version contains substantial modifications (an additional library with C++ sources, HDF file usage, etc.) and, again, you should not expect the build instructions for another version to work. The Aquaveo version contains some Python scripts, so you may need Python installed to use that version. You may also need Cmake.

Given that you are a self-declared beginner, I think that you are tackling something beyond your present capabilities. Even for an experienced person building the Aquaveo version would require a substantial investment of time.

You will probably be better off acquiring a pre-built version with the packages that you wish to use. The modflow.org site lists an E-mail address and a telephone number. That's where you need to seek help.

The aim is to create a slight change in the orginal source code. Then, sensitivity analysis on parameters.
First, compile the code (code that has been edited) and replace the EXE result in the application directory (Graphical User Interface).
In fact, make a change and then compile the model.
It seems very difficult.
And disappointing!
Thank you for your information

0 Kudos
Les_Neilson
Valued Contributor II
2,339 Views

Behzad S. wrote:

The aim is to create a slight change in the orginal source code. Then, sensitivity analysis on parameters.

First, compile the code (code that has been edited) and replace the EXE result in the application directory (Graphical User Interface).
In fact, make a change and then compile the model.
It seems very difficult.
And disappointing!
Thank you for your information

It has been more than 20 years since I worked with Modflow (I was writing an interface to Modflow from the main GUI software I was working on. At that time Modflow itself was quite easy to set up. But I am not familiar with the Aquaveo software. 

I am also hampered by the fact that I no longer have a Fortran compiler available at work :-( But I did find when looking at the files from the download there were some missing files (CxxTest\1.0\runner.cpp comes to mind) and some relative paths were not found (Shared for example) so my efforts were limited.

Missing files / libraries elsewhere would cause your project to not compile or link. But I don't know whether this is the cause of your problems.

Sorry I couldn't be of more help.

Les

0 Kudos
mecej4
Honored Contributor III
2,339 Views

I downloaded and built Modflow96, just to assess the complexity, if any, of the build process. This version is all-Fortran, and building was trivial.

I then tried Modflow 2005 (USGS version) and found that the build process can be difficult for a beginner. The main issue is that the number of source files is much larger, and they have to be compiled in such a way that modules get compiled before compiling source files that USE those modules. The USGS distribution does not provide a makefile, but I generated one using a Perl script that does just that. After generating the makefile, I compiled and built the program using the PS 2016-u4 compilers. The resulting EXE ran fine on the example problems that I tried, and ran about 10 to 20 percent faster than the EXE provided in the distribution. Note that I did not bother to use the USGS build instructions.

Behzad, you could use this makefile to build Modflow 2005. Perhaps, you can make the changes that you want to this version. If you only change the code in the files without adding new modules or new source files, you can continue to build using the makefile.

If you must use the Aquaveo version (you have not stated any reasons for doing so), I do not have anything helpful at this point.

0 Kudos
Behzad_S_
Beginner
2,339 Views

Les Neilson wrote:

Quote:

Behzad S. wrote:

 

The aim is to create a slight change in the orginal source code. Then, sensitivity analysis on parameters.

First, compile the code (code that has been edited) and replace the EXE result in the application directory (Graphical User Interface).
In fact, make a change and then compile the model.
It seems very difficult.
And disappointing!
Thank you for your information

 

 

It has been more than 20 years since I worked with Modflow (I was writing an interface to Modflow from the main GUI software I was working on. At that time Modflow itself was quite easy to set up. But I am not familiar with the Aquaveo software. 

I am also hampered by the fact that I no longer have a Fortran compiler available at work :-( But I did find when looking at the files from the download there were some missing files (CxxTest\1.0\runner.cpp comes to mind) and some relative paths were not found (Shared for example) so my efforts were limited.

Missing files / libraries elsewhere would cause your project to not compile or link. But I don't know whether this is the cause of your problems.

Sorry I couldn't be of more help.

Les

 

Of course, I know I talk with professionals. I am sure that your efforts elsewhere have been scored.

0 Kudos
Behzad_S_
Beginner
2,339 Views

mecej4 wrote:

I downloaded and built Modflow96, just to assess the complexity, if any, of the build process. This version is all-Fortran, and building was trivial.

I then tried Modflow 2005 (USGS version) and found that the build process can be difficult for a beginner. The main issue is that the number of source files is much larger, and they have to be compiled in such a way that modules get compiled before compiling source files that USE those modules. The USGS distribution does not provide a makefile, but I generated one using a Perl script that does just that. After generating the makefile, I compiled and built the program using the PS 2016-u4 compilers. The resulting EXE ran fine on the example problems that I tried, and ran about 10 to 20 percent faster than the EXE provided in the distribution. Note that I did not bother to use the USGS build instructions.

Behzad, you could use this makefile to build Modflow 2005. Perhaps, you can make the changes that you want to this version. If you only change the code in the files without adding new modules or new source files, you can continue to build using the makefile.

If you must use the Aquaveo version (you have not stated any reasons for doing so), I do not have anything helpful at this point.

Your solution is very interesting. I'll think about it.
But why I chose this software?
I've developed a conceptual model. This work was done in GMS software. It is difficult to build a mathematical model in DOS environment (USGS MODFLOW). And the harder it is post-processing analysis. This is the main reason for working with Aquaveo GMS Code. However, I will test your good idea.
There is a new approach for me. I think it's time to do it! Here. Get advice from the software developers. They responded to my email:

Behzad, 

Thank you for contacting Aquaveo technical support. We understand that you want to modify the code in order to be more case specific for a project that you are working on, and that you are having difficulty compiling it. Unfortunately as technical support we are not able to help you in this matter as this type of assistance and direction would require help from the developers, which is not part of what technical support provides. 
There is a way for you to get help if you want it. Here at Aquaveo we have paid consultants, whom you could hire at an hourly rate, who would be able to help you compile the code as well as work with you in order to get an executable that will work for the project needs.  
Regards,
Aquaveo Technical Support
(801) 691-5530
support@aquaveo.com
 

thanks for your help mecej4

0 Kudos
jimdempseyatthecove
Honored Contributor III
2,339 Views

Have you checked the Software Forums at Aquaveo?

Jim Dempsey

0 Kudos
jimdempseyatthecove
Honored Contributor III
2,339 Views

What you may have done, is you took all the Fortran files and placed them into a single Project in your solution (? mf2k5). What mecej4 effectively did was to split the Fortran files into the equivalent of multiple projects, where the modules are created in one project and the code USE-ing the modules are in a different project and which is dependent upon the modules project.

What you can do in Visual Studio is to create a new project in your solution that is a Fortran static library (? mf2k5_mods). Move the sources that create modules from where they are at (? mf2k5) to the new project (? mf2k5_mods). Then set the dependencies of the former project to include the newer (module) project.

Note, depending on the modules USE-ing other modules, you may need to partition the module files into layers:

mf2k5_mods_0
mf2k5_mods_1
...

Where the higher number are dependent upon the lower numbered files.

This process is more of busy work that it is of programming.

Additionally, if you get the make file from mecej4 you should be able to determine the number of and order of projects that need to be created.

Jim Dempsey

0 Kudos
Behzad_S_
Beginner
2,339 Views

jimdempseyatthecove wrote:

What you may have done, is you took all the Fortran files and placed them into a single Project in your solution (? mf2k5). What mecej4 effectively did was to split the Fortran files into the equivalent of multiple projects, where the modules are created in one project and the code USE-ing the modules are in a different project and which is dependent upon the modules project.

What you can do in Visual Studio is to create a new project in your solution that is a Fortran static library (? mf2k5_mods). Move the sources that create modules from where they are at (? mf2k5) to the new project (? mf2k5_mods). Then set the dependencies of the former project to include the newer (module) project.

Note, depending on the modules USE-ing other modules, you may need to partition the module files into layers:

mf2k5_mods_0
mf2k5_mods_1
...

Where the higher number are dependent upon the lower numbered files.

This process is more of busy work that it is of programming.

Additionally, if you get the make file from mecej4 you should be able to determine the number of and order of projects that need to be created.

Jim Dempsey

thank you.
The problem was eliminated. Code was compiled with success.
Finally I've used version of the listed software mentioned here.

0 Kudos
Behzad_S_
Beginner
2,339 Views
This comment has been moved to its own thread
0 Kudos
Reply