A request for help

From NWChem

Viewed 4138 times, With a total of 19 Posts
Jump to: navigation, search

Jump to page 12Next 16Last
Just Got Here
Threads 1
Posts 1
Dear NWChem users,

I'm a grad student and a novice Mac user looking to get into computational chemistry.

I currently have Mac OS 10.11.4 and would be most grateful if someone could point me in the direction of a step-by-step guide (something for dummies would be appropriate) to installing/compiling the latest version of NWChem 6.6 on my system.

Sincerely,
Jason

Gets Around
Threads 18
Posts 133
Click on the Terminal app from Applications/Utilities in the finder if you have not already done so. All of the following instructions assume that you are working from the command line. If you have not used a command line before these instructions may be difficult to follow, though I have tried to make them complete for a beginner. You should be able to directly copy and paste these commands into the terminal; manually typing them is more likely to produce errors.

If you have not already installed homebrew, make sure that you have the xcode command line tools installed and then install brew:

xcode-select --install


Then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


after you have gone through the Xcode setup.

(This is just a repetition of the steps documented at http://brew.sh -- you should probably double check to make sure I'm not trying to trick you into doing anything malicious.)

Then install mpich2 and gcc (which also installs gfortran) via brew.

brew install gcc mpich2


Make a directory to hold NWChem, like $HOME/nwchem:

mkdir $HOME/nwchem


Go to the Downloads page in your web browser, http://www.nwchem-sw.org/index.php/Download, and click on the newest source code release (http://www.nwchem-sw.org/download.php?f=Nwchem-6.6.revision27746-src.2015-10-20.tar.gz as of this writing).

After the file has downloaded, go to your nwchem directory in the terminal, copy the downloaded file there, and unpack it.

cd $HOME/nwchem
cp $HOME/Downloads/Nwchem-6.6.revision27746-src.2015-10-20.tar.gz .
tar xzf Nwchem-6.6.revision27746-src.2015-10-20.tar.gz


If you type ls in the terminal after these steps you should see a new directory nwchem-6.6. Now you're going to configure and build:

cd nwchem-6.6
export NWCHEM_TOP=`pwd`
export HAS_BLAS="y"
export BLASOPT="-framework Accelerate"
export NWCHEM_MODULES="all"
export NWCHEM_TARGET="MACX64"
export USE_MPI="y"
export USE_MPIF="y"
export USE_MPIF4="y"
export CFLAGS_FORGA="-DMPICH_NO_ATTR_TYPE_TAGS"
export MPI_INCLUDE="/usr/local/include"
export MPI_LIB="/usr/local/lib"
export LIBMPI=" -lmpifort -lmpi -lpmpi -lpthread"
export CFLAGS_FORGA="-DMPICH_NO_ATTR_TYPE_TAGS"
cd $NWCHEM_TOP/src
make nwchem_config &> make.nwchem_config.log
make -j 4 &> build.log


It will take a while to build. If all went well, after it finishes you should be able to type ls $HOME/nwchem/nwchem-6.6/bin/MACX64 and see a file named nwchem there. If the build did not finish normally, look at the last lines in build.log and come back to the forum to explain where the build failed so you can get further help.

After the build has completed you'll need to set up some environment variables so you can use NWChem comfortably from the command line. Type open $HOME/.bash_profile; this should open your .bash_profile in TextEdit.

Add these lines to the end of the file and then save and close it:
export NWPATH=$HOME/nwchem/nwchem-6.6
export NWCHEM_EXECUTABLE=$NWPATH/bin/MACX64/nwchem
export NWCHEM_BASIS_LIBRARY=$NWPATH/src/basis/libraries/
export PATH=$PATH:$NWPATH/bin/MACX64


In the terminal, type source $HOME/.bash_profile to load the new settings into your environment.

Now try running a simple test case. In the terminal do

cd $HOME/nwchem/nwchem-6.6/QA/tests/h2o
nwchem h2o.nw | tee h2o-test.out


This should finish in a couple of seconds, having spewed a lot of information your screen and also having generated a file named h2o-test.out. If you look at this file and the reference h2o.out file that was already present, you should see a section titled "RHF ENERGY GRADIENTS". The numbers in this section in your h2o-test.out should agree with the reference h2o.out.

Now let's try a somewhat more demanding job using two processor cores instead of one.

cd $HOME/nwchem/nwchem-6.6/QA/tests/h2o_raman_1
mpirun -np 2 nwchem h2o_raman_1.nw | tee h2o_raman_1-test.out


You can use however many cores your Mac has after the -np flag above, but any current Mac will have at least 2 physical cores. This job takes about 5 minutes to finish when running on my Mac with 2 cores as shown. It will go faster if you can use more cores. After you are done, the numbers in each section of h2o_raman_1-test.out headed by "DFT Linear Response..." should closely agree with the corresponding numbers in the reference file h2o_raman_1.out.

If everything went well, you're now set up to start running your own calculations with one or multiple processor cores. You might want to download Avogadro to help setting up calculations: https://sourceforge.net/projects/avogadro/files/latest/download

It is a graphical molecule editor that allows you to visualize geometry and create a few basic types of NWChem jobs from molecular structures you have created or imported. Those automatically generated inputs can be useful as starting points even though only a handful of NWChem's many options and bundled basis sets are directly supported by Avogadro.

Clicked A Few Times
Threads 0
Posts 9
Hello! I try to build nwchem with a MacOSX 10.12.6 and I followed the instructions but if I checked the directory ls $HOME/nwchem/nwchem-6.6/bin/MACX64 I could not find the folder nwchem only depend.x depend.x.dSYM. Then I looked up in the build.log and the last 3 lines say

ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [all] Error 1

How can I procede? Thanks in advance.
Marco

Forum Vet
Threads 9
Posts 1570
Please post more lines of your failed compilation error

Clicked A Few Times
Threads 0
Posts 9
Here the other lines...

Making libraries in ccca
/Applications/Xcode.app/Contents/Developer/usr/bin/make nwchem.o stubs.o
gfortran -cpp -fdefault-integer-8 -Warray-bounds -g -fno-aggressive-loop-optimizations -I. -I/Users/marcogiampa/nwchem/nwchem-6.6//src/include -I/Users/marcogiampa/nwchem/nwchem-6.6//src/tools/install/include -DMACX -DEXT_INT -DGFORTRAN -DGCC4 -DGCC46 -DPARALLEL_DIAG -DCOMPILATION_DATE="'`date +%a_%b_%d_%H:%M:%S_%Y`'" -DCOMPILATION_DIR="'/Users/marcogiampa/nwchem/nwchem-6.6/'" -DNWCHEM_BRANCH="'6.6'" -c -o nwchem.o nwchem.F
gfortran -cpp -fdefault-integer-8 -Warray-bounds -g -fno-aggressive-loop-optimizations -I. -I/Users/marcogiampa/nwchem/nwchem-6.6//src/include -I/Users/marcogiampa/nwchem/nwchem-6.6//src/tools/install/include -DMACX -DEXT_INT -DGFORTRAN -DGCC4 -DGCC46 -DPARALLEL_DIAG -DCOMPILATION_DATE="'`date +%a_%b_%d_%H:%M:%S_%Y`'" -DCOMPILATION_DIR="'/Users/marcogiampa/nwchem/nwchem-6.6/'" -DNWCHEM_BRANCH="'6.6'" -c -o stubs.o stubs.F
gfortran -L/Users/marcogiampa/nwchem/nwchem-6.6//lib/MACX64 -L/Users/marcogiampa/nwchem/nwchem-6.6//src/tools/install/lib -o /Users/marcogiampa/nwchem/nwchem-6.6//bin/MACX64/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 -lsolvation -lnwints -lprepar -lnwmd -lnwpw -lofpw -lpaw -lpspw -lband -lnwpwlib -lcafe -lspace -lanalyze -lqhop -lpfft -ldplot -ldrdy -lvscf -lqmmm -lqmd -letrans -lpspw -ltce -lbq -lmm -lcons -lperfm -ldntmc -lccca -lnwcutil -lga -larmci -lpeigs -lperfm -lcons -lbq -lnwcutil -lnwclapack -lnwcblas -lnwclapack -lnwcblas -L/usr/local/lib -lmpifort -lmpi -lpmpi -lpthread -lpthread
Undefined symbols for architecture x86_64:
 "__gfortran_stop_numeric_f08", referenced from:
_test2_ in libnwcutil.a(util_eaf_test.o)
_test1_ in libnwcutil.a(util_eaf_test.o)
_anl_ in libddscf.a(anlfit.o)
_feff_atom_ in libnwpwlib.a(feff6Lib.o)
_moints_aodisk_sprs2dense_a_ in libmoints.a(moints_aodisk.o)
_moints_aodisk_checkfile_ in libmoints.a(moints_aodisk.o)
_qenter_ in libccsd.a(qstat.o)
...
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [all] Error 1



Best

Forum Vet
Threads 9
Posts 1570
compiler versions
Could you please send me the output of the following commands

cc -v
gfortran -v
which gfortran
which cc

Forum Vet
Threads 9
Posts 1570
I have managed to reproduce this failure. On my Mac, it was due to a newer version of gfortran (from homebrew) being incompatible with objects compiled with previous versions of gfortran.
To fix, I have simply recompiled from scratch.

cd $NWCHEM_TOP/src
make clean
make

Clicked A Few Times
Threads 0
Posts 9
Here the output.

cc -v

Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

gfortran -v

Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin16/6.3.0/lto-wrapper
Target: x86_64-apple-darwin16
Configured with: ../gcc-6.3.0/configure --prefix=/usr/local/gfortran --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin16 --with-gmp=/Users/fx/devel/gcc/deps-static/x86_64 --with-mpfr=/Users/fx/devel/gcc/deps-static/x86_64 --with-mpc=/Users/fx/devel/gcc/deps-static/x86_64 --with-isl=/Users/fx/devel/gcc/deps-static/x86_64
Thread model: posix
gcc version 6.3.0 (GCC)

which gfortran

/usr/local/bin/gfortran

which cc

/usr/bin/cc


Exactly I used home-brew to have gfortran. How can I recompile from scratch?

Forum Vet
Threads 9
Posts 1570
Quote:Dathan87 Aug 14th 10:13 pm


Exactly I used home-brew to have gfortran. How can I recompile from scratch?


cd $NWCHEM_TOP/src
make clean
make

Clicked A Few Times
Threads 0
Posts 9
Unfortunately I got the same error

Forum Vet
Threads 9
Posts 1570
Quote:Dathan87 Aug 15th 12:57 pm
Unfortunately I got the same error

Same exact error? For the same objects?
There could be some mismatch between the C compiler (clang) and gfortran. My suggestion is to upgrade gfortran.
The latest gfortran from homebrew is version 7.2.0 (and you seem to have 6.3.0)
This should give you an update gfortran from homebrew
 brew update; brew upgrade gcc

Clicked A Few Times
Threads 0
Posts 9
I did the update of home-brew and the upgrade but still not working with the same error and the same objects.
I check the fortran was upgraded using the command gfortran -v showed this

Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin16/6.3.0/lto-wrapper
Target: x86_64-apple-darwin16
Configured with: ../gcc-6.3.0/configure --prefix=/usr/local/gfortran --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin16 --with-gmp=/Users/fx/devel/gcc/deps-static/x86_64 --with-mpfr=/Users/fx/devel/gcc/deps-static/x86_64 --with-mpc=/Users/fx/devel/gcc/deps-static/x86_64 --with-isl=/Users/fx/devel/gcc/deps-static/x86_64
Thread model: posix
gcc version 6.3.0 (GCC)
dhcp-10-68-187-96:~ marcogiampa$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

It looks like that it did not do the upgrade didn't?

Forum Vet
Threads 9
Posts 1570
What is the output of the following four commands

cc -v
uname -a
brew update; brew upgrade
brew info gcc

Clicked A Few Times
Threads 0
Posts 9
dhcp-10-68-187-96:~ marcogiampa$ cc -v
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

dhcp-10-68-187-96:~ marcogiampa$ uname -a
Darwin MacBook-Pro-di-Marco-Giampa.local 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

dhcp-10-68-187-96:~ marcogiampa$ brew update; brew upgrade
Updated 1 tap (homebrew/core).
==> Updated Formulae
duplicity pgrouting

dhcp-10-68-187-96:~ marcogiampa$ brew info gcc
gcc: stable 7.2.0 (bottled), HEAD
GNU compiler collection
https://gcc.gnu.org/
/usr/local/Cellar/gcc/7.1.0 (1,486 files, 283.8MB)
 Poured from bottle on 2017-08-13 at 12:44:29
/usr/local/Cellar/gcc/7.2.0 (1,487 files, 284MB)
 Poured from bottle on 2017-08-16 at 08:09:04
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/gcc.rb
==> Dependencies
Required: gmp ?, libmpc ?, mpfr ?, isl ?
==> Options
--with-jit
Build just-in-time compiler
--with-nls
Build with native language support (localization)
--HEAD
Install HEAD version
dhcp-10-68-187-96:~ marcogiampa$

Forum Vet
Threads 9
Posts 1570
Please send the output of the following commands

which gfortran
/usr/local/Cellar/gcc/7.2.0/bin/gfortran -v
ls -lrt /usr/local
ls -lrt /opt/local

Clicked A Few Times
Threads 0
Posts 9
dhcp-10-68-187-96:~ marcogiampa$ which gfortran
/usr/local/bin/gfortran

dhcp-10-68-187-96:~ marcogiampa$ /usr/local/Cellar/gcc/7.2.0/bin/gfortran -v
Using built-in specs.
COLLECT_GCC=/usr/local/Cellar/gcc/7.2.0/bin/gfortran
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/7.2.0/libexec/gcc/x86_64-apple-darwin16.7.0/7.2.0/lto-wrapper
Target: x86_64-apple-darwin16.7.0
Configured with: ../configure --build=x86_64-apple-darwin16.7.0 --prefix=/usr/local/Cellar/gcc/7.2.0 --libdir=/usr/local/Cellar/gcc/7.2.0/lib/gcc/7 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-7 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-checking=release --with-pkgversion='Homebrew GCC 7.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-nls
Thread model: posix
gcc version 7.2.0 (Homebrew GCC 7.2.0)

dhcp-10-68-187-96:~ marcogiampa$ ls -lrt /usr/local
total 0
drwxr-xr-x 3 marcogiampa wheel 102 1 Mag 2016 libexec
drwxr-xr-x 8 marcogiampa admin 272 24 Ott 2016 sbin
drwxr-xr-x 7 marcogiampa wheel 238 13 Feb 2017 gfortran
drwxr-xr-x 3 marcogiampa wheel 102 6 Mar 20:10 remotedesktop
drwxr-xr-x 3 marcogiampa admin 102 12 Ago 14:18 var
drwxrwxr-x 2 marcogiampa admin 68 13 Ago 12:40 Frameworks
drwxrwxr-x 17 marcogiampa admin 578 13 Ago 12:40 Homebrew
drwxr-xr-x 4 marcogiampa admin 136 13 Ago 12:41 etc
drwxr-xr-x 9 marcogiampa wheel 306 13 Ago 12:43 share
drwxr-xr-x 29 marcogiampa wheel 986 13 Ago 12:44 include
drwxr-xr-x 121 marcogiampa wheel 4114 13 Ago 12:44 lib
drwxrwxr-x 9 marcogiampa admin 306 13 Ago 15:06 Cellar
drwxrwxr-x 14 marcogiampa admin 476 16 Ago 08:09 opt
drwxr-xr-x 51 marcogiampa wheel 1734 16 Ago 14:15 bin

dhcp-10-68-187-96:~ marcogiampa$ ls -lrt /opt/local
ls: /opt/local: No such file or directory


Forum >> NWChem's corner >> Compiling NWChem
Jump to page 12Next 16Last



Who's here now Members 0 Guests 1 Bots/Crawler 0


AWC's: 2.5.10 MediaWiki - Stand Alone Forum Extension
Forum theme style by: AWC