Skip to content

Instantly share code, notes, and snippets.

@raphaeldussin
Last active January 23, 2024 18:28
Show Gist options
  • Save raphaeldussin/800a46d1cbad23b3874a668308d84816 to your computer and use it in GitHub Desktop.
Save raphaeldussin/800a46d1cbad23b3874a668308d84816 to your computer and use it in GitHub Desktop.
install ESMF 7.1.0beta + python3 ESMPy
# installing ESMF on Ubuntu Linux
# pre-req : gfortran, netcdf, openmpi, python3
# first mkdir /opt/esmf/7.0.0 and chown to yourself
# you also need a copy of esmf_7_0_0_src.tar
# Raphael Dussin, July 2016
PYTHONBIN=/opt/Anaconda3/4.1.1/bin/
CUSTOMINSTALLDIR=/opt/esmf/7.1.0beta
#------------------ installing the ESMF libraries ---------------
git archive --remote=git://git.code.sf.net/p/esmf/esmf --format=tar --prefix=esmf/ ESMF_7_1_0_beta_snapshot_06 | tar -xf -
cd esmf
export ESMF_DIR=$( pwd )
export ESMF_INSTALL_PREFIX=$CUSTOMINSTALLDIR
export ESMF_COMM=openmpi
export ESMF_NETCDF=split
export ESMF_NETCDF_INCLUDE=/usr/include
export ESMF_NETCDF_LIBPATH=/usr/lib
export ESMF_NETCDF_LIBS="-lnetcdff -lnetcdf"
make
make install
# At this point you should have ESMF installed
#------------------ installing the python3 wrapper ---------------
cd src/addon/ESMPy
$PYTHONBIN/python setup.py build --ESMFMKFILE=$CUSTOMINSTALLDIR/lib/libO/Linux.gfortran.64.openmpi.default/esmf.mk install
@raphaeldussin
Copy link
Author

if you can, download anaconda and use
conda install -c conda-forge esmf esmpy

@YonSci
Copy link

YonSci commented Oct 2, 2020

Thanks a lot, that saved me!!!

@xmiranda2
Copy link

hi, I had this error when running "make":
/usr/include/c++/9/bits/std_function.h:770:5: note: template argument deduction/substitution failed:
/home/ximena/esmf/esmf/src/Infrastructure/Mesh/src/Moab/io/ReadABAQUS.cpp:108:15: note: ‘std::ifstream’ {aka ‘std::basic_ifstream’} is not derived from ‘const std::function<_Res(_ArgTypes ...)>’
108 | if (NULL != abFile)
| ^~~~~~
make[10]: *** [/home/ximena/esmf/esmf/build/common.mk:3264: /home/ximena/esmf/esmf/obj/objO3/Linux.gfortran.64.openmpi.default/ReadABAQUS.o] Error 1
make[10]: Leaving directory '/home/ximena/esmf/esmf/mod/modO3/Linux.gfortran.64.openmpi.default'
make[9]: *** [/home/ximena/esmf/esmf/build/common.mk:1726: esmflib] Error 2
make[9]: Leaving directory '/home/ximena/esmf/esmf/mod/modO3/Linux.gfortran.64.openmpi.default'
make[8]: *** [/home/ximena/esmf/esmf/build/common.mk:1722: tree_lib] Error 2
make[8]: Leaving directory '/home/ximena/esmf/esmf/src/Infrastructure/Mesh/src/Moab/io'
make[7]: *** [/home/ximena/esmf/esmf/build/common.mk:3189: tree] Error 1
make[7]: Leaving directory '/home/ximena/esmf/esmf/src/Infrastructure/Mesh/src/Moab'
make[6]: *** [/home/ximena/esmf/esmf/build/common.mk:3189: tree] Error 1
make[6]: Leaving directory '/home/ximena/esmf/esmf/src/Infrastructure/Mesh/src'
make[5]: *** [/home/ximena/esmf/esmf/build/common.mk:3189: tree] Error 1
make[5]: Leaving directory '/home/ximena/esmf/esmf/src/Infrastructure/Mesh'
make[4]: *** [/home/ximena/esmf/esmf/build/common.mk:3189: tree] Error 1
make[4]: Leaving directory '/home/ximena/esmf/esmf/src/Infrastructure'
make[3]: *** [/home/ximena/esmf/esmf/build/common.mk:3189: tree] Error 1
make[3]: Leaving directory '/home/ximena/esmf/esmf/src'
make[2]: *** [/home/ximena/esmf/esmf/build/common.mk:3189: tree] Error 1
make[2]: Leaving directory '/home/ximena/esmf/esmf'
make[1]: *** [/home/ximena/esmf/esmf/build/common.mk:1699: build_libs] Error 2
make[1]: Leaving directory '/home/ximena/esmf/esmf'
make: *** [/home/ximena/esmf/esmf/build/common.mk:1692: lib] Error 2
Hope you cane help me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment