Problem compiling on Mac OS 10.13

From NWChem

Viewed 1022 times, With a total of 7 Posts
Jump to: navigation, search

Just Got Here
Threads 1
Posts 4
Hello, I am having troubles compiling nwchem-6.6 on a Mac with High Sierra (Mac OS 10.13.3)

Here is my config/build
export NWCHEM_TOP=/Users/me/nwchem-6.6
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 HAS_BLAS="y"
export BLASOPT="-framework Accelerate"
export NWCHEM_MODULES="all"
export MPI_INCLUDE="/opt/local/include"
export MPI_LIB="/opt/local/lib"
export LIBMPI=" -lmpifort -lmpi -lpmpi -lpthread"
make nwchem_config &> make.nwchem_config.log
make -j 4 &> build.log


Compiling, I get the following error:

gfortran  -c -cpp  -fdefault-integer-8 -g  -I.  -I/Users/me/nwchem-6.6/src/include -I/Users/me/nwchem-6.6/src/tools/install/include -DMACX -DEXT_INT -DGFORTRAN -DGCC4 -DPARALLEL_DIAG   basis.F
gfortran  -c -cpp  -fdefault-integer-8 -g  -I.  -I/Users/me/nwchem-6.6/src/include -I/Users/me/nwchem-6.6/src/tools/install/include -DMACX -DEXT_INT -DGFORTRAN -DGCC4 -DPARALLEL_DIAG   bas_input.F
gfortran  -c -cpp  -fdefault-integer-8 -g  -I.  -I/Users/me/nwchem-6.6/src/include -I/Users/me/nwchem-6.6/src/tools/install/include -DMACX -DEXT_INT -DGFORTRAN -DGCC4 -DPARALLEL_DIAG   bas_contrib.F
gfortran  -c -cpp  -fdefault-integer-8 -g  -I.  -I/Users/me/nwchem-6.6/src/include -I/Users/me/nwchem-6.6/src/tools/install/include -DMACX -DEXT_INT -DGFORTRAN -DGCC4 -DPARALLEL_DIAG   bas_checksum.F
dyld: Library not loaded: /usr/local/lib/libmpc.3.dylib
  Referenced from: /Users/me/usr/local/bin/../libexec/gcc/x86_64-apple-darwin15.6.0/7.1.0/f951
  Reason: image not found
dyld: Library not loaded: /usr/local/lib/libmpc.3.dylib
  Referenced from: /Users/me/usr/local/bin/../libexec/gcc/x86_64-apple-darwin15.6.0/7.1.0/f951
  Reason: image not found
gfortran: internal compiler error: Abort trap: 6 (program f951)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
gfortran: internal compiler error: Abort trap: 6 (program f951)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
make[1]: *** [/Users/me/nwchem-6.6/lib/MACX64/libnwcutil.a(basis.o)] Error 4
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [/Users/me/nwchem-6.6/lib/MACX64/libnwcutil.a(bas_input.o)] Error 4
dyld: Library not loaded: /usr/local/lib/libmpc.3.dylib
  Referenced from: /Users/me/usr/local/bin/../libexec/gcc/x86_64-apple-darwin15.6.0/7.1.0/f951
  Reason: image not found
dyld: Library not loaded: /usr/local/lib/libmpc.3.dylib
  Referenced from: /Users/me/usr/local/bin/../libexec/gcc/x86_64-apple-darwin15.6.0/7.1.0/f951
  Reason: image not found
gfortran: internal compiler error: Abort trap: 6 (program f951)
gfortran: internal compiler error: Abort trap: 6 (program f951)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
make[1]: *** [/Users/me/nwchem-6.6/lib/MACX64/libnwcutil.a(bas_checksum.o)] Error 4
make[1]: *** [/Users/me/nwchem-6.6/lib/MACX64/libnwcutil.a(bas_contrib.o)] Error 4
make: *** [libraries] Error 1


Looks like "/usr/local/lib/libmpc.3.dylib" doesn't exist. However, "/opt/local/lib/libmpc.3.dylib" does exist. The compiler is looking at "/usr/local/lib" and "/usr/local/include" instead of "/opt/local/....."

Any suggestions on how to proceed?
Thanks!

P.S.

Here are outputs from commands that may be relevant:

cc -v

produces:
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin



gfortran -v

