glotzerlab / hoomd-blue

Molecular dynamics and Monte Carlo soft matter simulation on GPUs.
http://glotzerlab.engin.umich.edu/hoomd-blue
BSD 3-Clause "New" or "Revised" License
336 stars 133 forks source link

Support clang LLVM > 3.8 in hpmc_enthalpy #287

Closed joaander closed 6 years ago

joaander commented 6 years ago

Original report by Jens Glaser (Bitbucket: jens_glaser, GitHub: jglaser).


Right now, with BUILD_JIT=ON and LLVM 3.9 or LLVM 5.0 I get compilation errors such as

In file included from /Users/jglaser/soft/hoomd-blue/hoomd/jit/OrcLazyJIT.cc:10:
/Users/jglaser/soft/hoomd-blue/hoomd/jit/OrcLazyJIT.h:24:10: fatal error: 
      'llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h' file not found
#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/jglaser/soft/hoomd-blue/hoomd/jit/EvalFactory.cc:3:
In file included from /Users/jglaser/soft/hoomd-blue/hoomd/jit/EvalFactory.h:8:
/Users/jglaser/soft/hoomd-blue/hoomd/jit/OrcLazyJIT.h:24:10: fatal error: 
      'llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h' file not found
#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
joaander commented 6 years ago

Original comment by Jens Glaser (Bitbucket: jens_glaser, GitHub: jglaser).


also, it seems like linking to all available LLVM libs (AVAILABLE_LLVM_LIBS) is causing some build errors on jenkins. However, I found it to be necessary on flux. Is there documentation anywhere on which libraries are needed, and with which version of LLVM?

joaander commented 6 years ago

Support LLVM 4+ API

The API is very different, there is little choice but to offer two separate code paths selected by ifdefs.

refs #287

joaander commented 6 years ago

I'm working on this. I have a start at supporting the API (currently testing LLVM 5.0). Will also need to go through the laborious process of building containers, patching broken ubuntu llvm packages, and testing 3.9, and 4.0 at some point.

Linking all libraries does seem to be a problem. With this branch tested on llvm 5, I get the following when importing the jit module

CommandLine Error: Option 'disable-symbolication' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

I will look into linking only needed libraries again.

joaander commented 6 years ago

Go back to explicit list of llvm libs to link

This removes the error I was getting and results in a working build on the arch llvm 5 image.

refs #287

joaander commented 6 years ago

Support LLVM 3.8, 3.9, 4.0, and 5.0

This intricate dance is needed due to slight API differences from LLVM version to version. I tested 3.8, 3.9, and 4.0 on ubuntu 16.04 and 5.0 on Arch.

I do not plan to build and maintain unit tests running on all these versions going forward. I will test the version compatible with CUDA and the latest version that Arch installs.

refs #287

joaander commented 6 years ago

Merged in llvm4-support (pull request #430)

Support all recent LLVM versions

fixes #287

Approved-by: Joshua Anderson joaander@umich.edu Approved-by: Jens Glaser jsglaser@umich.edu