Instructions in the manual cannot set modules and define target


Forum Vet
I used the following lines from the manual to compile NWCHEM6.3 revision2
export USE_MPI
export NWCHEM_MODULES all
export OLD_GA yes
export NWCHEM_TARGET MACX
export NWCHEM_TOP=/Users/computation/nwchem
Howerver, when I went into the directory/src and typed " make nwchem_config", the terminal showed that
you must set NWCHEM_MODULES to the list of modules to be included in NWCHEM builds, and when I typed
further "make", it showed you must define NWCHEM_TARGET in your environment to be the name of the machine you wish to build for...
According to the manual, I have finished the two things.
What is the problem here?
Thanks for your advice.

Thanks a lot. This works!

Gets Around
You are not declaring environment variables correctly. In a bash shell, which I think is the default on OS X, your need to do something like this:

export USE_MPI
export NWCHEM_MODULES=all
export OLD_GA=yes
export NWCHEM_TARGET=MACX
export NWCHEM_TOP=/Users/computation/nwchem


If you are setting an exported variable to a particular value, you need put an = sign between the variable and the value, with no white space in between. The manual shows how to set environment variables with setenv, which is how you do it in C-style shells, but you can't just replace setenv with export to make it work in bash. You need the extra = sign also.

Clicked A Few Times
Also, if the value you're trying to set contains spaces, you need to use some sort of quotation mark.

export LIBMPI='-lmpi_f90 -lmpi_f77 -lmpi -ldl -Wl,--export-dynamic -lnsl -lutil'

Forum Vet
No such file or directory.
After setting the necessary environmental variables, I got the message: config/makefile.h:146: /users/computation/nwchem-6.1.1/src/config/nwchem_config.h: No such file or directory.
This happened for Nwchem-6.3-revision2, too.
What should I do in this case?
Thanks for your advice!

Gets Around
Show what you did. Perform a fresh extraction of the source code from the archive and try to build NWChem up to the point you got an error. Then copy the contents of your terminal history into a message, or put the contents in a pastebin.com message if it's too long to put in a forum message. You aren't providing enough information to debug the problem.

