D
dwp@md1tech.co.uk
Tue, Apr 25, 2023 2:47 PM
Hello,
I have recently installed openCPI on a machine running Ubuntu. I am having trouble getting applications to run, getting the following output.
Compiling source file: example_rxToFile.cc for platform ubuntu22_04
Creating executable for "example_rxToFile" running on platform ubuntu22_04 from target-ubuntu22_04/example_rxToFile.o
Executing the example_rxToFile application.
/bin/bash: line 1: target-/example_rxToFile: No such file or directory
make: *** [/home/dwp/git/opencpi/cdk/include/application.mk:70: run] Error 127
It is outputting the compiled files into the directory target-ubuntu22_04
but then searching for them in the directory target-
.
If I rename the folder target-ubuntu22_04
to target-
the application runs. How can I specify the name of the target directory used to run applications from?
I had a look inside the makefile but I am not too familiar with the syntax and couldn’t see anything obvious.
Any help is really appreciated.
Thanks in advance,
Dan
Hello,
I have recently installed openCPI on a machine running Ubuntu. I am having trouble getting applications to run, getting the following output.
`Compiling source file: example_rxToFile.cc for platform ubuntu22_04`\
`Creating executable for "example_rxToFile" running on platform ubuntu22_04 from target-ubuntu22_04/example_rxToFile.o`\
`Executing the example_rxToFile application.`\
`/bin/bash: line 1: target-/example_rxToFile: No such file or directory`\
`make: *** [/home/dwp/git/opencpi/cdk/include/application.mk:70: run] Error 127`
It is outputting the compiled files into the directory `target-ubuntu22_04` but then searching for them in the directory `target-`.
If I rename the folder `target-ubuntu22_04` to `target-` the application runs. How can I specify the name of the target directory used to run applications from? \
I had a look inside the makefile but I am not too familiar with the syntax and couldn’t see anything obvious.
Any help is really appreciated.
Thanks in advance,\
Dan
JM
John McCabe
Tue, Apr 25, 2023 3:17 PM
As a matter of interest, which version of OpenCPI have you installed, and did you check the installation guide for what versions of Ubuntu are supported?
John McCabe
Principal Software Engineer
Kirintec Ltd
+44 (0) 1989 568350
+44 7551 547 473
jmccabe@kirintec.com
www.kirintec.com
Follow us:
.
Receipt of this e-mail is subject to conditions, view our email disclaimer. Kirintec Limited of Ross-on-Wye HR9 5PB is registered in England and Wales with the company number 6699502.
From: dwp@md1tech.co.uk dwp@md1tech.co.uk
Sent: Tuesday, April 25, 2023 3:48 PM
To: discuss@lists.opencpi.org
Subject: [Discuss OpenCPI] Help changing target directory
Hello,
I have recently installed openCPI on a machine running Ubuntu. I am having trouble getting applications to run, getting the following output.
Compiling source file: example_rxToFile.cc for platform ubuntu22_04
Creating executable for "example_rxToFile" running on platform ubuntu22_04 from target-ubuntu22_04/example_rxToFile.o
Executing the example_rxToFile application.
/bin/bash: line 1: target-/example_rxToFile: No such file or directory
make: *** [/home/dwp/git/opencpi/cdk/include/application.mk:70: run] Error 127
It is outputting the compiled files into the directory target-ubuntu22_04 but then searching for them in the directory target-.
If I rename the folder target-ubuntu22_04 to target- the application runs. How can I specify the name of the target directory used to run applications from?
I had a look inside the makefile but I am not too familiar with the syntax and couldn’t see anything obvious.
Any help is really appreciated.
Thanks in advance,
Dan
As a matter of interest, which version of OpenCPI have you installed, and did you check the installation guide for what versions of Ubuntu are supported?
John McCabe
Principal Software Engineer
Kirintec Ltd
+44 (0) 1989 568350
+44 7551 547 473
jmccabe@kirintec.com
www.kirintec.com
Follow us:
.
Receipt of this e-mail is subject to conditions, view our email disclaimer. Kirintec Limited of Ross-on-Wye HR9 5PB is registered in England and Wales with the company number 6699502.
From: dwp@md1tech.co.uk <dwp@md1tech.co.uk>
Sent: Tuesday, April 25, 2023 3:48 PM
To: discuss@lists.opencpi.org
Subject: [Discuss OpenCPI] Help changing target directory
Hello,
I have recently installed openCPI on a machine running Ubuntu. I am having trouble getting applications to run, getting the following output.
Compiling source file: example_rxToFile.cc for platform ubuntu22_04
Creating executable for "example_rxToFile" running on platform ubuntu22_04 from target-ubuntu22_04/example_rxToFile.o
Executing the example_rxToFile application.
/bin/bash: line 1: target-/example_rxToFile: No such file or directory
make: *** [/home/dwp/git/opencpi/cdk/include/application.mk:70: run] Error 127
It is outputting the compiled files into the directory target-ubuntu22_04 but then searching for them in the directory target-.
If I rename the folder target-ubuntu22_04 to target- the application runs. How can I specify the name of the target directory used to run applications from?
I had a look inside the makefile but I am not too familiar with the syntax and couldn’t see anything obvious.
Any help is really appreciated.
Thanks in advance,
Dan
DW
Dominic Walters
Tue, Apr 25, 2023 5:19 PM
Hi,
This error doesn't look immediately familiar.
Given that you are using ubuntu22_04
I take it that this is on develop
or the v2.5.0-beta
?
How are you building the application?
My immediate suggestion would be to move to the root directory and build
with:
source ./cdk/opencpi-setup.sh -r
ocpidev build -d /path/to/application/dir
If that still creates the target-
directory:
ocpidev build -d /path/to/application/dir --rcc-platform ubuntu22_04
Between the two of those, that should make sure the build code definitely
knows what the platform is and should name that directory correctly.
It looks like you're running some higher level command that does a build
and then runs the application?
Can you clarify what commands your running, and which one you think is
causing this problem?
Kind Regards,
D. Walters
On Tue, Apr 25, 2023 at 4:17 PM John McCabe jmccabe@kirintec.com wrote:
As a matter of interest, which version of OpenCPI have you installed, and
did you check the installation guide for what versions of Ubuntu are
supported?
John McCabe
Principal Software Engineer
Kirintec Ltd
+44 (0) 1989 568350
+44 7551 547 473 <+44%207551%20547%20473>
jmccabe@kirintec.com jmccabe@kirintec.com
www.kirintec.com http://www.kirintec.com/
Follow us:
https://en-gb.facebook.com/Kirintec/
https://uk.linkedin.com/company/kirintec
https://twitter.com/KirintecLtd
[image: Kirintec Events and News] https://www.kirintec.com/events-news/
.
https://www.kirintec.com/
Receipt of this e-mail is subject to conditions, view our
email disclaimer https://www.kirintec.com/terms-and-conditions/.
Kirintec Limited of Ross-on-Wye HR9 5PB is registered in England and Wales
with the company number 6699502.
From: dwp@md1tech.co.uk dwp@md1tech.co.uk
Sent: Tuesday, April 25, 2023 3:48 PM
To: discuss@lists.opencpi.org
Subject: [Discuss OpenCPI] Help changing target directory
Hello,
I have recently installed openCPI on a machine running Ubuntu. I am having
trouble getting applications to run, getting the following output.
Compiling source file: example_rxToFile.cc for platform ubuntu22_04
Creating executable for "example_rxToFile" running on platform ubuntu22_04
from target-ubuntu22_04/example_rxToFile.o
Executing the example_rxToFile application.
/bin/bash: line 1: target-/example_rxToFile: No such file or directory
make: *** [/home/dwp/git/opencpi/cdk/include/application.mk:70: run]
Error 127
It is outputting the compiled files into the directory target-ubuntu22_04
but then searching for them in the directory target-.
If I rename the folder target-ubuntu22_04 to target- the application
runs. How can I specify the name of the target directory used to run
applications from?
I had a look inside the makefile but I am not too familiar with the syntax
and couldn’t see anything obvious.
Any help is really appreciated.
Thanks in advance,
Dan
discuss mailing list -- discuss@lists.opencpi.org
To unsubscribe send an email to discuss-leave@lists.opencpi.org
Hi,
This error doesn't look immediately familiar.
Given that you are using `ubuntu22_04` I take it that this is on `develop`
or the `v2.5.0-beta`?
How are you building the application?
My immediate suggestion would be to move to the root directory and build
with:
```bash
source ./cdk/opencpi-setup.sh -r
ocpidev build -d /path/to/application/dir
```
If that still creates the `target-` directory:
```bash
ocpidev build -d /path/to/application/dir --rcc-platform ubuntu22_04
```
Between the two of those, that should make sure the build code definitely
knows what the platform is and should name that directory correctly.
It looks like you're running some higher level command that does a build
and then runs the application?
Can you clarify what commands your running, and which one you think is
causing this problem?
Kind Regards,
D. Walters
On Tue, Apr 25, 2023 at 4:17 PM John McCabe <jmccabe@kirintec.com> wrote:
> As a matter of interest, which version of OpenCPI have you installed, and
> did you check the installation guide for what versions of Ubuntu are
> supported?
>
>
> John McCabe
> Principal Software Engineer
> Kirintec Ltd
>
> +44 (0) 1989 568350
> *+44 7551 547 473* <+44%207551%20547%20473>
>
> *jmccabe@kirintec.com* <jmccabe@kirintec.com>
>
> *www.kirintec.com* <http://www.kirintec.com/>
> Follow us:
> <https://en-gb.facebook.com/Kirintec/>
> <https://uk.linkedin.com/company/kirintec>
> <https://twitter.com/KirintecLtd>
>
>
>
> [image: Kirintec Events and News] <https://www.kirintec.com/events-news/>
>
> .
>
> <https://www.kirintec.com/>
> Receipt of this e-mail is subject to conditions, *view our
> email disclaimer* <https://www.kirintec.com/terms-and-conditions/>.
> Kirintec Limited of Ross-on-Wye HR9 5PB is registered in England and Wales
> with the company number 6699502.
>
> *From:* dwp@md1tech.co.uk <dwp@md1tech.co.uk>
> *Sent:* Tuesday, April 25, 2023 3:48 PM
> *To:* discuss@lists.opencpi.org
> *Subject:* [Discuss OpenCPI] Help changing target directory
>
>
>
> Hello,
>
> I have recently installed openCPI on a machine running Ubuntu. I am having
> trouble getting applications to run, getting the following output.
>
> Compiling source file: example_rxToFile.cc for platform ubuntu22_04
> Creating executable for "example_rxToFile" running on platform ubuntu22_04
> from target-ubuntu22_04/example_rxToFile.o
> Executing the example_rxToFile application.
> /bin/bash: line 1: target-/example_rxToFile: No such file or directory
> make: *** [/home/dwp/git/opencpi/cdk/include/application.mk:70: run]
> Error 127
>
> It is outputting the compiled files into the directory target-ubuntu22_04
> but then searching for them in the directory target-.
>
> If I rename the folder target-ubuntu22_04 to target- the application
> runs. How can I specify the name of the target directory used to run
> applications from?
> I had a look inside the makefile but I am not too familiar with the syntax
> and couldn’t see anything obvious.
>
> Any help is really appreciated.
>
> Thanks in advance,
> Dan
> _______________________________________________
> discuss mailing list -- discuss@lists.opencpi.org
> To unsubscribe send an email to discuss-leave@lists.opencpi.org
>
D
dwp@md1tech.co.uk
Wed, Apr 26, 2023 9:54 AM
Hi John and Dominic,
I am running develop
and using ubuntu22_04 so yes according to the installation guide, it is supported.
I found a solution to this, there must have been something that went wrong during the installation as I did not have the OCPI_TARGET_*
environment variables set. To fix this I ran source "$OCPI_CDK_DIR/scripts/ocpitarget.sh" "$1"
.
I am not sure why this wasn’t done correctly by the install-opencpi.sh script on line 119 but doing it manually appears to have fixed it.
Thank you both for your suggestions,
Dan
Hi John and Dominic,
I am running `develop` and using ubuntu22_04 so yes according to the installation guide, it is supported.
I found a solution to this, there must have been something that went wrong during the installation as I did not have the `OCPI_TARGET_*` environment variables set. To fix this I ran `source "$OCPI_CDK_DIR/scripts/ocpitarget.sh" "$1"`.
I am not sure why this wasn’t done correctly by the **install-opencpi.sh** script on line 119 but doing it manually appears to have fixed it.
Thank you both for your suggestions,\
Dan
DW
Dominic Walters
Wed, Apr 26, 2023 10:41 AM
Hi,
The TARGET
variables should only be used when cross compiling, AFAIK. It
should be the TOOL
variables that need to be set.
I'm pretty sure source. /cdk/opencpi-setup.sh -r
sets those variables.
After installation you should be prompted (either in the install guide, or
by the installer) to add the above source
line to your .bashrc
.
That environment is not maintained between shell sessions, so you'll need
to source that file for every new terminal you open.
Can you try unset
those TARGET
variables, source
as above, and then
check which TOOL
variables get set (export | grep OCPI
)?
If OCPI_TOOL_PLATFORM
is not getting set to ubuntu22_04
then that's a
problem.
Kind Regards,
D. Walters
On Wed, 26 Apr 2023, 10:54 , dwp@md1tech.co.uk wrote:
Hi John and Dominic,
I am running develop and using ubuntu22_04 so yes according to the
installation guide, it is supported.
I found a solution to this, there must have been something that went wrong
during the installation as I did not have the OCPI_TARGET_* environment
variables set. To fix this I ran
source "$OCPI_CDK_DIR/scripts/ocpitarget.sh" "$1".
I am not sure why this wasn’t done correctly by the *install-opencpi.sh *script
on line 119 but doing it manually appears to have fixed it.
Thank you both for your suggestions,
Dan
discuss mailing list -- discuss@lists.opencpi.org
To unsubscribe send an email to discuss-leave@lists.opencpi.org
Hi,
The `TARGET` variables should only be used when cross compiling, AFAIK. It
should be the `TOOL` variables that need to be set.
I'm pretty sure `source. /cdk/opencpi-setup.sh -r` sets those variables.
After installation you should be prompted (either in the install guide, or
by the installer) to add the above `source` line to your `.bashrc`.
That environment is not maintained between shell sessions, so you'll need
to source that file for every new terminal you open.
Can you try `unset` those `TARGET` variables, `source` as above, and then
check which `TOOL` variables get set (`export | grep OCPI`)?
If `OCPI_TOOL_PLATFORM` is not getting set to `ubuntu22_04` then that's a
problem.
Kind Regards,
D. Walters
On Wed, 26 Apr 2023, 10:54 , <dwp@md1tech.co.uk> wrote:
> Hi John and Dominic,
>
> I am running develop and using ubuntu22_04 so yes according to the
> installation guide, it is supported.
>
> I found a solution to this, there must have been something that went wrong
> during the installation as I did not have the OCPI_TARGET_* environment
> variables set. To fix this I ran
> source "$OCPI_CDK_DIR/scripts/ocpitarget.sh" "$1".
>
> I am not sure why this wasn’t done correctly by the *install-opencpi.sh *script
> on line 119 but doing it manually appears to have fixed it.
>
> Thank you both for your suggestions,
> Dan
> _______________________________________________
> discuss mailing list -- discuss@lists.opencpi.org
> To unsubscribe send an email to discuss-leave@lists.opencpi.org
>
D
dwp@md1tech.co.uk
Wed, Apr 26, 2023 11:34 AM
Hi,
The TOOL
variables were indeed set. I unset them and ran the source
command and they returned to the same values:
OCPI_TOOL_OS
=linux
OCPI_TOOL_PLATFORM
=ubuntu22_04
OCPI_TOOL_ARCH
=x86_64
OCPI_TOOL_DIR
=ubuntu22_04
OCPI_TOOL_OS_VERSION
=u22_04
OCPI_TOOL_PLATFORM_DIR
=/home/dwp/git/opencpi/project-registry/ocpi.core/exports/rcc/platforms/ubuntu22_04
Running the source
command also removed the TARGET
variables and the problem returned when attempting ocpidev run
application example_rxToFile
giving the following output:
/bin/bash: line 1: target-/example_rxToFile: No such file or directory
make: *** [/home/dwp/git/opencpi/cdk/include/application.mk:70: run] Error 127
It is only when OCPI_TARGET_DIR
is set toubuntu_22_04
that the application runs. I can see that this variable is used in the file
<opencpi-root-dir>/cdk/include/application.mk
on line 63.
Thanks,
Dan
Hi,
The `TOOL` variables were indeed set. I unset them and ran the `source` command and they returned to the same values:
**`OCPI_TOOL_OS`**`=linux`\
**`OCPI_TOOL_PLATFORM`**`=ubuntu22_04`\
**`OCPI_TOOL_ARCH`**`=x86_64`\
**`OCPI_TOOL_DIR`**`=ubuntu22_04`\
**`OCPI_TOOL_OS_VERSION`**`=u22_04`\
**`OCPI_TOOL_PLATFORM_DIR`**`=/home/dwp/git/opencpi/project-registry/ocpi.core/exports/rcc/platforms/ubuntu22_04`
Running the `source` command also removed the `TARGET` variables and the problem returned when attempting `ocpidev run`\
`application example_rxToFile` giving the following output:
`/bin/bash: line 1: target-/example_rxToFile: No such file or directory`\
`make: *** [/home/dwp/git/opencpi/cdk/include/application.mk:70: run] Error 127`
It is only when `OCPI_TARGET_DIR `is set to` ubuntu_22_04 `that the application runs. I can see that this variable is used in the file\
`<opencpi-root-dir>/cdk/include/application.mk` on line 63.
Thanks,\
Dan
JK
James Kulp
Wed, Apr 26, 2023 2:43 PM
Both TOOL and TARGET variables are automatically set internally as/where
needed. They are not part of the documented interface.
TOOL variables control what tools are run (among those that OpenCPI
builds, like ocpigen), and are currently set /determined by the sourced
opencpi-setup.sh.
TARGET variables are set internally in some places when you are building
or running (via ocpidev) and default to the TOOL variables if no target
RCC platform is specified.
A recent change in "develop" fixed a set of issues involving optimized
vs. unoptimized targets - i.e. where you install opencpi unoptimized,
and then also install it optimized.
AFAICT it was tested in various combinations of installation sequences,
but is still busted in develop for this case, and doing "export
OCPI_TARGET_DIR=$OCPI_TOOL_DIR" after sourcing opencpi-setup.sh is a
workaround.
Jim
On 4/26/23 7:34 AM, dwp@md1tech.co.uk wrote:
Hi,
The |TOOL| variables were indeed set. I unset them and ran the
|source| command and they returned to the same values:
|OCPI_TOOL_OS||=linux
||OCPI_TOOL_PLATFORM||=ubuntu22_04
||OCPI_TOOL_ARCH||=x86_64
||OCPI_TOOL_DIR||=ubuntu22_04
||OCPI_TOOL_OS_VERSION||=u22_04
||OCPI_TOOL_PLATFORM_DIR||=/home/dwp/git/opencpi/project-registry/ocpi.core/exports/rcc/platforms/ubuntu22_04|
Running the |source| command also removed the |TARGET| variables and
the problem returned when attempting |ocpidev run
application example_rxToFile| giving the following output:
|/bin/bash: line 1: target-/example_rxToFile: No such file or directory
make: *** [/home/dwp/git/opencpi/cdk/include/application.mk:70: run]
Error 127|
It is only when |OCPI_TARGET_DIR |is set to|ubuntu_22_04 |that the
application runs. I can see that this variable is used in the file
|<opencpi-root-dir>/cdk/include/application.mk| on line 63.
Thanks,
Dan
discuss mailing list --discuss@lists.opencpi.org
To unsubscribe send an email todiscuss-leave@lists.opencpi.org
Both TOOL and TARGET variables are automatically set internally as/where
needed. They are not part of the documented interface.
TOOL variables control what tools are run (among those that OpenCPI
builds, like ocpigen), and are currently set /determined by the sourced
opencpi-setup.sh.
TARGET variables are set internally in some places when you are building
or running (via ocpidev) and default to the TOOL variables if no target
RCC platform is specified.
A recent change in "develop" fixed a set of issues involving optimized
vs. unoptimized targets - i.e. where you install opencpi unoptimized,
and then also install it optimized.
AFAICT it was tested in various combinations of installation sequences,
but is still busted in develop for this case, and doing "export
OCPI_TARGET_DIR=$OCPI_TOOL_DIR" after sourcing opencpi-setup.sh is a
workaround.
Jim
On 4/26/23 7:34 AM, dwp@md1tech.co.uk wrote:
>
> Hi,
>
> The |TOOL| variables were indeed set. I unset them and ran the
> |source| command and they returned to the same values:
>
> *|OCPI_TOOL_OS|*|=linux
> |*|OCPI_TOOL_PLATFORM|*|=ubuntu22_04
> |*|OCPI_TOOL_ARCH|*|=x86_64
> |*|OCPI_TOOL_DIR|*|=ubuntu22_04
> |*|OCPI_TOOL_OS_VERSION|*|=u22_04
> |*|OCPI_TOOL_PLATFORM_DIR|*|=/home/dwp/git/opencpi/project-registry/ocpi.core/exports/rcc/platforms/ubuntu22_04|
>
> Running the |source| command also removed the |TARGET| variables and
> the problem returned when attempting |ocpidev run
> application example_rxToFile| giving the following output:
>
> |/bin/bash: line 1: target-/example_rxToFile: No such file or directory
> make: *** [/home/dwp/git/opencpi/cdk/include/application.mk:70: run]
> Error 127|
>
> It is only when |OCPI_TARGET_DIR |is set to|ubuntu_22_04 |that the
> application runs. I can see that this variable is used in the file
> |<opencpi-root-dir>/cdk/include/application.mk| on line 63.
>
> Thanks,
> Dan
>
>
> _______________________________________________
> discuss mailing list --discuss@lists.opencpi.org
> To unsubscribe send an email todiscuss-leave@lists.opencpi.org
DW
Dominic Walters
Wed, Apr 26, 2023 2:43 PM
Hi,
Right, my local cdk/include/application.mk
uses OCPI_TOOL_DIR
, not
OCPI_TARGET_DIR
on line 63.
Looks like this was erroneously changed in !1075
https://gitlab.com/opencpi/opencpi/-/merge_requests/1075/diffs#e4890d4e4f9670ca41088cb1537380f349dee4dc
.
I'll make a bug report.
Fix here is to change that line to use OCPI_TOOL_DIR
.
Kind Regards,
D. Walters
Hi,
Right, my local `cdk/include/application.mk` uses `OCPI_TOOL_DIR`, not
`OCPI_TARGET_DIR` on line 63.
Looks like this was erroneously changed in !1075
<https://gitlab.com/opencpi/opencpi/-/merge_requests/1075/diffs#e4890d4e4f9670ca41088cb1537380f349dee4dc>
.
I'll make a bug report.
Fix here is to change that line to use `OCPI_TOOL_DIR`.
Kind Regards,
D. Walters
JK
James Kulp
Wed, Apr 26, 2023 2:49 PM
Yes, that is probably a better workaround/fix. It is still not
ultimately the correct fix (since it does not allow for running what you
are building), but that is more work...
Just to clarify: optimized builds and unoptimized builds can both be
done and coexist, for the same platform, including the host platform.
And there are other build variants that are possible (not yet fully
supported).
So what you are building and what you are running is the "target", which
may be different than the "tool", even if the platform is the same.
Jim
On 4/26/23 10:43 AM, Dominic Walters via discuss wrote:
Yes, that is probably a better workaround/fix. It is still not
ultimately the correct fix (since it does not allow for running what you
are building), but that is more work...
Just to clarify: optimized builds and unoptimized builds can both be
done and coexist, for the same platform, including the host platform.
And there are other build variants that are possible (not yet fully
supported).
So what you are building and what you are running is the "target", which
may be different than the "tool", even if the platform is the same.
Jim
On 4/26/23 10:43 AM, Dominic Walters via discuss wrote:
> Hi,
>
> Right, my local `cdk/include/application.mk <http://application.mk>`
> uses `OCPI_TOOL_DIR`, not `OCPI_TARGET_DIR` on line 63.
> Looks like this was erroneously changed in !1075
> <https://gitlab.com/opencpi/opencpi/-/merge_requests/1075/diffs#e4890d4e4f9670ca41088cb1537380f349dee4dc>.
> I'll make a bug report.
> Fix here is to change that line to use `OCPI_TOOL_DIR`.
>
> Kind Regards,
> D. Walters
>
>
> _______________________________________________
> discuss mailing list --discuss@lists.opencpi.org
> To unsubscribe send an email todiscuss-leave@lists.opencpi.org
RT
Robert Tracy
Wed, Apr 26, 2023 3:53 PM
Both TOOL and TARGET variables are automatically set internally as/where needed. They are not part of the documented interface.
TOOL variables control what tools are run (among those that OpenCPI builds, like ocpigen), and are currently set /determined by the sourced opencpi-setup.sh.
TARGET variables are set internally in some places when you are building or running (via ocpidev) and default to the TOOL variables if no target RCC platform is specified.
At least that's the way it's supposed to work. The currently broken use case is one that wasn't tested, i.e., a build outside the context of "install-opencpi.sh" or "ocpiadmin install ...". Those two contexts (which were tested) ensure that appropriate TARGET variables get set. In other words, it's entirely possible that cases exist where TARGET variables aren't getting set where they need to be. And as Jim said, the appropriate default is the TOOL variables.
So, "export OCPI_TARGET_DIR=$OCPI_TOOL_DIR" after sourcing "opencpi-setup.sh" is an appropriate workaround in this case.
I'm mentioning this because blindly changing "OCPI_TARGET_DIR" back to "OCPI_TOOL_DIR" in "application.mk" is almost certainly wrong. The correct fix (or at least a more correct fix) would be to follow the trail upstream and determine how "application.mk" is getting called without "OCPI_TARGET_DIR" getting set. There are probably multiple places where checking to see if "OCPI_TARGET_DIR" is set is doable: the trick is finding the best place, which would be at the highest possible level in the calling sequence so you don't have to do the check/set more than once.
Please do write this up as a bug, and kindly pay particular attention to the "how to reproduce" section because there's no guarantee the person who will end up working the issue is among the people participating in this discussion.
Respectfully,
--Bob
Jim said:
> Both TOOL and TARGET variables are automatically set internally as/where needed. They are not part of the documented interface.
> TOOL variables control what tools are run (among those that OpenCPI builds, like ocpigen), and are currently set /determined by the sourced opencpi-setup.sh.
> TARGET variables are set internally in some places when you are building or running (via ocpidev) and default to the TOOL variables if no target RCC platform is specified.
At least that's the way it's supposed to work. The currently broken use case is one that wasn't tested, i.e., a build outside the context of "install-opencpi.sh" or "ocpiadmin install ...". Those two contexts (which were tested) ensure that appropriate TARGET variables get set. In other words, it's entirely possible that cases exist where TARGET variables aren't getting set where they need to be. And as Jim said, the appropriate default is the TOOL variables.
So, "export OCPI_TARGET_DIR=$OCPI_TOOL_DIR" after sourcing "opencpi-setup.sh" is an appropriate workaround in this case.
I'm mentioning this because blindly changing "OCPI_TARGET_DIR" back to "OCPI_TOOL_DIR" in "application.mk" is almost certainly wrong. The correct fix (or at least a more correct fix) would be to follow the trail upstream and determine how "application.mk" is getting called without "OCPI_TARGET_DIR" getting set. There are probably multiple places where checking to see if "OCPI_TARGET_DIR" is set is doable: the trick is finding the best place, which would be at the highest possible level in the calling sequence so you don't have to do the check/set more than once.
Please do write this up as a bug, and kindly pay particular attention to the "how to reproduce" section because there's no guarantee the person who will end up working the issue is among the people participating in this discussion.
Respectfully,
--Bob