produces:
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/Users/me/usr/local/bin/../libexec/gcc/x86_64-apple-darwin15.6.0/7.1.0/lto-wrapper
Target: x86_64-apple-darwin15.6.0
Configured with: ../gcc-7.1.0/configure --enable-languages=c++,fortran
Thread model: posix
gcc version 7.1.0 (GCC) 



which gfortran

produces:
/Users/me/usr/local/bin/gfortran



which cc

produces:
/usr/bin/cc


Edited On 6:24:53 PM PST - Thu, Mar 1st 2018 by Easy Cheese

Forum Vet
Threads 9
Posts 1557
Might want to get a fully functional gfortran installation by using homebrew
https://github.com/nwchemgit/nwchem/wiki/Compiling-NWChem#method-2-using-gfortran-and-open...

Just Got Here
Threads 1
Posts 4
Quote:Edoapra Mar 1st 5:18 pm
Might want to get a fully functional gfortran installation by using homebrew
https://github.com/nwchemgit/nwchem/wiki/Compiling-NWChem#method-2-using-gfortran-and-open...


Thanks. Did that, now I have the following error:

Making libraries in basis
gfortran  -c -cpp  -fdefault-integer-8 -Warray-bounds -g -fno-aggressive-loop-optimizations  -I.  -I/Users/m3/nwchem-6.6/src/include -I/Users/m3/nwchem-6.6/src/tools/install/include -DMACX -DEXT_INT -DGFORTRAN -DGCC4 -DGCC46 -DPARALLEL_DIAG   basis.F
FATAL:/opt/local/bin/../libexec/as/x86_64/as: I don't understand 'm' flag!
make[1]: *** [/Users/me/nwchem-6.6/lib/MACX64/libnwcutil.a(basis.o)] Error 1
make: *** [libraries] Error 1


Any help would be great.

Forum Vet
Threads 9
Posts 1557
PATH
You are still not using the homebrew installation.
Please redefine your path excluding /opt/local/bin by executing

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

Just Got Here
Threads 1
Posts 4
Quote:Edoapra Mar 2nd 10:32 am
You are still not using the homebrew installation.
Please redefine your path excluding /opt/local/bin by executing

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin


OK. That helped somewhat. At this point, the error is:

  "_ma_trace_", referenced from:
      _memory_input_ in libnwctask.a(memory_input.o)
  "_ma_verify_allocator_stuff_", referenced from:
      _gsopt_project_hess_grad_ in liboptim.a(mepgs_drv.o)
      _mepgs_proj_grad_ in liboptim.a(mepgs_drv.o)
      _driver_project_hess_grad_ in libdriver.a(opt_drv.o)
      _driver_hss_init_ in libdriver.a(opt_drv.o)
      _grad_force_ in libgradients.a(grad_force.o)
      _md_start_ in libnwmd.a(md_start.o)
      _qmd_driver_ in libqmd.a(qmd_driver.o)
      ...
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [all] Error 1


The result from running

>> mpif90 -show

is

gfortran -I/usr/local/Cellar/open-mpi/3.0.0_2/include -Wl,-flat_namespace -Wl,-commons,use_dylibs -I/usr/local/Cellar/open-mpi/3.0.0_2/lib -L/usr/local/opt/libevent/lib -L/usr/local/Cellar/open-mpi/3.0.0_2/lib -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi


My env variables are

export NWCHEM_TOP=/Users/me/nwchem-6.6
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 USE_INTERNALBLAS="y"
export NWCHEM_MODULES="all"


Thanks Edoapra for all your help.

Link to build log
https://www.dropbox.com/s/75rkgq1lciadh05/build3.log?dl=0
Edited On 6:46:49 PM PST - Fri, Mar 2nd 2018 by Easy Cheese

Forum Vet
Threads 9
Posts 1557
recompile from scratch
Please recompile from scratch and send the log of the full compilation.

cd $NWCHEM_TOP/src
make realclean
make

Just Got Here
Threads 1
Posts 4
Here is the build file

https://www.dropbox.com/s/9b2v90yxtn6nv18/build.log?dl=0

Forum Vet
Threads 9
Posts 1557
Please
1) upload the file
/Users/thomsonk/nwchem-6.6/src/tools/build/config.log

2) report the output of the command
gfortran -V

3) report the output of the script
rm  -f gfortrantest.f90 
cat >  gfortrantest.f90  <<EOF
      program main
      end
EOF
gfortran  gfortrantest.f90
./a.out 
Edited On 10:58:32 AM PST - Mon, Mar 5th 2018 by Edoapra


Forum >> NWChem's corner >> Compiling NWChem



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