Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCHP 14.1.1 Compilation Error #326

Closed
4 tasks done
helpyuan opened this issue Jun 28, 2023 · 11 comments · Fixed by #334
Closed
4 tasks done

GCHP 14.1.1 Compilation Error #326

helpyuan opened this issue Jun 28, 2023 · 11 comments · Fixed by #334
Assignees
Labels
category: Bug Something isn't working topic: Build Related to makefiles or the build sequence
Milestone

Comments

@helpyuan
Copy link

helpyuan commented Jun 28, 2023

Name and Institution (Required)

Name: liumy
Institution: Chinese Academy of Meteorological Sciences

Confirm you have reviewed the following documentation

Description of your issue or question

Hi, I am a newcomer to GCHP and I am trying to install GCHP according to the tutorial (https://gchp.readthedocs.io/en/latest/user-guide/compiling.html#modify -Build settings). Now, I have created a new directory and run "CMake..", and the results are similar to the case in the tutorial, so I started running "make -j", but it gave me an error.

I have no clue about this error because every step I take is based on the tutorial. I hope to receive your help.

Please provide as much detail as possible. Always include the GCHP version number and any relevant configuration and log files.

Software:
GCHP v14.1.1
gcc 13.1.0
openmpi 4.1.5
esmf 8.3.0
netcdf 4.8.1

The relevant log files are as follows:
compiler_make.log.txt
compiler_make-j.log.txt
CMakeCache.txt
ecbuild.log
cmake.log.txt

@lizziel
Copy link
Contributor

lizziel commented Jun 28, 2023

Hi @helpyuan, welcome to the GEOS-Chem community. The error you are getting is happening immediately after you start building.

[  0%] Building Fortran object src/MAPL/shared/Constants/CMakeFiles/MAPL.constants.dir/InternalConstants.F90.o
gfortran: fatal error: no input files
compilation terminated.
/bin/sh: -ffree-line-length-none: command not found

Could you write out exactly what you are typing at the command line and where (which directory you are in) when configuring and building?

@helpyuan
Copy link
Author

helpyuan commented Jun 29, 2023

Hi @lizziel, here are my steps:

  1. git clone https://github.com/geoschem/GCHP.git GCHP
  2. git checkout 14.1.1
  3. git submodule update --init --recursive
  4. git status, and output is as follow:
    (# HEAD detached at 14.1.1
    nothing to commit, working directory clean)
  5. cd GCHP/
  6. mkdir build & cd build
  7. cmake ..
    note: the running result is cmake.log.txt
  8. make -j or make
    note: the running results are compiler_make-j.log.txt andcompiler_make.log.txt, respectively.

These are all the operations I can currently run. When configuring and building, I am in the build directory.

@helpyuan
Copy link
Author

This is the directory content of src/MAPL/shared/Constants/CMakeFiles/MAPL.constants.dir/.
I hope it will be helpful to you.

directory content

@lizziel
Copy link
Contributor

lizziel commented Jun 29, 2023

Hi @helpyuan, I have not been able to reproduce this and do not see anything obviously wrong in your CMakeCache.txt. In your reported steps Step 5 should be right after Step 1, but I assume that is what you did since otherwise checking out the tag would not work.

To check if this is an environment issue or an issue in GCHP-specific libraries, could you download GEOS-Chem Classic 14.1.1 and try to build that using your same environment?

git clone https://github.com/geoschem/gcclassic.git code.gcclassic
cd code.gcclassic
git checkout 14.1.1
git submodule update --init --recursive
mkdir build
cd build
cmake ..
make

@helpyuan
Copy link
Author

Hi @lizziel, I have followed your suggestions and carried out the relevant operations.

  1. git clone https://github.com/geoschem/gcclassic.git code.gcclassic
  2. cd code.gcclassic
  3. git checkout 14.1.1
    git checkout
  4. git submodule update --init --recursive
    git submodule update
  5. mkdir build
  6. cd build
  7. cmake ..
    cmake.log.txt
    CMakeCache.txt
  8. make
    make.log.txt

The environment for compilingGEOS-Chem Classic 14.1.1 is the same as when compiling GCHP 14.1.1, but compiling GEOS-Chem Classic 14.1.1 seems to have succeeded. How should I check the problem next?

@lizziel
Copy link
Contributor

lizziel commented Jun 30, 2023

Hi @helpyuan, this is puzzling since the error in GCHP is happening when compiling the very first file, as if the basic usage of gfortran is broken, such as a space where there should not be one.

[  0%] Building Fortran object src/MAPL/shared/Constants/CMakeFiles/MAPL.constants.dir/InternalConstants.F90.o
gfortran: fatal error: no input files
compilation terminated.
/bin/sh: -ffree-line-length-none: command not found
make[2]: *** [src/MAPL/shared/Constants/CMakeFiles/MAPL.constants.dir/InternalConstants.F90.o] Error 127
make[1]: *** [src/MAPL/shared/Constants/CMakeFiles/MAPL.constants.dir/all] Error 2
make: *** [all] Error 2

Here are a few thoughts:

  1. Try building GCHP again but using command make VERBOSE=1
  2. Would you be able to try building with a version of gfortran that is before 13, or try Intel compilers?
  3. I don't think this is a MAPL issue, but it does seem to be specific to GCHP's build system since GC-Classic builds fine. I am therefore bringing in GEOS build system and fortran expert @mathomp4. Matt, have you seen anything like this before in GEOS? Any known problems with GNU 13.1?

@lizziel
Copy link
Contributor

lizziel commented Jun 30, 2023

Heads up I will be away until July 11th.

@helpyuan
Copy link
Author

helpyuan commented Jul 1, 2023

Hi @lizziel, thank you for your suggestions. The results of my attempt are as follows:

  1. Try building GCHP again but using command make VERBOSE=1
    make_verbose=1.log.txt

  2. Would you be able to try building with a version of gfortran that is before 13, or try Intel compilers?
    I tried using gfortran-12.3.0 to build GCHP-14.1.1, but the results were the same as gfortran-13.1.1.
    cmake_gnu-12.3.0.log.txt
    CMakeCache_gnu-12.3.0.txt
    make_gnu-12.3.0.log.txt
    make_gnu-12.3.0_verbose=1.log.txt

In addition, I attempted to build GCHP-13.3.4 using gfortran-12.3.0 and encountered similar issues.
CMakeCache_gchp13.3.4_gnu12.3.0.txt
cmake_gchp13.3.4_gnu12.3.0.log.txt
make_gchp13.3.4_gnu12.3.0.log.txt
make_gchp13.3.4_gnu12.3.0_verbose=1.log.txt

@mathomp4
Copy link

mathomp4 commented Jul 2, 2023

Okay. First thing, GCC 13 does not like our model. We haven't figure it out yet, but it seemed like a compiler issue. Hopefully soon we can find a workaround. So, sticking with GCC 12 is a good idea.

That said, your issue is more basic than that. Something...weird is going on with the options:

[ 0%] Building Fortran object src/MAPL/shared/Constants/CMakeFiles/MAPL.constants.dir/InternalConstants.F90.o
cd /data/home/liumy/GCHP/src/GCHP/build/src/MAPL/shared/Constants && /data/home/liumy/tools/gcc-12.3.0/bin/gfortran -DBUILD_WITH_PFLOGGER -DFORTRAN_COMPILER_SUPPORTS_ASSUMED_TYPE -DFORTRAN_COMPILER_SUPPORTS_FINDLOC -DHAS_NETCDF3 -DHAS_NETCDF4 -DNETCDF_NEED_NF_MPIIO -D__GFORTRAN__ -I/data/home/liumy/GCHP/src/GCHP/src/MAPL/shared/Constants -I/data/home/liumy/GCHP/src/GCHP/build/src/MAPL/shared/Constants -I/data/home/liumy/GCHP/src/GCHP/build/include/MAPL.constants -I/data/home/liumy/GCHP/src/GCHP/src/MAPL/include -m64;-ffree-line-length-none -O2 -g -DNDEBUG -fallow-argument-mismatch -fallow-invalid-boz -J../../../../include/MAPL.constants -fPIC -c /data/home/liumy/GCHP/src/GCHP/src/MAPL/shared/Constants/InternalConstants.F90 -o CMakeFiles/MAPL.constants.dir/InternalConstants.F90.o
gfortran: fatal error: no input files
compilation terminated.
/bin/sh: -ffree-line-length-none: command not found

For some reason you are getting a semicolon in your build options, so Linux is seeing that as two different commands.

Do you know what is setting that -m64 flag? We don't it in any options internally so something external to MAPL seems to be passing it in. (Indeed, I haven't set that flag in a looooooong time. I forgot it even was a flag it's been so long since I've been on an i686 system.)

@helpyuan
Copy link
Author

Thank you for reminding me @mathomp4! -m64 is my environment variable, and once I remove it, I can compile and install it normally.

My issue has been successfully resolved. Thank you for your help @lizziel @mathomp4 !

@yantosca
Copy link
Contributor

Thanks @helpyuan for the update! We can now close out this issue. Let us know if you encounter other problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Bug Something isn't working topic: Build Related to makefiles or the build sequence
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants