The OASIS Coupler Forum

  HOME

Compiling OASIS error

Up to Installation and compilation

Posted by Anonymous at September 26 2022

Hello, everyone
  I'm trying to compile and install OASIS-MCT, but I'm having some problems. I'm in the make. My MPI and netCDF paths were specified in MyMachine, but an error occurred.
Build output to /public/home/sunjiacheng/oasis3-mct/util/make_dir/COMP.log
Build errors to /public/home/sunjiacheng/oasis3-mct/util/make_dir/COMP.err
=> Creating directories for compiling the static libraries
   in /public/home/sunjiacheng/oasis3-mct/INSTALL_OASIS/build-static/lib
=> Configuring libraries mpeu and mct
gmake[1]: *** [makemct-static] Error 77
make: *** [static-libs-fortran] Error 2

comp.err
configure: error: in `/public/home/sunjiacheng/oasis3-mct/INSTALL_OASIS/build-static/lib/mctdir':
configure: error: C compiler cannot create executables
See `config.log' for more details

Posted by Anonymous at September 26 2022

Can you share the make.intel@example file with me.
then I can troubleshoot your problem. Thank you.
Subhadeep Maishal
Email: subhadeepmaishal@kgpian.iitkgp.ac.in
Indian Institute of Technology Kharagpur

Posted by Anonymous at September 26 2022

#
# Include file for OASIS3 Makefile for Intel 21 on 
# Linux computer  with OpenMP
# module load intel/21.1.1
# module load intelmpi/2021.1.1
# module load lib/netcdf-fortran/4.4.4_phdf5_1.10.4
# module load python/3.7.7
#
###############################################################################
#
# CHAN	: communication technique used in OASIS3 (MPI1/MPI2)
CHAN            = MPI1
#
# Paths for libraries, object files and binaries
#
# COUPLE	: path for oasis3-mct main directory
COUPLE          = $(HOME)/oasis3-mct
#
# ARCHDIR       : directory created when compiling
 ARCHDIR        := $(COUPLE)/INSTALL_OASIS
#
# MPI library
MPIDIR           = /public/software/mpi/openmpi/intel2017/1.8.4
MPIBIN           = $(MPIDIR)/bin
MPIBIN           = $(MPIDIR)/bin
MPI_INCLUDE      = $(MPIDIR)/include
MPILIB           = -L$(MPIDIR)/lib
MPIRUN           = $(MPIBIN)/mpirun
#
# NETCDF library
NETCDF_INCLUDE=/public/software/mathlib/netcdf/intel2017/4.6.2/include
NETCDF_LIBRARY  =  -Wl,-rpath,/public/software/mathlib/netcdf/intel2017/4.6.2/lib -L/public/software/mathlib/netcdf/intel2017/4.6.2/lib -lnetcdff -lnetcdf
#
# Compiling and other commands
MAKE        = gmake
F90         = $(MPIBIN)/mpiifort -I$(MPI_INCLUDE)
F           = $(F90)
f90         = $(F90)
f           = $(F90)
CC          = $(MPIBIN)/mpiicc -I$(MPI_INCLUDE)
LD          = $(MPIBIN)/mpiifort $(MPILIB)
# Static libraries compilation options
STATOPT     =
# Shared libraries options
DYNOPT      = -fPIC
LDDYNOPT    = -shared
AR          = ar
ARFLAGS     = -ruv
# Fortran libraries for C linking
F2C_LIBS    = -lifcore -lifcoremt -lifport -limf
#
# CPP keys and compiler options
# 
CPPDEF    = -Duse_netCDF -Duse_comm_$(CHAN) -D__VERBOSE  -DTREAT_OVERLAY
#
# -g is necessary in F90FLAGS and LDFLAGS for pgf90 versions lower than 6.1
# 
FCBASEFLAGS = -O2 -xCORE-AVX2 -I. -assume byterecl -mt_mpi -qopenmp
#FCBASEFLAGS = -g -traceback -fpe0 -O0 -check all -check noarg_temp_created -I. -assume byterecl -mt_mpi -qopenmp
CCBASEFLAGS  = -O2 -qopenmp
#
# INC_DIR : includes all *mod for each library
 INC_DIR = -I$(ARCHDIR)/include
# FLIBS : for toys when linking in local Makefile
 FLIBS=${NETCDF_LIBRARY}
###################
#
F90FLAGS    = $(FCBASEFLAGS) $(INC_DIR) $(CPPDEF) -I$(NETCDF_INCLUDE) 
f90FLAGS    = $(FCBASEFLAGS) $(INC_DIR) $(CPPDEF) -I$(NETCDF_INCLUDE)
FFLAGS      = $(FCBASEFLAGS) $(INC_DIR) $(CPPDEF) -I$(NETCDF_INCLUDE)
fFLAGS      = $(FCBASEFLAGS) $(INC_DIR) $(CPPDEF) -I$(NETCDF_INCLUDE)
CCFLAGS     = $(CCBASEFLAGS) $(INC_DIR) $(CPPDEF) -I$(NETCDF_INCLUDE)
LDFLAGS     = $(FCBASEFLAGS)
F2C_LDFLAGS = $(F2C_LIBS)
#
#############################################################################

Posted by Anonymous at September 27 2022

Hello,
I re-edited my makeIntel file, but I made a mistake in the scrip part. How can I fix this?
=> Creating directories for compiling the static libraries
   in /public/home/sunjiacheng/oasis3-mct/INSTALL_OASIS/build/lib
=> Configuring libraries mpeu and mct
=> Compiling libraries mpeu and mct
=> Installing libraries mpeu and mct
=> Compiling library scrip
gmake[1]: *** [makescrip-static] Error 2
make: *** [static-libs-fortran] Error 2

Posted by Anonymous at September 27 2022

#
# Can you try it
# Include file for OASIS3 Makefile for a Linux system using 
# Portland Group Fortran Compiler and MPICH
# Subhadeep Maishal (subhadeepmaishal@kgpian.iitkgp.ac.in)
#Indian Institute of Technology Kharagpur
###############################################################################
#
# CHAN	: communication technique used in OASIS3 (MPI1/MPI2/NONE)
CHAN            = MPI1
#
# Paths for libraries, object files and binaries
#
# COUPLE	: path for oasis3-mct main directory 
#Change the line below
COUPLE          = /home/20cl91p02/NEXTGEN/OA/oasis3-mct
#
# ARCHDIR       : directory created when compiling
#Change the line below
ARCHDIR         = /home/20cl91p02/NEXTGEN/OA/oasis3_mct_install

#
# NETCDF library
NETCDF_INCLUDE  = $(shell $(NETCDF_CONFIG) --fflags)
NETCDF_LIBRARY  = $(shell $(NETCDF_CONFIG) --flibs)
#

# MPI library
MPIDIR      = 
MPIBIN      = 
MPI_INCLUDE = 
MPILIB      =

# Compiling and other commands
MAKE        = gmake
F90         = mpiifort
F           = $(F90)
f90         = $(F90)
f           = $(F90)
CC          = mpiicc -mt_mpi
LD          = mpiifort
AR          = ar
ARFLAGS     = r
#
# CPP keys and compiler options
# 
CPPDEF    = -Duse_libMPI -Duse_comm_$(CHAN)
#
# 
F90FLAGS_1  = -O2 -I. -mt_mpi
f90FLAGS_1  = $(F90FLAGS_1)
FFLAGS_1    = $(F90FLAGS_1)
fFLAGS_1    = $(F90FLAGS_1)
CCFLAGS_1   = -O2 -xAVX -mt_mpi
LDFLAGS     = -mt_mpi
#
###################
#
# Additional definitions that should not be changed
#
FLIBS		= $(NETCDF_LIBRARY)
# BINDIR        : directory for executables
BINDIR          = $(ARCHDIR)/bin
# LIBBUILD      : contains a directory for each library
LIBBUILD        = $(ARCHDIR)/build/lib
# INCPSMILE     : includes all *o and *mod for each library
INCPSMILE       = -I$(LIBBUILD)/psmile.$(CHAN) -I$(LIBBUILD)/mct -I$(LIBBUILD)/scrip 

