Compiling 6.8 on Ubuntu 16.04 with GPU


Just Got Here
Hi there,
I am trying to compile NWChem 6.8.1 from source on Ubuntu 16.04 with Cuda 9.0.

I am able to install with apt-get and with the .deb file, but I don't think these link to my GPU.

So instead, I am trying to compile from source.

Here is what I have, thanks to this forum and Rangsiman Ketkaew's automatic install script. It's mostly the basic install script, but I added "-lpthread" to LIBMPI and MPIF90_LIB to try to help with an error, but to no avail.

  1. ------------------------- NWCHEM Location -------------------------
export NWCHEM_TOP=/home/ubuntu/nwchem-6.8
export NWCHEM_TARGET=LINUX64
  1. ------------------------- NWCHEM Functionality --------------------
export USE_NOFSCHECK=TRUE
export NWCHEM_FSCHECK=N
export LARGE_FILES=TRUE
export MRCC_THEORY=Y
export EACCSD=Y
export IPCCSD=Y
export CCSDTQ=Y
export CCSDTLR=Y
export NWCHEM_LONG_PATHS=Y
  1. ------------------------- MPI libraries ---------------------------
export USE_MPI=y
export USE_MPIF=y
export USE_MPIF4=y
export MPI_LOC=/home/ubuntu/anaconda3/envs/python2
export MPI_LIB=/lib
export MPI_INCLUDE=/include
export MPIEXEC=/bin/mpiexec
export LIBMPI="-lmpi_usempi -lmpi_mpifh -lmpi -lpthread"
  1. export LIBMPI="-lmpi_usempi -lmpi_mpifh -lmpi -lpthread"
export PATH=/bin/:$PATH
export LD_LIBRARY_PATH=/lib/:$LD_LIBRARY_PATH
  1. ------------------------- Python Libraries ------------------------
export USE_PYTHONCONFIG=y
export PYTHONVERSION=2.7
export PYTHONHOME=/home/ubuntu/anaconda3/envs/python2/
export USE_PYTHON64=y
export PYTHONLIBTYPE=so
  1. ------------------------- MATH libraries --------------------------
export USE_64TO32=y
export BLAS_SIZE=4
export BLASOPT="-lopenblas -lpthread -lrt"
  1. ------------------------- CUDA info --------------------
export TCE_CUDA=Y
export CUDA_LIBS="-L/usr/local/cuda/lib64 -L/usr/local/cuda/lib -lcudart"
export CUDA_INCLUDE="-I. -I/usr/local/cuda/include"
  1. ------------------------- Compile ---------------------------------
make nwchem_config NWCHEM_MODULES="all python" FC=/home/ubuntu/anaconda3/envs/python2/bin/mpif90 CC=/home/ubuntu/anaconda3/envs/python2/bin/mpicc CUDA=/usr/local/cuda/bin/nvcc >& compile-config.log
make -j4 64_to_32 >& compile-64_to_32.log
export MAKEOPTS="USE_64TO32=y"
make -j4 >& compile-make-nwchem.log

Here are the outputs:

end of compile-config.log:
echo "No extra configuration libraries were added " >> NWCHEM_CONFIG
cp census.skeleton ../stubs.F
for routine in argos argos_input crossing debtest dia_input diana gasdev geninterface jantest jvltest jvltest2 kgdtest leps_energy leps_gradient lucia mc_data mc_driver mc_init mc_main md_data md_driver md_set moints_screen mymc_input mymd_input nbo_input nwxc_eval_df nwxc_eval_df2 nwxc_eval_df3 nwxc_get_cam nwxc_get_disp nwxc_getvals nwxc_getwght nwxc_has_2nd nwxc_has_cam nwxc_has_disp nwxc_has_hfx nwxc_has_mp2c nwxc_has_xc nwxc_init nwxc_input nwxc_is_gga nwxc_is_lda nwxc_is_mgga nwxc_is_on nwxc_print nwxc_print_nwpw nwxc_reset_rho_tolerance nwxc_rtdb_delete nwxc_rtdb_load nwxc_rtdb_store nwxc_vdw3_dftd3 nwxc_wght_hfx nwxc_wght_mp2c raktest rimp2g rism_input rjhtest smd_input task_fragment_energy task_nbo task_rism task_smd task_smd_dynamics task_smd_energy task_smd_fragment uccsdt uccsdtest urand wfn1_input wfn1_task_energy; do \
  sed s/STUBROUTINE/$routine/g stub.skeleton >> ../stubs.F ; \
