Closed Ferruck closed 8 years ago
compiler optimizations leading to undefined references Oo?. I don't even know where to start with that... very weird problem ... My guess is that higher compiler optimizations optimize my "__instantiateAllTempaltes" function away. ... Meaning It would be necessary do write out the template declarations instead of letting them derive implicitely by the compiler. Will take a look at this soon.
My first thought was template problems, too.
Don't know how to reproduce this. When adding "-O3" to
list(APPEND CMAKE_CXX_FLAGS "-O3 -std=c++11 -fPIC ${OpenMP_CXX_FLAGS}")
it still works
Strange, doesn't work for me.
Works now with your changes from #12 . Closing.
Another possible solution to this may had have been adding
extern "C"
This issue becomes relevant again, because alpaka doesn't like explicit template instantiations, see https://github.com/ComputationalRadiationPhysics/alpaka/issues/183#issuecomment-190737087 A solution to the problem in that comment is using a dummy function with CUPLA_KERNEL
calls, implicitely instantiating only the device version of a kernel, not both, host and device.
In the current
CMakeLists.txt
on therefactoring
branch (by now the most up to date), no parameters for compiler optimizations are given. This defaults to no optimization (at least on my machine).When turning on optimization with anything higher than
-O0
(e.g.-O1
,-O2
and so on) linking the example binary fails withRight now I have no idea where to start investigating into this. As this is not game breaking at the moment and this is your code, I'd like to ask you, @mxmlnkn to look into this when you have some sparse time. But as this library is intended to be fast, compiler optimizations should be possible at least right before the final release.
Maybe it's just an error in the
CMakeLists.txt
that I don't get right now so the first step could be that you could try your old Makefiles with enabled optimizations.