F90FLAGS  = $(F90FLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
f90FLAGS  = $(f90FLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
FFLAGS    = $(FFLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
fFLAGS    = $(fFLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
CCFLAGS   = $(CCFLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
#
#############################################################################

Posted by Anonymous at September 27 2022

#
#Can You try this ...
#Subhadeep Maishal
#Email: subhadeepmaishal@kgpian.iitkgp.ac.in
#Indian Institute of Technology Kharagpur
# Include file for OASIS3 Makefile for a Linux system using 
# Portland Group Fortran Compiler and MPICH
#
###############################################################################
#
# CHAN	: communication technique used in OASIS3 (MPI1/MPI2/NONE)
CHAN            = MPI1
#
# Paths for libraries, object files and binaries
#
# COUPLE	: path for oasis3-mct main directory
COUPLE          = /home/20cl91p02/NEXTGEN/OA/oasis3-mct
#
# ARCHDIR       : directory created when compiling
ARCHDIR         = /home/20cl91p02/NEXTGEN/OA/oasis3_mct_install

#
# NETCDF library
NETCDF_INCLUDE  = $(shell $(NETCDF_CONFIG) --fflags)
NETCDF_LIBRARY  = $(shell $(NETCDF_CONFIG) --flibs)
#

# MPI library
MPIDIR      = 
MPIBIN      = 
MPI_INCLUDE = 
MPILIB      =

# Compiling and other commands
MAKE        = gmake
F90         = mpiifort
F           = $(F90)
f90         = $(F90)
f           = $(F90)
CC          = mpiicc -mt_mpi
LD          = mpiifort
AR          = ar
ARFLAGS     = r
#
# CPP keys and compiler options
# 
CPPDEF    = -Duse_libMPI -Duse_comm_$(CHAN)
#
# 
F90FLAGS_1  = -O2 -I. -mt_mpi
f90FLAGS_1  = $(F90FLAGS_1)
FFLAGS_1    = $(F90FLAGS_1)
fFLAGS_1    = $(F90FLAGS_1)
CCFLAGS_1   = -O2 -xAVX -mt_mpi
LDFLAGS     = -mt_mpi
#
###################
#
# Additional definitions that should not be changed
#
FLIBS		= $(NETCDF_LIBRARY)
# BINDIR        : directory for executables
BINDIR          = $(ARCHDIR)/bin
# LIBBUILD      : contains a directory for each library
LIBBUILD        = $(ARCHDIR)/build/lib
# INCPSMILE     : includes all *o and *mod for each library
INCPSMILE       = -I$(LIBBUILD)/psmile.$(CHAN) -I$(LIBBUILD)/mct -I$(LIBBUILD)/scrip 

F90FLAGS  = $(F90FLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
f90FLAGS  = $(f90FLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
FFLAGS    = $(FFLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
fFLAGS    = $(fFLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
CCFLAGS   = $(CCFLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
#
#############################################################################

Posted by Anonymous at September 30 2022

Thanks for your advice, I have been able to solve the problem.

Posted by Anonymous at November 6 2023

I tried a lot, but still have problems and report the following error:
make -f TopMakefileOasis3

Compilation of the OASIS3-MCT static libraries
Build output to /home/fvcom/oasis3-mct/util/make_dir/COMP.log
Build errors to /home/fvcom/oasis3-mct/util/make_dir/COMP.err
gmake[1]: Entering directory '/home/fvcom/oasis3-mct/util/make_dir'
=> Creating directories for compiling the static libraries
   in /home/fvcom/oasis3_mct_install/build/lib
gmake[1]: Leaving directory '/home/fvcom/oasis3-mct/util/make_dir'
gmake[1]: Entering directory '/home/fvcom/oasis3-mct/util/make_dir'
=> Configuring libraries mpeu and mct
=> Compiling libraries mpeu and mct
=> Installing libraries mpeu and mct
gmake[1]: Leaving directory '/home/fvcom/oasis3-mct/util/make_dir'
gmake[1]: Entering directory '/home/fvcom/oasis3-mct/util/make_dir'
=> Compiling library scrip
gmake[1]: *** [TopMakefileOasis3:246: makescrip-static] Error 2
gmake[1]: Leaving directory '/home/fvcom/oasis3-mct/util/make_dir'
make: *** [TopMakefileOasis3:93: static-libs-fortran] Error 2


Here are the contents of my make.inc:
###############################################################################
#
# CHAN : communication technique used in OASIS3 (MPI1/MPI2/NONE)
CHAN = MPI1
#CHAN = MPI1
# Paths for libraries, object files and binaries
CHAN = MPI1 # # Paths for libraries, object files and binaries
# COUPLE : path for oasis3-mct main directory
COUPLE = /home/fvcom/oasis3-mct
# # ARCHDIR : directory for oasis3-mct main directory
# ARCHDIR : directory created when compiling
ARCHDIR = /home/fvcom/oasis3_mct_install

# # ARCHDIR : directory created when compiling
# NETCDF library
NETCDF_INCLUDE = $(shell $(NETCDF_CONFIG) --fflags)
NETCDF_LIBRARY = $(shell $(NETCDF_CONFIG) --flibs)
# MPI library

# MPI library
MPIDIR = 
MPIBIN = 
MPI_INCLUDE = 
MPILIB =

# Compiling and other commands
MAKE = gmake
F90 = mpiifort
F = $(F90)
f90 = $(F90)
f = $(F90)
CC = mpiicc -mt_mpi
LD = mpiifort
AR = ar
ARFLAGS = r
#ARFLAGS = r
# CPP keys and compiler options
#CPPDEF = -Duse_libMPI -Duse_comm_$(CHAN) 
CPPDEF = -Duse_libMPI -Duse_comm_$(CHAN)
#
# # CPPDEF = -Duse_libMPI 
F90FLAGS_1 = -O2 -I. -mt_mpi
f90FLAGS_1 = $(F90FLAGS_1)
fflags_1 = $(F90FLAGS_1)
fFLAGS_1 = $(F90FLAGS_1)
CCFLAGS_1 = -O2 -xAVX -mt_mpi
LDFLAGS = -mt_mpi
#LDFLAGS = -mt_mpi
###################
#
# Additional definitions that should not be changed
# # Additional definitions that should not be changed
FLIBS = $(NETCDF_LIBRARY)
# BINDIR : directory for executables
BINDIR = $(ARCHDIR)/bin
# LIBBUILD : contains a directory for each library
LIBBUILD = $(ARCHDIR)/build/lib
# INCPSMILE : includes all *o and *mod for each library
INCPSMILE = -I$(LIBBUILD)/psmile.$(CHAN) -I$(LIBBUILD)/mct -I$(LIBBUILD)/scrip 

F90FLAGS = $(F90FLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
f90FLAGS = $(f90FLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
fflags = $(fflags_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
fFLAGS = $(fFLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
CCFLAGS = $(CCFLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
#
#############################################################################

Posted by Anonymous at November 6 2023

I replied incorrectly. Sorry.
Reply to this