qcscine / chemoton

https://scine.ethz.ch
BSD 3-Clause "New" or "Revised" License
40 stars 4 forks source link

an error when compile chemoton link to mongo #4

Closed maoxinxina closed 2 months ago

maoxinxina commented 3 months ago

I wonder whether a way to deal with this problem.

Preparing Database...

-- The C compiler identification is GNU 14.1.1 -- The CXX compiler identification is GNU 14.1.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Warning at dev/cmake/ComponentSetup.cmake:61 (message):  You are compiling Scine components with an architecture-specific ISA:  -march=native.  Linking together libraries with mismatched architecture  build flags can cause problems, in particular with Eigen.  Watch out! Call Stack (most recent call first):  CMakeLists.txt:13 (scine_setup_component)

-- Scine::UtilsOS found locally at /home/xx/software/scine/chemoton/scratch/puffin/software/install/lib /cmake/ScineUtilsOS -- Could NOT find MKL (missing: MKL_INCLUDE_DIRS MKL_LIBRARIES)   -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Found BLAS for use with Eigen3 CMake Error at dev/cmake/ImportMongoCxx.cmake:17 (find_package):  By not providing "Findlibmongocxx-static.cmake" in CMAKE_MODULE_PATH this  project has asked CMake to find a package configuration file provided by  "libmongocxx-static", but CMake did not find one.

 Could not find a package configuration file provided by  "libmongocxx-static" with any of the following names:

   libmongocxx-staticConfig.cmake    libmongocxx-static-config.cmake

 Add the installation prefix of "libmongocxx-static" to CMAKE_PREFIX_PATH or  set "libmongocxx-static_DIR" to a directory containing one of the above  files.  If "libmongocxx-static" provides a separate development package or  SDK, be sure it has been installed. Call Stack (most recent call first):  src/Database/CMakeLists.txt:10 (import_mongocxx)

-- Configuring incomplete, errors occurred! Traceback (most recent call last):  File "/home/xx/software/miniconda3/envs/scine/lib/python3.10/runpy.py", line 196, in _run_module_as_m ain    return _run_code(code, main_globals, None,  File "/home/xx/software/miniconda3/envs/scine/lib/python3.10/runpy.py", line 86, in _run_code    exec(code, run_globals)  File "/home/xx/software/miniconda3/envs/scine/lib/python3.10/site-packages/scine_puffin/main.py", line 148, in    main()  File "/home/xx/software/miniconda3/envs/scine/lib/python3.10/site-packages/scine_puffin/main.py", line 134, in main    main_bootstrap(config)  File "/home/xx/software/miniconda3/envs/scine/lib/python3.10/site-packages/scine_puffin/main.py", line 73, in main_bootstrap    bootstrap(config)  File "/home/xx/software/miniconda3/envs/scine/lib/python3.10/site-packages/scine_puffin/bootstrap.py" , line 85, in bootstrap    program.install(program_build_dir, install_dir, config["resources"]["cores"])  File "/home/xx/software/miniconda3/envs/scine/lib/python3.10/site-packages/scine_puffin/programs/data base.py", line 22, in install    self.scine_module_install(repo_dir, install_dir, ncores)  File "/home/xx/software/miniconda3/envs/scine/lib/python3.10/site-packages/scine_puffin/programs/prog ram.py", line 161, in scine_module_install    subprocess.run(args, env=env, check=True)  File "/home/xx/software/miniconda3/envs/scine/lib/python3.10/subprocess.py", line 526, in run    raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['cmake', '-DCMAKE_BUILD_TYPE=Release', '-DSCINE_BUILD_TESTS=OF F', '-DSCINE_BUILD_PYTHON_BINDINGS=ON', '-DSCINE_MARCH=native', '-DCMAKE_INSTALL_PREFIX=/home/xx/softwa re/scine/chemoton/scratch/puffin/software/install', '-DPYTHON_EXECUTABLE=/home/xx/software/miniconda3/e nvs/scine/bin/python3', '..']' returned non-zero exit status 1. (scine)

weymutht commented 3 months ago

You need to install the Mongo C++ driver, since our database wrapper depends on it.

For example, on Ubuntu, the following script should work:


INSTALL_PREFIX=/soft/mongo_cxx

wget https://github.com/mongodb/mongo-c-driver/releases/download/1.13.0/mongo-c-driver-1.13.0.tar.gz
tar -xzf mongo-c-driver-1.13.0.tar.gz
cd mongo-c-driver-1.13.0
mkdir cmake-build
cd cmake-build

cmake  -DCMAKE_BUILD_TYPE=Release \
       -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
       -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF \
       ..

make -j 4
make install
cd ../..

wget https://github.com/mongodb/mongo-cxx-driver/archive/r3.4.1.tar.gz
tar -xzf r3.4.1.tar.gz
cd mongo-cxx-driver-r3.4.1/build
cmake -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
      -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} \
      ..
make -j 4
make install

export libbsoncxx_DIR=/soft/mongo_cxx/lib/cmake/libbsoncxx-3.4.1
export libmongocxx_DIR=/soft/mongo_cxx/lib/cmake/libmongocxx-3.4.1
maoxinxina commented 3 months ago

when i try to compile the mongo_cxx,a new problem occured. Is there a good way to deal with this problem.

/mongo_cxx/mongo-cxx-driver-r3.4.1/src/third_party/catch/include/catch.hpp:7355:45: error: size of array ‘altStackMem’ is not an integral constant-expression 7355 | char FatalConditionHandler::altStackMem[SIGSTKSZ] = {}; | ^~~~ make[2]: [src/bsoncxx/test/CMakeFiles/test_bson.dir/build.make:76: src/bsoncxx/test/CMakeFiles/test_bson.dir///third_party/catch/main.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:713: src/bsoncxx/test/CMakeFiles/test_bson.dir/all] Error 2 make: *** [Makefile:146: all] Error 2

which gcc version and linux distro do you use.

weymutht commented 3 months ago

You could try another compiler. Currently, we use mostly Ubuntu 20.04, 22.04, and CentOS 7. GCC versions 7 to 11 should all work.

maoxinxina commented 2 months ago

Thank you very much. It could be complied sucessfully on my computer with the Ubuntu 20.04.

weymutht commented 2 months ago

Great, I'm glad to hear this!