cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
stgateizo
Explorer
Explorer
642 Views
Registered: ‎10-07-2016

How to share source files in Vitis

Dear colleagues,

In Vitis 2020.1 i have created a system project, which contains two application projects named project A and project B.
The two application projects are very similar in functionaility, and therefore I want to share some c-source and header files from project A, which shall be used in project B. There shall only exist one source /header file for both projects.

Currently all source files are located in project A (T:\V2.1\vitis\HDMI_TX1\src). I have imported the source files which shall be shared by using the option "Create links in workspace" as depicted below:

pic.PNG

Well the shared source files appears now in project B (T:\V2.1\vitis\HDMI_TX2\src) with the link symbol in the lower right corner.

Pic.PNG

When I change the file in project B, the file is also changed in project A. This is exaclty what I'm looking for. So far so good !

But when I start compiling project B, the compiler complains, that it is not able to find the header file "axi_gpio.h", although it is visible as linked source file in the soruce folder of Project B.

What else do I have to do to get it running?

Best regards

stgateizo

0 Kudos
9 Replies
stgateizo
Explorer
Explorer
598 Views
Registered: ‎10-07-2016

No one who can answer this question ?

 

0 Kudos
stgateizo
Explorer
Explorer
549 Views
Registered: ‎10-07-2016

Hi all,

found the answer for my question on my own. Somebody in the forum had a similar issue with SDK. You still have to add the source path for the linked source files in C/C++ Build->Settings->Directories->IncludePath.

Here is the solution, which works also for VITIS.

https://forums.xilinx.com/t5/Embedded-Development-Tools/SDK-linked-source-file-error-quot-No-such-file-quot/m-p/742433

Regards

stgateizo

stgateizo
Explorer
Explorer
477 Views
Registered: ‎10-07-2016

Hi all,

actually I thought that I have found a the solution for my problem, but I was wrong !

When I include a path in project B, which points to the source files of project A (HDMI_TX1), then I'm able to compile project B properly, but then project A is no longer compiling !!!

Pic2.PNG

In project A, I get a problem a problem with a Xparameter define, which is no longer found, although the xparameter.h file is visible in the bsp of project A!

How can this be? Project A compiles properly, as long as the path in project B is not included. It is strange that a setting in project B influences the compilation of project A

Can anybody help?

regards

stgateizo

0 Kudos
olupj
Explorer
Explorer
464 Views
Registered: ‎01-27-2008

@stgateizo 

I haven't done this, but have you tried symbolic links?

ln -sf <target file> <link name>

Should work, then you keep one file in two "places", equally accessible.

 

 

0 Kudos
stgateizo
Explorer
Explorer
457 Views
Registered: ‎10-07-2016

Hi olupj,

it may work under linux, but I'm on Windows. I assume this does not work for Windows ?

 

0 Kudos
olupj
Explorer
Explorer
437 Views
Registered: ‎01-27-2008

There is a linking capability in windows, check it out.

Bottom line: try to take advantage of your OS utilities.

0 Kudos
stgateizo
Explorer
Explorer
414 Views
Registered: ‎10-07-2016

Hi Olupj,

thank you for this advice.

If I follow your suggestion, then I will link all files which are in the src folder of project A. But I do not want to link all source files from project A to project B. I only want to link some files.

Well I could split up the source files in shared sources and non-shared sources, by putting them into two different folders, for example a src/non_shared and a src/shared folder. By this way you could just link the shared sources as you suggested. But then I need to know what else have to be done, in order to support two differnt source folders. I assume there must be added some paths in the build settings?

Well it could be an option, but first I want to wait for an official answer from Xilinx how to work with shared source files. So far I didn't get any response...

Regards

stgateizo

0 Kudos
olupj
Explorer
Explorer
404 Views
Registered: ‎01-27-2008

Hi @stgateizo 

You can still do this on per-file basis with links.

Sometimes, even if the tool provides a solution (as you pointed out and tried), it's not as good as just using tools provided by the OS...

I hope they respond.

Jerry

0 Kudos
stgateizo
Explorer
Explorer
393 Views
Registered: ‎10-07-2016

Hi olupj,

 

[Olupj wrote] Sometimes, even if the tool provides a solution (as you pointed out and tried), it's not as good as just using tools provided by the OS...

Not only sometimes

stgateizo

0 Kudos