Error compiling hoomd-blue 3.4 with LLVM option on

176 views
Skip to first unread message

Roxana

unread,
Oct 10, 2022, 9:57:52 AM10/10/22
to hoomd-users
Dear HOOMD-developers,

I am trying to compile hoomd-blue 3.4 with the option to use jit from hpmc. In the CMake flags I do the following :
#######################################################
~/cmake-3.19.0-rc2/bin/./cmake ../ -DENABLE-LLVM=ON.
#######################################################
But I get an error for the LLVM:
#######################################################
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- 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
-- Configuring HOOMD v3.4.0
-- Setting build type to 'Release' as none was specified.
-- Found PythonInterp: /path/anaconda3/bin/python3 (found suitable version "3.9.13", minimum required is "3")
-- Found PythonLibs: /path/anaconda3/lib/libpython3.9.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Found pybind11: /path/anaconda3/include (found version "2.10.0")
-- Found pybind11: /path/anaconda3/share/cmake/pybind11 /path/anaconda3/include (version 2.10.0)
-- Installing hoomd python module to: /path/anaconda3/lib/python3.9/site-packages/hoomd
-- Found eigen: /usr/lib/cmake/eigen3 /usr/include/eigen3 (version 3.3.7)
-- Found LLVM: /usr/lib/llvm-10/cmake /usr/lib/llvm-10/lib/libLLVM.so clang_library-NOTFOUND /usr/lib/llvm-10/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS (version 10.0.0)
-- Configuring done
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:
clang_library
    linked by target "_jit" in directory /path/hoomd3.4/hoomd-blue/hoomd/hpmc

-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    ENABLE-LLVM


CMake Generate step failed.  Build files cannot be regenerated correctly.
#######################################################
There was a similar message from this type of problem in this group and the suggestion was to install libclang-cpp, I did this installation as well as libclang-dev. Am I missing something else?

I have attached the CMakeCache.txt file if it helps.

Thank you for your help!
Best,
Roxana
CMakeCache.txt

Joshua Anderson

unread,
Oct 10, 2022, 10:08:04 AM10/10/22
to hoomd...@googlegroups.com
Roxana,

As documented on https://hoomd-blue.readthedocs.io/en/v3.5.0/building.html, the option is ENABLE_LLVM, not ENABLE-LLVM. You also need to install all the dependencies required when ENABLE_LLVM=ON (also documented on that page).
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

--
You received this message because you are subscribed to the Google Groups "hoomd-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/0ede055a-4174-4a6d-a487-3ce00cb852bcn%40googlegroups.com.
<CMakeCache.txt>

Roxana

unread,
Oct 10, 2022, 10:40:49 AM10/10/22
to hoomd-users

Dear Dr. Joshua,


I am sorry, I did a typo in the line when I wrote this message, but I enable LLVM in the CmakeLists.txt. in line 90: "option(ENABLE_LLVM "Link to the LLVM library for run-time code generation" on)".

Regarding these dependencies:

option(ENABLE_LLVM "Link to the LLVM library for run-time code generation" on)

  • LLVM >= 10.0
  • libclang-cpp >= 10.0

I think I have the proper versions from them:

"llvm-config --version" -> 10.0.0

"clang --version" -> clang version 10.0.0-4ubuntu1

libclang was installed by -> apt-get install libclang-cpp10

Is there a package I am missing?


Best,

Roxana

Joshua Anderson

unread,
Oct 10, 2022, 10:53:48 AM10/10/22
to hoomd...@googlegroups.com
Roxana,

Yes, you are missing packages. See the corresponding CMake output that you shared:
Found LLVM: /usr/lib/llvm-10/cmake /usr/lib/llvm-10/lib/libLLVM.so clang_library-NOTFOUND /usr/lib/llvm-10/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS (version 10.0.0)

And review the building documentation, especially this statement.

"""
This documentation is generic. Replace <package-manager> with your package or module manager. You may need to adjust package names and/or install additional packages, such as -dev packages that provide headers needed to build hoomd.
"""
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

Roxana

unread,
Oct 11, 2022, 6:05:49 AM10/11/22
to hoomd-users
Dear Dr. Joshua,

Thank you for your answer.  I am new to CMake, could you please elaborate more about the missing packages?
If I understood correctly, LLVM exists "/usr/lib/llvm-10/cmake /usr/lib/llvm-10/lib/libLLVM.so" and this LLMV version is adequate base in the documentation.
Can you tell me which other -dev packages should I be aware of?

Thank you for your time!
Best,
Roxana

Joshua Anderson

unread,
Oct 11, 2022, 8:58:32 AM10/11/22
to hoomd...@googlegroups.com
Roxana,

No, I can't tell you based on the information you have provided. You don't mention which package manager or distribution you are using, you don't include the commands that you entered to install the dependencies. 

I quoted the lines from the documentation that recommend installing and "-dev" packages with your package manager, should it provide them. Did you try that? Did you even check and see if you package manager provides llvm-dev or libclang-cpp-dev packages (package names may differ depending on your specific package manager).

------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

Roxana

unread,
Oct 11, 2022, 10:26:03 AM10/11/22
to hoomd-users
Dear Dr. Joshua,

I am sorry I did not specify that.
I am running on 5.4.0-126-generic GNU/Linux using "apt" package manager, as well as conda

The commands that I used were:

conda install -c conda-forge libclang-cpp
sudo apt install llvm
sudo apt-get install llvm-10 lldb-10 llvm-10-dev libllvm10 llvm-10-runtime

Given my package manager, do you think I missed a package?

Thank you for your time!

Best,
Roxana

Joshua Anderson

unread,
Oct 11, 2022, 10:46:17 AM10/11/22
to hoomd...@googlegroups.com
Roxana,

I am not familiar with the "generic" Linux distribution. You are going to have to check the package search yourself and see if it provides a libclang-cpp-dev package (or one of a similar name matching those you installed) - as I've mentioned several times. Once you have found it in the package search, install it with `apt-get install`.

Your conda install is not relevant here as CMake output indicates it is finding the apt-get installed LLVM in /usr/lib.

------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

Roxana

unread,
Oct 11, 2022, 11:30:29 AM10/11/22
to hoomd-users
Dear Dr. Joshua,

Thank you for your patience and help! Your guidance allowed me to solve the problem. In the end, it was the package name as you told me.

Best,
Roxana
Reply all
Reply to author
Forward
0 new messages