JS Bin

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:

  1. Open the Makefile-linux-cpu file.
  2. Locate the LIBS section in the file.
  3. Add $(LIBPLUMED) before $(LIBFFTW) in the LIBS line:
LIBS = $(LIBPLUMED) $(LIBFFTW) ...
  1. This adjustment ensures that the PLUMED library is linked correctly before FFTW.
  2. 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:

  1. Set the PLUMED_ROOT environment variable:
    export PLUMED_ROOT=<path>/third-party/plumed-2.9.2
  2. Update the PATH environment variable:
    export PATH=$PLUMED_ROOT/bin:$PATH
  3. Update the LD_LIBRARY_PATH environment variable:
    export LD_LIBRARY_PATH=$PLUMED_ROOT/lib:$LD_LIBRARY_PATH
  4. Set the PLUMED_PATCHES environment variable:
    export PLUMED_PATCHES=$PLUMED_ROOT/patches
    Note: The patches folder might be located in the plumed-src directory. If it is not found in the expected location, manually move it into the PLUMED_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:

  1. Open the build.sh file.
  2. Locate the FFTW build section.
  3. Replace the following command:
    make -j${numCores} with: make CFLAGS=-fPIC -j${numCores}
  4. Locate the Plumed build section.
  5. 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'
  1. 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:

  1. Open the build.sh script.
  2. Locate the section for initializing XTB.
  3. 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:

  1. Find the path to the LAPACK and BLAS libraries.
  2. Modify the cmake command in build.sh:
-DLAPACK_LIBRARIES=<path>/liblapack.so
-DBLAS_LIBRARIES=<path>/libopenblas.so
  1. 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:

  1. Ensure no other versions of XTB are included in your environment variables.
  2. Run the following command to verify mctc-lib path:
grep -i "mctc-lib" build/CMakeCache.txt
  1. The correct output path should be: ./xtb-6.5.0-src/subprojects/mctc-lib
  2. 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:

  1. Open the Makefile.qbics file.
  2. Locate the gfortran compiler section and uncomment the -fallow-argument-mismatch option.
  3. Save the file and recompile the code.
##  gfortran (gcc) compiler
-
-
-
F90FLAGS   =   -fimplicit-none  -fbounds-check -std=gnu -Wconversion \
-Wsurprising -fallow-argument-mismatch
  1. 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:

  1. Open the Makefile in the qbics-source folder.
  2. In the LIBS section, place $(LIBDLFIND) before $(LIBBLAS).
  3. 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:

  1. Open the build.sh file.
  2. Locate the section where OpenBLAS is compiled.
  3. Modify the following line:
make TARGET=HASWELL -j${numCores}
  1. 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:

  1. For third-party libraries (e.g., PLUMED):
  2. Open the build.sh script.
  3. Add the following line to the PLUMED section:
export CXXFLAGS="-O1"
  1. Remove the -j${numCores} option from the make command.
  2. Save the changes and re-run the compilation.
  3. For Qbics compilation:
  4. Open the Makefile-linux-cpu file.
  5. Change -O2 to -O1 in the CXXFLAG setting.
  6. 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:

  1. Open the Makefile file.
  2. Locate the CXXFLAG section and adjust flags according to your system architecture:
  3. Case One: If the output indicates:
  4. ./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.
  5. Case Two: If the error message is:
  6. g++: error: unrecognized command line option '-mavx2'
    g++: error: unrecognized command line option '-mfma'
    Then remove -mavx2 -mfma from CXXFLAG.
  7. Save the changes and re-run the compilation process.

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:

  1. Check whether the Intel compiler is installed. If it returns a valid path, skip to Step 3.
    which icc
  2. Load the Intel Compiler Module:
    • Check for available Intel modules:
    • module avail
    • Load the module if available:
    • module load <intel_module_name>
    • Add the load command to .bashrc or .bash_profile for persistence.
    • If unavailable, contact the system administrator or install the Intel OneAPI toolkit manually.
  3. 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/).
  4. Update build configuration files:
    • Open the build.sh script and replace the Intel path with the correct setvars.sh directory.
    • Also update Makefile-linux-cpu in the qbics-src directory to reflect the correct path.

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:

  1. Open the build.sh script.
  2. Locate the line where setvars.sh is sourced.
  3. 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:

  1. Navigate to the qbics-src directory.
  2. 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:

  1. Method One: Clean and Rebuild
    1. Navigate to the Qbics root directory (e.g., ~/qbics-version).
    2. Execute the following command to remove old compiled objects:
      ./build.sh clean
    3. Then recompile everything by running:
      ./build.sh
  2. Method Two: Verify Folder Names
    1. Check whether the compiled MKL (or other) libraries were installed under a folder named lib or lib64.
    2. Open the Makefile-linux-cpu file and update the library paths to match the actual folder name.

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:

  1. Before executing qbics-linux-cpu, re-source the Intel oneAPI environment:
    source <path>/setvars.sh
  2. (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:

  1. Open the Makefile-linux-cpu file in the Qbics source directory.
  2. Locate the LIBS section.
  3. Add the following flags to the LIBS line:
    -lgsl -lgslcblas
  4. 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:

  1. Navigate to the directory containing the problematic file.
  2. Run the following command to convert the file format:
    dos2unix XXX.xyz
  3. 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:

  1. Use the find command to locate the libplumedkernel.so file:
    find <path>/third-party/plumed-2.9.2 -name libplumedkernel.so
  2. 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