I faced the following error when executing the MGN2MECH Makefile during the process of building the MEGANv3.2 code:
I tried again, replacing all 8 spaces with TAB, but I still received the same error. There weren’t 8 spaces in the Makefile when I checked it in Notepad++ and Sublime Text.
The weird thing is that even though the other Makefiles had 8 spaces inside of them, they ran without any issues. MGN2MECH Makefile is shared here:
How can I solve this issue? Thank you for any help in advance.
make sure that for
EVERY rule, the lines after the colon are of the form below (with no spaces
to the left of the command-part):
Thank you for your reply. I applied that, but unfortunately, I got the same error.
I tried reproducing your error.
I started by downloading MEGAN (MEGANv3.2_Dec_2021) from this location.
The latest version, MEGANv3.2, is illustrated in the above diagram
To run MEGAN3.2 you will need input data (landcover and environmental conditions) and code (preprocessor, emission factor processor, emission calculator and chemical mechanism...
I then build netcdf-c, netcdf-fortran, and ioapi for the intel compiler.
I then edited and ran the makefile for the
I did not have the same error.
Note, I did run into a different error.
I had to edit the paths and re-order the libraries to use:
I have attached the makefile.intel file that I was able to use successfully (renamed to makefile.intel.txt).
makefile.intel.txt (1.4 KB)
To use this, you would need to edit to specify the paths to the netcdf-c, netcdf-fortran and ioapi libraries on your system.
I did a diff between my makefile.intel and yours, and another difference is that you have switched the compiler to use gcc and the gcc compiler flags.
Please see the following issue for flags that can be used successfully with gcc for this program:
I’m new to biogenic emission modeling, and I’m trying to use the gfortran compiler to build and run the MEGANv3.2 model. I got an error when running “make_all_programs.scr”. I don’t know how to set the flag options of the Makefiles (under DAYMET, IOAPI2UAM, MEGCAN, MEGSEA, MEGVEA, MET2MGN, MGN2MECH, TXT2IOAPI) in accordance with the gfortran compiler. Could anyone help me to set the suitable flag options for the Makefiles?
Thank you for any help in advance.
I’ve also attached the makefile that worked for the gcc compiler here.
makefile.MGN2MECH.gcc.txt (1.2 KB)
I appreciate your response. I use the same flag option. I tried using the Makefile you had previously attached, but I got the same error. I have IOAPI v3.2 installed on my Linux instead of the recommended v3.1. Could that be the cause of this problem?
In the MGN2MECH directory, the makefile is linked to the makefile.intel.
I would do a make clean to verify that there are no old *.o files or old executable files in the directory.
To use the makefile.gcc, I had to remove that link and create a new one.
ln -s makefile.gcc makefile
If you are on system that uses modules, then check to see what modules are available using
load the gcc compiler using something like the following (dependent on what modules are available on your system)
module load openmpi_4.0.1/gcc_9.1.0
Then run make using the following command:
make |& tee makefile.log
Please attach the makefile.log file to this issue.
The command “module list” does not work on the system. I did a make clean and removed the old *.o files. Moreover, I removed the link file and created a new link. Finally, I run the make file. The log file is attached.
makefile.log.txt (85.5 KB)
While there were warnings, at the end of the log file, it shows that the model compiled successfully. Look for the executable in your directory called
Thank you for your help. There are files named “mgn2mech”, “mgn2mech.F”, and “mgn2mech.o” in the directory.