Skip to content

Cmake rework#19

Open
yuguen wants to merge 22 commits intomasterfrom
cmake-rework
Open

Cmake rework#19
yuguen wants to merge 22 commits intomasterfrom
cmake-rework

Conversation

@yuguen
Copy link
Owner

@yuguen yuguen commented Nov 16, 2022

No description provided.

yuguen added 10 commits November 8, 2022 05:54
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Copy link

@whitepau whitepau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor changes. FYI the link.txt does not appear on Windows, and when i try to compile, I get this error and cannot debug it:

D:\whitepau\build_2023-0>nmake fpga_emu

Microsoft (R) Program Maintenance Utility Version 14.27.29111.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Scanning dependencies of target displayEmulationCommands
[ 25%] Find the compile command in D:/whitepau/build_2023-0/compile_commands.json (the one using FPGA_EMULATOR) and the link command in D:/whitepau/build_2023-0/CMakeFiles/fpga_emu.dir/link.txt
[ 25%] Built target displayEmulationCommands
Scanning dependencies of target fpga_emu
[ 50%] Building CXX object CMakeFiles/fpga_emu.dir/src/fpga_template.cpp.obj
Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version 2023.0.0 Build 20221201
Copyright (C) 1985-2022 Intel Corporation. All rights reserved.

[ 75%] Building CXX object CMakeFiles/fpga_emu.dir/src/source2.cpp.obj
Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version 2023.0.0 Build 20221201
Copyright (C) 1985-2022 Intel Corporation. All rights reserved.

NMAKE : fatal error U1073: don't know how to make '\Qactypes'
Stop.
NMAKE : fatal error U1077: 'C:\devstudio2019\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\nmake.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\devstudio2019\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\nmake.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\devstudio2019\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\nmake.exe' : return code '0x2'
Stop.

D:\whitepau\build_2023-0>

Comment on lines +83 to +84
# Sanitize the include path
separate_arguments(INCLUDEPATHS_LIST)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Sanitize the include path
separate_arguments(INCLUDEPATHS_LIST)
# Sanitize the include path
if (WIN32)
separate_arguments(INCLUDEPATHS_LIST WINDOWS_COMMAND ${INCLUDEPATHS_LIST})
endif(WIN32)
if (UNIX)
separate_arguments(INCLUDEPATHS_LIST UNIX_COMMAND ${INCLUDEPATHS_LIST})
endif(UNIX)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the point of this

Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Copy link

@whitepau whitepau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here are some improvements to add link files support.

Note that the outputs don't reflect the linker arguments:


To link manually:
/p/psg/swip/hld/r/sycl/rel/20221202/linux64/bin/icpx -fsycl -fintelfpga -qactypes -o libsample.fpga_emu CMakeFiles/fpga_emu.dir/src/fpga_template.cpp.o CMakeFiles/fpga_emu.dir/src/functionality.cpp.o

From VERBOSE=1:

/p/psg/swip/hld/r/sycl/rel/20221202/linux64/bin/icpx      CMakeFiles/fpga_emu.dir/src/fpga_template.cpp.o CMakeFiles/fpga_emu.dir/src/functionality.cpp.o  -o libsample.fpga_emu  -L/nfs/site/disks/swuser_work_whitepau/ff-lib/lib -Wl,-rpath,/nfs/site/disks/swuser_work_whitepau/ff-lib/lib -lff -fsycl -fintelfpga -qactypes 

A working version is here: https://github.com/intel-sandbox/whitepau.ff-example


# Use cmake -DUSER_INCLUDE_PATHS=<paths> to set extra paths for general
# compilation.
set(USER_INCLUDE_PATHS "${USER_INCLUDE_PATHS} ../../../include")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set(USER_INCLUDE_PATHS "${USER_INCLUDE_PATHS} ../../../include")
set(USER_INCLUDE_PATHS "${USER_INCLUDE_PATHS} ../../../include /nfs/site/disks/swuser_work_whitepau/ff-lib/include")
# Use cmake -DUSER_LIB_PATHS=<paths> to set extra paths to target_link_libraries
set(USER_LIB_PATHS "${USER_LIB_PATHS} /nfs/site/disks/swuser_work_whitepau/ff-lib/lib")
# Use cmake -DUSER_LIBS=<libs> to add extra static libraries
set(USER_LIBS "${USER_LIBS} ff")

you don't have to include the ff library that I used

yuguen and others added 5 commits December 20, 2022 17:43
Co-authored-by: Paul White <paul.white@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Copy link

@whitepau whitepau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some small changes

yuguen added 3 commits January 3, 2023 05:52
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
Signed-off-by: Yohann Uguen <yohann.uguen@intel.com>
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

Successfully merging this pull request may close these issues.

2 participants