Hi
The newer versions of Purebasic for Linux requires the PUREBASIC_HOME variable to be set. I am not a Linux guru and I am not sure how to make this permanent so that it is available when I login or when a daemon runs etc. I have third party tool that will compile Purebasic on the fly when it detects a change. It works perfectly with PB 5.73 and compiles the changed files. However, it does not compile the file with PB 6.20. The PB 6.20 compilers all work and I have tested the standby features and they work. So I am wondering if the environment variable is missing when the daemon runs under another user. Therefore I am wondering how this should be configured so it is available to everyone and everything that runs on the server.
Thanks,
Simon
Linux Environment Variables
Linux Environment Variables
Simon White
dCipher Computing
dCipher Computing
Re: Linux Environment Variables
I have never used the PUREBASIC_HOME variable before.
So far I have always opened and started or compiled the files directly from the IDE.
An exception is when I start the pbcompiler from the terminal.
There I have started a bash script before to have all necessary settings and to use different compilers.
So far I have always opened and started or compiled the files directly from the IDE.
An exception is when I start the pbcompiler from the terminal.
There I have started a bash script before to have all necessary settings and to use different compilers.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Linux Environment Variables
I didn't tried yet, but did you check the second answer here ?
https://stackoverflow.com/questions/164 ... nux-system
https://stackoverflow.com/questions/164 ... nux-system
Re: Linux Environment Variables
I don't use the global environment setting because I use different PB versions on Linux.
If I need the pbcompiler in the terminal, I start a new bash in this script.
Thus, the environment settings are only valid for the running bash.
Don't forget to set the permission as program
pb.sh [path_to_purebasic_home]
If I need the pbcompiler in the terminal, I start a new bash in this script.
Thus, the environment settings are only valid for the running bash.
Don't forget to set the permission as program
pb.sh [path_to_purebasic_home]
Code: Select all
#!/bin/bash
# Test mandatory PureBasic path parameter
if [ -z "$1" ]; then
echo "Invalid parameters: Missing argument for target PureBasic directory"
exit 1
fi
# Set PUREBASIC_HOME and ensure compiler and IDE are in the PATH
export PUREBASIC_HOME=$1
export PATH="$PUREBASIC_HOME/compilers:$PUREBASIC_HOME:$PATH"
# Test if the PureBasic home is valid
if [ -f "$PUREBASIC_HOME/compilers/pbcompiler" ]; then
echo "Start terminal for pbcompiler"
#purebasic
bash
else
echo "Invalid path for target PureBasic directory"
exit 1
fi
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Linux Environment Variables
No I have not tried it yet. I did add the PUREBASIC_HOME variable to the /etc/environment file and that seems to work for when I log in. I do not know yet whether that helps with daemons etc.Fred wrote: Thu Mar 06, 2025 10:31 am I didn't tried yet, but did you check the second answer here ?
https://stackoverflow.com/questions/164 ... nux-system
Simon White
dCipher Computing
dCipher Computing
Re: Linux Environment Variables
you will probably need to restart the deamon
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Re: Linux Environment Variables
Permanently setting environment variables:
For systemd daemons/services
https://serverfault.com/a/413408
For init.d you have a starter script reacting to start/stop commands usually which can be edited.
For login shells use .bashrc/.profile/... as usual.
For systemd daemons/services
https://serverfault.com/a/413408
For init.d you have a starter script reacting to start/stop commands usually which can be edited.
For login shells use .bashrc/.profile/... as usual.
bye,
Daniel
Daniel