SMOKE compiled with GCC

Hello.
I have downloaded SMOKE (v4.8.1 and v4.8) for GCC but they are compiled with the Intel compiler (the own tar file name indicates so). I checked, just in case, and the executables don’t work as they cannot find the libraries, which of course makes sense.
Thanks.

Basically, to build SMOKE using gcc/gfortran:

  • If you don’t have gfortran installed, install it for your Linux distribution. (Note by the way that it is really the Fortran compiler which is significant for this, not the C compiler: different Fortran compilers (and sometimes even different versions of the “same” Fortran compiler) are generally not link-compatible…)
  • Do the command setenv BIN Linux2_x86_64gfort to set up the environment for building 64-bit gcc/gfortran libraries and executables
  • Install netCDF and I/O API libraries, as described in the I/O API installation instructions https://cjcoats.github.io/ioapi/AVAIL.html#build
  • Download the SMOKE source code, if necessary
  • In the resulting SMOKE subsys/smoke directory, do the command mkdir $BIN
  • In the subsys/smoke/src directory, adjust the Makeinclude file for the locations of the installed libraries
  • In the subsys/smoke/src directory, do the command make
2 Likes

Hi @cjcoats,
Thank you for your prompt answer. This starts the compilation although there is some problem with the linker and modbiog, which I have to troubleshoot. Will let you know if I have any further question.
P.S. By GCC I meant GNU compiler collection, not the C compiler per se (yep, it’s usually confusing)

It would be useful to see that part of the make-output, starting with the command-line for the step that failed, together with all the output from it…

The output from the part that fails reads:

cd /home/centos/PREPRO/SMOKE/subsys/smoke/src/../Linux2_x86_64gfort11;  /opt/praetorium/openmpi/bin/mpif90 -I/home/centos/ioapi-3.2/ioapi/fixed_src -I/home/centos/PREPRO/SMOKE/subsys/smoke/src/inc -I/home/centos/ioapi-3.2/Linux2_x86_64gfort11                 -extend-source 132 -zero                          -O3 -fallow-argument-mismatch -fallow-invalid-boz -DAUTO_ARRAYS=1 -DF90=1 -DFLDMN=1 -DFSTR_L=int -DIOAPI_NO_STDOUT=1 -DNEED_ARGS=1 -c /home/centos/PREPRO/SMOKE/subsys/smoke/src/emmod/modbiog.f
gfortran: warning: 132: linker input file unused because linking not done
gfortran: error: 132: linker input file not found: No such file or directory
make: *** [Makefile:349: modbiog.o] Error 1

It seems like it compiles modbiog (it has the -c flag so it shouldn’t link at this point). However, it’s unclear (at least to me) what is trying to do with modbiog.o as there are still a bunch of other .f files to be compiled.

Somehow, there’s a missing “-c” flag in this compiler command: it should have

.../opt/praetorium/openmpi/bin/mpif90 -c -I/home/centos/ioapi-3.2/ioapi/fixed_src...

In your Makefile, the .f.o rule should have that -c; It should read


.f.o:
	cd ${OBJDIR};  ${FC} ${FFLAGS} -c $<

That rule is correctly defined with -c (it actually appears at the very end of the command line). Something else is triggering the error (will take a fresh look at it tomorrow).

Did you try the package on the EPA FTP? I think they are statically compiled:

https://gaftp.epa.gov/Air/emismod/2016/v2/smoke_2016v2_platform_core_01oct2021.zip

Hi @cjcoats.
The problem was my own fault as I forgot to fix EFLAG. Thanks.

1 Like

Hi @eyth.alison.
I took a look at the link earlier this morning. You’re right in that they seem to be statically compiled. Will compare vs. my own compilation. Thanks.

Actually, I ran into an error while compiling:

/home/centos/PREPRO/SMOKE/subsys/smoke/src/smkinven/rdemspd.f:304:15:

  304 |         LFIP = ''
      |               1
Error: Cannot convert CHARACTER(0) to INTEGER(4) at (1)
make: *** [Makefile:349: rdemspd.o] Error 1

/home/centos/PREPRO/SMOKE/subsys/smoke/src/smkinven/rdorlfr.f:493:15:

  493 |         LFIP = ''
      |               1
Error: Cannot convert CHARACTER(0) to INTEGER(4) at (1)
make: *** [Makefile:349: rdorlfr.o] Error 1

LFIP is defined as an integer so the error makes sense. I was able to compile by simply substituting with LFIP=0 but I have no clue if this is the intended use.

1 Like

That is a known bug and has been fixed for an upcoming release. You are correct. It should be set it to zero. LFIP=0.

1 Like

Wow, thank you. I’ve succeeded in installing SMOKE 4.8.1 with AMD CPU.

1 Like