Forum Vet
Exactly, I have done the following
BASH-3.2# export USE_MPI
BASH-3.2# export NWCHEM_MODULES=all
BASH-3.2# export OLD_GA=yes
BASH-3.2# export NWCHEM_TARGET=MACX
BASH-3.2# export NWCHEM_TOP=/users/computation/nwchem
BASH-3.2# cd /users/computation/nwchem/src
BASH-3.2# make nwchem_config
 The message is as the followingconfig/makefile.h:145: /users/computation/nwchem-6.3/src/config/nwchem_config.h: No such file or directory
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C config -f make_nwchem_config NWCHEM_MODULES="all"
echo \# This configuration generated automatically on \
`hostname` at `date` > nwchem_config.h
echo "# Request modules from user: all" >> nwchem_config.h
echo "NW_MODULE_SUBDIRS = NWints atomscf ddscf gradients moints nwdft nwxc rimp2 stepper driver optim cphf ccsd vib mcscf prepar esp hessian selci dplot mp2_grad qhop property nwpw fft analyz nwmd cafe space drdy vscf qmmm qmd etrans tce bq cons perfm dntmc dangchang ccca" >> nwchem_config.h
echo "NW_MODULE_LIBS = -lccsd -lmcscf -lselci -lmp2 -lmoints -lstepper -ldriver -loptim -lnwdft -lgradients -lcphf -lesp -lddscf -ldangchang -lguess -lhessian -lvib -lnwcutil -lrimp2 -lproperty -lnwints -lprepar -lnwmd -lnwpw -lofpw -lpaw -lpspw -lband -lnwpwlib -lnwxc -lcafe -lspace -lanalyze -lqhop -lpfft -ldplot -ldrdy -lvscf -lqmmm -lqmd -letrans -lpspw -ltce -lbq -lcons -lperfm -ldntmc -lccca" >> nwchem_config.h
echo "EXCLUDED_SUBDIRS = develop scfaux plane_wave oimp2 rimp2_grad python argos diana uccsdt rism geninterface transport smd nbo leps" >> nwchem_config.h
echo "EXCLUDED_SUBDIRS = develop scfaux plane_wave oimp2 rimp2_grad python argos diana uccsdt rism geninterface transport smd nbo leps" >> nwchem_config.h
echo "CONFIG_LIBS = " >> nwchem_config.h
echo \# This configuration generated automatically on \
`hostname` at `date` > NWCHEM_CONFIG
echo "# Request modules from user: all" >> NWCHEM_CONFIG
echo The following subdirectories are built: >> NWCHEM_CONFIG
echo NWints analyz atomscf bq cafe ccca ccsd cons cphf dangchang ddscf dntmc dplot drdy driver esp etrans fft gradients hessian mcscf moints mp2_grad nwdft nwmd nwpw nwxc optim perfm prepar property qhop qmd qmmm rimp2 selci space stepper symmetry tce vib vscf >> NWCHEM_CONFIG
echo corresponding to these libraries: >> NWCHEM_CONFIG
echo -lnwints -lanalyze -lguess -lbq -lcafe -lccca -lccsd
......
sed s/STUBROUTINE/$routine/g stub.skeleton >> ../stubs.F ; \
doneBASH-3.2# make
config/makefile.h:145: /users/computation/nwchem-6.3/src/config/nwchem_config.h: No such file or directory
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C config -f make_nwchem_config NWCHEM_MODULES="all"
echo \# This configuration generated automatically on \
`hostname` at `date` > nwchem_config.h
echo "# Request modules from user: all" >> nwchem_config.h
echo "NW_MODULE_SUBDIRS = NWints atomscf ddscf gradients moints nwdft nwxc rimp2 stepper driver optim cphf ccsd vib mcscf prepar esp hessian selci dplot mp2_grad qhop property nwpw fft analyz nwmd cafe space drdy vscf qmmm qmd etrans tce bq cons perfm dntmc dangchang ccca" >> nwchem_config.h
......
sed s/STUBROUTINE/$routine/g stub.skeleton >> ../stubs.F ; \
done
test \! -f 64_to_32 -o \! -f 32_to_64 || rm -f 64_to_32 32_to_64
test -d /users/computation/nwchem-6.3/lib/MACX || mkdir -p /users/computation/nwchem-6.3/lib/MACX
test -d /users/computation/nwchem-6.3/bin/MACX || mkdir -p /users/computation/nwchem-6.3/bin/MACX
./util/util_nwchem_version.bash
Making libraries in tools
../config/makefile.h:145: /users/computation/nwchem-6.3/src/config/nwchem_config.h: No such file or directory
make[1]: *** No rule to make target `/users/computation/nwchem-6.3/src/config/nwchem_config.h'. Stop.
make: *** [libraries] Error 1

Gets Around
Your NWCHEM_TOP is shown declared as /users/computation/nwchem but when you do make nwchem_config it is behaving as if /users/computation/nwchem-6.3 were the NWCHEM_TOP.

Some guesses at the problem:
-Did you really unpack the source code from the archive anew before attempting compilation, or are there old files hanging around from a previous compilation attempt? You can try 'make realclean' first to clean up stray files.
-Are there incompatible environment variables set in your shell from a previous compilation attempt, or maybe set by a script file?
-Are you using symbolic links for directory names? I don't know if that would even matter, but I have never tried building NWChem in a symlink-named directory.

Forum Vet
Is GFortran 4.9 compatible with Nwchem6.3-rev2?
I used tar xvzf to unpack the software and changed the name of the directory into nwchem-6.3, but the compilation still failed. A lot of compilations contained warnings. By the way, I installed GAMESS binary and compiled Dalton2013.3 on the same computer. The message form the terminal is as the followingBASH-3.2# make nwchem_config
config/makefile.h:145: /users/computation/nwchem-6.3/src/config/nwchem_config.h: No such file or directory
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C config -f make_nwchem_config NWCHEM_MODULES="all"
echo \# This configuration generated automatically on \
`hostname` at `date` > nwchem_config.h
echo "# Request modules from user: all" >> nwchem_config.h
echo "NW_MODULE_SUBDIRS = NWints atomscf ddscf gradients moints nwdft nwxc rimp2 stepper driver optim cphf ccsd vib mcscf prepar esp hessian selci dplot mp2_grad qhop property nwpw fft analyz nwmd cafe space drdy vscf qmmm qmd etrans tce bq cons perfm dntmc dangchang ccca" >> nwchem_config.h
echo "NW_MODULE_LIBS = -lccsd -lmcscf -lselci -lmp2 -lmoints -lstepper -ldriver -loptim -lnwdft -lgradients -lcphf -lesp -lddscf -ldangchang -lguess -lhessian -lvib -lnwcutil -lrimp2 -lproperty -lnwints -lprepar -lnwmd -lnwpw -lofpw -lpaw -lpspw -lband -lnwpwlib -lnwxc -lcafe -lspace -lanalyze -lqhop -lpfft -ldplot -ldrdy -lvscf -lqmmm -lqmd -letrans -lpspw -ltce -lbq -lcons -lperfm -ldntmc -lccca" >> nwchem_config.h
echo "EXCLUDED_SUBDIRS = develop scfaux plane_wave oimp2 rimp2_grad python argos diana uccsdt rism geninterface transport smd nbo leps"
...... sed s/STUBROUTINE/$routine/g stub.skeleton >> ../stubs.F ; \
done
BASH-3.2# make
test \! -f 64_to_32 -o \! -f 32_to_64 || rm -f 64_to_32 32_to_64
test -d /users/computation/nwchem-6.3/lib/MACX || mkdir -p /users/computation/nwchem-6.3/lib/MACX
test -d /users/computation/nwchem-6.3/bin/MACX || mkdir -p /users/computation/nwchem-6.3/bin/MACX
./util/util_nwchem_version.bash
Making libraries in tools
mkdir -p lib/MACX
mkdir -p include*** Building Parallel Tools ****

>>> making Memory Allocator (MA) library <<<
(cd ./ma; /Applications/Xcode.app/Contents/Developer/usr/bin/make)
if [ -f *.stamp ]; then\
/Applications/Xcode.app/Contents/Developer/usr/bin/make cleanstamp;\
fi
cp macommon.h matypes.h macdecls.h scope.h error.h memcpy.h string-util.h table.h mafdecls.fh typesf2c.h winutil.h winf2c.h ../include
echo "" > MACX.stamp
gcc -DMACX -DGFORTRAN -DVERIFY -DSTATS -O -c -o error.o error.c
ar rcv ../lib/MACX/libma.a error.o
a - error.o
gcc -DMACX -DGFORTRAN -DVERIFY -DSTATS -O -c -o f2c.o f2c.c
ar rcv ../lib/MACX/libma.a f2c.oa - f2c.oa - f2c.o

......
3 warnings generated.
......10 assign 30 to next
                                                                       1
Warnings( in Chinese) Deleted feature: ASSIGN statement at (1)
dblas.f:1519.19:

  20    go to next,(30, 50, 70, 110)
......gfortran -L/users/computation/nwchem-6.3/lib/MACX -L/users/computation/nwchem-6.3/src/tools/lib/MACX -o /users/computation/nwchem-6.3/bin/MACX/nwchem nwchem.o stubs.o -lnwctask -lccsd -lmcscf -lselci -lmp2 -lmoints -lstepper -ldriver -loptim -lnwdft -lgradients -lcphf -lesp -lddscf -ldangchang -lguess -lhessian -lvib -lnwcutil -lrimp2 -lproperty -lnwints -lprepar -lnwmd -lnwpw -lofpw -lpaw -lpspw -lband -lnwpwlib -lnwxc -lcafe -lspace -lanalyze -lqhop -lpfft -ldplot -ldrdy -lvscf -lqmmm -lqmd -letrans -lpspw -ltce -lbq -lcons -lperfm -ldntmc -lccca -lnwcutil -lpario -lglobal -lma -lpeigs -lperfm -lcons -lbq -lnwcutil -llapack -lblas -llapack -lblas -larmci -ltcgmsg -lm -lcc_dynamic
ld: library not found for -lcc_dynamic
collect2: ???ld ?? 1
make: *** [all] Error 1

Gets Around
You should be fine with gfortran 4.9. My current guess is problems with environment variables, since you are renaming directories and not symlinking them, and since you have taken all precautions to ensure that the build directory is clean. Or maybe the Mac build system isn't well maintained.

I see, sadly, that nobody seems to be offering a precompiled OS X binary of NWChem. I wonder how often it's actually compiled/tested on the OS X platform.

Forum Vet
Maybe there is no math library installed
Maybe there is no compiler such as gnu installed ?

Forum Vet
MAC OS X Mavericks 10.3 and openmpi-1.8.1 have been installed on my computer
MAC OS X Mavericks 10.3 and openmpi-1.8.1 have been installed on my computer.


Forum >> NWChem's corner >> Compiling NWChem