Alpaka: OSX: ranlib: file libalpaka.a(Dymmy.cpp.o) has no symbols

Created on 5 Mar 2018  路  8Comments  路  Source: alpaka-group/alpaka

Compiling PIConGPU with alpaka on OSX fails in the CMake step.

The main reason might be the "dummy" library that is created which we should replace with a more modern, CMake 3 INTERFACE target instead.

ranlib: file libalpaka.a(Dummy.cpp.o) has no symbols

Environment:

  • macOS "High Sierra" (10.13.3)
  • Apple Clang 9.0
  • CMake 3.10.2
  • Boost 1.65.1
  • OpenMP 2.0 "blocks" backend
Bug

All 8 comments

besides the needed fix, can we maybe add a single osx entry to our travis-ci build matrix?

@psychocoderHPC the same issue will probably re-appear in cupla

I can look into it but not before the next week.

I think a first workaround before a cmake update (which takes a little bit time) would be to add a dummy function into the dummy library.

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

Is there any way to ignore this linker error?
As far as I know, the INTERFACE library type produces problems for IDE projects generated by CMake. With some of the last updates it was made possible to attach source files to such a library, but those will appear as part of the consuming library and not the interface library itself. I have no problem with a dummy function returning the version ;-)

We could add osx to our travis-ci builds. However this is a large undertaking and I do not have a Mac to develop/test this. Furthermore, OSX builds seem to be a bottleneck on travis at the moment.

As far as I know, the INTERFACE library type produces problems for IDE projects generated by CMake.

Can you link that issue?

Technically, we just need to create a (not-building but dependency adding and then installing) target in CMake:

add_library(alpaka INTERFACE)
target_include_directories(alpaka INTERFACE
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
    $<INSTALL_INTERFACE:include>
)

target_link_libraries(alpaka INTERFACE boost::boost) # ...
# ...

install(TARGETS alpaka
# ...
)

For OSX on travis I just mean a single test, not the full matrix again. Just to make sure the general logic works, e.g. with the latest boost. Yes, these resources are very scare but a good way for us to test if we don't have macs every day at hand. One can set the test also to "allow failing" and just check it from time to time if it fails due to travis too often.

I do not want to have the whole test matrix on mac as well. But even a single compiler/boost/nvcc compilation seems to be much work, at least to me.

Your pseudo-code from above should work. However, you will not see the alpaka sources anymore when generating an IDE project (e.g. Visual Studio).

There is a bug ticket for this avaiable as well as a workaround: https://gitlab.kitware.com/cmake/cmake/issues/15234

Ok, the work-around is a one-liner with a custom target for the IDE that is never called. We should do that.

I will try out the work-around in the next days.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ax3l picture ax3l  路  4Comments

BenjaminW3 picture BenjaminW3  路  6Comments

theZiz picture theZiz  路  5Comments

SimeonEhrig picture SimeonEhrig  路  5Comments

BenjaminW3 picture BenjaminW3  路  3Comments