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 errors #127

Closed
yurivict opened this issue Mar 9, 2023 · 6 comments
Closed

Link errors #127

yurivict opened this issue Mar 9, 2023 · 6 comments

Comments

@yurivict
Copy link

yurivict commented Mar 9, 2023

===>  Building for cosma-2.6.4
[ 33% 3/3] : && /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fstack-protector-strong     -Wl,-rpath=-Wl,-rpath=/usr/local/lib/gcc12 -Wl,-rpath -Wl,/usr/local/mpi/openmpi/lib -Wl,--enable-new-dtags -pthread -fopenmp=libomp miniapp/CMakeFiles/cosma_miniapp.dir/cosma_miniapp.cpp.o -o miniapp/cosma_miniapp  -Wl,-rpath,/usr/ports/math/cosma/work/.build/src/cosma:/usr/local/lib:/usr/local/mpi/openmpi/lib:  src/cosma/libcosma.so  /usr/local/lib/libcosta.so  /usr/local/mpi/openmpi/lib/libmpi_cxx.so  /usr/local/mpi/openmpi/lib/libmpi.so  /usr/lib/libomp.so  /usr/local/lib/libopenblas.so && :
FAILED: miniapp/cosma_miniapp 
: && /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fstack-protector-strong     -Wl,-rpath=-Wl,-rpath=/usr/local/lib/gcc12 -Wl,-rpath -Wl,/usr/local/mpi/openmpi/lib -Wl,--enable-new-dtags -pthread -fopenmp=libomp miniapp/CMakeFiles/cosma_miniapp.dir/cosma_miniapp.cpp.o -o miniapp/cosma_miniapp  -Wl,-rpath,/usr/ports/math/cosma/work/.build/src/cosma:/usr/local/lib:/usr/local/mpi/openmpi/lib:  src/cosma/libcosma.so  /usr/local/lib/libcosta.so  /usr/local/mpi/openmpi/lib/libmpi_cxx.so  /usr/local/mpi/openmpi/lib/libmpi.so  /usr/lib/libomp.so  /usr/local/lib/libopenblas.so && :
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: warning: libmpi.so.12, needed by /usr/local/lib/libcosta.so, may conflict with libmpi.so.40
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<double>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, char const*, double const*, double const*, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<double>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<std::__1::complex<double> >(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > > > >&, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<std::__1::complex<float> >(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > > > >&, char const*, std::__1::complex<float> const*, std::__1::complex<float> const*, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<std::__1::complex<float> >(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > > > >&, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<std::__1::complex<double> >(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > > > >&, char const*, std::__1::complex<double> const*, std::__1::complex<double> const*, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<float>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<float> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<float> > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<float> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<float> > > >&, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<float>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<float> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<float> > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<float> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<float> > > >&, char const*, float const*, float const*, ompi_communicator_t*)'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
[ 66% 3/3] : && /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fstack-protector-strong     -Wl,-rpath=-Wl,-rpath=/usr/local/lib/gcc12 -Wl,-rpath -Wl,/usr/local/mpi/openmpi/lib -Wl,--enable-new-dtags -pthread -fopenmp=libomp miniapp/CMakeFiles/layout_miniapp.dir/layout_miniapp.cpp.o -o miniapp/layout_miniapp  -Wl,-rpath,/usr/ports/math/cosma/work/.build/src/cosma:/usr/local/lib:/usr/local/mpi/openmpi/lib:  src/cosma/libcosma.so  /usr/local/lib/libcosta.so  /usr/local/mpi/openmpi/lib/libmpi_cxx.so  /usr/local/mpi/openmpi/lib/libmpi.so  /usr/lib/libomp.so  /usr/local/lib/libopenblas.so && :
FAILED: miniapp/layout_miniapp 
: && /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fstack-protector-strong     -Wl,-rpath=-Wl,-rpath=/usr/local/lib/gcc12 -Wl,-rpath -Wl,/usr/local/mpi/openmpi/lib -Wl,--enable-new-dtags -pthread -fopenmp=libomp miniapp/CMakeFiles/layout_miniapp.dir/layout_miniapp.cpp.o -o miniapp/layout_miniapp  -Wl,-rpath,/usr/ports/math/cosma/work/.build/src/cosma:/usr/local/lib:/usr/local/mpi/openmpi/lib:  src/cosma/libcosma.so  /usr/local/lib/libcosta.so  /usr/local/mpi/openmpi/lib/libmpi_cxx.so  /usr/local/mpi/openmpi/lib/libmpi.so  /usr/lib/libomp.so  /usr/local/lib/libopenblas.so && :
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: warning: libmpi.so.12, needed by /usr/local/lib/libcosta.so, may conflict with libmpi.so.40
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<double>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, char const*, double const*, double const*, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<double>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<std::__1::complex<double> >(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > > > >&, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<std::__1::complex<float> >(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > > > >&, char const*, std::__1::complex<float> const*, std::__1::complex<float> const*, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<std::__1::complex<float> >(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > > > >&, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<std::__1::complex<double> >(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > > > >&, char const*, std::__1::complex<double> const*, std::__1::complex<double> const*, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<float>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<float> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<float> > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<float> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<float> > > >&, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<float>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<float> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<float> > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<float> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<float> > > >&, char const*, float const*, float const*, ompi_communicator_t*)'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
[100% 3/3] : && /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fstack-protector-strong     -Wl,-rpath=-Wl,-rpath=/usr/local/lib/gcc12 -Wl,-rpath -Wl,/usr/local/mpi/openmpi/lib -Wl,--enable-new-dtags -pthread -fopenmp=libomp miniapp/CMakeFiles/cosma_statistics.dir/cosma_statistics.cpp.o -o miniapp/cosma_statistics  -Wl,-rpath,/usr/ports/math/cosma/work/.build/src/cosma:/usr/local/lib:/usr/local/mpi/openmpi/lib:  src/cosma/libcosma.so  /usr/local/lib/libcosta.so  /usr/local/mpi/openmpi/lib/libmpi_cxx.so  /usr/local/mpi/openmpi/lib/libmpi.so  /usr/lib/libomp.so  /usr/local/lib/libopenblas.so && :
FAILED: miniapp/cosma_statistics 
: && /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fstack-protector-strong     -Wl,-rpath=-Wl,-rpath=/usr/local/lib/gcc12 -Wl,-rpath -Wl,/usr/local/mpi/openmpi/lib -Wl,--enable-new-dtags -pthread -fopenmp=libomp miniapp/CMakeFiles/cosma_statistics.dir/cosma_statistics.cpp.o -o miniapp/cosma_statistics  -Wl,-rpath,/usr/ports/math/cosma/work/.build/src/cosma:/usr/local/lib:/usr/local/mpi/openmpi/lib:  src/cosma/libcosma.so  /usr/local/lib/libcosta.so  /usr/local/mpi/openmpi/lib/libmpi_cxx.so  /usr/local/mpi/openmpi/lib/libmpi.so  /usr/lib/libomp.so  /usr/local/lib/libopenblas.so && :
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: warning: libmpi.so.12, needed by /usr/local/lib/libcosta.so, may conflict with libmpi.so.40
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<double>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, char const*, double const*, double const*, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<double>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<std::__1::complex<double> >(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > > > >&, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<std::__1::complex<float> >(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > > > >&, char const*, std::__1::complex<float> const*, std::__1::complex<float> const*, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<std::__1::complex<float> >(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<float> > > > >&, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<std::__1::complex<double> >(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<std::__1::complex<double> > > > >&, char const*, std::__1::complex<double> const*, std::__1::complex<double> const*, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<float>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<float> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<float> > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<float> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<float> > > >&, ompi_communicator_t*)'
/usr/local/bin/x86_64-unknown-freebsd13.1-ld: src/cosma/libcosma.so: undefined reference to `void costa::transform<float>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<float> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<float> > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<float> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<float> > > >&, char const*, float const*, float const*, ompi_communicator_t*)'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Version: 2.6.4
costa-2.2 built with BUILD_SHARED_LIBS=ON
clang-14
FreeBSD 13.1

@simonpintarelli
Copy link
Member

I can't reproduce this with cosma v2.6.4 using costa v2.2 (external, shared lib). Are you sure /usr/local/lib/libcosta.so is v2.2?

@yurivict
Copy link
Author

cosma-2.6.5 also breaks the same way:

[ 33% 3/3] : && /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fstack-protector-strong     -Wl,-rpath=-Wl,-rpath=/usr/local/lib/gcc12 -Wl,-rpath -Wl,/usr/local/mpi/openmpi/lib -Wl,--enable-new-dtags -pthread -fopenmp=libomp miniapp/CMakeFiles/layout_miniapp.dir/layout_miniapp.cpp.o -o miniapp/layout_miniapp  -Wl,-rpath,/usr/ports/math/cosma/work/.build/src/cosma:/usr/local/lib:/usr/local/mpi/openmpi/lib:  src/cosma/libcosma.so  /usr/local/lib/libcosta.so  /usr/local/mpi/openmpi/lib/libmpi_cxx.so  /usr/local/mpi/openmpi/lib/libmpi.so  /usr/lib/libomp.so  /usr/local/lib/libopenblas.so && :
FAILED: miniapp/layout_miniapp
: && /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fstack-protector-strong     -Wl,-rpath=-Wl,-rpath=/usr/local/lib/gcc12 -Wl,-rpath -Wl,/usr/local/mpi/openmpi/lib -Wl,--enable-new-dtags -pthread -fopenmp=libomp miniapp/CMakeFiles/layout_miniapp.dir/layout_miniapp.cpp.o -o miniapp/layout_miniapp  -Wl,-rpath,/usr/ports/math/cosma/work/.build/src/cosma:/usr/local/lib:/usr/local/mpi/openmpi/lib:  src/cosma/libcosma.so  /usr/local/lib/libcosta.so  /usr/local/mpi/openmpi/lib/libmpi_cxx.so  /usr/local/mpi/openmpi/lib/libmpi.so  /usr/lib/libomp.so  /usr/local/lib/libopenblas.so && :
ld: error: src/cosma/libcosma.so: undefined reference to void costa::transform<double>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, char const*, double const*, double const*, ompi_communicator_t*) [--no-allow-shlib-undefined]
ld: error: src/cosma/libcosma.so: undefined reference to void costa::transform<double>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double> >, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double> > > >&, ompi_communicator_t*) [--no-allow-shlib-undefined]

costa-2.2 is built with shared libraries: -DBUILD_SHARED_LIBS=ON.

@simonpintarelli
Copy link
Member

I can't reproduce the error for costa-2.2 (built as shared library from tar.gz) and cosma-2.6.5. Running nm, objdump command on the libcosta.so shows that the symbols reported missing above are present.

Did you costa update first before attempting to compile cosma?

@yurivict
Copy link
Author

yurivict commented May 28, 2023

Now costa-2.2.2 builds fine.

But cosma-2.6.6 fails:

[ 91% 24/24] : && /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fstack-protector-strong     -Wl,-rpath=-Wl,-rpath=/usr/local/lib/gcc12 -Wl,-rpath -Wl,/usr/local/mpi/openmpi/lib -Wl,--enable-new-dtags -pthread miniapp/CMakeFiles/layout_miniapp.dir/layout_miniapp.cpp.o -o miniapp/layout_miniapp  -Wl,-rpath,/usr/ports/math/cosma/work/.build/src/cosma:/usr/local/lib:/usr/local/mpi/openmpi/lib:  src/cosma/libcosma.so  /usr/local/lib/libcosta.so  /usr/local/mpi/openmpi/lib/libmpi_cxx.so  /usr/local/mpi/openmpi/lib/libmpi.so  /usr/lib/libomp.so  /usr/local/lib/libopenblas.so && :
FAILED: miniapp/layout_miniapp 
: && /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fstack-protector-strong     -Wl,-rpath=-Wl,-rpath=/usr/local/lib/gcc12 -Wl,-rpath -Wl,/usr/local/mpi/openmpi/lib -Wl,--enable-new-dtags -pthread miniapp/CMakeFiles/layout_miniapp.dir/layout_miniapp.cpp.o -o miniapp/layout_miniapp  -Wl,-rpath,/usr/ports/math/cosma/work/.build/src/cosma:/usr/local/lib:/usr/local/mpi/openmpi/lib:  src/cosma/libcosma.so  /usr/local/lib/libcosta.so  /usr/local/mpi/openmpi/lib/libmpi_cxx.so  /usr/local/mpi/openmpi/lib/libmpi.so  /usr/lib/libomp.so  /usr/local/lib/libopenblas.so && :
ld: error: undefined reference due to --no-allow-shlib-undefined: void costa::transform<double>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double>>, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double>>>>&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double>>, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double>>>>&, char const*, double const*, double const*, ompi_communicator_t*)
>>> referenced by src/cosma/libcosma.so

ld: error: undefined reference due to --no-allow-shlib-undefined: void costa::transform<double>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double>>, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double>>>>&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<double>>, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<double>>>>&, ompi_communicator_t*)
>>> referenced by src/cosma/libcosma.so

ld: error: undefined reference due to --no-allow-shlib-undefined: void costa::transform<float>(std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<float>>, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<float>>>>&, std::__1::vector<std::__1::reference_wrapper<costa::grid_layout<float>>, std::__1::allocator<std::__1::reference_wrapper<costa::grid_layout<float>>>>&, char const*, float const*, float const*, ompi_communicator_t*)
>>> referenced by src/cosma/libcosma.so

clang-15
FreeBSD 13.2

@dmikushin
Copy link
Contributor

dmikushin commented Oct 26, 2023

COSTA API is a C++ API, meaning that it has explicit use of std:: things. Unlike for C API, the mangling of std:: is not standardized across compilers. Therefore, it's absolutely necessary that all involved components must be compiled with the same compiler (even exactly same version of the same compiler). A missing symbol is likely an indication that it exists with a slightly different mangling - I'd grep for that first. If it does exist, then I'd hunt for CMake logic, which accidentally ignores the proper compiler setting. Also try to build without ccache.

@simonpintarelli
Copy link
Member

Closing, #141 reports the same.

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

3 participants