#2679: How to link an externally compiled library during ET compilation
Reporter: Maria Mutz Status: new Milestone: Version: Type: bug Priority: major Component: EinsteinToolkit thorn
I have compiled the COCAL code separately from the ET, generating a library for which I have the .a file. I’m trying to link to that library when compiling the ET on Expanse. When I try to link it without copying all the source files in the thorn that uses it into the src directory I get “undefined reference to” errors for anything in a subdirectory. I tried moving all the files in subdirectories into the src directory as a work-around, but then I started getting errors that look like this:
```
/lib/../lib64/crt1.o: In function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status
make[3]: *** [<builtin>: include_modulefiles_MRNS.f90] Error 1
make[2]: *** [/home/mmutz/Cactus/lib/make/make.thornlib:113: make.checked] Error 2
make[1]: *** [/home/mmutz/Cactus/lib/make/make.configuration:179: /home/mmutz/Cactus/configs/sim17/lib/libthorn_Cocalthorn.a] Error 2
```
What is the proper way to link the library during compilation?
I’ve attached a copy of my config file.
attachment: OptionList.pdf (https://api.bitbucket.org/2.0/repositories/einsteintoolkit/tickets/issues/26...)
-- Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2679/how-to-link-an-ext...
trac@lists.einsteintoolkit.org