Any reliable Linux IDE for PB?

Linux specific forum
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Any reliable Linux IDE for PB?

Post by Justin »

I am really fed up with the PB IDE crashing every 10 seconds, coding is impossible.
So i am looking for alternatives, so far i just googled and found these ones:
http://blog.agileactors.com/blog/2017/1 ... d-compared

I am testing Geany right now.
I just need something that can be configured with the pbcompiler, syntax highlighting, maybe project support, just the basic things to get you coding in pb.
Does anyone have any experience and could post opinions and a little guide for a quick set up?
I know there are more people with this problem, maybe we could start trying that list and post the results.
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: Any reliable Linux IDE for PB?

Post by Justin »

I did quick test with Geany but failed:

If you go to Build > Set Build Commands
In the Execute commands fill:
In the 'Command' editbox: your_pb_compilers_path/pbcompiler -h
Launches the pbcompiler and shows the help.

But: your_pb_compilers_path/pbcompiler %d/%e.pb

Shows

******************************************
PureBasic 5.62 (Linux - x64)
******************************************

Loading external modules...
Error: Can't load OS libraries, please re-install PureBasic.


------------------
(program exited with code: 1)
Press return to continue

I tried setting the working directory to the purebasic/compilers/ and does not work,
any hints?
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: Any reliable Linux IDE for PB?

Post by Justin »

Every single program i try vs code, code blocks.. i keep getting the same error, what am i missing?
vs code seems the best.
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: Any reliable Linux IDE for PB?

Post by Justin »

I read the INSTALL file on pb dir and used method 2.
Now i can compile from any terminal and the exe launches normaly, but when i try to compile from those ide programs the pbcompiler launches, compiles the program but it is not executed, a file purebasic.out is created.
Any help?
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: Any reliable Linux IDE for PB?

Post by Justin »

Got it to work in code blocks

in geany only works with files in the local hd not in usb

vs code does not work

does not work means it compiles but does not launch the exe, maybe a permissions issue?

any help will be appreciated.
User avatar
mk-soft
Always Here
Always Here
Posts: 5334
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Any reliable Linux IDE for PB?

Post by mk-soft »

I found this...
Link viewtopic.php?f=15&t=70470

It's easier:
- Open your "personal folder".
- Show hidden files
- edit the file".bashrc"

Add the following lines
export PUREBASIC_HOME=[path to purebasic] - example: /home/yourname/Apps/purebasic-v562
export PATH=$PUREBASIC_HOME/compilers:$PATH
Save ".bashrc"

P.S. The pbcompiler need the envoirment variable "PUREBASIC_HOME"
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
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: Any reliable Linux IDE for PB?

Post by Justin »

I also did that, from any terminal it works and launches the pb exe using
pbcompiler file.pb

But with those programs when configuring the tools passing that command line they only compile the executable, and don't run it.
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Any reliable Linux IDE for PB?

Post by Marc56us »

(Linux Slackware 14.2 - Purebasic 5.62 x64 in ~/Documents/purebasic)
Hello.pb

Code: Select all

OpenConsole()
PrintN("Hello World")
Input()
$ PS1='\w \$ '
~/Documents $ purebasic/compilers/pbcompiler Hello.pb

******************************************
PureBasic 5.62 (Linux - x64)
******************************************

Loading external modules...
Error: Can't load OS libraries, please re-install PureBasic.


~/Documents $ export PUREBASIC_HOME=~/Documents/purebasic

~/Documents $ echo $PUREBASIC_HOME
/home/marc/Documents/purebasic

~/Documents $ purebasic/compilers/pbcompiler Hello.pb -e Hello

******************************************
PureBasic 5.62 (Linux - x64)
******************************************

Loading external modules...
Starting compilation...
Starting compilation...
4 lines processed.
Creating the executable.

- Feel the ..PuRe.. Power -

~/Documents $ file Hello
Hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped

~/Documents $ ./Hello
Hello World

:arrow: You need to set PUREBASIC_HOME to purebasic root folder even if you compile from compiler folder

:D
but it is not executed, a file purebasic.out is created
So it's works. purebasic.out is the name of the compiled file if you don't specify -e
The compiler (command line) does not launch executable after compiling.
You need to launch it yourself (./purebasic.out)
Remember that under unix, there is no PATH on the local directory (security). You must specify the full name or (./name) to launch a program.

:wink:

Edit: Hum, sometime executable is launch after compiling
Reset for testing

$ PS1='[\w \$] '
[~/Documents $] cd ~/Documents/
[~/Documents $] export PUREBASIC_HOME=
[~/Documents $] echo $PUREBASIC_HOME
(nothing)
[~/Documents $] purebasic/compilers/pbcompiler Hello.pb