done
cp util_module_avail_F.begin ../util/util_module_avail.F
echo "c This function was auto generated by make_nwchem_config" >> ../util/util_module_avail.F
for module in NWints analyz atomscf bq cafe ccca ccsd cons cphf dangchang ddscf dimqm dntmc dplot drdy driver esp etrans fft gradients hessian mcscf mm moints mp2_grad nwdft nwmd nwpw optim perfm prepar property python qhop qmd qmmm rimp2 selci solvation space stepper symmetry tce vib vscf; do \
  echo "        case (\""$module"\")" >> ../util/util_module_avail.F ; \
done
cat util_module_avail_F.end >> ../util/util_module_avail.F
make[1]: Leaving directory '/home/ubuntu/nwchem-6.8/src/config'


at the end of compile-64_to_32.log:
make[2]: Leaving directory '/home/ubuntu/nwchem-6.8/src/config'
/home/ubuntu/nwchem-6.8/bin/LINUX64/depend.x -I/home/ubuntu/nwchem-6.8/src/tools/install/include > dependencies
cat: /home/ubuntu/nwchem-6.8/src/tools/build/config.h: No such file or directory
/home/ubuntu/nwchem-6.8/src/config/64_to_32 bas_blas.F bas_blasP.F basis.F
make[1]: /home/ubuntu/nwchem-6.8/src/config/64_to_32: Command not found
../config/makelib.h:275: recipe for target '64_to_32' failed
make[1]: *** [64_to_32] Error 127
make[1]: Leaving directory '/home/ubuntu/nwchem-6.8/src/basis'
GNUmakefile:154: recipe for target '64_to_32' failed
make: *** [64_to_32] Error 1


at the end of compile-make-nwchem.log:
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether a simple C MPI program compiles... yes
configure: searching for MPI_TS...
checking mpi.h usability... yes
checking mpi.h presence... yes
checking for mpi.h... yes
checking for library containing MPI_Init... no
configure: error: test for COMEX_NETWORK=MPI_TS failed
configure: error: ../../ga-5.6.3/comex/configure failed for comex
GNUmakefile:652: recipe for target 'build/config.status' failed
make[1]: *** [build/config.status] Error 1
make[1]: Leaving directory '/home/ubuntu/nwchem-6.8/src/tools'
GNUmakefile:103: recipe for target 'libraries' failed
make: *** [libraries] Error 1


Does anyone have any advice for how I could get NWChem to run on a GPU? I am fine using a docker or other options to change operating systems, but I have not seen any examples of fully compiled 6.8 on a GPU.

Thanks!

VA

Just Got Here
Hi,
I made some progress with the compile, but still having problems.

Basically, if I add:
export ARMCI_NETWORK="MPI-PR",
I am able to get past the previous error.

However, if I just use make (without CC= or FC= ), I get a similar error:
checking for mpi.h... yes
checking for library containing MPI_Init... no
configure: error: test for COMEX_NETWORK=MPI_PR failed
configure: error: ../../ga-5.6.3/comex/configure failed for comex
GNUmakefile:652: recipe for target 'build/config.status' failed
make[1]: *** [build/config.status] Error 1
make[1]: Leaving directory '/home/ubuntu/nwchem-6.8/src/tools'
GNUmakefile:103: recipe for target 'libraries' failed

Adding CC=/home/ubuntu/anaconda3/envs/python2/bin/mpicc gets me past this error, but then a new error shows up:
make[1]: *** No rule to make target '/home/ubuntu/nwchem-6.8/src/include/mafdecls.fh', needed by '/home/ubuntu/nwchem-6.8/lib/LINUX64/libnwcutil.a(basis.o)'. Stop.

Adding FC=/home/ubuntu/anaconda3/envs/python2/bin/mpif90 gets me past this error, but then there is an -i8 error much later:
Making libraries in basis
make[1]: Entering directory '/home/ubuntu/nwchem-6.8/src/basis'
/home/ubuntu/anaconda3/envs/python2/bin/mpif90 -c -i8 -g -I. -I/home/ubuntu/nwchem-6.8/src/include -I/home/ubuntu/nwchem-6.8/src/tools/install/include -DEXT_INT -DLINUX -DLINUX64 -DNOIO -DEAFHACK -DPARALLEL_DIAG basis.F
gfortran: error: unrecognized command line option ‘-i8’
../config/makefile.h:2694: recipe for target '/home/ubuntu/nwchem-6.8/lib/LINUX64/libnwcutil.a(basis.o)' failed
make[1]: *** [/home/ubuntu/nwchem-6.8/lib/LINUX64/libnwcutil.a(basis.o)] Error 1
make[1]: Leaving directory '/home/ubuntu/nwchem-6.8/src/basis'
GNUmakefile:103: recipe for target 'libraries' failed
make: *** [libraries] Error 1

I tried switching the FC to mpifort, but this resulted in the same error.
I'm thinking about trying gfortran next, but it would be wonderful if someone had a suggestion.

Thank you!

VA


Forum >> NWChem's corner >> Compiling NWChem