Skip to content

Commit

Permalink
CMakeLists: Split Host Code
Browse files Browse the repository at this point in the history
Compile host code separately without nvcc
"code splitting" and link it statically.
  • Loading branch information
ax3l committed Jan 24, 2017
1 parent 5797f12 commit 1ce79f6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
12 changes: 8 additions & 4 deletions src/picongpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,19 @@ include_directories(BEFORE ${PIC_EXTENSION_PATH}/include)
# Compile & Link PIConGPU
################################################################################

file(GLOB CUDASRCFILES "*.cu")
file(GLOB SRCFILES "*.cpp")
file(GLOB_RECURSE CUDASRCFILES "*.cu")
file(GLOB_RECURSE SRCFILES "*.cpp")

add_library(picongpu-hostonly
STATIC
${SRCFILES}
)

cuda_add_executable(picongpu
${CUDASRCFILES}
${SRCFILES}
)

target_link_libraries(picongpu ${LIBS} m)
target_link_libraries(picongpu ${LIBS} picongpu-hostonly m)

################################################################################
# Install PIConGPU
Expand Down
3 changes: 2 additions & 1 deletion src/picongpu/include/plugins/common/particlePatches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/

#include "particlePatches.hpp"
#include "plugins/common/particlePatches.hpp"


namespace picongpu
{
Expand Down
3 changes: 2 additions & 1 deletion src/picongpu/include/plugins/common/stringHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/

#include "stringHelpers.hpp"
#include "plugins/common/stringHelpers.hpp"


namespace picongpu
{
Expand Down
3 changes: 2 additions & 1 deletion src/picongpu/include/plugins/hdf5/openPMD/patchReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

#if( ENABLE_HDF5 == 1 )

# include "patchReader.hpp"
# include "plugins/hdf5/openPMD/patchReader.hpp"


namespace picongpu
{
Expand Down

0 comments on commit 1ce79f6

Please sign in to comment.