Closed bircoph closed 9 years ago
Same thing happening on up-to-date Debian Testing using CMake 3.2.2.
Nicely spotted @bircoph !
As a temporary fix, I commented out the non-building test and the rest of the testsuite builds successfully. Unfortunately, neither make test
nor ctest
seems to be doing anything.
EDIT: typo
Unfortunately, neither make test nor ctest seems to be doing anything.
This happens when running from the top build directory.
cd test && ctest
works.
@AvtechScientific, it will be nice to have top-level CTestTestfile.cmake which includes test/CTestTestfile.cmake (or test subdirectory).
We look for a newer system to reproduce the errors, in the meanwhile, could you, please, check whether swapping aslmath and asldata helps:
target_link_libraries(testMatrixOfElements aslacl asldata aslmath asl)
target_link_libraries(testMatrixOfElements aslacl asldata aslmath asl)
It still fails to build:
FAILED: : && /usr/lib64/ccache/bin/x86_64-pc-linux-gnu-g++ -march=native -O2 -funswitch-loops -fpredictive-commoning -ftree-vectorize -ftree-slp-vectorize -fvect-cost-model -fgcse-after-reload -ftree-partial-pre -ftree-loop-im -fweb -frename-registers -fomit-frame-pointer -fexcess-precision=fast -pipe -frecord-gcc-switches -fno-stack-protector -fvisibility-inlines-hidden -fpermissive -Wno-deprecated -march=native -O2 -funswitch-loops -fpredictive-commoning -pipe -Wl,-O1,--as-needed,--sort-common,-z,combreloc,-z,relro,-z,now,--relax,--hash-style=gnu test/testACL/CMakeFiles/testMatrixOfElements.dir/testMatrixOfElements.cc.o -o test/testACL/testMatrixOfElements -rdynamic src/libasl.so.0.1.5 src/acl/libaslacl.so.0.1.5 src/acl/Operators/libaslacloperators.so.0.1.5 src/acl/aclMath/libaslaclmath.so.0.1.5 -lOpenCL src/data/libasldata.so.0.1.5 src/math/libaslmath.so.0.1.5 src/libaslcommon.so.0.1.5 && :
src/math/libaslmath.so.0.1.5: undefined reference to `asl::generateDataContainer_SP(asl::Block const&, acl::VectorOfElements const&, unsigned int)'
src/math/libaslmath.so.0.1.5: undefined reference to `asl::offset(asl::Block const&, int)'
collect2: error: ld returned 1 exit status
Please note that if in the build command one moves "src/libasl.so.0.1.5" to the end of the list, build is fine. Now the question is how to move it there, because it is already on the end of the list in test/testACL/CMakeLists.txt. I have no idea what and why moves it around during cmake run.
@bircoph Most ASL binaries are quite underlinked (see #13), which is likely to be the source of the missing references.
Current git head fixes this for me.
Hi,
with --as-needed in LDFLAGS (default it Gentoo) tests fail to link:
This happens due to incorrect order of library arguments: libasl.so.0.1.5 should follow libaslmath.so.0.1.5 because libaslmath uses symbols from libasl.
On the other hand testACL/CMakeLists.txt contains:
which looks valid (asl is the last library on the list).
This problem starts with >=cmake-3.1.0: for 3.0.2 such problem is not reproducible, for 3.1.0 and later versions it takes place. Current version of cmake used for the build is 3.3.0.
Full build log is available here: https://bpaste.net/show/56abb9c2f641