While trying to compile the ac0 fortran library for the pyscf-ac0 python interface to InQuanto-pyscf module, the numpy.disutils in setup.py fails in properly linking necessary lapack/blas/mkl routines to the ac0 library.
This is apparently due to the limits of numpy.disutils in searching for library directories in the system.
Since numpy.disutils is due to be deprecated soon, maybe a better solution would be with a new automatic procedure?
In the meantime, I post here a workaround solution to setup.py where the local directory, where the relevant libraries are located, can be hard coded.
The example is for openblas/mkl.
from numpy.distutils.core import setup, Extension
import os
import sys
if sys.platform.startswith("darwin"): # OSX
if not "LDFLAGS" in os.environ:
os.environ["LDFLAGS"] = ""
os.environ["LDFLAGS"] = (
os.environ["LDFLAGS"]
+ " -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
)
setup_args = dict(
ext_modules=[
Extension(
name='pyscf.cas_ac0.ac0_lib',
sources=['pyscf/cas_ac0/accas_lib.f90'],
# uncomment the following 2 lines for openblas libraries
#library_dirs=['/full/path/where/openblas/libraries/are/located/'],
#libraries=['openblas'],
# uncomment the following 2 lines for mkl libraries in intel environment
#library_dirs=['/full/path/where/mkl/are/in//lib/intel64'],
#libraries=['mkl_intel_lp64', 'mkl_core', 'mkl_sequential'],
#in the previous line please change 'intel' with 'gf' if mkl compiled with gcc
)
]
)
setup(**setup_args)
While trying to compile the
ac0
fortran library for thepyscf-ac0
python interface toInQuanto-pyscf
module, thenumpy.disutils
insetup.py
fails in properly linking necessarylapack/blas/mkl
routines to theac0
library.This is apparently due to the limits of
numpy.disutils
in searching for library directories in the system. Sincenumpy.disutils
is due to be deprecated soon, maybe a better solution would be with a new automatic procedure? In the meantime, I post here a workaround solution tosetup.py
where the local directory, where the relevant libraries are located, can be hard coded. The example is for openblas/mkl.