Specifying relative path for included files

D
dwp@md1tech.co.uk
Tue, May 16, 2023 10:45 AM

Hello,

I have some a .hpp file that contains functions that can be used by multiple RCC workers.
Is there an environment variable that points to the top level of the project or some other way that I can specify the relative path to the file?

Currently I have the full path given in the RCC Worker xml Includeddirs property which works fine on my local machine but obviously this path doesn’t exist when attempting to run on other machines.  I tried using ../ from the location of the XML file but this did not work.

Thanks in advance,
Dan

Hello, I have some a .hpp file that contains functions that can be used by multiple RCC workers.\ Is there an environment variable that points to the top level of the project or some other way that I can specify the relative path to the file? Currently I have the full path given in the RCC Worker xml `Includeddirs `property which works fine on my local machine but obviously this path doesn’t exist when attempting to run on other machines. I tried using `../ `from the location of the XML file but this did not work. Thanks in advance,\ Dan
D
dwp@md1tech.co.uk
Tue, May 16, 2023 2:14 PM

Must have made a typo somewhere as using a relative path with ../ now appears to be working

Must have made a typo somewhere as using a relative path with `../` now appears to be working
AO
Aaron Olivarez
Tue, May 16, 2023 2:38 PM

Glad you got it working.

For future reference there is an environment variable you could use as a
reference point. It's called OCPI_ROOT_DIR , from there you can
access projects directory.

Aaron

On Tue, May 16, 2023 at 9:14 AM dwp@md1tech.co.uk wrote:

Must have made a typo somewhere as using a relative path with ../ now
appears to be working


discuss mailing list -- discuss@lists.opencpi.org
To unsubscribe send an email to discuss-leave@lists.opencpi.org

Glad you got it working. For future reference there is an environment variable you could use as a reference point. It's called OCPI_ROOT_DIR , from there you can access projects directory. Aaron On Tue, May 16, 2023 at 9:14 AM <dwp@md1tech.co.uk> wrote: > Must have made a typo somewhere as using a relative path with ../ now > appears to be working > _______________________________________________ > discuss mailing list -- discuss@lists.opencpi.org > To unsubscribe send an email to discuss-leave@lists.opencpi.org >
IC
Ian Chodera
Tue, May 16, 2023 2:48 PM

Hi Aaron

OCPI_ROOT_DIR seems to be where OCPI was installed - not where our project folders are - for reference Dan and I are working on a shared machine, with separate project directories

Ian Chodera
MD1 Technology Ltd.

e: iac@md1tech.co.uk
w: www.md1tech.co.uk

MD1TechnologyLtd. is registered in England & Wales with company number 09378746.
Registered address: Cheltenham Film & Photographic Studios, Hatherley Lane, Cheltenham, Gloucestershire, England. GL51 6PN.
VAT registration number: GB 206 3877 05

On 16 May 2023, at 15:38, Aaron Olivarez aaron@olivarez.info wrote:

Glad you got it working.

For future reference there is an environment variable you could use as a reference point. It's called OCPI_ROOT_DIR , from there you can access projects directory.

Aaron

On Tue, May 16, 2023 at 9:14 AM <dwp@md1tech.co.uk mailto:dwp@md1tech.co.uk> wrote:

Must have made a typo somewhere as using a relative path with ../ now appears to be working


discuss mailing list -- discuss@lists.opencpi.org mailto:discuss@lists.opencpi.org
To unsubscribe send an email to discuss-leave@lists.opencpi.org mailto:discuss-leave@lists.opencpi.org


discuss mailing list -- discuss@lists.opencpi.org
To unsubscribe send an email to discuss-leave@lists.opencpi.org

Hi Aaron > OCPI_ROOT_DIR seems to be where OCPI was installed - not where our project folders are - for reference Dan and I are working on a shared machine, with separate project directories Ian Chodera MD1 Technology Ltd. e: iac@md1tech.co.uk w: www.md1tech.co.uk  MD1TechnologyLtd. is registered in England & Wales with company number 09378746. Registered address: Cheltenham Film & Photographic Studios, Hatherley Lane, Cheltenham, Gloucestershire, England. GL51 6PN. VAT registration number: GB 206 3877 05 > On 16 May 2023, at 15:38, Aaron Olivarez <aaron@olivarez.info> wrote: > > Glad you got it working. > > For future reference there is an environment variable you could use as a reference point. It's called OCPI_ROOT_DIR , from there you can access projects directory. > > Aaron > > On Tue, May 16, 2023 at 9:14 AM <dwp@md1tech.co.uk <mailto:dwp@md1tech.co.uk>> wrote: >> Must have made a typo somewhere as using a relative path with ../ now appears to be working >> >> _______________________________________________ >> discuss mailing list -- discuss@lists.opencpi.org <mailto:discuss@lists.opencpi.org> >> To unsubscribe send an email to discuss-leave@lists.opencpi.org <mailto:discuss-leave@lists.opencpi.org> > _______________________________________________ > discuss mailing list -- discuss@lists.opencpi.org > To unsubscribe send an email to discuss-leave@lists.opencpi.org
AO
Aaron Olivarez
Tue, May 16, 2023 2:59 PM

If your project is not located inside the installed directory you can
navigate from the OCPI_ROOT_DIR to your project using the
symlinks in projects-registry. Assuming your OpenCPI project is
registered using ocpidev register project from your project directory.

Aaron

On Tue, May 16, 2023 at 9:48 AM Ian Chodera iac@md1tech.co.uk wrote:

Hi Aaron

OCPI_ROOT_DIR seems to be where OCPI was installed - not where our project
folders are - for reference Dan and I are working on a shared machine, with
separate project directories

Ian Chodera
MD1 Technology Ltd.

e: iac@md1tech.co.uk
w: www.md1tech.co.uk

[image: 9001-RGB-Logo-136x136.jpg]

MD1TechnologyLtd. is registered in England & Wales with company number
09378746.
Registered address: Cheltenham Film & Photographic Studios, Hatherley
Lane, Cheltenham, Gloucestershire, England. GL51 6PN.
VAT registration number: GB 206 3877 05

On 16 May 2023, at 15:38, Aaron Olivarez aaron@olivarez.info wrote:

Glad you got it working.

For future reference there is an environment variable you could use as a
reference point. It's called OCPI_ROOT_DIR , from there you can
access projects directory.

Aaron

On Tue, May 16, 2023 at 9:14 AM dwp@md1tech.co.uk wrote:

Must have made a typo somewhere as using a relative path with ../ now
appears to be working


discuss mailing list -- discuss@lists.opencpi.org
To unsubscribe send an email to discuss-leave@lists.opencpi.org


discuss mailing list -- discuss@lists.opencpi.org
To unsubscribe send an email to discuss-leave@lists.opencpi.org

If your project is not located inside the installed directory you can navigate from the OCPI_ROOT_DIR to your project using the symlinks in `projects-registry`. Assuming your OpenCPI project is registered using `ocpidev register project` from your project directory. Aaron On Tue, May 16, 2023 at 9:48 AM Ian Chodera <iac@md1tech.co.uk> wrote: > Hi Aaron > > OCPI_ROOT_DIR seems to be where OCPI was installed - not where our project > folders are - for reference Dan and I are working on a shared machine, with > separate project directories > > > Ian Chodera > MD1 Technology Ltd. > > e: iac@md1tech.co.uk > w: www.md1tech.co.uk > > > [image: 9001-RGB-Logo-136x136.jpg] > > > > MD1TechnologyLtd. is registered in England & Wales with company number > 09378746. > Registered address: Cheltenham Film & Photographic Studios, Hatherley > Lane, Cheltenham, Gloucestershire, England. GL51 6PN. > VAT registration number: GB 206 3877 05 > > On 16 May 2023, at 15:38, Aaron Olivarez <aaron@olivarez.info> wrote: > > Glad you got it working. > > For future reference there is an environment variable you could use as a > reference point. It's called OCPI_ROOT_DIR , from there you can > access projects directory. > > Aaron > > On Tue, May 16, 2023 at 9:14 AM <dwp@md1tech.co.uk> wrote: > >> Must have made a typo somewhere as using a relative path with ../ now >> appears to be working >> _______________________________________________ >> discuss mailing list -- discuss@lists.opencpi.org >> To unsubscribe send an email to discuss-leave@lists.opencpi.org >> > _______________________________________________ > discuss mailing list -- discuss@lists.opencpi.org > To unsubscribe send an email to discuss-leave@lists.opencpi.org > > >
DW
Dominic Walters
Tue, May 16, 2023 9:38 PM

Worth noting, I believe environment variables are not supported in XML, so
you'd need to go via Makefile if you wanted to use $OCPI_ROOT_DIR.
I'd recommend staying in XML and using ../, then to access other projects
I'd go via the imports directory in your project.
That way the relative project locations can change and the relative path
will still be correct.

On Tue, May 16, 2023 at 3:59 PM Aaron Olivarez aaron@olivarez.info wrote:

If your project is not located inside the installed directory you can
navigate from the OCPI_ROOT_DIR to your project using the
symlinks in projects-registry. Assuming your OpenCPI project is
registered using ocpidev register project from your project directory.

Aaron

On Tue, May 16, 2023 at 9:48 AM Ian Chodera iac@md1tech.co.uk wrote:

Hi Aaron

OCPI_ROOT_DIR seems to be where OCPI was installed - not where our
project folders are - for reference Dan and I are working on a shared
machine, with separate project directories

Ian Chodera
MD1 Technology Ltd.

e: iac@md1tech.co.uk
w: www.md1tech.co.uk

[image: 9001-RGB-Logo-136x136.jpg]

MD1TechnologyLtd. is registered in England & Wales with company number
09378746.
Registered address: Cheltenham Film & Photographic Studios, Hatherley
Lane, Cheltenham, Gloucestershire, England. GL51 6PN.
VAT registration number: GB 206 3877 05

On 16 May 2023, at 15:38, Aaron Olivarez aaron@olivarez.info wrote:

Glad you got it working.

For future reference there is an environment variable you could use as a
reference point. It's called OCPI_ROOT_DIR , from there you can
access projects directory.

Aaron

On Tue, May 16, 2023 at 9:14 AM dwp@md1tech.co.uk wrote:

Must have made a typo somewhere as using a relative path with ../ now
appears to be working


discuss mailing list -- discuss@lists.opencpi.org
To unsubscribe send an email to discuss-leave@lists.opencpi.org


discuss mailing list -- discuss@lists.opencpi.org
To unsubscribe send an email to discuss-leave@lists.opencpi.org


discuss mailing list -- discuss@lists.opencpi.org
To unsubscribe send an email to discuss-leave@lists.opencpi.org

Worth noting, I believe environment variables are not supported in XML, so you'd need to go via Makefile if you wanted to use $OCPI_ROOT_DIR. I'd recommend staying in XML and using `../`, then to access other projects I'd go via the `imports` directory in your project. That way the relative project locations can change and the relative path will still be correct. On Tue, May 16, 2023 at 3:59 PM Aaron Olivarez <aaron@olivarez.info> wrote: > If your project is not located inside the installed directory you can > navigate from the OCPI_ROOT_DIR to your project using the > symlinks in `projects-registry`. Assuming your OpenCPI project is > registered using `ocpidev register project` from your project directory. > > Aaron > > > > On Tue, May 16, 2023 at 9:48 AM Ian Chodera <iac@md1tech.co.uk> wrote: > >> Hi Aaron >> >> OCPI_ROOT_DIR seems to be where OCPI was installed - not where our >> project folders are - for reference Dan and I are working on a shared >> machine, with separate project directories >> >> >> Ian Chodera >> MD1 Technology Ltd. >> >> e: iac@md1tech.co.uk >> w: www.md1tech.co.uk >> >> >> [image: 9001-RGB-Logo-136x136.jpg] >> >> >> >> MD1TechnologyLtd. is registered in England & Wales with company number >> 09378746. >> Registered address: Cheltenham Film & Photographic Studios, Hatherley >> Lane, Cheltenham, Gloucestershire, England. GL51 6PN. >> VAT registration number: GB 206 3877 05 >> >> On 16 May 2023, at 15:38, Aaron Olivarez <aaron@olivarez.info> wrote: >> >> Glad you got it working. >> >> For future reference there is an environment variable you could use as a >> reference point. It's called OCPI_ROOT_DIR , from there you can >> access projects directory. >> >> Aaron >> >> On Tue, May 16, 2023 at 9:14 AM <dwp@md1tech.co.uk> wrote: >> >>> Must have made a typo somewhere as using a relative path with ../ now >>> appears to be working >>> _______________________________________________ >>> discuss mailing list -- discuss@lists.opencpi.org >>> To unsubscribe send an email to discuss-leave@lists.opencpi.org >>> >> _______________________________________________ >> discuss mailing list -- discuss@lists.opencpi.org >> To unsubscribe send an email to discuss-leave@lists.opencpi.org >> >> >> _______________________________________________ > discuss mailing list -- discuss@lists.opencpi.org > To unsubscribe send an email to discuss-leave@lists.opencpi.org >