******************************************
PureBasic 5.62 (Linux - x64)
******************************************

Loading external modules...
Error: Can't load OS libraries, please re-install PureBasic.

[~/Documents $] export PUREBASIC_HOME=~/Documents/purebasic
[~/Documents $] echo $PUREBASIC_HOME
/home/marc/Documents/purebasic
(yes)
[~/Documents $] purebasic/compilers/pbcompiler Hello.pb

******************************************
PureBasic 5.62 (Linux - x64)
******************************************

Loading external modules...
Starting compilation...
Starting compilation...
4 lines processed.
Creating the executable.

- Feel the ..PuRe.. Power -

Hello World
User avatar
mk-soft
Always Here
Always Here
Posts: 5334
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Any reliable Linux IDE for PB?

Post by mk-soft »

Its work for me

A little trick to start extern debugger over small script

Create script "calldebugger.sh" and save to "purebasic/compilers" folder
pbcompiler --debugger "$1" -e "$2"
pbdebugger $2
Program "RunCompiler" to start script..

Code: Select all

Import "-no-pie"
EndImport

Global file.s, out.s, param.s
file = ProgramParameter(0)
If Bool(file)
  If Left(file,1) <> "/"
    file = GetCurrentDirectory() + file
  EndIf
Else
  file = OpenFileRequester("PB-File", "", "", 0)
EndIf
If Bool(file)
  out = #DQUOTE$ + GetPathPart(file) + GetFilePart(file, #PB_FileSystem_NoExtension) + #DQUOTE$
  file = #DQUOTE$ + file + #DQUOTE$
  param = "calldebugger.sh " + file + " " + out
  Compiler = RunProgram("bash", param, "", #PB_Program_Open | #PB_Program_Read)
  Output$ = ""
  If Compiler
    While ProgramRunning(Compiler)
      If AvailableProgramOutput(Compiler)
        Output$ + ReadProgramString(Compiler) + Chr(13)
      EndIf
      Delay(20)
    Wend
    Output$ + Chr(13) + Chr(13)
    Output$ + "Exitcode: " + Str(ProgramExitCode(Compiler))
    
    CloseProgram(Compiler) ; Schließt die Verbindung zum Programm
  EndIf
  MessageRequester("Output", Output$)
EndIf
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
Bitblazer
Enthusiast
Enthusiast
Posts: 732
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Any reliable Linux IDE for PB?

Post by Bitblazer »

OpenSuse Leap 15 works fine with the Linux PB IDE and has all the features i need. I switched from *Ubuntu distros after trying to fix compatibility issues for a few days.
webpage - discord chat links -> purebasic GPT4All
User avatar
mk-soft
Always Here
Always Here
Posts: 5334
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Any reliable Linux IDE for PB?

Post by mk-soft »

Bitblazer wrote:OpenSuse Leap 15 works fine with the Linux PB IDE and has all the features i need. I switched from *Ubuntu distros after trying to fix compatibility issues for a few days.
I'm running it under Ubuntu Gnome and Budgie.
What problems?
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
swhite
Enthusiast
Enthusiast
Posts: 726
Joined: Thu May 21, 2009 6:56 pm

Re: Any reliable Linux IDE for PB?

Post by swhite »

Hi

I use OpenSuse Leap 42.3 and this is reasonable reliable. I do occasionally have the IDE vanish but not everyday. I am not sure what triggers this behavior because it will work fine for days and then all of a sudden it will vanish and I have to restart the IDE.

I have not had a chance to update to Opensuse 15 to see if it is better.

Simon
Simon White
dCipher Computing
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: Any reliable Linux IDE for PB?

Post by Justin »

Thanks for the help. It seems that visual studio code is a good option, finally i got it to work using "tasks", if anyone is interested i used:

Code: Select all

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "PB Build",
            "type": "shell",
            "command": "pbcompiler -d /fullpath/yourfile.pb"
        },

       {
            "label": "PB Run",
            "type": "shell",
            "command": "fullpath/purebasic.out"
        },

    ]
}
You can assign shortcuts to the tasks.
It's strange i had to use two tasks one for build and for run, gluing the commands with "&&" launches the executable twice!
More strange if you simply type 'pbcompiler file.pb' in the vs code terminal, builds and run the executable normally.
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Any reliable Linux IDE for PB?

Post by Marc56us »

This is what I indicated, sometimes the command line compiler (pbcompiler) runs the exe after compiling but not every time.
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: Any reliable Linux IDE for PB?

Post by Justin »

Finally i got visual studio code to compile and run saving all files with a single F5 key press, it took me two days LOL. i had to download the macros extension, because unbelievably there is not an option to save all before build.
I can post the steps if someone is interested.

With a lot of work this editor could be totally customized for PB.
Post Reply