Project

General

Profile

Bug #1668

Ensure that all libraries/modules will build as dynamic/shared objects (.so/.dylib vs .a)

Added by Phil Miller 10 months ago. Updated 5 months ago.

Status:
Merged
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
08/29/2017
Due date:
% Done:

0%


Description

./build LIBS netlrts-darwin-x86_64 --build-shared --suffix=shared -j2 -g

$ ls netlrts-darwin-x86_64-shared/lib{,_so} | grep -v '.dep$' | sort | cut -d. -f1 | uniq -c | sort -n | grep 1 | grep -v /
   1 libampiromio
   1 libirecv
   1 libmoduleCkSparseContiguousReducer
   1 libmodulesearchEngine
   1 libmodulesearchEngine_bound
   1 libqt
   1 libhwloc_embedded

Something is screwy in the build process of these library objects that leaves them without a .so/.dylib built, where every other library has one. The most concerning to me are libqt and libampiromio.

Related issues

Related to Charm++ - Feature #952: Update AMPI's version of ROMIO In Progress 01/17/2016
Related to Charm++ - Bug #1747: hwloc Breaking ROMIO Configure Script Merged 11/27/2017

History

#1 Updated by Phil Miller 10 months ago

So, it turns out that libqt is wrong in the opposite direction - libqt.a gets built, but doesn't get copied to the lib directory, while libqt.dylib (on my mac) gets copied to lib_so

#2 Updated by Phil Miller 10 months ago

A further amendment to that statement - libqt.a is missing because it's only copied as

cp libqt.a ../lib/libckqt.a

Note the change in name from libqt to libckqt. The dynamic version libqt.dylib is copied as both libqt and libckqt. This is a little weird.

#3 Updated by Matthias Diener 10 months ago

ROMIO is currently not able to be built dynamically. Bug #952 tracks an update for ROMIO which should make it easier to enable creating a shared romio library.

#4 Updated by Matthias Diener 10 months ago

Can we merge lib/ and lib_so/ ? I think this separation is not necessary, as shared and static libraries have different file extensions. Normal Linux systems have *.so and *.a in /usr/lib/, for example.

#5 Updated by Phil Miller 10 months ago

  • Related to Feature #952: Update AMPI's version of ROMIO added

#6 Updated by Phil Miller 10 months ago

Merging the two directories would be a separate issue - this is just about whether both static and dynamic objects get built and installed at all.

#7 Updated by Phil Miller 10 months ago

  • Status changed from New to Implemented

remote: https://charm.cs.illinois.edu/gerrit/2962 Bug #1668 irecv Makefile: enable charmc's automatic generation of dynamic ...
remote: https://charm.cs.illinois.edu/gerrit/2963 Bug #1668 Makefile: Don't copy libqt.a under an unused name
remote: https://charm.cs.illinois.edu/gerrit/2964 Bug #1668 state_space_searchengine: Ensure dynamic libraries get built when ...
remote: https://charm.cs.illinois.edu/gerrit/2965 Bug #1668 sparseContiguousReducer: Ensure dynamic libraries get built when ...

AMPI's ROMIO will have to happen with the version update mentioned. I'll add a note over there.

#8 Updated by Phil Miller 10 months ago

  • Assignee set to Phil Miller

#9 Updated by Phil Miller 10 months ago

Ok, I see why we don't merge the two directories - when linking under control of charmc, it addresses user requests for static or dynamic linking of the finished binary by only passing one path or the other to the underlying linker. This means that even if the underlying tool is stupid about respecting the user's preference, we guarantee that it will only see the desired variant of the RTS objects.

#10 Updated by Phil Miller 8 months ago

  • Description updated (diff)

Looks like our hwloc also needs to have shared object compilation enabled. It's missing, probably because it doesn't ultimately use charmc to assemble its .a, which would implicitly generate the .so/.dylib/.dll as well.

#11 Updated by Sam White 8 months ago

libampiromio is only built statically because the version of ROMIO we have doesn't support shared builds.
I believe this commit would get us that, but it isn't working yet. Matthias may have more details on it: https://charm.cs.illinois.edu/gerrit/#/c/2940/

Edit: the above comments confirm this.

#12 Updated by Matthias Diener 8 months ago

Yeah, there is no update regarding romio yet.

#13 Updated by Phil Miller 8 months ago

charmc wants to reference hwloc when linking a shared object for QuickThreads. hwloc doesn't build a corresponding shared object by default, and adding enable_shared='yes' in configure.ac isn't enough to do it. More investigation to follow.

#14 Updated by Evan Ramos 7 months ago

  • Related to Bug #1747: hwloc Breaking ROMIO Configure Script added

#15 Updated by Evan Ramos 6 months ago

