1 Third-Party Library Summary
FFTW Library
Issue: This issue occurred because the PLUMED library support was not available for the FFTW library during compilation.
The error message displayed was: FFTW Library Missing PLUMED Support
Optimization Solution:
- Open the
Makefile-linux-cpu
file. - Locate the
LIBS
section in the file. - Add
$(LIBPLUMED)
before$(LIBFFTW)
in theLIBS
line:
LIBS = $(LIBPLUMED) $(LIBFFTW) ...
- This adjustment ensures that the PLUMED library is linked correctly before FFTW.
- Save the changes and re-run the compilation process.
Plumed Library
Issue: When calling the PLUMED library independently, the following error might occur:
<path>/plumed-2.9.2/bin/plumed: error while loading shared libraries: libplumedKernel.so: cannot open shared object file: No such file or directory
This error indicates that the program cannot locate the libplumedKernel.so
shared library file.
Tips: To resolve this, make sure to correctly configure the required environment variables.
Optimization Solution:
- Set the
PLUMED_ROOT
environment variable:
export PLUMED_ROOT=<path>/third-party/plumed-2.9.2
- Update the
PATH
environment variable:
export PATH=$PLUMED_ROOT/bin:$PATH
- Update the
LD_LIBRARY_PATH
environment variable:
export LD_LIBRARY_PATH=$PLUMED_ROOT/lib:$LD_LIBRARY_PATH
- Set the
PLUMED_PATCHES
environment variable:
export PLUMED_PATCHES=$PLUMED_ROOT/patches
Note: Thepatches
folder might be located in theplumed-src
directory. If it is not found in the expected location, manually move it into thePLUMED_ROOT
directory.
Issue: This error occurs during the linking of libplumedKernel.so
due to relocation issues in libfftw3.a
.
The root cause is that libfftw3.a
was compiled without the -fPIC
flag, which makes it incompatible with shared libraries.
To resolve this, recompile FFTW with -fPIC
or use the shared version libfftw3.so
.
Optimization Solution:
- Open the
build.sh
file. - Locate the FFTW build section.
- Replace the following command:
make -j${numCores}
with:make CFLAGS=-fPIC -j${numCores}
- Locate the Plumed build section.
- Add the following environment variables before compiling PLUMED to specify the FFTW include and library paths:
export CPPFLAGS='-I/<path>/fftw-3.3.10/include'
export LDFLAGS='-L/<path>/fftw-3.3.10/lib'
- Save the changes and re-run
build.sh
.
XTB Library
Issue: XTB library is not initialized as a Git repository.
Error message: fatal: Not a git repository (or any parent up to mount point /lustre)
Optimization Solution:
- Open the
build.sh
script. - Locate the section for initializing XTB.
- Add the following Git commands before compilation:
git init
git config user.name "Your Name"
git config user.email "your.email@example.com"
git add .
git commit -m "Initial commit"
Issue: Missing LAPACK or BLAS support during compilation.
Error messages:
Could NOT find LAPACK (missing: LAPACK_LIBRARIES)
,
Could NOT find BLAS (missing: BLAS_LIBRARIES)
Optimization Solution:
- Find the path to the LAPACK and BLAS libraries.
- Modify the
cmake
command inbuild.sh
:
-DLAPACK_LIBRARIES=<path>/liblapack.so
-DBLAS_LIBRARIES=<path>/libopenblas.so
- Save the changes and re-run the build script.
Issue: XTB fails to generate libmctc-lib.a
or libtest-drive.a
This may be due to conflicting environment variables or incorrect mctc-lib
path.
Optimization Solution:
- Ensure no other versions of XTB are included in your environment variables.
- Run the following command to verify
mctc-lib
path:
grep -i "mctc-lib" build/CMakeCache.txt
- The correct output path should be:
./xtb-6.5.0-src/subprojects/mctc-lib
- If incorrect, adjust and recompile.
DL-FIND Library
Issue: Compilation error in dlf_formstep.f90
and dlf_qts.f90
due to rank mismatch
.
This issue does not appear with GCC 9.3.0, but occurs with GCC 11.4.0 and 12.2.0 due to stricter type checking on argument ranks.
Optimization Solution:
- Open the
Makefile.qbics
file. - Locate the gfortran compiler section and uncomment the
-fallow-argument-mismatch
option. - Save the file and recompile the code.
## gfortran (gcc) compiler
-
-
-
F90FLAGS = -fimplicit-none -fbounds-check -std=gnu -Wconversion \
-Wsurprising -fallow-argument-mismatch
- If this does not resolve the issue, try using
-Wno-argument-mismatch
instead.
Issue: Linking error in dlf_hdlc_matrixlib_d.F90
due to undefined reference to dsyevx_
.
This is caused by incorrect linking order for the dsyevx
function during compilation.
Optimization Solution:
- Open the
Makefile
in theqbics-source
folder. - In the
LIBS
section, place$(LIBDLFIND)
before$(LIBBLAS)
. - Save the
Makefile
and recompile Qbics.
OpenBLAS Library
Issue: This issue occurs during the OpenBLAS build process in the exports
directory.
It is caused by undefined references to GEMM kernel symbols, such as
zgemm_itcopy
, zgemm_incopy
, dgemm_itcopy
, and dgemm_incopy
.
Optimization Solution:
- Open the
build.sh
file. - Locate the section where OpenBLAS is compiled.
- Modify the following line:
make TARGET=HASWELL -j${numCores}
- Save the changes and recompile the project.
System-Related Issues Summary
Memory
Issue: This issue occurred due to insufficient memory or computational resources during the linking stage.
The error message displayed during compilation is:
g++: Killed Signal Terminated Program cclplus
Optimization Solution:
- For third-party libraries (e.g., PLUMED):
- Open the
build.sh
script. - Add the following line to the PLUMED section:
export CXXFLAGS="-O1"
- Remove the
-j${numCores}
option from themake
command. - Save the changes and re-run the compilation.
- For Qbics compilation:
- Open the
Makefile-linux-cpu
file. - Change
-O2
to-O1
in theCXXFLAG
setting. - Save the file and recompile to reduce memory usage.
System Architecture Compatibility
Issue: This issue is caused by system architecture compatibility problems. In an aarch64
environment, some C++ code requires specific compiler flags to designate the target architecture. Incompatible parameters must be adjusted to avoid compilation errors.
Optimization Solution:
- Open the
Makefile
file. - Locate the
CXXFLAG
section and adjust flags according to your system architecture: - Case One: If the output indicates:
- Case Two: If the error message is:
- Save the changes and re-run the compilation process.
./build/linux-cpu/obj/dft/GrimmeDFTD_Link.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
Add -march=armv8-a
at the end of the CXXFLAG
line.
g++: error: unrecognized command line option '-mavx2'
g++: error: unrecognized command line option '-mfma'
Then remove -mavx2 -mfma
from CXXFLAG
.
QBICS Summary
Locate and Replace the Path of Intel OneAPI
Issue: The Intel OneAPI compiler path is not correctly set, which may lead to build failures or missing compiler commands. This often occurs because the path to setvars.sh
or the compiler executables is not correctly configured for the current system.
Optimization Solution:
- Check whether the Intel compiler is installed. If it returns a valid path, skip to Step 3.
which icc
- Load the Intel Compiler Module:
- Check for available Intel modules:
module avail
- Load the module if available:
- Add the load command to
.bashrc
or.bash_profile
for persistence. - If unavailable, contact the system administrator or install the Intel OneAPI toolkit manually.
- Locate the Intel compiler installation directory:
- Use
which icc
to find the executable. - From this path, locate the directory containing
setvars.sh
(commonly under/opt/intel/oneapi/
).
- Use
- Update build configuration files:
- Open the
build.sh
script and replace the Intel path with the correctsetvars.sh
directory. - Also update
Makefile-linux-cpu
in theqbics-src
directory to reflect the correct path.
- Open the
module load <intel_module_name>
setvars.sh Already Executed
Issue: The setvars.sh
script has already been executed. Re-sourcing the script is skipped with the warning message: Skipping re-execution
.
Optimization Solution:
- Open the
build.sh
script. - Locate the line where
setvars.sh
is sourced. - Add the
--force
flag to force re-execution of the script:source <path>/setvars.sh --force
Qbics Compilation: Missing mkl.h
Issue: The compiler reports a missing dependency: <path>/mkl/<version>/include/mkl.h
.
The error message reads: No rule to make target <path>/mkl/<version>/include/mkl.h, needed by build/linux-cpu/obj/basis/BasisSetData.o
.
Optimization Solution:
- Navigate to the
qbics-src
directory. - Run the following command manually instead of using
build.sh
:make -f Makefile-linux-cpu
Third-Party Library Conflicts
Issue: Even if third-party libraries compile successfully on their own, Qbics may still fail to compile due to hidden incompatibilities or misconfigurations. These errors commonly stem from stale build files or incorrect directory references (e.g., lib
vs lib64
).
Optimization Solution:
- Method One: Clean and Rebuild
- Navigate to the Qbics root directory (e.g.,
~/qbics-version
). - Execute the following command to remove old compiled objects:
./build.sh clean
- Then recompile everything by running:
./build.sh
- Navigate to the Qbics root directory (e.g.,
- Method Two: Verify Folder Names
- Check whether the compiled MKL (or other) libraries were installed under a folder named
lib
orlib64
. - Open the
Makefile-linux-cpu
file and update the library paths to match the actual folder name.
- Check whether the compiled MKL (or other) libraries were installed under a folder named
Running Qbics
Issue: The Qbics executable qbics-linux-cpu
was generated successfully, but failed to run due to missing shared library dependencies.
The error message shown is:
error while loading shared libraries: libmkl_intel_lp64.so.1: cannot open shared object file
Optimization Solution:
- Before executing
qbics-linux-cpu
, re-source the Intel oneAPI environment:source <path>/setvars.sh
- (Optional) Add the above
source
command to your shell environment file (e.g.,~/.bashrc
or~/.bash_profile
).
Note: This is recommended, but on certain servers, modifying environment files may interfere with file transfers. Use with caution.
Missing GSL Library
Issue: The GNU Scientific Library (GSL) is not linked correctly during compilation, leading to linker errors such as:
undefined reference to 'gsl_*'
Optimization Solution:
- Open the
Makefile-linux-cpu
file in the Qbics source directory. - Locate the
LIBS
section. - Add the following flags to the
LIBS
line:-lgsl -lgslcblas
- Save the
Makefile
and recompile Qbics.
Calculating the Problems Involved
Input File Types
Issue: The Qbics executable may fail due to differences in text file formats, particularly between Windows (CRLF) and Unix/Linux (LF) newline conventions.
A common error message is: Incorrect XYZ format in "XXX.xyz" at "28^": A positive integer is needed.
Optimization Solution:
- Navigate to the directory containing the problematic file.
- Run the following command to convert the file format:
dos2unix XXX.xyz
dos2unix
is a command-line tool used to convert Windows-style line endings (CRLF) into Unix-style (LF).
Calling the Plumed Library Alone
Issue: When invoking the Plumed library independently, the following error may appear:
error while loading shared libraries: libplumedkernel.so: cannot open shared object file: No such file or directory
This indicates that the required dynamic library is not found in the system's runtime linking path.
Optimization Solution:
- Use the
find
command to locate thelibplumedkernel.so
file:find <path>/third-party/plumed-2.9.2 -name libplumedkernel.so
- If the file is found, set the relevant environment variables:
export PLUMED_ROOT=<path>/third-party/plumed-2.9.2 export PATH=$PLUMED_ROOT/bin:$PATH export LD_LIBRARY_PATH=$PLUMED_ROOT/lib:$LD_LIBRARY_PATH export PLUMED_PATCHES=$PLUMED_ROOT/patches