Makefile:6: *** missing separator (did you mean TAB instead of 8 spaces?). Stop

Hi,
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:

https://drive.google.com/drive/folders/1C9GJHsDmd-HKjAniiAKP6DyPogTb-kGN?usp=sharing

How can I solve this issue? Thank you for any help in advance.
Reza

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):

@cjcoats
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.

I then build netcdf-c, netcdf-fortran, and ioapi for the intel compiler.

I then edited and ran the makefile for the MGN2MECH code.

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:

-lnetcdff -lnetcdf

instead of

-lnetcdf -lnetcdff

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’ve also attached the makefile that worked for the gcc compiler here.
makefile.MGN2MECH.gcc.txt (1.2 KB)

@lizadams
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.

rm makefile
ln -s makefile.gcc makefile

If you are on system that uses modules, then check to see what modules are available using

module list

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.

1 Like

@lizadams
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 mgn2mech .

1 Like

@lizadams
Thank you for your help. There are files named “mgn2mech”, “mgn2mech.F”, and “mgn2mech.o” in the directory.