hwloc will build a shared object with https://charm.cs.illinois.edu/gerrit/3450

#16 Updated by Sam White 6 months ago

All of the above changes have been merged, so the only remaining issue here should be ROMIO.

#17 Updated by Phil Miller 6 months ago

QuickThreads is also still kinda messed up, at least on Mac builds

#18 Updated by Phil Miller 6 months ago

  • Status changed from Implemented to In Progress
  • Assignee changed from Phil Miller to Evan Ramos

hwloc builds a dynamic library, but it's not presently usable on Mac. I needed to uncomment the cp command in src/scripts/Makefile to actually get it in lib_so/, copied over the libhwloc_embedded.0.dylib file that it referenced as well, and I still get the following:

$ pwd
/Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/tests/charm++/simplearrayhello

$ otool -L hello
hello:
    /Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/lib_so/libckmain.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/lib_so/libck.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/lib_so/libmemory-default.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/lib_so/libthreads-default.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/lib_so/libconv-machine.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/lib_so/libconv-core.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/lib_so/libtmgr.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/lib_so/libconv-util.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/lib_so/libconv-partition.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/lib/libhwloc_embedded.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
    /Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/lib_so/libldb-rand.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/lib_so/libconv-ldb.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/tmp/QuickThreads/libckqt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/lib_so/libmoduleNDMeshStreamer.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/lib_so/libmodulecompletion.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)

$ ./hello
dyld: Library not loaded: /usr/local/lib/libhwloc_embedded.0.dylib
  Referenced from: /Users/phil/PPL/charm/netlrts-darwin-x86_64-v6.8.2-208-gf71a444/tests/charm++/simplearrayhello/./hello
  Reason: image not found
Trace/BPT trap: 5

#19 Updated by Evan Ramos 6 months ago

  • Status changed from In Progress to Implemented

With https://charm.cs.illinois.edu/gerrit/3469 I get:

$ pwd
/Users/evan/charm/netlrts-darwin-x86_64/tests/charm++/simplearrayhello

$ otool -L hello
hello:
    /Users/evan/charm/netlrts-darwin-x86_64/lib_so/libckmain.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/evan/charm/netlrts-darwin-x86_64/lib_so/libck.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/evan/charm/netlrts-darwin-x86_64/lib_so/libmemory-default.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/evan/charm/netlrts-darwin-x86_64/lib_so/libthreads-default.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/evan/charm/netlrts-darwin-x86_64/lib_so/libconv-machine.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/evan/charm/netlrts-darwin-x86_64/lib_so/libconv-core.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/evan/charm/netlrts-darwin-x86_64/lib_so/libtmgr.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/evan/charm/netlrts-darwin-x86_64/lib_so/libconv-util.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/evan/charm/netlrts-darwin-x86_64/lib_so/libconv-partition.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/evan/charm/netlrts-darwin-x86_64/lib_so/libhwloc_embedded.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
    /Users/evan/charm/netlrts-darwin-x86_64/lib_so/libldb-rand.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/evan/charm/netlrts-darwin-x86_64/lib_so/libconv-ldb.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/evan/charm/netlrts-darwin-x86_64/lib_so/libckqt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/evan/charm/netlrts-darwin-x86_64/lib_so/libmoduleNDMeshStreamer.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/evan/charm/netlrts-darwin-x86_64/lib_so/libmodulecompletion.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)

$ ./hello
Charm++: standalone mode (not using charmrun)
Charm++> Running in non-SMP mode: numPes 1
Converse/Charm++ Commit ID: v6.8.2-211-gfa0e46341
Charm++> scheduler running in netpoll mode.
CharmLB> Load balancer assumes all CPUs are same.
Charm++> Running on 1 unique compute nodes (8-way SMP).
Charm++> cpu topology info is gathered in 0.000 seconds.
Running Hello on 1 processors for 5 elements
[0] Hello 0 created
[0] Hello 1 created
[0] Hello 2 created
[0] Hello 3 created
[0] Hello 4 created
[0] Hi[17] from element 0
[0] Hi[18] from element 1
[0] Hi[19] from element 2
[0] Hi[20] from element 3
[0] Hi[21] from element 4
All done
[Partition 0][Node 0] End of program

#20 Updated by Matthias Diener 6 months ago

The ROMIO issue mentioned above is not solved yet, so AMPI applications still require at least the static ROMIO library. I'll address this in early January.

#21 Updated by Sam White 5 months ago

This enables shared builds of ROMIO: https://charm.cs.illinois.edu/gerrit/#/c/3499/

I think this issue can be closed now?

#22 Updated by Evan Ramos 5 months ago

  • Status changed from Implemented to Merged

I tried the build and grep commands in the issue description and no items were listed. I agree that it is complete.

Also available in: Atom PDF