mphowardlab / azplugins

A HOOMD-blue component for soft matter simulations.
BSD 3-Clause "New" or "Revised" License
20 stars 12 forks source link

clarification of build procedure #68

Closed jamie-arcc closed 1 month ago

jamie-arcc commented 1 year ago

I am having a really hard time getting azplugins to build and install... I have tried both the main branch as well as the 0.11.0 release and I am trying to build against hoomd 2.9.7. For the internal build method, is cmake supposed to be run after linking the azplugins directory in? if I run cmake, link in azplugins, and run make install, azplugins doesn't get installed, just hoomd. if I link it in before running cmake, the cmakefiles for azplugins complain that they can't find hoomd. if I try the external build method after installing hoomd, I get two undefined symbol references at the end.

build environment:

any assistance or clarification you can provide would be greatly appreciated

jamie-arcc commented 1 year ago

I just realized I was symlinking the top azplugins directory rather than azplugins/azplugins

mphoward commented 1 year ago

For an internal build, you should symlink then run cmake. Are you symlinking the right directory? You want to link azplugins/azplugins (the python module & source code) and not the base azplugins. I suspect you are getting the base directory, which would cause cmake to run FindHOOMD.cmake (and fail).

For an external build, I would need to see the error you are getting for undefined symbols. We run our unit tests as external builds (without error) in a similar build configuration.

See the HOOMD documentation here: https://hoomd-blue.readthedocs.io/en/v2.9.7/developer.html#plugins-and-components

jamie-arcc commented 1 year ago

Thank you for your response. After fixing the link, it seemed to get most of the way through but now I am getting compilation errors:

[ 13%] Building NVCC (Device) object hoomd/azplugins/CMakeFiles/cuda_compile_1.dir/cuda_compile_1_generated_MPCDReversePerturbationFlowGPU.cu.o
/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(245): error: name followed by "::" must be a class or namespace name

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(245): error: identifier "d_pairs_wrap" is undefined

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(247): error: name followed by "::" must be a class or namespace name

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(256): error: not a class or struct name

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(256): error: class or struct definition is missing

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(262): warning #12-D: parsing restarts here after previous syntax error

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(294): error: name followed by "::" must be a class or namespace name

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(294): error: incomplete type is not allowed

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(422): error: not a class or struct name

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(422): error: class or struct definition is missing

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(428): warning #12-D: parsing restarts here after previous syntax error

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(446): error: name followed by "::" must be a class or namespace name

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(446): error: identifier "t_layer_hi" is undefined

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(446): error: name followed by "::" must be a class or namespace name

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(447): error: name followed by "::" must be a class or namespace name

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(447): error: identifier "t_layer_lo" is undefined

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(447): error: name followed by "::" must be a class or namespace name

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(450): error: name followed by "::" must be a class or namespace name

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(452): error: incomplete type is not allowed

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(454): error: name followed by "::" must be a class or namespace name

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(454): error: expected an expression

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(455): error: name followed by "::" must be a class or namespace name

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(457): error: incomplete type is not allowed

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(459): error: name followed by "::" must be a class or namespace name

/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu(459): error: expected an expression

23 errors detected in the compilation of "/srcs/hoomd-blue/hoomd-blue/hoomd/azplugins/MPCDReversePerturbationFlowGPU.cu".
CMake Error at cuda_compile_1_generated_MPCDReversePerturbationFlowGPU.cu.o.Release.cmake:280 (message):
  Error generating file
  /srcs/hoomd-blue/hoomd-blue/build/hoomd/azplugins/CMakeFiles/cuda_compile_1.dir//./cuda_compile_1_generated_MPCDReversePerturbationFlowGPU.cu.o

make[2]: *** [hoomd/azplugins/CMakeFiles/cuda_compile_1.dir/cuda_compile_1_generated_MPCDReversePerturbationFlowGPU.cu.o] Error 1
make[1]: *** [hoomd/azplugins/CMakeFiles/_azplugins.dir/all] Error 2
make: *** [all] Error 2

Would you be able to provide any insight into this?

mphoward commented 1 year ago

Is this error from 0.11.0 or main? I committed on main to fix a thrust/cub compile issue, but I don't think we tagged a release:

https://github.com/mphowardlab/azplugins/commit/3d9a7beac0645c9c1116ef0bf05965037a4b731e

Let me know if this fixes the problem for you, and I will release a version 0.12.0 since there are actually a couple commits there that are not in the changelog.

jamie-arcc commented 1 year ago

I was using 0.11.0 originally. It looks like it compiled fine when I switched to the main branch, though it did throw a bunch of warnings about namespaces being redefined:

<command-line>: warning: "THRUST_CUB_WRAPPED_NAMESPACE" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "HOOMD_THRUST" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "HOOMD_CUB" redefined
<command-line>: note: this is the location of the previous definition

but they're just warnings. thanks a ton for being so responsive and helpful!

mphoward commented 1 year ago

OK thanks! That's good to know, I will have to look to see how HOOMD is defining those themselves, as I know they are needed in each module. This bug fix is only sometimes needed for CUDA 11.5 and I think we removed in HOOMD v3, so I haven't worried too much about it.

mphoward commented 1 month ago

Cleaning house: the warning noted above was for a specific version of CUDA that we have moved a few versions past, so I am closing this issue.