scr icon indicating copy to clipboard operation
scr copied to clipboard

add YOGRT_LIBRARIES to SCR_EXTERNAL_SERIAL_LIBS

Open Alessandro-Barbieri opened this issue 4 years ago • 4 comments

Alessandro-Barbieri avatar Mar 26 '22 09:03 Alessandro-Barbieri

Thanks, @Alessandro-Barbieri . I think we only call libyogrt from the main SCR library, so in theory we shouldn't have to link to libyogrt in the serial binaries.

Does this PR resolve a link error that you're seeing? Can you forward the error info?

adammoody avatar Mar 28 '22 20:03 adammoody

[53/78] /usr/bin/x86_64-pc-linux-gnu-gcc  -I/var/tmp/portage/sys-cluster/scr-3.0/work/scr-3.0/src -I/var/tmp/portage/sys-cluster/scr-3.0/work/scr-3.0_build -D_GLIBCXX_ASSERTIONS -Wall -Os -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -fexceptions -fstack-clash-protection -fcf-protection=full -fasynchronous-unwind-tables -ftree-vectorize -fplugin=annobin -Waddress -Waggressive-loop-optimizations -Warray-bounds -Wclobbered -Wdate-time -Wformat -Wformat-security -Wfree-nonheap-object -Wnonnull -Wparentheses -Wpointer-arith -Wreturn-local-addr -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wuninitialized -Wunused-value -Wvolatile-register-var -Wno-error=implicit-function-declaration -Wimplicit-function-declaration -fPIE -MD -MT src/CMakeFiles/scr_crc32.dir/scr_crc32.c.o -MF src/CMakeFiles/scr_crc32.dir/scr_crc32.c.o.d -o src/CMakeFiles/scr_crc32.dir/scr_crc32.c.o -c /var/tmp/portage/sys-cluster/scr-3.0/work/scr-3.0/src/scr_crc32.c
[54/78] : && /usr/bin/x86_64-pc-linux-gnu-gcc -Wall -Os -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -fexceptions -fstack-clash-protection -fcf-protection=full -fasynchronous-unwind-tables -ftree-vectorize -fplugin=annobin -Waddress -Waggressive-loop-optimizations -Warray-bounds -Wclobbered -Wdate-time -Wformat -Wformat-security -Wfree-nonheap-object -Wnonnull -Wparentheses -Wpointer-arith -Wreturn-local-addr -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wuninitialized -Wunused-value -Wvolatile-register-var -Wno-error=implicit-function-declaration -Wimplicit-function-declaration -Wl,-O1 -Wl,--as-needed -Wl,--sort-common    -rdynamic src/CMakeFiles/scr_crc32.dir/scr_crc32.c.o -o src/scr_crc32  -Wl,-rpath,/var/tmp/portage/sys-cluster/scr-3.0/work/scr-3.0_build/src  src/libscr_base.so  -laxl  -lredset_base  -lspath_base  -lkvtree_base  -lz  -lpthread && :
FAILED: src/scr_crc32
: && /usr/bin/x86_64-pc-linux-gnu-gcc -Wall -Os -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -fexceptions -fstack-clash-protection -fcf-protection=full -fasynchronous-unwind-tables -ftree-vectorize -fplugin=annobin -Waddress -Waggressive-loop-optimizations -Warray-bounds -Wclobbered -Wdate-time -Wformat -Wformat-security -Wfree-nonheap-object -Wnonnull -Wparentheses -Wpointer-arith -Wreturn-local-addr -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wuninitialized -Wunused-value -Wvolatile-register-var -Wno-error=implicit-function-declaration -Wimplicit-function-declaration -Wl,-O1 -Wl,--as-needed -Wl,--sort-common    -rdynamic src/CMakeFiles/scr_crc32.dir/scr_crc32.c.o -o src/scr_crc32  -Wl,-rpath,/var/tmp/portage/sys-cluster/scr-3.0/work/scr-3.0_build/src  src/libscr_base.so  -laxl  -lredset_base  -lspath_base  -lkvtree_base  -lz  -lpthread && :
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: src/libscr_base.so: undefined reference to `yogrt_remaining'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Alessandro-Barbieri avatar Mar 29 '22 20:03 Alessandro-Barbieri

Thanks, @Alessandro-Barbieri . That's helpful. For some reason, I don't see the same error in my link. Maybe the linker version or option is the difference.

Rather than add libyogrt to the link, I'm wondering if we can drop the scr_env.c file from the objects in the serial binaries. Does it work if you drop scr_env.c from the noMPI sources here?

https://github.com/LLNL/scr/blob/d153d585f8d3aef119d0986afd7b5642805270df/src/CMakeLists.txt#L24

adammoody avatar Mar 29 '22 20:03 adammoody

That's because yogrt_remaining is used in scr_env.c and it will end in scr_base.a (in this case you get no errors because it's static) but if you try to build scr_base.so as in https://github.com/LLNL/scr/pull/454 you'll get that error at link time

Alessandro-Barbieri avatar Apr 24 '22 01:04 Alessandro-Barbieri