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
330 stars 127 forks source link

relocation linking error when compiling #244

Closed joaander closed 7 years ago

joaander commented 7 years ago

Original report by akpc (Bitbucket: akpc, GitHub: akpc).


I am compiling the latest version using the method recommended, using gcc 5.4.0 and python 3.4.3. Then I get the following results. I found this question relevant, but I don't know how to fix it. """

/usr/bin/ld: /com/python/3.4.3/lib/python3.4/config-3.4m/libpython3.4m.a(abstract.o): relocation R_X86_64_32S against `_PyObject_NextNotImplemented' can not be used when making a shared object; recompile with -fPIC /com/python/3.4.3/lib/python3.4/config-3.4m/libpython3.4m.a: could not read symbols: Bad value """

joaander commented 7 years ago

Could you attach your CMakeCache.txt file from your build directory?

Also, what is the location of libpython3.4m.so under /com/python/3.4.3/lib/python3.4?

What is the output of:

python -c "import sysconfig; print(sysconfig.get_config_var('LDLIBRARY'))"

and

python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))"

and

python -c "import sysconfig; print(sysconfig.get_config_var('LIBPL'))"
joaander commented 7 years ago

Original comment by akpc (Bitbucket: akpc, GitHub: akpc).


joaander commented 7 years ago

Original comment by akpc (Bitbucket: akpc, GitHub: akpc).


Thanks for quick response.

No, I cannot locate libpython3.4m.so at all.

#!bash

locate libpython3.4m.so
(empty output)
locate libpython
/usr/lib64/libpython2.6.so

The output is as following:

#!bash
python -c "import sysconfig; print(sysconfig.get_config_var('LDLIBRARY'))"
libpython3.4m.a
python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))"
/com/python/3.4.3/lib
python -c "import sysconfig; print(sysconfig.get_config_var('LIBPL'))"
/com/python/3.4.3/lib/python3.4/config-3.4m
joaander commented 7 years ago

Thanks for the information. It would appear that the python installation in /com/python/3.4.3/lib/python3.4 was configured without the --enable-shared option. Without a shared python library, hoomd (a python extension) cannot be built. -enable-shared is not enabled by default when compiling python from source, so it needs to be specified manually.

joaander commented 7 years ago

Original comment by akpc (Bitbucket: akpc, GitHub: akpc).


I changed python to the one build by anaconda and this solved my problem.

but after I installed hoomd, it said that the build of hoomd was compiled for a minimum capability of 3.0 but the GPU is only 2.0. How can I change it to be compiled for a minimum capability of 2.0, or how can I make sure that the computation node I am using is not capable of 3.0?

joaander commented 7 years ago

Compute 2.0 GPUs have not been manufactured in over 5 years, and all national supercomputers using compute 2.0 have been decommissioned. So we no longer support hoomd on such systems. You can modify CUDA_ARCH_LIST (see the docs) and hoomd may or may not work on your GPUs. I have not tested hoomd on compute 2.0 hardware in the last 5 months.

joaander commented 7 years ago

Original comment by akpc (Bitbucket: akpc, GitHub: akpc).


Ok, I see, then I will just use the CPU version to do my computation. It seems that my institute is using older GPUs. Thank you, Joshua.

joaander commented 7 years ago

Not a bug in hoomd.