Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link error: cannot find -lgc #32

Open
elliottslaughter opened this issue Mar 20, 2019 · 4 comments
Open

Link error: cannot find -lgc #32

elliottslaughter opened this issue Mar 20, 2019 · 4 comments

Comments

@elliottslaughter
Copy link
Contributor

When I build my application with the newest master branch, I get the following link error:

x10c++  -x10rt mpi -O3 -NO_CHECKS TaskBench.x10 -post "# -o main #  -std=c++11 -I../core #  -L../core -lcore_s"
x10c++: Failed to copy core.h from to /global/u1/s/slaughte/task-bench/x10/
x10c++: /usr/bin/ld: cannot find -lgc    
     collect2: error: ld returned 1 exit status    
x10c++: Non-zero return code: 1
2 errors.

Reverting my copy of x10 to commit 9212dc2 appears to fix the problem. Maybe the BDWGC upgrade is responsible?

@dgrove-oss
Copy link
Member

Sorry for the slow response; been overloaded for a while.

Couple of thoughts.

  1. Does it work if you compile a trivial program (eg HelloWorld.x10) without an explict -post command to x10c++?
  2. Can you take a look to see if libgc.so was correctly built in x10.runtime/src-cpp/bdwgc-8.0.2/install/lib/ and verify that it was correctly copied to x10.dist/lib/

@elliottslaughter
Copy link
Contributor Author

  1. Yes, it compiles.

  2. Here's what I see:

    $ ls deps/x10/x10/x10.runtime/src-cpp/bdwgc-8.0.2/install/lib 
    libcord.la  libcord.so  libcord.so.1  libcord.so.1.4.0  libgc.la  libgc.so  libgc.so.1  libgc.so.1.4.2  pkgconfig
    $ ls deps/x10/x10/x10.dist/lib 
    RunJava.jar                           commons-math3-3.6.1.jar  hazelcast-client-3.11.1.jar  libgc.so.1.4.2      lpg.jar          x10doc.jar
    antlr-runtime_4.5.0.201505151407.jar  ecj-4.10.jar             libgc.so                     libx10rt_mpi.a      snappy-java.jar
    commons-logging-1.2.jar               hazelcast-3.11.1.jar     libgc.so.1                   logging.properties  x10c.jar
    

    Looks like the libgc.la isn't getting copied? I think the C++ compiler on this system is configured to specify -static by default.

@elliottslaughter
Copy link
Contributor Author

I went back to the old commit that worked, and it turns out the difference is that the static library extension changed from .a to .la. I'm guessing your build process is set to copy all .a files but hasn't been adapted to copy .la.

@elliottslaughter
Copy link
Contributor Author

I may be wrong about the usage of .la, looks like it's associated with libtool. Anyway, the old build had .a and no .la and the new had .la but no .a. Perhaps the static library isn't being built at all? Could be a configure flag that needs to be set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants