charmplusplus / charm

The Charm++ parallel programming system. Visit https://charmplusplus.org/ for more information.
Apache License 2.0
207 stars 50 forks source link

Relation problem during compilation #3846

Open VictorEijkhout opened 1 month ago

VictorEijkhout commented 1 month ago
/usr/bin/ld: hwloc-prefix/src/hwloc-build/hwloc/topology-linux.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `cmi_hwloc_alloc_mmap' which may bind externally can not be used when making a sha
red object; recompile with -fPIC

I'm configuring with

cmake -D CMAKE_INSTALL_PREFIX=/work/00434/eijkhout/charmpp/installation-charmpp-8.0.0-vista-nvidia24.9-openmpi5.0.5_nvc249                     -D CMAKE_COLOR_DIAGNOSTICS=OFF                     -D CMAKE_VERBOSE_MAKEFILE=ON                     -D BUILD_SHARED_LIBS=ON                     -D NETWORK=mpi -D CMAKE_POSITION_INDEPENDENT_CODE=ON                       /work/00434/eijkhout/charmpp/charmpp-8.0.0/

so the fPIC flag should be covered. Maybe you're not propagating it?

I get the same problem with gcc14

ritvikrao commented 1 month ago

I would suggest you try using the build script to install charm++, as opposed to directly using cmake, and see if that resolves your issue.

VictorEijkhout commented 4 weeks ago
Starting from version 7.0, Charm++ uses the CMake-based build system 
when building with the ./build command. To use the old configure-based build 
system, you can build with the ./buildold command with the same options. 
We intend to remove the old build system in Charm++ 7.1.

?

VictorEijkhout commented 4 weeks ago

But sure, the build script works. However, it only creates static libraries. How do I tell it to make shared?

ZwFink commented 4 weeks ago

--build-shared

VictorEijkhout commented 4 weeks ago

Ok, that builds the shared & static in two separate directories. (Not great, usually that's combined in one directory.)

  1. How do I pass that option to the cmake install?
  2. I can't get a prefix dir set: I build
    ./build charm++ ucx-linux-arm8 --build-shared --basedir=$(pwd)/../installation-old --force

    but the basedir seems to be ignored.

VictorEijkhout commented 3 weeks ago

Let me ask that last one separately.