nwchemgit / nwchem

NWChem: Open Source High-Performance Computational Chemistry
http://nwchemgit.github.io
Other
484 stars 161 forks source link

Support build with unbundled libraries #904

Closed marcindulak closed 8 months ago

marcindulak commented 8 months ago

Is your feature request related to a problem? Please describe.

Fedora discourages including libraries as part of a process of building a package like nwchem. Instead nwchem should dynamically link to the already existing libraries on the system (like ga, blas, scalapack, etc.).

https://docs.fedoraproject.org/en-US/packaging-guidelines/#bundling

Fedora packages SHOULD make every effort to avoid having multiple, separate, upstream projects bundled together in a single package.

Describe the solution you'd like

An option to support for building nwchem with all libraries unbundled.

Describe alternatives you've considered

Currently I maintain a set of commands used to unbundle nwchem https://src.fedoraproject.org/rpms/nwchem/blob/af06fdbfeafd22894170fd879354f153d6ab0d2e/f/nwchem.spec#_188, but the process of discovering how to unbundle takes time.

# remove the whole src/libext
rm -rf src/libext/{elpa,libext_utils,libxc,mpich,openblas,plumed,scalapack,tblite}/

# remove bundling of BLAS/LAPACK
rm -rf src/blas/ src/lapack/
sed -e 's|CORE_SUBDIRS_EXTRA +=.*|CORE_SUBDIRS_EXTRA +=|g' -i src/config/makefile.h
sed -e 's|CORE_SUBDIRS_EXTRA =.*|CORE_SUBDIRS_EXTRA =|g' -i src/config/makefile.h
sed -e 's|-llapack||g' -i src/config/makefile.h
sed -e 's|-lblas||g' -i src/config/makefile.h
sed -e 's|-lnwclapack||g' -i src/config/makefile.h
sed -e 's|-lnwcblas||g' -i src/config/makefile.h

Additional context

Here is an example of issue when discovering how to unbundle. https://github.com/nwchemgit/nwchem/commit/45f057eca7e3bbe85815efe2bbcbbcacc6b95471 seems to not accept the current unbundling anymore, as it requires "blas" directory to be present. I don't know yet what the unbundling commands need to be.

+ /usr/bin/make BLAS_SIZE=4 USE_INTERNALBLAS=1 USE_MPI=y clean
***warning MPI_LIB ignored since FORCE_MPI_ENV not set***
***warning MPI_INCLUDE ignored since FORCE_MPI_ENV not set***
make[1]: Entering directory '/builddir/build/BUILD/nwchem-45f057eca7e3bbe85815efe2bbcbbcacc6b95471/src'
***warning MPI_LIB ignored since FORCE_MPI_ENV not set***
***warning MPI_INCLUDE ignored since FORCE_MPI_ENV not set***
test \! -f 64_to_32 -o \! -f 32_to_64 || rm -f 64_to_32 32_to_64
test -d /builddir/build/BUILD/nwchem-45f057eca7e3bbe85815efe2bbcbbcacc6b95471/lib/LINUX64 || mkdir -p /builddir/build/BUILD/nwchem-45f057eca7e3bbe85815efe2bbcbbcacc6b95471/lib/LINUX64
test -d /builddir/build/BUILD/nwchem-45f057eca7e3bbe85815efe2bbcbbcacc6b95471/bin/LINUX64 || mkdir -p /builddir/build/BUILD/nwchem-45f057eca7e3bbe85815efe2bbcbbcacc6b95471/bin/LINUX64
./util/util_nwchem_version.bash
which: no git in (/usr/lib64/openmpi/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin)
make[1]: Leaving directory '/builddir/build/BUILD/nwchem-45f057eca7e3bbe85815efe2bbcbbcacc6b95471/src'
rm -f core *.o *.a *.trace
Making clean in blas
make[1]: Entering directory '/builddir/build/BUILD/nwchem-45f057eca7e3bbe85815efe2bbcbbcacc6b95471/src'
make[1]: *** blas: No such file or directory.  Stop.
make[1]: Leaving directory '/builddir/build/BUILD/nwchem-45f057eca7e3bbe85815efe2bbcbbcacc6b95471/src'
make: *** [GNUmakefile:116: clean] Error 1
edoapra commented 8 months ago

This is not a bug report. It should have appeared in the discussion session