Error while building Avogadrolibs

The following is the error I got while trying to cmake --build .. I am following steps given in Build - wiki.openchemistry.org.
I am using ubuntu 20.04 LTS.

`CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
SPGLIB_INCLUDE_DIR (ADVANCED)
used as include directory in directory /home/jhalak/Desktop/Gsoc/openchemistry/avogadrolibs/avogadro/core
used as include directory in directory /home/jhalak/Desktop/Gsoc/openchemistry/avogadrolibs/avogadro/core
used as include directory in directory /home/jhalak/Desktop/Gsoc/openchemistry/avogadrolibs/avogadro/core
used as include directory in directory /home/jhalak/Desktop/Gsoc/openchemistry/avogadrolibs/avogadro/core
used as include directory in directory /home/jhalak/Desktop/Gsoc/openchemistry/avogadrolibs/avogadro/core
used as include directory in directory /home/jhalak/Desktop/Gsoc/openchemistry/avogadrolibs/avogadro/core
used as include directory in directory /home/jhalak/Desktop/Gsoc/openchemistry/avogadrolibs/avogadro/core

– Configuring incomplete, errors occurred!
See also “/home/jhalak/Desktop/Gsoc/openchemistry-build/avogadrolibs/CMakeFiles/CMakeOutput.log”.
See also “/home/jhalak/Desktop/Gsoc/openchemistry-build/avogadrolibs/CMakeFiles/CMakeError.log”.
make[2]: *** [CMakeFiles/avogadrolibs.dir/build.make:115: avogadrolibs-prefix/src/avogadrolibs-stamp/avogadrolibs-configure] Error 1
make[1]: *** [CMakeFiles/Makefile2:149: CMakeFiles/avogadrolibs.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
`

Please let me know how to resolve this.
Thanks in advance.

1 Like

Dear Jhalak,

I have recently encountered this problem on 2 machines with Ubuntu 20 and version of installation from some month ago (1.93.0-2-gf4e4606). My solution was:

  1. download spglib from GitHub - spglib/spglib: C library for finding and handling crystal symmetries
  2. copy the source (src directory) to the directory resulting from avogadro2 build: openchemistry/avogadrolibs/avogadro/core/ and rename that directory to spglib
  3. edit file CMakeLists.txt in the same directory and set the SPGLIB_INCLUDE_DIR variable (using the full path to the same directory in which this CMakeLists.txt file is located), i.e., change from:

.

if(USE_SPGLIB)
  find_package(Spglib REQUIRED)
  include_directories(SYSTEM ${SPGLIB_INCLUDE_DIR})
endif()

to:

if(USE_SPGLIB)
  find_package(Spglib REQUIRED)
  set(SPGLIB_INCLUDE_DIR "/home/igors/Downloads/tests4sclerotics/openchemistry/avogadrolibs/avogadro/core")
  include_directories(SYSTEM ${SPGLIB_INCLUDE_DIR})
endif()

And then just continue compiling (rerun the last command). For me, it worked.

Also, in some old post someone suggested to set variable USE_LIBSPG to 0, but this did not worked for me (I used cmake).

This is fixed in the latest code from GitHub - which will be 1.94.

Thank You , Dr. Hutchinson!

thanks for the awesome information.

thanks my issue has been fixed.