[Mochi-devel] running mochi examples
Latham, Robert J.
robl at mcs.anl.gov
Tue Nov 5 09:28:33 CST 2019
On Mon, 2019-11-04 at 19:00 -0500, Abid Malik via mochi-devel wrote:
>
> Thanks.
>
> I am getting the following linking error:
>
>
> Linking C executable 01_margo_hello_server
> /usr/bin/ld: CMakeFiles/01_margo_hello_server.dir/hello_server.c.o:
> undefined reference to symbol 'ABT_thread_create'
> /gpfs/alpine/csc299/world-shared/amalik/mochi/spack/opt/spack/linux-
> rhel7-power9le/gcc-6.4.0/argobots-develop-
> uwvdjjdzrkn475ax7bw4w7hztawzidg3/lib/libabt.so.0: error adding
> symbols: DSO missing from command line
> /usr/bin/sha1sum: 01_margo_hello_server: No such file or directory
> collect2: error: ld returned 1 exit status
> make[2]: *** [01_margo_hello_server] Error 1
> make[1]: *** [CMakeFiles/01_margo_hello_server.dir/all] Error 2
> make: *** [all] Error 2
>
> currently, I have the following:
>
> Currently Loaded Modules:
> 1) xl/16.1.1-3 6) darshan-runtime/3.1.7
> 11) boost-1.70.0-gcc-6.4.0-dw376xg
> 2) spectrum-mpi/10.3.0.1-20190611 7) DefApps
> 12) libfabric-1.8.1-gcc-6.4.0-d4kxa4p
> 3) hsi/5.0.2.p5 8) argobots-develop-gcc-6.4.0-
> uwvdjjd 13) mercury-master-gcc-6.4.0-nbp34rm
> 4) xalt/1.1.4 9) bzip2-1.0.8-gcc-6.4.0-
> mdsmice 14) margo-0.5.2-gcc-6.4.0-gniufvt
> 5) lsf-tools/2.0 10) zlib-1.2.11-gcc-6.4.0-
> nbedgs2 15) cmake/3.15.2
>
> Argobot is there. Am I missing something?
You're right that on most platforms 'modules' takes care of setting
whatever flags are needed for the compiler and linker to find the
library. I don't know why the toolchain on summit does not use CPATH
and such.
I had to compile with the help of pkg-config like so:
gcc margo-example-client.c my-rpc.c $(pkg-config --libs margo)
We're pretty good about providing pkg-config files for the mochi
suite. I hope you never have to do things manually, but if you come
across a spack package, however, that does not have pkg-config support,
you might have to. You can get the paths (for CFLAGS and LDFLAGS) by
hand with "spack find --paths":
% spack find --paths margo
==> 1 installed package
-- linux-rhel7-power9le / gcc at 9.1.0 -----------------------------
margo at 0.5.2 /autofs/nccs-svm1_home1/robl/src/spack/opt/spack/linux-
rhel7-power9le/gcc-9.1.0/margo-0.5.2-bwzjgx7k3ocghtxh4ihcj3uxpchqv7zq
Again, if you ever have to do that for a Mochi package, that's a bug
and you should tell us.
==rob
More information about the mochi-devel
mailing list